diff --git a/CHANGES b/CHANGES index 1264acd..13a4523 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,68 @@ +2014-03-19 Tom.Shields + + * output.c: rename MAXSHORT to MAXYYINT + +2014-03-18 Tom.Shields + + * yaccpar.skel: skeleton with btyacc additions + + * NOTES-btyacc-Changes: byacc-btyacc-20140323 + + * defs.h: + several changes to help decouple the use of 'short' as the type of value + used in yacc parsers. + + * NOTES-btyacc-Disposition: byacc-btyacc-20140323 + +2014-03-17 Tom.Shields + + * skel2c, yaccpar.skel, yaccpar.skel.old: RCS_BASE + + * configure.in: add --with-max-table-size and --enable-btyacc options + +2014-03-16 Tom.Shields + + * main.c: use Value_t rather than short + +2014-02-18 Tom.Shields + + * lr0.c, graph.c: use Value_t rather than short + + * closure.c: use Value_t rather than short + ifdef'd forward-reference prototypes to match ifdef'ing of the actual functions + + * lalr.c: rename MAXSHORT to MAXYYINT + +2014-01-01 Thomas E. Dickey + + * yacc.1: document %token-table, improve presentation of double-quotes + + * VERSION: bump + + * output.c, skeleton.c: + amend the last change so that yytname is #define'd as needed rather than + permanent - to avoid breaking cproto for instance. + +2014-01-01 Christos.Zoulas + + * output.c, defs.h, main.c, reader.c, skeleton.c: + changes to build ntpd using byacc: + - rename yyname[] to yytname[] + - add YYTRANSLATE() macro + - recognize bison's %token-table declaration + +2014-01-01 Thomas E. Dickey + + * configure: regen + + * yacc.1: s/EE/XE/ to work around groff bug on Debian 6 + + * makefile.in: use CF_MAKE_DOCS + + * aclocal.m4: add CF_MAKE_DOCS + + * configure.in: use CF_MAKE_DOCS + 2013-12-26 Thomas E. Dickey * config.guess: 2013-11-29 diff --git a/MANIFEST b/MANIFEST index 0c976f8..7601d51 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for byacc, version t20140101 +MANIFEST for byacc, version t20140321-gcov -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 @@ -58,76 +58,151 @@ package/pkgsrc/PLIST scripts from NetBSD pkgsrc, for test-builds package/pkgsrc/distinfo scripts from NetBSD pkgsrc, for test-builds test subdirectory test/README describe contents of "test" subdirectory +test/calc.error reference output for testing test/calc.output "-v" output from byacc test/calc.tab.c c-file for calc.y test/calc.tab.h header-file for calc.y test/calc.y example from VMS freeware version of byacc +test/calc1.error reference output for testing test/calc1.output output from calc1.y test/calc1.tab.c output from calc1.y test/calc1.tab.h output from calc1.y test/calc1.y advanced example from Steve Johnson's paper. +test/calc2.error reference output for testing test/calc2.output test-cases and reference files for %lex-param / %parse-param test/calc2.tab.c test-cases and reference files for %lex-param / %parse-param test/calc2.tab.h test-cases and reference files for %lex-param / %parse-param test/calc2.y test-cases and reference files for %lex-param / %parse-param +test/calc3.error reference output for testing test/calc3.output test-cases and reference files for %lex-param / %parse-param test/calc3.tab.c test-cases and reference files for %lex-param / %parse-param test/calc3.tab.h test-cases and reference files for %lex-param / %parse-param test/calc3.y test-cases and reference files for %lex-param / %parse-param test/code_calc.code.c reference output for testing +test/code_calc.error reference output for testing test/code_calc.output reference output for testing test/code_calc.tab.c reference output for testing test/code_calc.tab.h reference output for testing test/code_calc.y reference input for testing test/code_error.code.c reference output for testing +test/code_error.error reference output for testing test/code_error.output reference output for testing test/code_error.tab.c reference output for testing test/code_error.tab.h reference output for testing test/code_error.y reference input for testing +test/err_syntax1.error reference output for testing +test/err_syntax1.output reference output for testing +test/err_syntax1.tab.c reference output for testing +test/err_syntax1.tab.h reference output for testing +test/err_syntax1.y test-case with syntax error (and nonprinting character) +test/err_syntax2.error reference output for testing +test/err_syntax2.output reference output for testing +test/err_syntax2.tab.c reference output for testing +test/err_syntax2.tab.h reference output for testing +test/err_syntax2.y testcase for unterminated_comment() +test/err_syntax3.error reference output for testing +test/err_syntax3.output reference output for testing +test/err_syntax3.tab.c reference output for testing +test/err_syntax3.tab.h reference output for testing +test/err_syntax3.y testcase for unterminated_string() +test/err_syntax4.error reference output for testing +test/err_syntax4.output reference output for testing +test/err_syntax4.tab.c reference output for testing +test/err_syntax4.tab.h reference output for testing +test/err_syntax4.y testcase for unterminated_text() +test/err_syntax5.error reference output for testing +test/err_syntax5.output reference output for testing +test/err_syntax5.tab.c reference output for testing +test/err_syntax5.tab.h reference output for testing +test/err_syntax5.y testcase for unterminated_union() +test/err_syntax6.error reference output for testing +test/err_syntax6.output reference output for testing +test/err_syntax6.tab.c reference output for testing +test/err_syntax6.tab.h reference output for testing +test/err_syntax6.y testcase for illegal_tag() +test/err_syntax7.error reference output for testing +test/err_syntax7.output reference output for testing +test/err_syntax7.tab.c reference output for testing +test/err_syntax7.tab.h reference output for testing +test/err_syntax7.y testcase for illegal_character() +test/err_syntax7a.error reference output for testing +test/err_syntax7a.output reference output for testing +test/err_syntax7a.tab.c reference output for testing +test/err_syntax7a.tab.h reference output for testing +test/err_syntax7a.y testcase for illegal_character() +test/err_syntax7b.error reference output for testing +test/err_syntax7b.output reference output for testing +test/err_syntax7b.tab.c reference output for testing +test/err_syntax7b.tab.h reference output for testing +test/err_syntax7b.y testcase for illegal_character() +test/err_syntax8.error reference output for testing +test/err_syntax8.output reference output for testing +test/err_syntax8.tab.c reference output for testing +test/err_syntax8.tab.h reference output for testing +test/err_syntax8.y testcase for used_reserved() +test/err_syntax8a.error reference output for testing +test/err_syntax8a.output reference output for testing +test/err_syntax8a.tab.c reference output for testing +test/err_syntax8a.tab.h reference output for testing +test/err_syntax8a.y testcase for used_reserved() +test/err_syntax9.error reference output for testing +test/err_syntax9.output reference output for testing +test/err_syntax9.tab.c reference output for testing +test/err_syntax9.tab.h reference output for testing +test/err_syntax9.y testcase for tokenized_start() +test/error.error reference output for testing test/error.output original version of byacc - 1993 test/error.tab.c original version of byacc - 1993 test/error.tab.h original version of byacc - 1993 test/error.y original version of byacc - 1993 -test/ftp.output original version of byacc - 1993 -test/ftp.tab.c original version of byacc - 1993 -test/ftp.tab.h original version of byacc - 1993 -test/ftp.y original version of byacc - 1993 +test/grammar.dot generated dot-file +test/grammar.error reference output for testing test/grammar.output "-v" output from grammar.y test/grammar.tab.c c-file for grammar.y test/grammar.tab.h h-file for grammar.y test/grammar.y grammar from cproto +test/pure_calc.error reference output for testing test/pure_calc.output reference output for testing test/pure_calc.tab.c reference output for testing test/pure_calc.tab.h reference output for testing test/pure_calc.y reference input for testing +test/pure_error.error reference output for testing test/pure_error.output reference output for testing test/pure_error.tab.c reference output for testing test/pure_error.tab.h reference output for testing test/pure_error.y reference input for testing +test/quote_calc-s.error reference output for testing test/quote_calc-s.output test reference with -s option test/quote_calc-s.tab.c test reference with -s option test/quote_calc-s.tab.h test reference with -s option +test/quote_calc.error reference output for testing test/quote_calc.output test-reference for %token using quoted name test/quote_calc.tab.c test-reference for %token using quoted name test/quote_calc.tab.h test-reference for %token using quoted name test/quote_calc.y test-case for %token using quoted name +test/quote_calc2-s.error reference output for testing test/quote_calc2-s.output test reference with -s option test/quote_calc2-s.tab.c test reference with -s option test/quote_calc2-s.tab.h test reference with -s option +test/quote_calc2.error reference output for testing test/quote_calc2.output test-reference for %token using quoted name test/quote_calc2.tab.c test-reference for %token using quoted name test/quote_calc2.tab.h test-reference for %token using quoted name test/quote_calc2.y test-case for %token using quoted name +test/quote_calc3-s.error reference output for testing test/quote_calc3-s.output test reference with -s option test/quote_calc3-s.tab.c test reference with -s option test/quote_calc3-s.tab.h test reference with -s option +test/quote_calc3.error reference output for testing test/quote_calc3.output test-reference for %token using quoted name test/quote_calc3.tab.c test-reference for %token using quoted name test/quote_calc3.tab.h test-reference for %token using quoted name test/quote_calc3.y test-case for %token using quoted name +test/quote_calc4-s.error reference output for testing test/quote_calc4-s.output test reference with -s option test/quote_calc4-s.tab.c test reference with -s option test/quote_calc4-s.tab.h test reference with -s option +test/quote_calc4.error reference output for testing test/quote_calc4.output test-reference for %token using quoted name test/quote_calc4.tab.c test-reference for %token using quoted name test/quote_calc4.tab.h test-reference for %token using quoted name diff --git a/test/calc.error b/test/calc.error new file mode 100644 index 0000000..e69de29 diff --git a/test/calc1.error b/test/calc1.error new file mode 100644 index 0000000..9c1f715 --- /dev/null +++ b/test/calc1.error @@ -0,0 +1,2 @@ +YACC: 2 rules never reduced +YACC: 18 shift/reduce conflicts, 26 reduce/reduce conflicts. diff --git a/test/calc2.error b/test/calc2.error new file mode 100644 index 0000000..e69de29 diff --git a/test/calc3.error b/test/calc3.error new file mode 100644 index 0000000..e69de29 diff --git a/test/code_calc.error b/test/code_calc.error new file mode 100644 index 0000000..e69de29 diff --git a/test/code_error.error b/test/code_error.error new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax1.error b/test/err_syntax1.error new file mode 100644 index 0000000..e3a341d --- /dev/null +++ b/test/err_syntax1.error @@ -0,0 +1,3 @@ +YACC: e - line 1 of "./test/err_syntax1.y", syntax error + ?% { + ^ diff --git a/test/err_syntax1.output b/test/err_syntax1.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax1.tab.c b/test/err_syntax1.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax1.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax1.tab.h b/test/err_syntax1.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax1.y b/test/err_syntax1.y new file mode 100644 index 0000000..2735520 --- /dev/null +++ b/test/err_syntax1.y @@ -0,0 +1,28 @@ + % { +int yylex(void); +static void yyerror(const char *); +%} +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax2.error b/test/err_syntax2.error new file mode 100644 index 0000000..fefda9f --- /dev/null +++ b/test/err_syntax2.error @@ -0,0 +1,3 @@ +YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +%{ /* + ^ diff --git a/test/err_syntax2.output b/test/err_syntax2.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax2.tab.c b/test/err_syntax2.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax2.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax2.tab.h b/test/err_syntax2.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax2.y b/test/err_syntax2.y new file mode 100644 index 0000000..247511e --- /dev/null +++ b/test/err_syntax2.y @@ -0,0 +1,28 @@ +%{ /* +int yylex(void); +static void yyerror(const char *); +%} +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax3.error b/test/err_syntax3.error new file mode 100644 index 0000000..6926214 --- /dev/null +++ b/test/err_syntax3.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +%token '(' '*' '& + ^ diff --git a/test/err_syntax3.output b/test/err_syntax3.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax3.tab.c b/test/err_syntax3.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax3.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax3.tab.h b/test/err_syntax3.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax3.y b/test/err_syntax3.y new file mode 100644 index 0000000..c10b227 --- /dev/null +++ b/test/err_syntax3.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token '(' '*' '& + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax4.error b/test/err_syntax4.error new file mode 100644 index 0000000..72b683e --- /dev/null +++ b/test/err_syntax4.error @@ -0,0 +1,3 @@ +YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +%{ +^ diff --git a/test/err_syntax4.output b/test/err_syntax4.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax4.tab.c b/test/err_syntax4.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax4.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax4.tab.h b/test/err_syntax4.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax4.y b/test/err_syntax4.y new file mode 100644 index 0000000..2c6f22f --- /dev/null +++ b/test/err_syntax4.y @@ -0,0 +1,28 @@ +%{ +int yylex(void); +static void yyerror(const char *); +} +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax5.error b/test/err_syntax5.error new file mode 100644 index 0000000..fd3bf0d --- /dev/null +++ b/test/err_syntax5.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +%union { +^ diff --git a/test/err_syntax5.output b/test/err_syntax5.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax5.tab.c b/test/err_syntax5.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax5.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax5.tab.h b/test/err_syntax5.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax5.y b/test/err_syntax5.y new file mode 100644 index 0000000..ca9ce1a --- /dev/null +++ b/test/err_syntax5.y @@ -0,0 +1,33 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%union { + char *str; + int num + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax6.error b/test/err_syntax6.error new file mode 100644 index 0000000..ae83bd2 --- /dev/null +++ b/test/err_syntax6.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +%token + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax7.error b/test/err_syntax7.error new file mode 100644 index 0000000..fb63422 --- /dev/null +++ b/test/err_syntax7.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax7.y", illegal character +%token '\777' + ^ diff --git a/test/err_syntax7.output b/test/err_syntax7.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7.tab.c b/test/err_syntax7.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax7.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax7.tab.h b/test/err_syntax7.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7.y b/test/err_syntax7.y new file mode 100644 index 0000000..783d563 --- /dev/null +++ b/test/err_syntax7.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token '\777' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax7a.error b/test/err_syntax7a.error new file mode 100644 index 0000000..f6adba6 --- /dev/null +++ b/test/err_syntax7a.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +%token '\xfff' + ^ diff --git a/test/err_syntax7a.output b/test/err_syntax7a.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7a.tab.c b/test/err_syntax7a.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax7a.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax7a.tab.h b/test/err_syntax7a.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7a.y b/test/err_syntax7a.y new file mode 100644 index 0000000..ae105d0 --- /dev/null +++ b/test/err_syntax7a.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token '\xfff' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax7b.error b/test/err_syntax7b.error new file mode 100644 index 0000000..f3e512f --- /dev/null +++ b/test/err_syntax7b.error @@ -0,0 +1,3 @@ +YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +%token '\x.' + ^ diff --git a/test/err_syntax7b.output b/test/err_syntax7b.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7b.tab.c b/test/err_syntax7b.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax7b.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax7b.tab.h b/test/err_syntax7b.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax7b.y b/test/err_syntax7b.y new file mode 100644 index 0000000..a3e5e21 --- /dev/null +++ b/test/err_syntax7b.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token '\x.' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax8.error b/test/err_syntax8.error new file mode 100644 index 0000000..53a3a32 --- /dev/null +++ b/test/err_syntax8.error @@ -0,0 +1 @@ +YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . diff --git a/test/err_syntax8.output b/test/err_syntax8.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax8.tab.c b/test/err_syntax8.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax8.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax8.tab.h b/test/err_syntax8.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax8.y b/test/err_syntax8.y new file mode 100644 index 0000000..5ac0974 --- /dev/null +++ b/test/err_syntax8.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token . '\777' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax8a.error b/test/err_syntax8a.error new file mode 100644 index 0000000..3135551 --- /dev/null +++ b/test/err_syntax8a.error @@ -0,0 +1 @@ +YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 diff --git a/test/err_syntax8a.output b/test/err_syntax8a.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax8a.tab.c b/test/err_syntax8a.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax8a.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax8a.tab.h b/test/err_syntax8a.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax8a.y b/test/err_syntax8a.y new file mode 100644 index 0000000..9a3a76c --- /dev/null +++ b/test/err_syntax8a.y @@ -0,0 +1,31 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%token $$123 '\777' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/err_syntax9.error b/test/err_syntax9.error new file mode 100644 index 0000000..43696bd --- /dev/null +++ b/test/err_syntax9.error @@ -0,0 +1 @@ +YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token diff --git a/test/err_syntax9.output b/test/err_syntax9.output new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax9.tab.c b/test/err_syntax9.tab.c new file mode 100644 index 0000000..3ec4bac --- /dev/null +++ b/test/err_syntax9.tab.c @@ -0,0 +1,13 @@ +#ifndef lint +static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; +#endif + +#define YYBYACC 1 +#define YYMAJOR 1 +#define YYMINOR 9 + +#define YYEMPTY (-1) +#define yyclearin (yychar = YYEMPTY) +#define yyerrok (yyerrflag = 0) +#define YYRECOVERING() (yyerrflag != 0) + diff --git a/test/err_syntax9.tab.h b/test/err_syntax9.tab.h new file mode 100644 index 0000000..e69de29 diff --git a/test/err_syntax9.y b/test/err_syntax9.y new file mode 100644 index 0000000..f3ec6fa --- /dev/null +++ b/test/err_syntax9.y @@ -0,0 +1,32 @@ +%{ +int yylex(void); +static void yyerror(const char *); +%} + +%start text +%token text '(' '*' '&' + +%% +S: error +%% + +#include + +int +main(void) +{ + printf("yyparse() = %d\n", yyparse()); + return 0; +} + +int +yylex(void) +{ + return -1; +} + +static void +yyerror(const char* s) +{ + printf("%s\n", s); +} diff --git a/test/error.error b/test/error.error new file mode 100644 index 0000000..e69de29 diff --git a/test/ftp.output b/test/ftp.output deleted file mode 100644 index c8931a5..0000000 --- a/test/ftp.output +++ /dev/null @@ -1,1625 +0,0 @@ - 0 $accept : cmd_list $end - - 1 cmd_list : - 2 | cmd_list cmd - 3 | cmd_list rcmd - - 4 cmd : USER SP username CRLF - 5 | PASS SP password CRLF - 6 | PORT SP host_port CRLF - 7 | PASV CRLF - 8 | TYPE SP type_code CRLF - 9 | STRU SP struct_code CRLF - 10 | MODE SP mode_code CRLF - 11 | ALLO SP NUMBER CRLF - 12 | ALLO SP NUMBER SP R SP NUMBER CRLF - 13 | RETR check_login SP pathname CRLF - 14 | STOR check_login SP pathname CRLF - 15 | APPE check_login SP pathname CRLF - 16 | NLST check_login CRLF - 17 | NLST check_login SP STRING CRLF - 18 | LIST check_login CRLF - 19 | LIST check_login SP pathname CRLF - 20 | STAT check_login SP pathname CRLF - 21 | STAT CRLF - 22 | DELE check_login SP pathname CRLF - 23 | RNTO SP pathname CRLF - 24 | ABOR CRLF - 25 | CWD check_login CRLF - 26 | CWD check_login SP pathname CRLF - 27 | HELP CRLF - 28 | HELP SP STRING CRLF - 29 | NOOP CRLF - 30 | MKD check_login SP pathname CRLF - 31 | RMD check_login SP pathname CRLF - 32 | PWD check_login CRLF - 33 | CDUP check_login CRLF - 34 | SITE SP HELP CRLF - 35 | SITE SP HELP SP STRING CRLF - 36 | SITE SP UMASK check_login CRLF - 37 | SITE SP UMASK check_login SP octal_number CRLF - 38 | SITE SP CHMOD check_login SP octal_number SP pathname CRLF - 39 | SITE SP IDLE CRLF - 40 | SITE SP IDLE SP NUMBER CRLF - 41 | STOU check_login SP pathname CRLF - 42 | SYST CRLF - 43 | SIZE check_login SP pathname CRLF - 44 | MDTM check_login SP pathname CRLF - 45 | QUIT CRLF - 46 | error CRLF - - 47 rcmd : RNFR check_login SP pathname CRLF - - 48 username : STRING - - 49 password : - 50 | STRING - - 51 byte_size : NUMBER - - 52 host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER - - 53 form_code : N - 54 | T - 55 | C - - 56 type_code : A - 57 | A SP form_code - 58 | E - 59 | E SP form_code - 60 | I - 61 | L - 62 | L SP byte_size - 63 | L byte_size - - 64 struct_code : F - 65 | R - 66 | P - - 67 mode_code : S - 68 | B - 69 | C - - 70 pathname : pathstring - - 71 pathstring : STRING - - 72 octal_number : NUMBER - - 73 check_login : - -state 0 - $accept : . cmd_list $end (0) - cmd_list : . (1) - - . reduce 1 - - cmd_list goto 1 - - -state 1 - $accept : cmd_list . $end (0) - cmd_list : cmd_list . cmd (2) - cmd_list : cmd_list . rcmd (3) - - $end accept - error shift 2 - USER shift 3 - PASS shift 4 - QUIT shift 5 - PORT shift 6 - PASV shift 7 - TYPE shift 8 - STRU shift 9 - MODE shift 10 - RETR shift 11 - STOR shift 12 - APPE shift 13 - ALLO shift 14 - RNFR shift 15 - RNTO shift 16 - ABOR shift 17 - DELE shift 18 - CWD shift 19 - LIST shift 20 - NLST shift 21 - SITE shift 22 - STAT shift 23 - HELP shift 24 - NOOP shift 25 - MKD shift 26 - RMD shift 27 - PWD shift 28 - CDUP shift 29 - STOU shift 30 - SYST shift 31 - SIZE shift 32 - MDTM shift 33 - . error - - cmd goto 34 - rcmd goto 35 - - -state 2 - cmd : error . CRLF (46) - - CRLF shift 36 - . error - - -state 3 - cmd : USER . SP username CRLF (4) - - SP shift 37 - . error - - -state 4 - cmd : PASS . SP password CRLF (5) - - SP shift 38 - . error - - -state 5 - cmd : QUIT . CRLF (45) - - CRLF shift 39 - . error - - -state 6 - cmd : PORT . SP host_port CRLF (6) - - SP shift 40 - . error - - -state 7 - cmd : PASV . CRLF (7) - - CRLF shift 41 - . error - - -state 8 - cmd : TYPE . SP type_code CRLF (8) - - SP shift 42 - . error - - -state 9 - cmd : STRU . SP struct_code CRLF (9) - - SP shift 43 - . error - - -state 10 - cmd : MODE . SP mode_code CRLF (10) - - SP shift 44 - . error - - -state 11 - cmd : RETR . check_login SP pathname CRLF (13) - check_login : . (73) - - . reduce 73 - - check_login goto 45 - - -state 12 - cmd : STOR . check_login SP pathname CRLF (14) - check_login : . (73) - - . reduce 73 - - check_login goto 46 - - -state 13 - cmd : APPE . check_login SP pathname CRLF (15) - check_login : . (73) - - . reduce 73 - - check_login goto 47 - - -state 14 - cmd : ALLO . SP NUMBER CRLF (11) - cmd : ALLO . SP NUMBER SP R SP NUMBER CRLF (12) - - SP shift 48 - . error - - -state 15 - rcmd : RNFR . check_login SP pathname CRLF (47) - check_login : . (73) - - . reduce 73 - - check_login goto 49 - - -state 16 - cmd : RNTO . SP pathname CRLF (23) - - SP shift 50 - . error - - -state 17 - cmd : ABOR . CRLF (24) - - CRLF shift 51 - . error - - -state 18 - cmd : DELE . check_login SP pathname CRLF (22) - check_login : . (73) - - . reduce 73 - - check_login goto 52 - - -state 19 - cmd : CWD . check_login CRLF (25) - cmd : CWD . check_login SP pathname CRLF (26) - check_login : . (73) - - . reduce 73 - - check_login goto 53 - - -state 20 - cmd : LIST . check_login CRLF (18) - cmd : LIST . check_login SP pathname CRLF (19) - check_login : . (73) - - . reduce 73 - - check_login goto 54 - - -state 21 - cmd : NLST . check_login CRLF (16) - cmd : NLST . check_login SP STRING CRLF (17) - check_login : . (73) - - . reduce 73 - - check_login goto 55 - - -state 22 - cmd : SITE . SP HELP CRLF (34) - cmd : SITE . SP HELP SP STRING CRLF (35) - cmd : SITE . SP UMASK check_login CRLF (36) - cmd : SITE . SP UMASK check_login SP octal_number CRLF (37) - cmd : SITE . SP CHMOD check_login SP octal_number SP pathname CRLF (38) - cmd : SITE . SP IDLE CRLF (39) - cmd : SITE . SP IDLE SP NUMBER CRLF (40) - - SP shift 56 - . error - - -state 23 - cmd : STAT . check_login SP pathname CRLF (20) - cmd : STAT . CRLF (21) - check_login : . (73) - - CRLF shift 57 - SP reduce 73 - - check_login goto 58 - - -state 24 - cmd : HELP . CRLF (27) - cmd : HELP . SP STRING CRLF (28) - - SP shift 59 - CRLF shift 60 - . error - - -state 25 - cmd : NOOP . CRLF (29) - - CRLF shift 61 - . error - - -state 26 - cmd : MKD . check_login SP pathname CRLF (30) - check_login : . (73) - - . reduce 73 - - check_login goto 62 - - -state 27 - cmd : RMD . check_login SP pathname CRLF (31) - check_login : . (73) - - . reduce 73 - - check_login goto 63 - - -state 28 - cmd : PWD . check_login CRLF (32) - check_login : . (73) - - . reduce 73 - - check_login goto 64 - - -state 29 - cmd : CDUP . check_login CRLF (33) - check_login : . (73) - - . reduce 73 - - check_login goto 65 - - -state 30 - cmd : STOU . check_login SP pathname CRLF (41) - check_login : . (73) - - . reduce 73 - - check_login goto 66 - - -state 31 - cmd : SYST . CRLF (42) - - CRLF shift 67 - . error - - -state 32 - cmd : SIZE . check_login SP pathname CRLF (43) - check_login : . (73) - - . reduce 73 - - check_login goto 68 - - -state 33 - cmd : MDTM . check_login SP pathname CRLF (44) - check_login : . (73) - - . reduce 73 - - check_login goto 69 - - -state 34 - cmd_list : cmd_list cmd . (2) - - . reduce 2 - - -state 35 - cmd_list : cmd_list rcmd . (3) - - . reduce 3 - - -state 36 - cmd : error CRLF . (46) - - . reduce 46 - - -state 37 - cmd : USER SP . username CRLF (4) - - STRING shift 70 - . error - - username goto 71 - - -state 38 - cmd : PASS SP . password CRLF (5) - password : . (49) - - STRING shift 72 - CRLF reduce 49 - - password goto 73 - - -state 39 - cmd : QUIT CRLF . (45) - - . reduce 45 - - -state 40 - cmd : PORT SP . host_port CRLF (6) - - NUMBER shift 74 - . error - - host_port goto 75 - - -state 41 - cmd : PASV CRLF . (7) - - . reduce 7 - - -state 42 - cmd : TYPE SP . type_code CRLF (8) - - A shift 76 - E shift 77 - I shift 78 - L shift 79 - . error - - type_code goto 80 - - -state 43 - cmd : STRU SP . struct_code CRLF (9) - - F shift 81 - P shift 82 - R shift 83 - . error - - struct_code goto 84 - - -state 44 - cmd : MODE SP . mode_code CRLF (10) - - B shift 85 - C shift 86 - S shift 87 - . error - - mode_code goto 88 - - -state 45 - cmd : RETR check_login . SP pathname CRLF (13) - - SP shift 89 - . error - - -state 46 - cmd : STOR check_login . SP pathname CRLF (14) - - SP shift 90 - . error - - -state 47 - cmd : APPE check_login . SP pathname CRLF (15) - - SP shift 91 - . error - - -state 48 - cmd : ALLO SP . NUMBER CRLF (11) - cmd : ALLO SP . NUMBER SP R SP NUMBER CRLF (12) - - NUMBER shift 92 - . error - - -state 49 - rcmd : RNFR check_login . SP pathname CRLF (47) - - SP shift 93 - . error - - -state 50 - cmd : RNTO SP . pathname CRLF (23) - - STRING shift 94 - . error - - pathname goto 95 - pathstring goto 96 - - -state 51 - cmd : ABOR CRLF . (24) - - . reduce 24 - - -state 52 - cmd : DELE check_login . SP pathname CRLF (22) - - SP shift 97 - . error - - -state 53 - cmd : CWD check_login . CRLF (25) - cmd : CWD check_login . SP pathname CRLF (26) - - SP shift 98 - CRLF shift 99 - . error - - -state 54 - cmd : LIST check_login . CRLF (18) - cmd : LIST check_login . SP pathname CRLF (19) - - SP shift 100 - CRLF shift 101 - . error - - -state 55 - cmd : NLST check_login . CRLF (16) - cmd : NLST check_login . SP STRING CRLF (17) - - SP shift 102 - CRLF shift 103 - . error - - -state 56 - cmd : SITE SP . HELP CRLF (34) - cmd : SITE SP . HELP SP STRING CRLF (35) - cmd : SITE SP . UMASK check_login CRLF (36) - cmd : SITE SP . UMASK check_login SP octal_number CRLF (37) - cmd : SITE SP . CHMOD check_login SP octal_number SP pathname CRLF (38) - cmd : SITE SP . IDLE CRLF (39) - cmd : SITE SP . IDLE SP NUMBER CRLF (40) - - HELP shift 104 - UMASK shift 105 - IDLE shift 106 - CHMOD shift 107 - . error - - -state 57 - cmd : STAT CRLF . (21) - - . reduce 21 - - -state 58 - cmd : STAT check_login . SP pathname CRLF (20) - - SP shift 108 - . error - - -state 59 - cmd : HELP SP . STRING CRLF (28) - - STRING shift 109 - . error - - -state 60 - cmd : HELP CRLF . (27) - - . reduce 27 - - -state 61 - cmd : NOOP CRLF . (29) - - . reduce 29 - - -state 62 - cmd : MKD check_login . SP pathname CRLF (30) - - SP shift 110 - . error - - -state 63 - cmd : RMD check_login . SP pathname CRLF (31) - - SP shift 111 - . error - - -state 64 - cmd : PWD check_login . CRLF (32) - - CRLF shift 112 - . error - - -state 65 - cmd : CDUP check_login . CRLF (33) - - CRLF shift 113 - . error - - -state 66 - cmd : STOU check_login . SP pathname CRLF (41) - - SP shift 114 - . error - - -state 67 - cmd : SYST CRLF . (42) - - . reduce 42 - - -state 68 - cmd : SIZE check_login . SP pathname CRLF (43) - - SP shift 115 - . error - - -state 69 - cmd : MDTM check_login . SP pathname CRLF (44) - - SP shift 116 - . error - - -state 70 - username : STRING . (48) - - . reduce 48 - - -state 71 - cmd : USER SP username . CRLF (4) - - CRLF shift 117 - . error - - -state 72 - password : STRING . (50) - - . reduce 50 - - -state 73 - cmd : PASS SP password . CRLF (5) - - CRLF shift 118 - . error - - -state 74 - host_port : NUMBER . COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER (52) - - COMMA shift 119 - . error - - -state 75 - cmd : PORT SP host_port . CRLF (6) - - CRLF shift 120 - . error - - -state 76 - type_code : A . (56) - type_code : A . SP form_code (57) - - SP shift 121 - CRLF reduce 56 - - -state 77 - type_code : E . (58) - type_code : E . SP form_code (59) - - SP shift 122 - CRLF reduce 58 - - -state 78 - type_code : I . (60) - - . reduce 60 - - -state 79 - type_code : L . (61) - type_code : L . SP byte_size (62) - type_code : L . byte_size (63) - - NUMBER shift 123 - SP shift 124 - CRLF reduce 61 - - byte_size goto 125 - - -state 80 - cmd : TYPE SP type_code . CRLF (8) - - CRLF shift 126 - . error - - -state 81 - struct_code : F . (64) - - . reduce 64 - - -state 82 - struct_code : P . (66) - - . reduce 66 - - -state 83 - struct_code : R . (65) - - . reduce 65 - - -state 84 - cmd : STRU SP struct_code . CRLF (9) - - CRLF shift 127 - . error - - -state 85 - mode_code : B . (68) - - . reduce 68 - - -state 86 - mode_code : C . (69) - - . reduce 69 - - -state 87 - mode_code : S . (67) - - . reduce 67 - - -state 88 - cmd : MODE SP mode_code . CRLF (10) - - CRLF shift 128 - . error - - -state 89 - cmd : RETR check_login SP . pathname CRLF (13) - - STRING shift 94 - . error - - pathname goto 129 - pathstring goto 96 - - -state 90 - cmd : STOR check_login SP . pathname CRLF (14) - - STRING shift 94 - . error - - pathname goto 130 - pathstring goto 96 - - -state 91 - cmd : APPE check_login SP . pathname CRLF (15) - - STRING shift 94 - . error - - pathname goto 131 - pathstring goto 96 - - -state 92 - cmd : ALLO SP NUMBER . CRLF (11) - cmd : ALLO SP NUMBER . SP R SP NUMBER CRLF (12) - - SP shift 132 - CRLF shift 133 - . error - - -state 93 - rcmd : RNFR check_login SP . pathname CRLF (47) - - STRING shift 94 - . error - - pathname goto 134 - pathstring goto 96 - - -state 94 - pathstring : STRING . (71) - - . reduce 71 - - -state 95 - cmd : RNTO SP pathname . CRLF (23) - - CRLF shift 135 - . error - - -state 96 - pathname : pathstring . (70) - - . reduce 70 - - -state 97 - cmd : DELE check_login SP . pathname CRLF (22) - - STRING shift 94 - . error - - pathname goto 136 - pathstring goto 96 - - -state 98 - cmd : CWD check_login SP . pathname CRLF (26) - - STRING shift 94 - . error - - pathname goto 137 - pathstring goto 96 - - -state 99 - cmd : CWD check_login CRLF . (25) - - . reduce 25 - - -state 100 - cmd : LIST check_login SP . pathname CRLF (19) - - STRING shift 94 - . error - - pathname goto 138 - pathstring goto 96 - - -state 101 - cmd : LIST check_login CRLF . (18) - - . reduce 18 - - -state 102 - cmd : NLST check_login SP . STRING CRLF (17) - - STRING shift 139 - . error - - -state 103 - cmd : NLST check_login CRLF . (16) - - . reduce 16 - - -state 104 - cmd : SITE SP HELP . CRLF (34) - cmd : SITE SP HELP . SP STRING CRLF (35) - - SP shift 140 - CRLF shift 141 - . error - - -state 105 - cmd : SITE SP UMASK . check_login CRLF (36) - cmd : SITE SP UMASK . check_login SP octal_number CRLF (37) - check_login : . (73) - - . reduce 73 - - check_login goto 142 - - -state 106 - cmd : SITE SP IDLE . CRLF (39) - cmd : SITE SP IDLE . SP NUMBER CRLF (40) - - SP shift 143 - CRLF shift 144 - . error - - -state 107 - cmd : SITE SP CHMOD . check_login SP octal_number SP pathname CRLF (38) - check_login : . (73) - - . reduce 73 - - check_login goto 145 - - -state 108 - cmd : STAT check_login SP . pathname CRLF (20) - - STRING shift 94 - . error - - pathname goto 146 - pathstring goto 96 - - -state 109 - cmd : HELP SP STRING . CRLF (28) - - CRLF shift 147 - . error - - -state 110 - cmd : MKD check_login SP . pathname CRLF (30) - - STRING shift 94 - . error - - pathname goto 148 - pathstring goto 96 - - -state 111 - cmd : RMD check_login SP . pathname CRLF (31) - - STRING shift 94 - . error - - pathname goto 149 - pathstring goto 96 - - -state 112 - cmd : PWD check_login CRLF . (32) - - . reduce 32 - - -state 113 - cmd : CDUP check_login CRLF . (33) - - . reduce 33 - - -state 114 - cmd : STOU check_login SP . pathname CRLF (41) - - STRING shift 94 - . error - - pathname goto 150 - pathstring goto 96 - - -state 115 - cmd : SIZE check_login SP . pathname CRLF (43) - - STRING shift 94 - . error - - pathname goto 151 - pathstring goto 96 - - -state 116 - cmd : MDTM check_login SP . pathname CRLF (44) - - STRING shift 94 - . error - - pathname goto 152 - pathstring goto 96 - - -state 117 - cmd : USER SP username CRLF . (4) - - . reduce 4 - - -state 118 - cmd : PASS SP password CRLF . (5) - - . reduce 5 - - -state 119 - host_port : NUMBER COMMA . NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER (52) - - NUMBER shift 153 - . error - - -state 120 - cmd : PORT SP host_port CRLF . (6) - - . reduce 6 - - -state 121 - type_code : A SP . form_code (57) - - C shift 154 - N shift 155 - T shift 156 - . error - - form_code goto 157 - - -state 122 - type_code : E SP . form_code (59) - - C shift 154 - N shift 155 - T shift 156 - . error - - form_code goto 158 - - -state 123 - byte_size : NUMBER . (51) - - . reduce 51 - - -state 124 - type_code : L SP . byte_size (62) - - NUMBER shift 123 - . error - - byte_size goto 159 - - -state 125 - type_code : L byte_size . (63) - - . reduce 63 - - -state 126 - cmd : TYPE SP type_code CRLF . (8) - - . reduce 8 - - -state 127 - cmd : STRU SP struct_code CRLF . (9) - - . reduce 9 - - -state 128 - cmd : MODE SP mode_code CRLF . (10) - - . reduce 10 - - -state 129 - cmd : RETR check_login SP pathname . CRLF (13) - - CRLF shift 160 - . error - - -state 130 - cmd : STOR check_login SP pathname . CRLF (14) - - CRLF shift 161 - . error - - -state 131 - cmd : APPE check_login SP pathname . CRLF (15) - - CRLF shift 162 - . error - - -state 132 - cmd : ALLO SP NUMBER SP . R SP NUMBER CRLF (12) - - R shift 163 - . error - - -state 133 - cmd : ALLO SP NUMBER CRLF . (11) - - . reduce 11 - - -state 134 - rcmd : RNFR check_login SP pathname . CRLF (47) - - CRLF shift 164 - . error - - -state 135 - cmd : RNTO SP pathname CRLF . (23) - - . reduce 23 - - -state 136 - cmd : DELE check_login SP pathname . CRLF (22) - - CRLF shift 165 - . error - - -state 137 - cmd : CWD check_login SP pathname . CRLF (26) - - CRLF shift 166 - . error - - -state 138 - cmd : LIST check_login SP pathname . CRLF (19) - - CRLF shift 167 - . error - - -state 139 - cmd : NLST check_login SP STRING . CRLF (17) - - CRLF shift 168 - . error - - -state 140 - cmd : SITE SP HELP SP . STRING CRLF (35) - - STRING shift 169 - . error - - -state 141 - cmd : SITE SP HELP CRLF . (34) - - . reduce 34 - - -state 142 - cmd : SITE SP UMASK check_login . CRLF (36) - cmd : SITE SP UMASK check_login . SP octal_number CRLF (37) - - SP shift 170 - CRLF shift 171 - . error - - -state 143 - cmd : SITE SP IDLE SP . NUMBER CRLF (40) - - NUMBER shift 172 - . error - - -state 144 - cmd : SITE SP IDLE CRLF . (39) - - . reduce 39 - - -state 145 - cmd : SITE SP CHMOD check_login . SP octal_number SP pathname CRLF (38) - - SP shift 173 - . error - - -state 146 - cmd : STAT check_login SP pathname . CRLF (20) - - CRLF shift 174 - . error - - -state 147 - cmd : HELP SP STRING CRLF . (28) - - . reduce 28 - - -state 148 - cmd : MKD check_login SP pathname . CRLF (30) - - CRLF shift 175 - . error - - -state 149 - cmd : RMD check_login SP pathname . CRLF (31) - - CRLF shift 176 - . error - - -state 150 - cmd : STOU check_login SP pathname . CRLF (41) - - CRLF shift 177 - . error - - -state 151 - cmd : SIZE check_login SP pathname . CRLF (43) - - CRLF shift 178 - . error - - -state 152 - cmd : MDTM check_login SP pathname . CRLF (44) - - CRLF shift 179 - . error - - -state 153 - host_port : NUMBER COMMA NUMBER . COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER (52) - - COMMA shift 180 - . error - - -state 154 - form_code : C . (55) - - . reduce 55 - - -state 155 - form_code : N . (53) - - . reduce 53 - - -state 156 - form_code : T . (54) - - . reduce 54 - - -state 157 - type_code : A SP form_code . (57) - - . reduce 57 - - -state 158 - type_code : E SP form_code . (59) - - . reduce 59 - - -state 159 - type_code : L SP byte_size . (62) - - . reduce 62 - - -state 160 - cmd : RETR check_login SP pathname CRLF . (13) - - . reduce 13 - - -state 161 - cmd : STOR check_login SP pathname CRLF . (14) - - . reduce 14 - - -state 162 - cmd : APPE check_login SP pathname CRLF . (15) - - . reduce 15 - - -state 163 - cmd : ALLO SP NUMBER SP R . SP NUMBER CRLF (12) - - SP shift 181 - . error - - -state 164 - rcmd : RNFR check_login SP pathname CRLF . (47) - - . reduce 47 - - -state 165 - cmd : DELE check_login SP pathname CRLF . (22) - - . reduce 22 - - -state 166 - cmd : CWD check_login SP pathname CRLF . (26) - - . reduce 26 - - -state 167 - cmd : LIST check_login SP pathname CRLF . (19) - - . reduce 19 - - -state 168 - cmd : NLST check_login SP STRING CRLF . (17) - - . reduce 17 - - -state 169 - cmd : SITE SP HELP SP STRING . CRLF (35) - - CRLF shift 182 - . error - - -state 170 - cmd : SITE SP UMASK check_login SP . octal_number CRLF (37) - - NUMBER shift 183 - . error - - octal_number goto 184 - - -state 171 - cmd : SITE SP UMASK check_login CRLF . (36) - - . reduce 36 - - -state 172 - cmd : SITE SP IDLE SP NUMBER . CRLF (40) - - CRLF shift 185 - . error - - -state 173 - cmd : SITE SP CHMOD check_login SP . octal_number SP pathname CRLF (38) - - NUMBER shift 183 - . error - - octal_number goto 186 - - -state 174 - cmd : STAT check_login SP pathname CRLF . (20) - - . reduce 20 - - -state 175 - cmd : MKD check_login SP pathname CRLF . (30) - - . reduce 30 - - -state 176 - cmd : RMD check_login SP pathname CRLF . (31) - - . reduce 31 - - -state 177 - cmd : STOU check_login SP pathname CRLF . (41) - - . reduce 41 - - -state 178 - cmd : SIZE check_login SP pathname CRLF . (43) - - . reduce 43 - - -state 179 - cmd : MDTM check_login SP pathname CRLF . (44) - - . reduce 44 - - -state 180 - host_port : NUMBER COMMA NUMBER COMMA . NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER (52) - - NUMBER shift 187 - . error - - -state 181 - cmd : ALLO SP NUMBER SP R SP . NUMBER CRLF (12) - - NUMBER shift 188 - . error - - -state 182 - cmd : SITE SP HELP SP STRING CRLF . (35) - - . reduce 35 - - -state 183 - octal_number : NUMBER . (72) - - . reduce 72 - - -state 184 - cmd : SITE SP UMASK check_login SP octal_number . CRLF (37) - - CRLF shift 189 - . error - - -state 185 - cmd : SITE SP IDLE SP NUMBER CRLF . (40) - - . reduce 40 - - -state 186 - cmd : SITE SP CHMOD check_login SP octal_number . SP pathname CRLF (38) - - SP shift 190 - . error - - -state 187 - host_port : NUMBER COMMA NUMBER COMMA NUMBER . COMMA NUMBER COMMA NUMBER COMMA NUMBER (52) - - COMMA shift 191 - . error - - -state 188 - cmd : ALLO SP NUMBER SP R SP NUMBER . CRLF (12) - - CRLF shift 192 - . error - - -state 189 - cmd : SITE SP UMASK check_login SP octal_number CRLF . (37) - - . reduce 37 - - -state 190 - cmd : SITE SP CHMOD check_login SP octal_number SP . pathname CRLF (38) - - STRING shift 94 - . error - - pathname goto 193 - pathstring goto 96 - - -state 191 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA . NUMBER COMMA NUMBER COMMA NUMBER (52) - - NUMBER shift 194 - . error - - -state 192 - cmd : ALLO SP NUMBER SP R SP NUMBER CRLF . (12) - - . reduce 12 - - -state 193 - cmd : SITE SP CHMOD check_login SP octal_number SP pathname . CRLF (38) - - CRLF shift 195 - . error - - -state 194 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER . COMMA NUMBER COMMA NUMBER (52) - - COMMA shift 196 - . error - - -state 195 - cmd : SITE SP CHMOD check_login SP octal_number SP pathname CRLF . (38) - - . reduce 38 - - -state 196 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA . NUMBER COMMA NUMBER (52) - - NUMBER shift 197 - . error - - -state 197 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER . COMMA NUMBER (52) - - COMMA shift 198 - . error - - -state 198 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA . NUMBER (52) - - NUMBER shift 199 - . error - - -state 199 - host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER . (52) - - . reduce 52 - - -65 terminals, 16 nonterminals -74 grammar rules, 200 states diff --git a/test/ftp.tab.c b/test/ftp.tab.c deleted file mode 100644 index 71d7c6e..0000000 --- a/test/ftp.tab.c +++ /dev/null @@ -1,2005 +0,0 @@ -#ifndef lint -static const char yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93"; -#endif - -#define YYBYACC 1 -#define YYMAJOR 1 -#define YYMINOR 9 - -#define YYEMPTY (-1) -#define yyclearin (yychar = YYEMPTY) -#define yyerrok (yyerrflag = 0) -#define YYRECOVERING() (yyerrflag != 0) - - -#ifndef yyparse -#define yyparse ftp_parse -#endif /* yyparse */ - -#ifndef yylex -#define yylex ftp_lex -#endif /* yylex */ - -#ifndef yyerror -#define yyerror ftp_error -#endif /* yyerror */ - -#ifndef yychar -#define yychar ftp_char -#endif /* yychar */ - -#ifndef yyval -#define yyval ftp_val -#endif /* yyval */ - -#ifndef yylval -#define yylval ftp_lval -#endif /* yylval */ - -#ifndef yydebug -#define yydebug ftp_debug -#endif /* yydebug */ - -#ifndef yynerrs -#define yynerrs ftp_nerrs -#endif /* yynerrs */ - -#ifndef yyerrflag -#define yyerrflag ftp_errflag -#endif /* yyerrflag */ - -#ifndef yylhs -#define yylhs ftp_lhs -#endif /* yylhs */ - -#ifndef yylen -#define yylen ftp_len -#endif /* yylen */ - -#ifndef yydefred -#define yydefred ftp_defred -#endif /* yydefred */ - -#ifndef yydgoto -#define yydgoto ftp_dgoto -#endif /* yydgoto */ - -#ifndef yysindex -#define yysindex ftp_sindex -#endif /* yysindex */ - -#ifndef yyrindex -#define yyrindex ftp_rindex -#endif /* yyrindex */ - -#ifndef yygindex -#define yygindex ftp_gindex -#endif /* yygindex */ - -#ifndef yytable -#define yytable ftp_table -#endif /* yytable */ - -#ifndef yycheck -#define yycheck ftp_check -#endif /* yycheck */ - -#ifndef yyname -#define yyname ftp_name -#endif /* yyname */ - -#ifndef yyrule -#define yyrule ftp_rule -#endif /* yyrule */ -#define YYPREFIX "ftp_" - -#define YYPURE 0 - -#line 26 "ftp.y" - -/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -extern struct sockaddr_in data_dest; -extern int logged_in; -extern struct passwd *pw; -extern int guest; -extern int logging; -extern int type; -extern int form; -extern int debug; -extern int timeout; -extern int maxtimeout; -extern int pdata; -extern char hostname[], remotehost[]; -extern char proctitle[]; -extern char *globerr; -extern int usedefault; -extern int transflag; -extern char tmpline[]; - -extern char **glob(char *); -extern char *renamefrom(char *); -extern void cwd(const char *); - -extern void dologout(int); -extern void fatal(const char *); -extern void makedir(const char *); -extern void nack(const char *); -extern void pass(const char *); -extern void passive(void); -extern void pwd(void); -extern void removedir(char *); -extern void renamecmd(char *, char *); -extern void retrieve(const char *, const char *); -extern void send_file_list(const char *); -extern void statcmd(void); -extern void statfilecmd(const char *); -extern void store(char *, const char *, int); -extern void user(const char *); - -extern void perror_reply(int, const char *, ...); -extern void reply(int, const char *, ...); -extern void lreply(int, const char *, ...); - -static int cmd_type; -static int cmd_form; -static int cmd_bytesz; -char cbuf[512]; -char *fromname; - -struct tab { - const char *name; - short token; - short state; - short implemented; /* 1 if command is implemented */ - const char *help; -}; - -static char * copy(const char *); - -#ifdef YYBISON -static void sizecmd(char *filename); -static void help(struct tab *ctab, char *s); -struct tab cmdtab[]; -struct tab sitetab[]; -#endif - -static void -yyerror(const char *msg) -{ - perror(msg); -} -#line 126 "ftp.y" -#ifdef YYSTYPE -#undef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -#endif -#ifndef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -typedef union -{ - int ival; - char *sval; -} YYSTYPE; -#endif /* !YYSTYPE_IS_DECLARED */ -#line 211 "ftp.tab.c" - -/* compatibility with bison */ -#ifdef YYPARSE_PARAM -/* compatibility with FreeBSD */ -# ifdef YYPARSE_PARAM_TYPE -# define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM) -# else -# define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM) -# endif -#else -# define YYPARSE_DECL() yyparse(void) -#endif - -/* Parameters sent to lex. */ -#ifdef YYLEX_PARAM -# define YYLEX_DECL() yylex(void *YYLEX_PARAM) -# define YYLEX yylex(YYLEX_PARAM) -#else -# define YYLEX_DECL() yylex(void) -# define YYLEX yylex() -#endif - -/* Parameters sent to yyerror. */ -#ifndef YYERROR_DECL -#define YYERROR_DECL() yyerror(const char *s) -#endif -#ifndef YYERROR_CALL -#define YYERROR_CALL(msg) yyerror(msg) -#endif - -extern int YYPARSE_DECL(); - -#define NUMBER 257 -#define STRING 258 -#define A 259 -#define B 260 -#define C 261 -#define E 262 -#define F 263 -#define I 264 -#define L 265 -#define N 266 -#define P 267 -#define R 268 -#define S 269 -#define T 270 -#define SP 271 -#define CRLF 272 -#define COMMA 273 -#define USER 274 -#define PASS 275 -#define ACCT 276 -#define REIN 277 -#define QUIT 278 -#define PORT 279 -#define PASV 280 -#define TYPE 281 -#define STRU 282 -#define MODE 283 -#define RETR 284 -#define STOR 285 -#define APPE 286 -#define MLFL 287 -#define MAIL 288 -#define MSND 289 -#define MSOM 290 -#define MSAM 291 -#define MRSQ 292 -#define MRCP 293 -#define ALLO 294 -#define REST 295 -#define RNFR 296 -#define RNTO 297 -#define ABOR 298 -#define DELE 299 -#define CWD 300 -#define LIST 301 -#define NLST 302 -#define SITE 303 -#define STAT 304 -#define HELP 305 -#define NOOP 306 -#define MKD 307 -#define RMD 308 -#define PWD 309 -#define CDUP 310 -#define STOU 311 -#define SMNT 312 -#define SYST 313 -#define SIZE 314 -#define MDTM 315 -#define UMASK 316 -#define IDLE 317 -#define CHMOD 318 -#define LEXERR 319 -#define YYERRCODE 256 -static const short ftp_lhs[] = { -1, - 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 12, 10, 7, 7, - 1, 13, 3, 3, 3, 14, 14, 14, 14, 14, - 14, 14, 14, 6, 6, 6, 4, 4, 4, 8, - 9, 5, 2, -}; -static const short ftp_len[] = { 2, - 0, 2, 2, 4, 4, 4, 2, 4, 4, 4, - 4, 8, 5, 5, 5, 3, 5, 3, 5, 5, - 2, 5, 4, 2, 3, 5, 2, 4, 2, 5, - 5, 3, 3, 4, 6, 5, 7, 9, 4, 6, - 5, 2, 5, 5, 2, 2, 5, 1, 0, 1, - 1, 11, 1, 1, 1, 1, 3, 1, 3, 1, - 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, -}; -static const short ftp_defred[] = { 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 73, 73, 73, 0, 73, 0, 0, 73, 73, 73, - 73, 0, 0, 0, 0, 73, 73, 73, 73, 73, - 0, 73, 73, 2, 3, 46, 0, 0, 45, 0, - 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 24, 0, 0, 0, 0, 0, 21, 0, 0, 27, - 29, 0, 0, 0, 0, 0, 42, 0, 0, 48, - 0, 50, 0, 0, 0, 0, 0, 60, 0, 0, - 64, 66, 65, 0, 68, 69, 67, 0, 0, 0, - 0, 0, 0, 71, 0, 70, 0, 0, 25, 0, - 18, 0, 16, 0, 73, 0, 73, 0, 0, 0, - 0, 32, 33, 0, 0, 0, 4, 5, 0, 6, - 0, 0, 51, 0, 63, 8, 9, 10, 0, 0, - 0, 0, 11, 0, 23, 0, 0, 0, 0, 0, - 34, 0, 0, 39, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 55, 53, 54, 57, 59, 62, 13, - 14, 15, 0, 47, 22, 26, 19, 17, 0, 0, - 36, 0, 0, 20, 30, 31, 41, 43, 44, 0, - 0, 35, 72, 0, 40, 0, 0, 0, 37, 0, - 0, 12, 0, 0, 38, 0, 0, 0, 52, -}; -static const short ftp_dgoto[] = { 1, - 125, 45, 157, 88, 184, 84, 73, 95, 96, 71, - 34, 35, 75, 80, -}; -static const short ftp_sindex[] = { 0, - -224, -256, -248, -241, -239, -233, -225, -218, -200, -165, - 0, 0, 0, -164, 0, -163, -176, 0, 0, 0, - 0, -162, -161, -231, -160, 0, 0, 0, 0, 0, - -159, 0, 0, 0, 0, 0, -240, -148, 0, -143, - 0, -252, -175, -255, -156, -155, -154, -139, -152, -138, - 0, -149, -205, -203, -177, -253, 0, -147, -133, 0, - 0, -145, -144, -142, -141, -137, 0, -136, -135, 0, - -140, 0, -134, -132, -130, -131, -128, 0, -254, -127, - 0, 0, 0, -126, 0, 0, 0, -125, -138, -138, - -138, -174, -138, 0, -124, 0, -138, -138, 0, -138, - 0, -129, 0, -172, 0, -169, 0, -138, -123, -138, - -138, 0, 0, -138, -138, -138, 0, 0, -120, 0, - -246, -246, 0, -118, 0, 0, 0, 0, -122, -121, - -119, -116, 0, -117, 0, -115, -114, -113, -112, -104, - 0, -167, -101, 0, -110, -109, 0, -108, -107, -106, - -105, -103, -111, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -100, 0, 0, 0, 0, 0, -102, -85, - 0, -99, -85, 0, 0, 0, 0, 0, 0, -83, - -82, 0, 0, -96, 0, -94, -95, -93, 0, -138, - -77, 0, -91, -90, 0, -75, -88, -73, 0, -}; -static const short ftp_rindex[] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -86, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, -81, -80, 0, -160, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; -static const short ftp_gindex[] = { 0, - 4, 16, 11, 0, -29, 0, 0, -89, 0, 0, - 0, 0, 0, 0, -}; -#define YYTABLESIZE 192 -static const short ftp_table[] = { 129, - 130, 131, 123, 134, 85, 86, 76, 136, 137, 77, - 138, 78, 79, 87, 154, 36, 124, 70, 146, 155, - 148, 149, 37, 156, 150, 151, 152, 46, 47, 38, - 49, 2, 39, 52, 53, 54, 55, 40, 58, 59, - 60, 62, 63, 64, 65, 66, 41, 68, 69, 3, - 4, 104, 42, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 105, 106, 107, 98, 99, 100, 101, 14, - 43, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 81, 31, 32, - 33, 82, 83, 102, 103, 51, 132, 133, 140, 141, - 193, 143, 144, 170, 171, 44, 48, 50, 56, 72, - 57, 61, 67, 74, 89, 90, 91, 92, 93, 94, - 142, 97, 145, 108, 109, 110, 111, 159, 139, 112, - 113, 117, 158, 114, 115, 116, 153, 118, 123, 121, - 119, 120, 122, 186, 126, 127, 128, 135, 147, 160, - 161, 163, 162, 169, 164, 172, 165, 166, 167, 168, - 173, 180, 174, 175, 176, 177, 178, 0, 179, 182, - 181, 183, 185, 187, 188, 189, 190, 191, 192, 194, - 195, 197, 196, 199, 198, 49, 73, 0, 0, 0, - 56, 58, -}; -static const short ftp_check[] = { 89, - 90, 91, 257, 93, 260, 261, 259, 97, 98, 262, - 100, 264, 265, 269, 261, 272, 271, 258, 108, 266, - 110, 111, 271, 270, 114, 115, 116, 12, 13, 271, - 15, 256, 272, 18, 19, 20, 21, 271, 23, 271, - 272, 26, 27, 28, 29, 30, 272, 32, 33, 274, - 275, 305, 271, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 316, 317, 318, 271, 272, 271, 272, 294, - 271, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 263, 313, 314, - 315, 267, 268, 271, 272, 272, 271, 272, 271, 272, - 190, 271, 272, 271, 272, 271, 271, 271, 271, 258, - 272, 272, 272, 257, 271, 271, 271, 257, 271, 258, - 105, 271, 107, 271, 258, 271, 271, 124, 258, 272, - 272, 272, 122, 271, 271, 271, 257, 272, 257, 271, - 273, 272, 271, 173, 272, 272, 272, 272, 272, 272, - 272, 268, 272, 258, 272, 257, 272, 272, 272, 272, - 271, 273, 272, 272, 272, 272, 272, -1, 272, 272, - 271, 257, 272, 257, 257, 272, 271, 273, 272, 257, - 272, 257, 273, 257, 273, 272, 271, -1, -1, -1, - 272, 272, -}; -#define YYFINAL 1 -#ifndef YYDEBUG -#define YYDEBUG 0 -#endif -#define YYMAXTOKEN 319 -#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? (YYMAXTOKEN + 1) : (a)) -#if YYDEBUG -static const char *yyname[] = { - -"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"NUMBER","STRING","A","B","C","E", -"F","I","L","N","P","R","S","T","SP","CRLF","COMMA","USER","PASS","ACCT","REIN", -"QUIT","PORT","PASV","TYPE","STRU","MODE","RETR","STOR","APPE","MLFL","MAIL", -"MSND","MSOM","MSAM","MRSQ","MRCP","ALLO","REST","RNFR","RNTO","ABOR","DELE", -"CWD","LIST","NLST","SITE","STAT","HELP","NOOP","MKD","RMD","PWD","CDUP","STOU", -"SMNT","SYST","SIZE","MDTM","UMASK","IDLE","CHMOD","LEXERR","illegal-symbol", -}; -static const char *yyrule[] = { -"$accept : cmd_list", -"cmd_list :", -"cmd_list : cmd_list cmd", -"cmd_list : cmd_list rcmd", -"cmd : USER SP username CRLF", -"cmd : PASS SP password CRLF", -"cmd : PORT SP host_port CRLF", -"cmd : PASV CRLF", -"cmd : TYPE SP type_code CRLF", -"cmd : STRU SP struct_code CRLF", -"cmd : MODE SP mode_code CRLF", -"cmd : ALLO SP NUMBER CRLF", -"cmd : ALLO SP NUMBER SP R SP NUMBER CRLF", -"cmd : RETR check_login SP pathname CRLF", -"cmd : STOR check_login SP pathname CRLF", -"cmd : APPE check_login SP pathname CRLF", -"cmd : NLST check_login CRLF", -"cmd : NLST check_login SP STRING CRLF", -"cmd : LIST check_login CRLF", -"cmd : LIST check_login SP pathname CRLF", -"cmd : STAT check_login SP pathname CRLF", -"cmd : STAT CRLF", -"cmd : DELE check_login SP pathname CRLF", -"cmd : RNTO SP pathname CRLF", -"cmd : ABOR CRLF", -"cmd : CWD check_login CRLF", -"cmd : CWD check_login SP pathname CRLF", -"cmd : HELP CRLF", -"cmd : HELP SP STRING CRLF", -"cmd : NOOP CRLF", -"cmd : MKD check_login SP pathname CRLF", -"cmd : RMD check_login SP pathname CRLF", -"cmd : PWD check_login CRLF", -"cmd : CDUP check_login CRLF", -"cmd : SITE SP HELP CRLF", -"cmd : SITE SP HELP SP STRING CRLF", -"cmd : SITE SP UMASK check_login CRLF", -"cmd : SITE SP UMASK check_login SP octal_number CRLF", -"cmd : SITE SP CHMOD check_login SP octal_number SP pathname CRLF", -"cmd : SITE SP IDLE CRLF", -"cmd : SITE SP IDLE SP NUMBER CRLF", -"cmd : STOU check_login SP pathname CRLF", -"cmd : SYST CRLF", -"cmd : SIZE check_login SP pathname CRLF", -"cmd : MDTM check_login SP pathname CRLF", -"cmd : QUIT CRLF", -"cmd : error CRLF", -"rcmd : RNFR check_login SP pathname CRLF", -"username : STRING", -"password :", -"password : STRING", -"byte_size : NUMBER", -"host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER", -"form_code : N", -"form_code : T", -"form_code : C", -"type_code : A", -"type_code : A SP form_code", -"type_code : E", -"type_code : E SP form_code", -"type_code : I", -"type_code : L", -"type_code : L SP byte_size", -"type_code : L byte_size", -"struct_code : F", -"struct_code : R", -"struct_code : P", -"mode_code : S", -"mode_code : B", -"mode_code : C", -"pathname : pathstring", -"pathstring : STRING", -"octal_number : NUMBER", -"check_login :", - -}; -#endif - -int yydebug; -int yynerrs; - -int yyerrflag; -int yychar; -YYSTYPE yyval; -YYSTYPE yylval; - -/* define the initial stack-sizes */ -#ifdef YYSTACKSIZE -#undef YYMAXDEPTH -#define YYMAXDEPTH YYSTACKSIZE -#else -#ifdef YYMAXDEPTH -#define YYSTACKSIZE YYMAXDEPTH -#else -#define YYSTACKSIZE 10000 -#define YYMAXDEPTH 10000 -#endif -#endif - -#define YYINITSTACKSIZE 200 - -typedef struct { - unsigned stacksize; - short *s_base; - short *s_mark; - short *s_last; - YYSTYPE *l_base; - YYSTYPE *l_mark; -} YYSTACKDATA; -/* variables for the parser stack */ -static YYSTACKDATA yystack; -#line 733 "ftp.y" - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -extern jmp_buf errcatch; - -static void upper(char *); - -#define CMD 0 /* beginning of command */ -#define ARGS 1 /* expect miscellaneous arguments */ -#define STR1 2 /* expect SP followed by STRING */ -#define STR2 3 /* expect STRING */ -#define OSTR 4 /* optional SP then STRING */ -#define ZSTR1 5 /* SP then optional STRING */ -#define ZSTR2 6 /* optional STRING after SP */ -#define SITECMD 7 /* SITE command */ -#define NSTR 8 /* Number followed by a string */ - -struct tab cmdtab[] = { /* In order defined in RFC 765 */ - { "USER", USER, STR1, 1, " username" }, - { "PASS", PASS, ZSTR1, 1, " password" }, - { "ACCT", ACCT, STR1, 0, "(specify account)" }, - { "SMNT", SMNT, ARGS, 0, "(structure mount)" }, - { "REIN", REIN, ARGS, 0, "(reinitialize server state)" }, - { "QUIT", QUIT, ARGS, 1, "(terminate service)", }, - { "PORT", PORT, ARGS, 1, " b0, b1, b2, b3, b4" }, - { "PASV", PASV, ARGS, 1, "(set server in passive mode)" }, - { "TYPE", TYPE, ARGS, 1, " [ A | E | I | L ]" }, - { "STRU", STRU, ARGS, 1, "(specify file structure)" }, - { "MODE", MODE, ARGS, 1, "(specify transfer mode)" }, - { "RETR", RETR, STR1, 1, " file-name" }, - { "STOR", STOR, STR1, 1, " file-name" }, - { "APPE", APPE, STR1, 1, " file-name" }, - { "MLFL", MLFL, OSTR, 0, "(mail file)" }, - { "MAIL", MAIL, OSTR, 0, "(mail to user)" }, - { "MSND", MSND, OSTR, 0, "(mail send to terminal)" }, - { "MSOM", MSOM, OSTR, 0, "(mail send to terminal or mailbox)" }, - { "MSAM", MSAM, OSTR, 0, "(mail send to terminal and mailbox)" }, - { "MRSQ", MRSQ, OSTR, 0, "(mail recipient scheme question)" }, - { "MRCP", MRCP, STR1, 0, "(mail recipient)" }, - { "ALLO", ALLO, ARGS, 1, "allocate storage (vacuously)" }, - { "REST", REST, ARGS, 0, "(restart command)" }, - { "RNFR", RNFR, STR1, 1, " file-name" }, - { "RNTO", RNTO, STR1, 1, " file-name" }, - { "ABOR", ABOR, ARGS, 1, "(abort operation)" }, - { "DELE", DELE, STR1, 1, " file-name" }, - { "CWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "XCWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "LIST", LIST, OSTR, 1, "[ path-name ]" }, - { "NLST", NLST, OSTR, 1, "[ path-name ]" }, - { "SITE", SITE, SITECMD, 1, "site-cmd [ arguments ]" }, - { "SYST", SYST, ARGS, 1, "(get type of operating system)" }, - { "STAT", STAT, OSTR, 1, "[ path-name ]" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { "NOOP", NOOP, ARGS, 1, "" }, - { "MKD", MKD, STR1, 1, " path-name" }, - { "XMKD", MKD, STR1, 1, " path-name" }, - { "RMD", RMD, STR1, 1, " path-name" }, - { "XRMD", RMD, STR1, 1, " path-name" }, - { "PWD", PWD, ARGS, 1, "(return current directory)" }, - { "XPWD", PWD, ARGS, 1, "(return current directory)" }, - { "CDUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "XCUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "STOU", STOU, STR1, 1, " file-name" }, - { "SIZE", SIZE, OSTR, 1, " path-name" }, - { "MDTM", MDTM, OSTR, 1, " path-name" }, - { 0, 0, 0, 0, 0 } -}; - -struct tab sitetab[] = { - { "UMASK", UMASK, ARGS, 1, "[ umask ]" }, - { "IDLE", IDLE, ARGS, 1, "[ maximum-idle-time ]" }, - { "CHMOD", CHMOD, NSTR, 1, " mode file-name" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { 0, 0, 0, 0, 0 } -}; - -static struct tab * -lookup(struct tab *p, char *cmd) -{ - - for (; p->name != 0; p++) - if (strcmp(cmd, p->name) == 0) - return (p); - return (0); -} - -#include - -/* - * get_line - a hacked up version of fgets to ignore TELNET escape codes. - */ -static char * -get_line(char *s, int n, FILE *iop) -{ - register int c; - register char *cs; - - cs = s; -/* tmpline may contain saved command from urgent mode interruption */ - for (c = 0; tmpline[c] != '\0' && --n > 0; ++c) { - *cs++ = tmpline[c]; - if (tmpline[c] == '\n') { - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - tmpline[0] = '\0'; - return(s); - } - if (c == 0) - tmpline[0] = '\0'; - } - while ((c = getc(iop)) != EOF) { - c &= 0377; - if (c == IAC) { - if ((c = getc(iop)) != EOF) { - c &= 0377; - switch (c) { - case WILL: - case WONT: - c = getc(iop); - printf("%c%c%c", IAC, DONT, 0377&c); - (void) fflush(stdout); - continue; - case DO: - case DONT: - c = getc(iop); - printf("%c%c%c", IAC, WONT, 0377&c); - (void) fflush(stdout); - continue; - case IAC: - break; - default: - continue; /* ignore command */ - } - } - } - *cs++ = (char) c; - if (--n <= 0 || c == '\n') - break; - } - if (c == EOF && cs == s) - return (0); - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - return (s); -} - -static void -toolong(int sig) -{ - time_t now; - - (void) sig; - reply(421, - "Timeout (%d seconds): closing control connection.", timeout); - (void) time(&now); - if (logging) { - syslog(LOG_INFO, - "User %s timed out after %d seconds at %s", - (pw ? pw -> pw_name : "unknown"), timeout, ctime(&now)); - } - dologout(1); -} - -int -yylex(void) -{ - static int cpos, state; - register char *cp, *cp2; - register struct tab *p; - int n; - char c; - - for (;;) { - switch (state) { - - case CMD: - (void) signal(SIGALRM, toolong); - (void) alarm((unsigned) timeout); - if (get_line(cbuf, sizeof(cbuf)-1, stdin) == 0) { - reply(221, "You could at least say goodbye."); - dologout(0); - } - (void) alarm(0); -#ifdef SETPROCTITLE - if (strncasecmp(cbuf, "PASS", 4) != 0) - setproctitle("%s: %s", proctitle, cbuf); -#endif /* SETPROCTITLE */ - if ((cp = strchr(cbuf, '\r'))) { - *cp++ = '\n'; - *cp = '\0'; - } - if ((cp = strpbrk(cbuf, " \n"))) - cpos = (int) (cp - cbuf); - if (cpos == 0) - cpos = 4; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cbuf); - p = lookup(cmdtab, cbuf); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - break; - - case SITECMD: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - cp = &cbuf[cpos]; - if ((cp2 = strpbrk(cp, " \n"))) - cpos = (int) (cp2 - cbuf); - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cp); - p = lookup(sitetab, cp); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - state = CMD; - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - state = CMD; - break; - - case OSTR: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR1: - case ZSTR1: - dostr1: - if (cbuf[cpos] == ' ') { - cpos++; - if (state == OSTR) - state = STR2; - else - ++state; - return (SP); - } - break; - - case ZSTR2: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR2: - cp = &cbuf[cpos]; - n = (int) strlen(cp); - cpos += n - 1; - /* - * Make sure the string is nonempty and \n terminated. - */ - if (n > 1 && cbuf[cpos] == '\n') { - cbuf[cpos] = '\0'; - *(char **)&yylval = copy(cp); - cbuf[cpos] = '\n'; - state = ARGS; - return (STRING); - } - break; - - case NSTR: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval.ival = atoi(cp); - cbuf[cpos] = c; - state = STR1; - return (NUMBER); - } - state = STR1; - goto dostr1; - - case ARGS: - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval.ival = atoi(cp); - cbuf[cpos] = c; - return (NUMBER); - } - switch (cbuf[cpos++]) { - - case '\n': - state = CMD; - return (CRLF); - - case ' ': - return (SP); - - case ',': - return (COMMA); - - case 'A': - case 'a': - return (A); - - case 'B': - case 'b': - return (B); - - case 'C': - case 'c': - return (C); - - case 'E': - case 'e': - return (E); - - case 'F': - case 'f': - return (F); - - case 'I': - case 'i': - return (I); - - case 'L': - case 'l': - return (L); - - case 'N': - case 'n': - return (N); - - case 'P': - case 'p': - return (P); - - case 'R': - case 'r': - return (R); - - case 'S': - case 's': - return (S); - - case 'T': - case 't': - return (T); - - } - break; - - default: - fatal("Unknown state in scanner."); - } - yyerror((char *) 0); - state = CMD; - longjmp(errcatch,0); - } -} - -static void -upper(char *s) -{ - while (*s != '\0') { - if (islower(*s)) - *s = toupper(*s); - s++; - } -} - -static char * -copy(const char *s) -{ - char *p; - - p = (char * )malloc(strlen(s) + 1); - if (p == 0) - fatal("Ran out of memory."); - else - (void) strcpy(p, s); - return (p); -} - -static void -help(struct tab *ctab, char *s) -{ - register struct tab *c; - register int width, NCMDS; - const char *help_type; - - if (ctab == sitetab) - help_type = "SITE "; - else - help_type = ""; - width = 0, NCMDS = 0; - for (c = ctab; c->name != 0; c++) { - int len = (int) strlen(c->name); - - if (len > width) - width = len; - NCMDS++; - } - width = (width + 8) &~ 7; - if (s == 0) { - register int i, j, w; - int columns, lines; - - lreply(214, "The following %scommands are recognized %s.", - help_type, "(* =>'s unimplemented)"); - columns = 76 / width; - if (columns == 0) - columns = 1; - lines = (NCMDS + columns - 1) / columns; - for (i = 0; i < lines; i++) { - printf(" "); - for (j = 0; j < columns; j++) { - c = ctab + j * lines + i; - assert(c->name != 0); - printf("%s%c", c->name, - c->implemented ? ' ' : '*'); - if (c + lines >= &ctab[NCMDS]) - break; - w = (int) strlen(c->name) + 1; - while (w < width) { - putchar(' '); - w++; - } - } - printf("\r\n"); - } - (void) fflush(stdout); - reply(214, "Direct comments to ftp-bugs@%s.", hostname); - return; - } - upper(s); - c = lookup(ctab, s); - if (c == (struct tab *)0) { - reply(502, "Unknown command %s.", s); - return; - } - if (c->implemented) - reply(214, "Syntax: %s%s %s", help_type, c->name, c->help); - else - reply(214, "%s%-*s\t%s; unimplemented.", help_type, width, - c->name, c->help); -} - -static void -sizecmd(char *filename) -{ - switch (type) { - case TYPE_L: - case TYPE_I: { - struct stat stbuf; - if (stat(filename, &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) - reply(550, "%s: not a plain file.", filename); - else -#ifdef HAVE_LONG_LONG - reply(213, "%llu", (long long) stbuf.st_size); -#else - reply(213, "%lu", stbuf.st_size); -#endif - break;} - case TYPE_A: { - FILE *fin; - register int c, count; - struct stat stbuf; - fin = fopen(filename, "r"); - if (fin == 0) { - perror_reply(550, filename); - return; - } - if (fstat(fileno(fin), &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", filename); - (void) fclose(fin); - return; - } - - count = 0; - while((c=getc(fin)) != EOF) { - if (c == '\n') /* will get expanded to \r\n */ - count++; - count++; - } - (void) fclose(fin); - - reply(213, "%ld", count); - break;} - default: - reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); - } -} -#line 1103 "ftp.tab.c" - -#if YYDEBUG -#include /* needed for printf */ -#endif - -#include /* needed for malloc, etc */ -#include /* needed for memset */ - -/* allocate initial stack or double stack size, up to YYMAXDEPTH */ -static int yygrowstack(YYSTACKDATA *data) -{ - int i; - unsigned newsize; - short *newss; - YYSTYPE *newvs; - - if ((newsize = data->stacksize) == 0) - newsize = YYINITSTACKSIZE; - else if (newsize >= YYMAXDEPTH) - return -1; - else if ((newsize *= 2) > YYMAXDEPTH) - newsize = YYMAXDEPTH; - - i = (int) (data->s_mark - data->s_base); - newss = (short *)realloc(data->s_base, newsize * sizeof(*newss)); - if (newss == 0) - return -1; - - data->s_base = newss; - data->s_mark = newss + i; - - newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs)); - if (newvs == 0) - return -1; - - data->l_base = newvs; - data->l_mark = newvs + i; - - data->stacksize = newsize; - data->s_last = data->s_base + newsize - 1; - return 0; -} - -#if YYPURE || defined(YY_NO_LEAKS) -static void yyfreestack(YYSTACKDATA *data) -{ - free(data->s_base); - free(data->l_base); - memset(data, 0, sizeof(*data)); -} -#else -#define yyfreestack(data) /* nothing */ -#endif - -#define YYABORT goto yyabort -#define YYREJECT goto yyabort -#define YYACCEPT goto yyaccept -#define YYERROR goto yyerrlab - -int -YYPARSE_DECL() -{ - int yym, yyn, yystate; -#if YYDEBUG - const char *yys; - - if ((yys = getenv("YYDEBUG")) != 0) - { - yyn = *yys; - if (yyn >= '0' && yyn <= '9') - yydebug = yyn - '0'; - } -#endif - - yynerrs = 0; - yyerrflag = 0; - yychar = YYEMPTY; - yystate = 0; - -#if YYPURE - memset(&yystack, 0, sizeof(yystack)); -#endif - - if (yystack.s_base == NULL && yygrowstack(&yystack)) goto yyoverflow; - yystack.s_mark = yystack.s_base; - yystack.l_mark = yystack.l_base; - yystate = 0; - *yystack.s_mark = 0; - -yyloop: - if ((yyn = yydefred[yystate]) != 0) goto yyreduce; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - } - if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, shifting to state %d\n", - YYPREFIX, yystate, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - yychar = YYEMPTY; - if (yyerrflag > 0) --yyerrflag; - goto yyloop; - } - if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yychar) - { - yyn = yytable[yyn]; - goto yyreduce; - } - if (yyerrflag) goto yyinrecovery; - - yyerror("syntax error"); - - goto yyerrlab; - -yyerrlab: - ++yynerrs; - -yyinrecovery: - if (yyerrflag < 3) - { - yyerrflag = 3; - for (;;) - { - if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, error recovery shifting\ - to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - yystate = yytable[yyn]; - *++yystack.s_mark = yytable[yyn]; - *++yystack.l_mark = yylval; - goto yyloop; - } - else - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: error recovery discarding state %d\n", - YYPREFIX, *yystack.s_mark); -#endif - if (yystack.s_mark <= yystack.s_base) goto yyabort; - --yystack.s_mark; - --yystack.l_mark; - } - } - } - else - { - if (yychar == 0) goto yyabort; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, error recovery discards token %d (%s)\n", - YYPREFIX, yystate, yychar, yys); - } -#endif - yychar = YYEMPTY; - goto yyloop; - } - -yyreduce: -#if YYDEBUG - if (yydebug) - printf("%sdebug: state %d, reducing by rule %d (%s)\n", - YYPREFIX, yystate, yyn, yyrule[yyn]); -#endif - yym = yylen[yyn]; - if (yym) - yyval = yystack.l_mark[1-yym]; - else - memset(&yyval, 0, sizeof yyval); - switch (yyn) - { -case 2: -#line 172 "ftp.y" - { - fromname = (char *) 0; - } -break; -case 4: -#line 179 "ftp.y" - { - user(yystack.l_mark[-1].sval); - free(yystack.l_mark[-1].sval); - } -break; -case 5: -#line 184 "ftp.y" - { - pass(yystack.l_mark[-1].sval); - free(yystack.l_mark[-1].sval); - } -break; -case 6: -#line 189 "ftp.y" - { - usedefault = 0; - if (pdata >= 0) { - (void) close(pdata); - pdata = -1; - } - reply(200, "PORT command successful."); - } -break; -case 7: -#line 198 "ftp.y" - { - passive(); - } -break; -case 8: -#line 202 "ftp.y" - { - switch (cmd_type) { - - case TYPE_A: - if (cmd_form == FORM_N) { - reply(200, "Type set to A."); - type = cmd_type; - form = cmd_form; - } else - reply(504, "Form must be N."); - break; - - case TYPE_E: - reply(504, "Type E not implemented."); - break; - - case TYPE_I: - reply(200, "Type set to I."); - type = cmd_type; - break; - - case TYPE_L: -#if NBBY == 8 - if (cmd_bytesz == 8) { - reply(200, - "Type set to L (byte size 8)."); - type = cmd_type; - } else - reply(504, "Byte size must be 8."); -#else /* NBBY == 8 */ - UNIMPLEMENTED for NBBY != 8 -#endif /* NBBY == 8 */ - } - } -break; -case 9: -#line 237 "ftp.y" - { - switch (yystack.l_mark[-1].ival) { - - case STRU_F: - reply(200, "STRU F ok."); - break; - - default: - reply(504, "Unimplemented STRU type."); - } - } -break; -case 10: -#line 249 "ftp.y" - { - switch (yystack.l_mark[-1].ival) { - - case MODE_S: - reply(200, "MODE S ok."); - break; - - default: - reply(502, "Unimplemented MODE type."); - } - } -break; -case 11: -#line 261 "ftp.y" - { - reply(202, "ALLO command ignored."); - } -break; -case 12: -#line 265 "ftp.y" - { - reply(202, "ALLO command ignored."); - } -break; -case 13: -#line 269 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - retrieve((char *) 0, yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free(yystack.l_mark[-1].sval); - } -break; -case 14: -#line 276 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - store(yystack.l_mark[-1].sval, "w", 0); - if (yystack.l_mark[-1].sval != 0) - free(yystack.l_mark[-1].sval); - } -break; -case 15: -#line 283 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - store(yystack.l_mark[-1].sval, "a", 0); - if (yystack.l_mark[-1].sval != 0) - free(yystack.l_mark[-1].sval); - } -break; -case 16: -#line 290 "ftp.y" - { - if (yystack.l_mark[-1].ival) - send_file_list("."); - } -break; -case 17: -#line 295 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - send_file_list((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 18: -#line 302 "ftp.y" - { - if (yystack.l_mark[-1].ival) - retrieve("/bin/ls -lgA", ""); - } -break; -case 19: -#line 307 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - retrieve("/bin/ls -lgA %s", yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free(yystack.l_mark[-1].sval); - } -break; -case 20: -#line 314 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - statfilecmd(yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free(yystack.l_mark[-1].sval); - } -break; -case 21: -#line 321 "ftp.y" - { - statcmd(); - } -break; -case 22: -#line 325 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - remove((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 23: -#line 332 "ftp.y" - { - if (fromname) { - renamecmd(fromname, (char *) yystack.l_mark[-1].sval); - free(fromname); - fromname = (char *) 0; - } else { - reply(503, "Bad sequence of commands."); - } - free((char *) yystack.l_mark[-1].sval); - } -break; -case 24: -#line 343 "ftp.y" - { - reply(225, "ABOR command successful."); - } -break; -case 25: -#line 347 "ftp.y" - { - if (yystack.l_mark[-1].ival) - cwd(pw->pw_dir); - } -break; -case 26: -#line 352 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - cwd((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 27: -#line 359 "ftp.y" - { - help(cmdtab, (char *) 0); - } -break; -case 28: -#line 363 "ftp.y" - { - register char *cp = (char *)yystack.l_mark[-1].sval; - - if (strncasecmp(cp, "SITE", 4) == 0) { - cp = (char *)yystack.l_mark[-1].sval + 4; - if (*cp == ' ') - cp++; - if (*cp) - help(sitetab, cp); - else - help(sitetab, (char *) 0); - } else - help(cmdtab, (char *) yystack.l_mark[-1].sval); - } -break; -case 29: -#line 378 "ftp.y" - { - reply(200, "NOOP command successful."); - } -break; -case 30: -#line 382 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - makedir((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 31: -#line 389 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - removedir((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 32: -#line 396 "ftp.y" - { - if (yystack.l_mark[-1].ival) - pwd(); - } -break; -case 33: -#line 401 "ftp.y" - { - if (yystack.l_mark[-1].ival) - cwd(".."); - } -break; -case 34: -#line 406 "ftp.y" - { - help(sitetab, (char *) 0); - } -break; -case 35: -#line 410 "ftp.y" - { - help(sitetab, (char *) yystack.l_mark[-1].sval); - } -break; -case 36: -#line 414 "ftp.y" - { - int oldmask; - - if (yystack.l_mark[-1].ival) { - oldmask = umask(0); - (void) umask(oldmask); - reply(200, "Current UMASK is %03o", oldmask); - } - } -break; -case 37: -#line 424 "ftp.y" - { - int oldmask; - - if (yystack.l_mark[-3].ival) { - if ((yystack.l_mark[-1].ival == -1) || (yystack.l_mark[-1].ival > 0777)) { - reply(501, "Bad UMASK value"); - } else { - oldmask = umask(yystack.l_mark[-1].ival); - reply(200, - "UMASK set to %03o (was %03o)", - yystack.l_mark[-1].ival, oldmask); - } - } - } -break; -case 38: -#line 439 "ftp.y" - { - if (yystack.l_mark[-5].ival && (yystack.l_mark[-1].sval != 0)) { - if (yystack.l_mark[-3].ival > 0777) - reply(501, - "CHMOD: Mode value must be between 0 and 0777"); - else if (chmod((char *) yystack.l_mark[-1].sval, yystack.l_mark[-3].ival) < 0) - perror_reply(550, (char *) yystack.l_mark[-1].sval); - else - reply(200, "CHMOD command successful."); - } - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 39: -#line 453 "ftp.y" - { - reply(200, - "Current IDLE time limit is %d seconds; max %d", - timeout, maxtimeout); - } -break; -case 40: -#line 459 "ftp.y" - { - if (yystack.l_mark[-1].ival < 30 || yystack.l_mark[-1].ival > maxtimeout) { - reply(501, - "Maximum IDLE time must be between 30 and %d seconds", - maxtimeout); - } else { - timeout = yystack.l_mark[-1].ival; - (void) alarm((unsigned) timeout); - reply(200, - "Maximum IDLE time set to %d seconds", - timeout); - } - } -break; -case 41: -#line 473 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - store((char *) yystack.l_mark[-1].sval, "w", 1); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 42: -#line 480 "ftp.y" - { -#ifdef unix -#ifdef BSD - reply(215, "UNIX Type: L%d Version: BSD-%d", - NBBY, BSD); -#else /* BSD */ - reply(215, "UNIX Type: L%d", NBBY); -#endif /* BSD */ -#else /* unix */ - reply(215, "UNKNOWN Type: L%d", NBBY); -#endif /* unix */ - } -break; -case 43: -#line 501 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) - sizecmd((char *) yystack.l_mark[-1].sval); - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 44: -#line 518 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval != 0) { - struct stat stbuf; - if (stat((char *) yystack.l_mark[-1].sval, &stbuf) < 0) - perror_reply(550, "%s", (char *) yystack.l_mark[-1].sval); - else if ((stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", - (char *) yystack.l_mark[-1].sval); - } else { - register struct tm *t; - t = gmtime(&stbuf.st_mtime); - reply(213, - "%04d%02d%02d%02d%02d%02d", - 1900 + t->tm_year, - t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - } - } - if (yystack.l_mark[-1].sval != 0) - free((char *) yystack.l_mark[-1].sval); - } -break; -case 45: -#line 540 "ftp.y" - { - reply(221, "Goodbye."); - dologout(0); - } -break; -case 46: -#line 545 "ftp.y" - { - yyerrok; - } -break; -case 47: -#line 550 "ftp.y" - { - if (yystack.l_mark[-3].ival && yystack.l_mark[-1].sval) { - fromname = renamefrom((char *) yystack.l_mark[-1].sval); - if (fromname == (char *) 0 && yystack.l_mark[-1].sval) { - free((char *) yystack.l_mark[-1].sval); - } - } - } -break; -case 49: -#line 564 "ftp.y" - { - *(const char **)(&(yyval.sval)) = ""; - } -break; -case 52: -#line 575 "ftp.y" - { - register char *a, *p; - - a = (char *)&data_dest.sin_addr; - a[0] = (char) yystack.l_mark[-10].ival; - a[1] = (char) yystack.l_mark[-8].ival; - a[2] = (char) yystack.l_mark[-6].ival; - a[3] = (char) yystack.l_mark[-4].ival; - p = (char *)&data_dest.sin_port; - p[0] = (char) yystack.l_mark[-2].ival; - p[1] = (char) yystack.l_mark[0].ival; - data_dest.sin_family = AF_INET; - } -break; -case 53: -#line 591 "ftp.y" - { - yyval.ival = FORM_N; - } -break; -case 54: -#line 595 "ftp.y" - { - yyval.ival = FORM_T; - } -break; -case 55: -#line 599 "ftp.y" - { - yyval.ival = FORM_C; - } -break; -case 56: -#line 605 "ftp.y" - { - cmd_type = TYPE_A; - cmd_form = FORM_N; - } -break; -case 57: -#line 610 "ftp.y" - { - cmd_type = TYPE_A; - cmd_form = yystack.l_mark[0].ival; - } -break; -case 58: -#line 615 "ftp.y" - { - cmd_type = TYPE_E; - cmd_form = FORM_N; - } -break; -case 59: -#line 620 "ftp.y" - { - cmd_type = TYPE_E; - cmd_form = yystack.l_mark[0].ival; - } -break; -case 60: -#line 625 "ftp.y" - { - cmd_type = TYPE_I; - } -break; -case 61: -#line 629 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = NBBY; - } -break; -case 62: -#line 634 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = yystack.l_mark[0].ival; - } -break; -case 63: -#line 640 "ftp.y" - { - cmd_type = TYPE_L; - cmd_bytesz = yystack.l_mark[0].ival; - } -break; -case 64: -#line 647 "ftp.y" - { - yyval.ival = STRU_F; - } -break; -case 65: -#line 651 "ftp.y" - { - yyval.ival = STRU_R; - } -break; -case 66: -#line 655 "ftp.y" - { - yyval.ival = STRU_P; - } -break; -case 67: -#line 661 "ftp.y" - { - yyval.ival = MODE_S; - } -break; -case 68: -#line 665 "ftp.y" - { - yyval.ival = MODE_B; - } -break; -case 69: -#line 669 "ftp.y" - { - yyval.ival = MODE_C; - } -break; -case 70: -#line 675 "ftp.y" - { - /* - * Problem: this production is used for all pathname - * processing, but only gives a 550 error reply. - * This is a valid reply in some cases but not in others. - */ - if (logged_in && yystack.l_mark[0].sval && strncmp((char *) yystack.l_mark[0].sval, "~", 1) == 0) { - *(char **)&(yyval.sval) = *glob((char *) yystack.l_mark[0].sval); - if (globerr != 0) { - reply(550, globerr); - yyval.sval = 0; - } - free((char *) yystack.l_mark[0].sval); - } else - yyval.sval = yystack.l_mark[0].sval; - } -break; -case 72: -#line 697 "ftp.y" - { - register int ret, dec, multby, digit; - - /* - * Convert a number that was read as decimal number - * to what it would be if it had been read as octal. - */ - dec = yystack.l_mark[0].ival; - multby = 1; - ret = 0; - while (dec) { - digit = dec%10; - if (digit > 7) { - ret = -1; - break; - } - ret += digit * multby; - multby *= 8; - dec /= 10; - } - yyval.ival = ret; - } -break; -case 73: -#line 722 "ftp.y" - { - if (logged_in) - yyval.ival = 1; - else { - reply(530, "Please login with USER and PASS."); - yyval.ival = 0; - } - } -break; -#line 1946 "ftp.tab.c" - } - yystack.s_mark -= yym; - yystate = *yystack.s_mark; - yystack.l_mark -= yym; - yym = yylhs[yyn]; - if (yystate == 0 && yym == 0) - { -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state 0 to\ - state %d\n", YYPREFIX, YYFINAL); -#endif - yystate = YYFINAL; - *++yystack.s_mark = YYFINAL; - *++yystack.l_mark = yyval; - if (yychar < 0) - { - if ((yychar = YYLEX) < 0) yychar = 0; -#if YYDEBUG - if (yydebug) - { - yys = yyname[YYTRANSLATE(yychar)]; - printf("%sdebug: state %d, reading %d (%s)\n", - YYPREFIX, YYFINAL, yychar, yys); - } -#endif - } - if (yychar == 0) goto yyaccept; - goto yyloop; - } - if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 && - yyn <= YYTABLESIZE && yycheck[yyn] == yystate) - yystate = yytable[yyn]; - else - yystate = yydgoto[yym]; -#if YYDEBUG - if (yydebug) - printf("%sdebug: after reduction, shifting from state %d \ -to state %d\n", YYPREFIX, *yystack.s_mark, yystate); -#endif - if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack)) - { - goto yyoverflow; - } - *++yystack.s_mark = (short) yystate; - *++yystack.l_mark = yyval; - goto yyloop; - -yyoverflow: - yyerror("yacc stack overflow"); - -yyabort: - yyfreestack(&yystack); - return (1); - -yyaccept: - yyfreestack(&yystack); - return (0); -} diff --git a/test/ftp.tab.h b/test/ftp.tab.h deleted file mode 100644 index 6e72663..0000000 --- a/test/ftp.tab.h +++ /dev/null @@ -1,76 +0,0 @@ -#define NUMBER 257 -#define STRING 258 -#define A 259 -#define B 260 -#define C 261 -#define E 262 -#define F 263 -#define I 264 -#define L 265 -#define N 266 -#define P 267 -#define R 268 -#define S 269 -#define T 270 -#define SP 271 -#define CRLF 272 -#define COMMA 273 -#define USER 274 -#define PASS 275 -#define ACCT 276 -#define REIN 277 -#define QUIT 278 -#define PORT 279 -#define PASV 280 -#define TYPE 281 -#define STRU 282 -#define MODE 283 -#define RETR 284 -#define STOR 285 -#define APPE 286 -#define MLFL 287 -#define MAIL 288 -#define MSND 289 -#define MSOM 290 -#define MSAM 291 -#define MRSQ 292 -#define MRCP 293 -#define ALLO 294 -#define REST 295 -#define RNFR 296 -#define RNTO 297 -#define ABOR 298 -#define DELE 299 -#define CWD 300 -#define LIST 301 -#define NLST 302 -#define SITE 303 -#define STAT 304 -#define HELP 305 -#define NOOP 306 -#define MKD 307 -#define RMD 308 -#define PWD 309 -#define CDUP 310 -#define STOU 311 -#define SMNT 312 -#define SYST 313 -#define SIZE 314 -#define MDTM 315 -#define UMASK 316 -#define IDLE 317 -#define CHMOD 318 -#define LEXERR 319 -#ifdef YYSTYPE -#undef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -#endif -#ifndef YYSTYPE_IS_DECLARED -#define YYSTYPE_IS_DECLARED 1 -typedef union -{ - int ival; - char *sval; -} YYSTYPE; -#endif /* !YYSTYPE_IS_DECLARED */ -extern YYSTYPE ftp_lval; diff --git a/test/ftp.y b/test/ftp.y deleted file mode 100644 index c095b3e..0000000 --- a/test/ftp.y +++ /dev/null @@ -1,1254 +0,0 @@ -/* - * Copyright (c) 1985, 1988 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89 - */ - -/* - * Grammar for FTP commands. - * See RFC 959. - */ - -%{ - -/* sccsid[] = "@(#)ftpcmd.y 5.20.1.1 (Berkeley) 3/2/89"; */ - -#include -#include - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef YYBISON -int yylex(void); -static void yyerror(const char *); -#endif - -extern struct sockaddr_in data_dest; -extern int logged_in; -extern struct passwd *pw; -extern int guest; -extern int logging; -extern int type; -extern int form; -extern int debug; -extern int timeout; -extern int maxtimeout; -extern int pdata; -extern char hostname[], remotehost[]; -extern char proctitle[]; -extern char *globerr; -extern int usedefault; -extern int transflag; -extern char tmpline[]; - -extern char **glob(char *); -extern char *renamefrom(char *); -extern void cwd(const char *); - -extern void dologout(int); -extern void fatal(const char *); -extern void makedir(const char *); -extern void nack(const char *); -extern void pass(const char *); -extern void passive(void); -extern void pwd(void); -extern void removedir(char *); -extern void renamecmd(char *, char *); -extern void retrieve(const char *, const char *); -extern void send_file_list(const char *); -extern void statcmd(void); -extern void statfilecmd(const char *); -extern void store(char *, const char *, int); -extern void user(const char *); - -extern void perror_reply(int, const char *, ...); -extern void reply(int, const char *, ...); -extern void lreply(int, const char *, ...); - -static int cmd_type; -static int cmd_form; -static int cmd_bytesz; -char cbuf[512]; -char *fromname; - -struct tab { - const char *name; - short token; - short state; - short implemented; /* 1 if command is implemented */ - const char *help; -}; - -static char * copy(const char *); - -#ifdef YYBISON -static void sizecmd(char *filename); -static void help(struct tab *ctab, char *s); -struct tab cmdtab[]; -struct tab sitetab[]; -#endif - -static void -yyerror(const char *msg) -{ - perror(msg); -} -%} - -%union -{ - int ival; - char *sval; -} -%token NUMBER -%token STRING - -%type - byte_size - check_login - form_code - mode_code - octal_number - struct_code - -%type - password - pathname - pathstring - username - -%token - A B C E F I - L N P R S T - - SP CRLF COMMA STRING NUMBER - - USER PASS ACCT REIN QUIT PORT - PASV TYPE STRU MODE RETR STOR - APPE MLFL MAIL MSND MSOM MSAM - MRSQ MRCP ALLO REST RNFR RNTO - ABOR DELE CWD LIST NLST SITE - STAT HELP NOOP MKD RMD PWD - CDUP STOU SMNT SYST SIZE MDTM - - UMASK IDLE CHMOD - - LEXERR - -%start cmd_list - -%% - -cmd_list: /* empty */ - | cmd_list cmd - { - fromname = (char *) 0; - } - | cmd_list rcmd - ; - -cmd: USER SP username CRLF - { - user($3); - free($3); - } - | PASS SP password CRLF - { - pass($3); - free($3); - } - | PORT SP host_port CRLF - { - usedefault = 0; - if (pdata >= 0) { - (void) close(pdata); - pdata = -1; - } - reply(200, "PORT command successful."); - } - | PASV CRLF - { - passive(); - } - | TYPE SP type_code CRLF - { - switch (cmd_type) { - - case TYPE_A: - if (cmd_form == FORM_N) { - reply(200, "Type set to A."); - type = cmd_type; - form = cmd_form; - } else - reply(504, "Form must be N."); - break; - - case TYPE_E: - reply(504, "Type E not implemented."); - break; - - case TYPE_I: - reply(200, "Type set to I."); - type = cmd_type; - break; - - case TYPE_L: -#if NBBY == 8 - if (cmd_bytesz == 8) { - reply(200, - "Type set to L (byte size 8)."); - type = cmd_type; - } else - reply(504, "Byte size must be 8."); -#else /* NBBY == 8 */ - UNIMPLEMENTED for NBBY != 8 -#endif /* NBBY == 8 */ - } - } - | STRU SP struct_code CRLF - { - switch ($3) { - - case STRU_F: - reply(200, "STRU F ok."); - break; - - default: - reply(504, "Unimplemented STRU type."); - } - } - | MODE SP mode_code CRLF - { - switch ($3) { - - case MODE_S: - reply(200, "MODE S ok."); - break; - - default: - reply(502, "Unimplemented MODE type."); - } - } - | ALLO SP NUMBER CRLF - { - reply(202, "ALLO command ignored."); - } - | ALLO SP NUMBER SP R SP NUMBER CRLF - { - reply(202, "ALLO command ignored."); - } - | RETR check_login SP pathname CRLF - { - if ($2 && $4 != 0) - retrieve((char *) 0, $4); - if ($4 != 0) - free($4); - } - | STOR check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store($4, "w", 0); - if ($4 != 0) - free($4); - } - | APPE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store($4, "a", 0); - if ($4 != 0) - free($4); - } - | NLST check_login CRLF - { - if ($2) - send_file_list("."); - } - | NLST check_login SP STRING CRLF - { - if ($2 && $4 != 0) - send_file_list((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | LIST check_login CRLF - { - if ($2) - retrieve("/bin/ls -lgA", ""); - } - | LIST check_login SP pathname CRLF - { - if ($2 && $4 != 0) - retrieve("/bin/ls -lgA %s", $4); - if ($4 != 0) - free($4); - } - | STAT check_login SP pathname CRLF - { - if ($2 && $4 != 0) - statfilecmd($4); - if ($4 != 0) - free($4); - } - | STAT CRLF - { - statcmd(); - } - | DELE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - remove((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | RNTO SP pathname CRLF - { - if (fromname) { - renamecmd(fromname, (char *) $3); - free(fromname); - fromname = (char *) 0; - } else { - reply(503, "Bad sequence of commands."); - } - free((char *) $3); - } - | ABOR CRLF - { - reply(225, "ABOR command successful."); - } - | CWD check_login CRLF - { - if ($2) - cwd(pw->pw_dir); - } - | CWD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - cwd((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | HELP CRLF - { - help(cmdtab, (char *) 0); - } - | HELP SP STRING CRLF - { - register char *cp = (char *)$3; - - if (strncasecmp(cp, "SITE", 4) == 0) { - cp = (char *)$3 + 4; - if (*cp == ' ') - cp++; - if (*cp) - help(sitetab, cp); - else - help(sitetab, (char *) 0); - } else - help(cmdtab, (char *) $3); - } - | NOOP CRLF - { - reply(200, "NOOP command successful."); - } - | MKD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - makedir((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | RMD check_login SP pathname CRLF - { - if ($2 && $4 != 0) - removedir((char *) $4); - if ($4 != 0) - free((char *) $4); - } - | PWD check_login CRLF - { - if ($2) - pwd(); - } - | CDUP check_login CRLF - { - if ($2) - cwd(".."); - } - | SITE SP HELP CRLF - { - help(sitetab, (char *) 0); - } - | SITE SP HELP SP STRING CRLF - { - help(sitetab, (char *) $5); - } - | SITE SP UMASK check_login CRLF - { - int oldmask; - - if ($4) { - oldmask = umask(0); - (void) umask(oldmask); - reply(200, "Current UMASK is %03o", oldmask); - } - } - | SITE SP UMASK check_login SP octal_number CRLF - { - int oldmask; - - if ($4) { - if (($6 == -1) || ($6 > 0777)) { - reply(501, "Bad UMASK value"); - } else { - oldmask = umask($6); - reply(200, - "UMASK set to %03o (was %03o)", - $6, oldmask); - } - } - } - | SITE SP CHMOD check_login SP octal_number SP pathname CRLF - { - if ($4 && ($8 != 0)) { - if ($6 > 0777) - reply(501, - "CHMOD: Mode value must be between 0 and 0777"); - else if (chmod((char *) $8, $6) < 0) - perror_reply(550, (char *) $8); - else - reply(200, "CHMOD command successful."); - } - if ($8 != 0) - free((char *) $8); - } - | SITE SP IDLE CRLF - { - reply(200, - "Current IDLE time limit is %d seconds; max %d", - timeout, maxtimeout); - } - | SITE SP IDLE SP NUMBER CRLF - { - if ($5 < 30 || $5 > maxtimeout) { - reply(501, - "Maximum IDLE time must be between 30 and %d seconds", - maxtimeout); - } else { - timeout = $5; - (void) alarm((unsigned) timeout); - reply(200, - "Maximum IDLE time set to %d seconds", - timeout); - } - } - | STOU check_login SP pathname CRLF - { - if ($2 && $4 != 0) - store((char *) $4, "w", 1); - if ($4 != 0) - free((char *) $4); - } - | SYST CRLF - { -#ifdef unix -#ifdef BSD - reply(215, "UNIX Type: L%d Version: BSD-%d", - NBBY, BSD); -#else /* BSD */ - reply(215, "UNIX Type: L%d", NBBY); -#endif /* BSD */ -#else /* unix */ - reply(215, "UNKNOWN Type: L%d", NBBY); -#endif /* unix */ - } - - /* - * SIZE is not in RFC959, but Postel has blessed it and - * it will be in the updated RFC. - * - * Return size of file in a format suitable for - * using with RESTART (we just count bytes). - */ - | SIZE check_login SP pathname CRLF - { - if ($2 && $4 != 0) - sizecmd((char *) $4); - if ($4 != 0) - free((char *) $4); - } - - /* - * MDTM is not in RFC959, but Postel has blessed it and - * it will be in the updated RFC. - * - * Return modification time of file as an ISO 3307 - * style time. E.g. YYYYMMDDHHMMSS or YYYYMMDDHHMMSS.xxx - * where xxx is the fractional second (of any precision, - * not necessarily 3 digits) - */ - | MDTM check_login SP pathname CRLF - { - if ($2 && $4 != 0) { - struct stat stbuf; - if (stat((char *) $4, &stbuf) < 0) - perror_reply(550, "%s", (char *) $4); - else if ((stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", - (char *) $4); - } else { - register struct tm *t; - t = gmtime(&stbuf.st_mtime); - reply(213, - "%04d%02d%02d%02d%02d%02d", - 1900 + t->tm_year, - t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - } - } - if ($4 != 0) - free((char *) $4); - } - | QUIT CRLF - { - reply(221, "Goodbye."); - dologout(0); - } - | error CRLF - { - yyerrok; - } - ; -rcmd: RNFR check_login SP pathname CRLF - { - if ($2 && $4) { - fromname = renamefrom((char *) $4); - if (fromname == (char *) 0 && $4) { - free((char *) $4); - } - } - } - ; - -username: STRING - ; - -password: /* empty */ - { - *(const char **)(&($$)) = ""; - } - | STRING - ; - -byte_size: NUMBER - ; - -host_port: NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA - NUMBER COMMA NUMBER - { - register char *a, *p; - - a = (char *)&data_dest.sin_addr; - a[0] = (char) $1; - a[1] = (char) $3; - a[2] = (char) $5; - a[3] = (char) $7; - p = (char *)&data_dest.sin_port; - p[0] = (char) $9; - p[1] = (char) $11; - data_dest.sin_family = AF_INET; - } - ; - -form_code: N - { - $$ = FORM_N; - } - | T - { - $$ = FORM_T; - } - | C - { - $$ = FORM_C; - } - ; - -type_code: A - { - cmd_type = TYPE_A; - cmd_form = FORM_N; - } - | A SP form_code - { - cmd_type = TYPE_A; - cmd_form = $3; - } - | E - { - cmd_type = TYPE_E; - cmd_form = FORM_N; - } - | E SP form_code - { - cmd_type = TYPE_E; - cmd_form = $3; - } - | I - { - cmd_type = TYPE_I; - } - | L - { - cmd_type = TYPE_L; - cmd_bytesz = NBBY; - } - | L SP byte_size - { - cmd_type = TYPE_L; - cmd_bytesz = $3; - } - /* this is for a bug in the BBN ftp */ - | L byte_size - { - cmd_type = TYPE_L; - cmd_bytesz = $2; - } - ; - -struct_code: F - { - $$ = STRU_F; - } - | R - { - $$ = STRU_R; - } - | P - { - $$ = STRU_P; - } - ; - -mode_code: S - { - $$ = MODE_S; - } - | B - { - $$ = MODE_B; - } - | C - { - $$ = MODE_C; - } - ; - -pathname: pathstring - { - /* - * Problem: this production is used for all pathname - * processing, but only gives a 550 error reply. - * This is a valid reply in some cases but not in others. - */ - if (logged_in && $1 && strncmp((char *) $1, "~", 1) == 0) { - *(char **)&($$) = *glob((char *) $1); - if (globerr != 0) { - reply(550, globerr); - $$ = 0; - } - free((char *) $1); - } else - $$ = $1; - } - ; - -pathstring: STRING - ; - -octal_number: NUMBER - { - register int ret, dec, multby, digit; - - /* - * Convert a number that was read as decimal number - * to what it would be if it had been read as octal. - */ - dec = $1; - multby = 1; - ret = 0; - while (dec) { - digit = dec%10; - if (digit > 7) { - ret = -1; - break; - } - ret += digit * multby; - multby *= 8; - dec /= 10; - } - $$ = ret; - } - ; - -check_login: /* empty */ - { - if (logged_in) - $$ = 1; - else { - reply(530, "Please login with USER and PASS."); - $$ = 0; - } - } - ; - -%% - -#ifdef YYBYACC -extern int YYLEX_DECL(); -#endif - -extern jmp_buf errcatch; - -static void upper(char *); - -#define CMD 0 /* beginning of command */ -#define ARGS 1 /* expect miscellaneous arguments */ -#define STR1 2 /* expect SP followed by STRING */ -#define STR2 3 /* expect STRING */ -#define OSTR 4 /* optional SP then STRING */ -#define ZSTR1 5 /* SP then optional STRING */ -#define ZSTR2 6 /* optional STRING after SP */ -#define SITECMD 7 /* SITE command */ -#define NSTR 8 /* Number followed by a string */ - -struct tab cmdtab[] = { /* In order defined in RFC 765 */ - { "USER", USER, STR1, 1, " username" }, - { "PASS", PASS, ZSTR1, 1, " password" }, - { "ACCT", ACCT, STR1, 0, "(specify account)" }, - { "SMNT", SMNT, ARGS, 0, "(structure mount)" }, - { "REIN", REIN, ARGS, 0, "(reinitialize server state)" }, - { "QUIT", QUIT, ARGS, 1, "(terminate service)", }, - { "PORT", PORT, ARGS, 1, " b0, b1, b2, b3, b4" }, - { "PASV", PASV, ARGS, 1, "(set server in passive mode)" }, - { "TYPE", TYPE, ARGS, 1, " [ A | E | I | L ]" }, - { "STRU", STRU, ARGS, 1, "(specify file structure)" }, - { "MODE", MODE, ARGS, 1, "(specify transfer mode)" }, - { "RETR", RETR, STR1, 1, " file-name" }, - { "STOR", STOR, STR1, 1, " file-name" }, - { "APPE", APPE, STR1, 1, " file-name" }, - { "MLFL", MLFL, OSTR, 0, "(mail file)" }, - { "MAIL", MAIL, OSTR, 0, "(mail to user)" }, - { "MSND", MSND, OSTR, 0, "(mail send to terminal)" }, - { "MSOM", MSOM, OSTR, 0, "(mail send to terminal or mailbox)" }, - { "MSAM", MSAM, OSTR, 0, "(mail send to terminal and mailbox)" }, - { "MRSQ", MRSQ, OSTR, 0, "(mail recipient scheme question)" }, - { "MRCP", MRCP, STR1, 0, "(mail recipient)" }, - { "ALLO", ALLO, ARGS, 1, "allocate storage (vacuously)" }, - { "REST", REST, ARGS, 0, "(restart command)" }, - { "RNFR", RNFR, STR1, 1, " file-name" }, - { "RNTO", RNTO, STR1, 1, " file-name" }, - { "ABOR", ABOR, ARGS, 1, "(abort operation)" }, - { "DELE", DELE, STR1, 1, " file-name" }, - { "CWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "XCWD", CWD, OSTR, 1, "[ directory-name ]" }, - { "LIST", LIST, OSTR, 1, "[ path-name ]" }, - { "NLST", NLST, OSTR, 1, "[ path-name ]" }, - { "SITE", SITE, SITECMD, 1, "site-cmd [ arguments ]" }, - { "SYST", SYST, ARGS, 1, "(get type of operating system)" }, - { "STAT", STAT, OSTR, 1, "[ path-name ]" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { "NOOP", NOOP, ARGS, 1, "" }, - { "MKD", MKD, STR1, 1, " path-name" }, - { "XMKD", MKD, STR1, 1, " path-name" }, - { "RMD", RMD, STR1, 1, " path-name" }, - { "XRMD", RMD, STR1, 1, " path-name" }, - { "PWD", PWD, ARGS, 1, "(return current directory)" }, - { "XPWD", PWD, ARGS, 1, "(return current directory)" }, - { "CDUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "XCUP", CDUP, ARGS, 1, "(change to parent directory)" }, - { "STOU", STOU, STR1, 1, " file-name" }, - { "SIZE", SIZE, OSTR, 1, " path-name" }, - { "MDTM", MDTM, OSTR, 1, " path-name" }, - { 0, 0, 0, 0, 0 } -}; - -struct tab sitetab[] = { - { "UMASK", UMASK, ARGS, 1, "[ umask ]" }, - { "IDLE", IDLE, ARGS, 1, "[ maximum-idle-time ]" }, - { "CHMOD", CHMOD, NSTR, 1, " mode file-name" }, - { "HELP", HELP, OSTR, 1, "[ ]" }, - { 0, 0, 0, 0, 0 } -}; - -static struct tab * -lookup(struct tab *p, char *cmd) -{ - - for (; p->name != 0; p++) - if (strcmp(cmd, p->name) == 0) - return (p); - return (0); -} - -#include - -/* - * get_line - a hacked up version of fgets to ignore TELNET escape codes. - */ -static char * -get_line(char *s, int n, FILE *iop) -{ - register int c; - register char *cs; - - cs = s; -/* tmpline may contain saved command from urgent mode interruption */ - for (c = 0; tmpline[c] != '\0' && --n > 0; ++c) { - *cs++ = tmpline[c]; - if (tmpline[c] == '\n') { - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - tmpline[0] = '\0'; - return(s); - } - if (c == 0) - tmpline[0] = '\0'; - } - while ((c = getc(iop)) != EOF) { - c &= 0377; - if (c == IAC) { - if ((c = getc(iop)) != EOF) { - c &= 0377; - switch (c) { - case WILL: - case WONT: - c = getc(iop); - printf("%c%c%c", IAC, DONT, 0377&c); - (void) fflush(stdout); - continue; - case DO: - case DONT: - c = getc(iop); - printf("%c%c%c", IAC, WONT, 0377&c); - (void) fflush(stdout); - continue; - case IAC: - break; - default: - continue; /* ignore command */ - } - } - } - *cs++ = (char) c; - if (--n <= 0 || c == '\n') - break; - } - if (c == EOF && cs == s) - return (0); - *cs = '\0'; - if (debug) - syslog(LOG_DEBUG, "command: %s", s); - return (s); -} - -static void -toolong(int sig) -{ - time_t now; - - (void) sig; - reply(421, - "Timeout (%d seconds): closing control connection.", timeout); - (void) time(&now); - if (logging) { - syslog(LOG_INFO, - "User %s timed out after %d seconds at %s", - (pw ? pw -> pw_name : "unknown"), timeout, ctime(&now)); - } - dologout(1); -} - -int -yylex(void) -{ - static int cpos, state; - register char *cp, *cp2; - register struct tab *p; - int n; - char c; - - for (;;) { - switch (state) { - - case CMD: - (void) signal(SIGALRM, toolong); - (void) alarm((unsigned) timeout); - if (get_line(cbuf, sizeof(cbuf)-1, stdin) == 0) { - reply(221, "You could at least say goodbye."); - dologout(0); - } - (void) alarm(0); -#ifdef SETPROCTITLE - if (strncasecmp(cbuf, "PASS", 4) != 0) - setproctitle("%s: %s", proctitle, cbuf); -#endif /* SETPROCTITLE */ - if ((cp = strchr(cbuf, '\r'))) { - *cp++ = '\n'; - *cp = '\0'; - } - if ((cp = strpbrk(cbuf, " \n"))) - cpos = (int) (cp - cbuf); - if (cpos == 0) - cpos = 4; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cbuf); - p = lookup(cmdtab, cbuf); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - break; - - case SITECMD: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - cp = &cbuf[cpos]; - if ((cp2 = strpbrk(cp, " \n"))) - cpos = (int) (cp2 - cbuf); - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - upper(cp); - p = lookup(sitetab, cp); - cbuf[cpos] = c; - if (p != 0) { - if (p->implemented == 0) { - state = CMD; - nack(p->name); - longjmp(errcatch,0); - /* NOTREACHED */ - } - state = p->state; - *(const char **)(&yylval) = p->name; - return (p->token); - } - state = CMD; - break; - - case OSTR: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR1: - case ZSTR1: - dostr1: - if (cbuf[cpos] == ' ') { - cpos++; - if (state == OSTR) - state = STR2; - else - ++state; - return (SP); - } - break; - - case ZSTR2: - if (cbuf[cpos] == '\n') { - state = CMD; - return (CRLF); - } - /* FALLTHROUGH */ - - case STR2: - cp = &cbuf[cpos]; - n = (int) strlen(cp); - cpos += n - 1; - /* - * Make sure the string is nonempty and \n terminated. - */ - if (n > 1 && cbuf[cpos] == '\n') { - cbuf[cpos] = '\0'; - *(char **)&yylval = copy(cp); - cbuf[cpos] = '\n'; - state = ARGS; - return (STRING); - } - break; - - case NSTR: - if (cbuf[cpos] == ' ') { - cpos++; - return (SP); - } - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval.ival = atoi(cp); - cbuf[cpos] = c; - state = STR1; - return (NUMBER); - } - state = STR1; - goto dostr1; - - case ARGS: - if (isdigit(cbuf[cpos])) { - cp = &cbuf[cpos]; - while (isdigit(cbuf[++cpos])) - ; - c = cbuf[cpos]; - cbuf[cpos] = '\0'; - yylval.ival = atoi(cp); - cbuf[cpos] = c; - return (NUMBER); - } - switch (cbuf[cpos++]) { - - case '\n': - state = CMD; - return (CRLF); - - case ' ': - return (SP); - - case ',': - return (COMMA); - - case 'A': - case 'a': - return (A); - - case 'B': - case 'b': - return (B); - - case 'C': - case 'c': - return (C); - - case 'E': - case 'e': - return (E); - - case 'F': - case 'f': - return (F); - - case 'I': - case 'i': - return (I); - - case 'L': - case 'l': - return (L); - - case 'N': - case 'n': - return (N); - - case 'P': - case 'p': - return (P); - - case 'R': - case 'r': - return (R); - - case 'S': - case 's': - return (S); - - case 'T': - case 't': - return (T); - - } - break; - - default: - fatal("Unknown state in scanner."); - } - yyerror((char *) 0); - state = CMD; - longjmp(errcatch,0); - } -} - -static void -upper(char *s) -{ - while (*s != '\0') { - if (islower(*s)) - *s = toupper(*s); - s++; - } -} - -static char * -copy(const char *s) -{ - char *p; - - p = (char * )malloc(strlen(s) + 1); - if (p == 0) - fatal("Ran out of memory."); - else - (void) strcpy(p, s); - return (p); -} - -static void -help(struct tab *ctab, char *s) -{ - register struct tab *c; - register int width, NCMDS; - const char *help_type; - - if (ctab == sitetab) - help_type = "SITE "; - else - help_type = ""; - width = 0, NCMDS = 0; - for (c = ctab; c->name != 0; c++) { - int len = (int) strlen(c->name); - - if (len > width) - width = len; - NCMDS++; - } - width = (width + 8) &~ 7; - if (s == 0) { - register int i, j, w; - int columns, lines; - - lreply(214, "The following %scommands are recognized %s.", - help_type, "(* =>'s unimplemented)"); - columns = 76 / width; - if (columns == 0) - columns = 1; - lines = (NCMDS + columns - 1) / columns; - for (i = 0; i < lines; i++) { - printf(" "); - for (j = 0; j < columns; j++) { - c = ctab + j * lines + i; - assert(c->name != 0); - printf("%s%c", c->name, - c->implemented ? ' ' : '*'); - if (c + lines >= &ctab[NCMDS]) - break; - w = (int) strlen(c->name) + 1; - while (w < width) { - putchar(' '); - w++; - } - } - printf("\r\n"); - } - (void) fflush(stdout); - reply(214, "Direct comments to ftp-bugs@%s.", hostname); - return; - } - upper(s); - c = lookup(ctab, s); - if (c == (struct tab *)0) { - reply(502, "Unknown command %s.", s); - return; - } - if (c->implemented) - reply(214, "Syntax: %s%s %s", help_type, c->name, c->help); - else - reply(214, "%s%-*s\t%s; unimplemented.", help_type, width, - c->name, c->help); -} - -static void -sizecmd(char *filename) -{ - switch (type) { - case TYPE_L: - case TYPE_I: { - struct stat stbuf; - if (stat(filename, &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) - reply(550, "%s: not a plain file.", filename); - else -#ifdef HAVE_LONG_LONG - reply(213, "%llu", (long long) stbuf.st_size); -#else - reply(213, "%lu", stbuf.st_size); -#endif - break;} - case TYPE_A: { - FILE *fin; - register int c, count; - struct stat stbuf; - fin = fopen(filename, "r"); - if (fin == 0) { - perror_reply(550, filename); - return; - } - if (fstat(fileno(fin), &stbuf) < 0 || - (stbuf.st_mode&S_IFMT) != S_IFREG) { - reply(550, "%s: not a plain file.", filename); - (void) fclose(fin); - return; - } - - count = 0; - while((c=getc(fin)) != EOF) { - if (c == '\n') /* will get expanded to \r\n */ - count++; - count++; - } - (void) fclose(fin); - - reply(213, "%ld", count); - break;} - default: - reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); - } -} diff --git a/test/grammar.dot b/test/grammar.dot new file mode 100644 index 0000000..1988e12 --- /dev/null +++ b/test/grammar.dot @@ -0,0 +1,906 @@ +digraph test-grammar { + edge [fontsize=10]; + node [shape=box,fontsize=10]; + orientation=landscape; + rankdir=LR; + /* + margin=0.2; + page="8.27,11.69"; // for A4 printing + ratio=auto; + */ + + q0 [label="0:\l $accept -> . program $end\l program -> . { $end }\l program -> . translation_unit\l translation_unit -> . external_declaration\l translation_unit -> . translation_unit external_declaration\l external_declaration -> . declaration\l external_declaration -> . function_definition\l external_declaration -> . ';'\l external_declaration -> . linkage_specification\l external_declaration -> . T_ASM T_ASMARG ';'\l external_declaration -> . error T_MATCHRBRACE\l external_declaration -> . error ';'\l linkage_specification -> . T_EXTERN T_STRING_LITERAL braces\l linkage_specification -> . T_EXTERN T_STRING_LITERAL declaration\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l function_definition -> . decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE\l function_definition -> . declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q1 [label="1:\l external_declaration -> error . T_MATCHRBRACE\l external_declaration -> error . ';'\l"]; + q2 [label="2:\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> '(' . declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q3 [label="3:\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l pointer -> '*' . opt_type_qualifiers\l pointer -> '*' . opt_type_qualifiers pointer\l opt_type_qualifiers -> . { ')' ',' T_BRACKETS T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l opt_type_qualifiers -> . type_qualifier_list\l type_qualifier_list -> . type_qualifier\l type_qualifier_list -> . type_qualifier_list type_qualifier\l"]; + q4 [label="4:\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l identifier_or_ref -> '&' . any_id\l"]; + q5 [label="5:\l any_id -> T_IDENTIFIER . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q6 [label="6:\l type_specifier -> T_TYPEDEF_NAME . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l any_id -> T_TYPEDEF_NAME . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q7 [label="7:\l type_qualifier -> T_DEFINE_NAME . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q8 [label="8:\l storage_class -> T_AUTO . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q9 [label="9:\l linkage_specification -> T_EXTERN . T_STRING_LITERAL braces\l linkage_specification -> T_EXTERN . T_STRING_LITERAL declaration\l storage_class -> T_EXTERN . { ';' T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q10 [label="10:\l storage_class -> T_REGISTER . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q11 [label="11:\l storage_class -> T_STATIC . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q12 [label="12:\l any_typedef -> T_TYPEDEF . { T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l"]; + q13 [label="13:\l storage_class -> T_INLINE . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q14 [label="14:\l any_typedef -> T_EXTENSION . T_TYPEDEF\l storage_class -> T_EXTENSION . { ';' T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q15 [label="15:\l type_specifier -> T_CHAR . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q16 [label="16:\l type_specifier -> T_DOUBLE . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q17 [label="17:\l type_specifier -> T_FLOAT . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q18 [label="18:\l type_specifier -> T_INT . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q19 [label="19:\l type_specifier -> T_VOID . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q20 [label="20:\l type_specifier -> T_LONG . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q21 [label="21:\l type_specifier -> T_SHORT . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q22 [label="22:\l type_specifier -> T_SIGNED . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q23 [label="23:\l type_specifier -> T_UNSIGNED . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q24 [label="24:\l enumeration -> T_ENUM . { T_LBRACE T_TYPEDEF_NAME T_IDENTIFIER }\l"]; + q25 [label="25:\l struct_or_union -> T_STRUCT . { T_LBRACE T_TYPEDEF_NAME T_IDENTIFIER }\l"]; + q26 [label="26:\l struct_or_union -> T_UNION . { T_LBRACE T_TYPEDEF_NAME T_IDENTIFIER }\l"]; + q27 [label="27:\l type_specifier -> T_Bool . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q28 [label="28:\l type_specifier -> T_Complex . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q29 [label="29:\l type_specifier -> T_Imaginary . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q30 [label="30:\l type_qualifier -> T_TYPE_QUALIFIER . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q31 [label="31:\l external_declaration -> T_ASM . T_ASMARG ';'\l"]; + q32 [label="32:\l external_declaration -> ';' . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q33 [label="33:\l $accept -> program . $end\l"]; + q34 [label="34:\l declaration -> decl_specifiers . ';'\l declaration -> decl_specifiers . init_declarator_list ';'\l function_definition -> decl_specifiers . declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE\l decl_specifiers -> decl_specifiers . decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l init_declarator_list -> . init_declarator\l init_declarator_list -> . init_declarator_list ',' init_declarator\l init_declarator -> . declarator\l init_declarator -> . declarator '=' $$5 T_INITIALIZER\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q35 [label="35:\l decl_specifiers -> decl_specifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q36 [label="36:\l decl_specifier -> storage_class . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q37 [label="37:\l decl_specifier -> type_specifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q38 [label="38:\l decl_specifier -> type_qualifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q39 [label="39:\l type_specifier -> struct_or_union_specifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q40 [label="40:\l type_specifier -> enum_specifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q41 [label="41:\l $$4 -> . { T_VA_DCL T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l function_definition -> declarator . $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE\l"]; + q42 [label="42:\l declarator -> direct_declarator . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l direct_declarator -> direct_declarator . T_BRACKETS\l direct_declarator -> direct_declarator . '(' parameter_type_list ')'\l direct_declarator -> direct_declarator . '(' opt_identifier_list ')'\l"]; + q43 [label="43:\l braces -> . T_LBRACE T_MATCHRBRACE\l struct_or_union_specifier -> struct_or_union . any_id braces\l struct_or_union_specifier -> struct_or_union . braces\l struct_or_union_specifier -> struct_or_union . any_id\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l"]; + q44 [label="44:\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> pointer . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q45 [label="45:\l identifier_or_ref -> any_id . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q46 [label="46:\l direct_declarator -> identifier_or_ref . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q47 [label="47:\l braces -> . T_LBRACE T_MATCHRBRACE\l enum_specifier -> enumeration . any_id braces\l enum_specifier -> enumeration . braces\l enum_specifier -> enumeration . any_id\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l"]; + q48 [label="48:\l program -> translation_unit . { $end }\l translation_unit -> translation_unit . external_declaration\l external_declaration -> . declaration\l external_declaration -> . function_definition\l external_declaration -> . ';'\l external_declaration -> . linkage_specification\l external_declaration -> . T_ASM T_ASMARG ';'\l external_declaration -> . error T_MATCHRBRACE\l external_declaration -> . error ';'\l linkage_specification -> . T_EXTERN T_STRING_LITERAL braces\l linkage_specification -> . T_EXTERN T_STRING_LITERAL declaration\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l function_definition -> . decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE\l function_definition -> . declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q49 [label="49:\l translation_unit -> external_declaration . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q50 [label="50:\l external_declaration -> declaration . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q51 [label="51:\l external_declaration -> function_definition . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q52 [label="52:\l external_declaration -> linkage_specification . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q53 [label="53:\l declaration -> any_typedef . decl_specifiers $$1 opt_declarator_list ';'\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q54 [label="54:\l external_declaration -> error T_MATCHRBRACE . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q55 [label="55:\l external_declaration -> error ';' . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q56 [label="56:\l any_id -> T_TYPEDEF_NAME . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q57 [label="57:\l direct_declarator -> '(' declarator . ')'\l"]; + q58 [label="58:\l type_qualifier_list -> type_qualifier . { ')' ',' T_BRACKETS T_TYPE_QUALIFIER T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q59 [label="59:\l pointer -> . '*' opt_type_qualifiers\l pointer -> '*' opt_type_qualifiers . { ')' ',' T_BRACKETS T_TYPEDEF_NAME T_IDENTIFIER '&' '(' }\l pointer -> . '*' opt_type_qualifiers pointer\l pointer -> '*' opt_type_qualifiers . pointer\l"]; + q60 [label="60:\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l opt_type_qualifiers -> type_qualifier_list . { ')' ',' T_BRACKETS T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l type_qualifier_list -> type_qualifier_list . type_qualifier\l"]; + q61 [label="61:\l identifier_or_ref -> '&' any_id . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q62 [label="62:\l braces -> . T_LBRACE T_MATCHRBRACE\l linkage_specification -> T_EXTERN T_STRING_LITERAL . braces\l linkage_specification -> T_EXTERN T_STRING_LITERAL . declaration\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q63 [label="63:\l any_typedef -> T_EXTENSION T_TYPEDEF . { T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l"]; + q64 [label="64:\l external_declaration -> T_ASM T_ASMARG . ';'\l"]; + q65 [label="65:\l storage_class -> T_EXTERN . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q66 [label="66:\l storage_class -> T_EXTENSION . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q67 [label="67:\l declaration -> decl_specifiers ';' . { ';' T_ASM T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q68 [label="68:\l decl_specifiers -> decl_specifiers decl_specifier . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q69 [label="69:\l declaration -> decl_specifiers init_declarator_list . ';'\l init_declarator_list -> init_declarator_list . ',' init_declarator\l"]; + q70 [label="70:\l init_declarator_list -> init_declarator . { ',' ';' }\l"]; + q71 [label="71:\l $$2 -> . { T_VA_DCL T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l function_definition -> decl_specifiers declarator . $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE\l init_declarator -> declarator . { ',' ';' }\l init_declarator -> declarator . '=' $$5 T_INITIALIZER\l"]; + q72 [label="72:\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l function_definition -> declarator $$4 . opt_declaration_list T_LBRACE T_MATCHRBRACE\l opt_declaration_list -> . { T_LBRACE }\l opt_declaration_list -> . T_VA_DCL\l opt_declaration_list -> . declaration_list\l declaration_list -> . declaration\l declaration_list -> . declaration_list declaration\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q73 [label="73:\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l direct_declarator -> direct_declarator '(' . parameter_type_list ')'\l direct_declarator -> direct_declarator '(' . opt_identifier_list ')'\l parameter_type_list -> . parameter_list\l parameter_type_list -> . parameter_list ',' T_ELLIPSIS\l parameter_list -> . parameter_declaration\l parameter_list -> . parameter_list ',' parameter_declaration\l parameter_declaration -> . decl_specifiers declarator\l parameter_declaration -> . decl_specifiers abs_declarator\l parameter_declaration -> . decl_specifiers\l opt_identifier_list -> . { ')' }\l opt_identifier_list -> . identifier_list\l identifier_list -> . any_id\l identifier_list -> . identifier_list ',' any_id\l"]; + q74 [label="74:\l direct_declarator -> direct_declarator T_BRACKETS . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q75 [label="75:\l braces -> T_LBRACE . T_MATCHRBRACE\l"]; + q76 [label="76:\l braces -> . T_LBRACE T_MATCHRBRACE\l struct_or_union_specifier -> struct_or_union any_id . braces\l struct_or_union_specifier -> struct_or_union any_id . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q77 [label="77:\l struct_or_union_specifier -> struct_or_union braces . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q78 [label="78:\l declarator -> pointer direct_declarator . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l direct_declarator -> direct_declarator . T_BRACKETS\l direct_declarator -> direct_declarator . '(' parameter_type_list ')'\l direct_declarator -> direct_declarator . '(' opt_identifier_list ')'\l"]; + q79 [label="79:\l braces -> . T_LBRACE T_MATCHRBRACE\l enum_specifier -> enumeration any_id . braces\l enum_specifier -> enumeration any_id . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q80 [label="80:\l enum_specifier -> enumeration braces . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q81 [label="81:\l translation_unit -> translation_unit external_declaration . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q82 [label="82:\l type_specifier -> T_TYPEDEF_NAME . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q83 [label="83:\l $$1 -> . { ';' T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l declaration -> any_typedef decl_specifiers . $$1 opt_declarator_list ';'\l decl_specifiers -> decl_specifiers . decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q84 [label="84:\l direct_declarator -> '(' declarator ')' . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q85 [label="85:\l pointer -> '*' opt_type_qualifiers pointer . { ')' ',' T_BRACKETS T_TYPEDEF_NAME T_IDENTIFIER '&' '(' }\l"]; + q86 [label="86:\l type_qualifier_list -> type_qualifier_list type_qualifier . { ')' ',' T_BRACKETS T_TYPE_QUALIFIER T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q87 [label="87:\l declaration -> decl_specifiers . ';'\l declaration -> decl_specifiers . init_declarator_list ';'\l decl_specifiers -> decl_specifiers . decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l init_declarator_list -> . init_declarator\l init_declarator_list -> . init_declarator_list ',' init_declarator\l init_declarator -> . declarator\l init_declarator -> . declarator '=' $$5 T_INITIALIZER\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q88 [label="88:\l linkage_specification -> T_EXTERN T_STRING_LITERAL declaration . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q89 [label="89:\l linkage_specification -> T_EXTERN T_STRING_LITERAL braces . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q90 [label="90:\l external_declaration -> T_ASM T_ASMARG ';' . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q91 [label="91:\l declaration -> decl_specifiers init_declarator_list ';' . { ';' T_ASM T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q92 [label="92:\l init_declarator_list -> init_declarator_list ',' . init_declarator\l init_declarator -> . declarator\l init_declarator -> . declarator '=' $$5 T_INITIALIZER\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q93 [label="93:\l $$5 -> . { T_INITIALIZER }\l init_declarator -> declarator '=' . $$5 T_INITIALIZER\l"]; + q94 [label="94:\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l function_definition -> decl_specifiers declarator $$2 . opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE\l opt_declaration_list -> . { T_LBRACE }\l opt_declaration_list -> . T_VA_DCL\l opt_declaration_list -> . declaration_list\l declaration_list -> . declaration\l declaration_list -> . declaration_list declaration\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q95 [label="95:\l opt_declaration_list -> T_VA_DCL . { T_LBRACE }\l"]; + q96 [label="96:\l declaration_list -> declaration . { T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l"]; + q97 [label="97:\l function_definition -> declarator $$4 opt_declaration_list . T_LBRACE T_MATCHRBRACE\l"]; + q98 [label="98:\l declaration -> . decl_specifiers ';'\l declaration -> . decl_specifiers init_declarator_list ';'\l declaration -> . any_typedef decl_specifiers $$1 opt_declarator_list ';'\l any_typedef -> . T_EXTENSION T_TYPEDEF\l any_typedef -> . T_TYPEDEF\l opt_declaration_list -> declaration_list . { T_LBRACE }\l declaration_list -> declaration_list . declaration\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l"]; + q99 [label="99:\l decl_specifiers -> decl_specifiers . decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l parameter_declaration -> decl_specifiers . declarator\l parameter_declaration -> decl_specifiers . abs_declarator\l parameter_declaration -> decl_specifiers . { ')' ',' }\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l abs_declarator -> . pointer\l abs_declarator -> . pointer direct_abs_declarator\l abs_declarator -> . direct_abs_declarator\l direct_abs_declarator -> . '(' abs_declarator ')'\l direct_abs_declarator -> . direct_abs_declarator T_BRACKETS\l direct_abs_declarator -> . T_BRACKETS\l direct_abs_declarator -> . direct_abs_declarator '(' parameter_type_list ')'\l direct_abs_declarator -> . direct_abs_declarator '(' ')'\l direct_abs_declarator -> . '(' parameter_type_list ')'\l direct_abs_declarator -> . '(' ')'\l"]; + q100 [label="100:\l direct_declarator -> direct_declarator '(' parameter_type_list . ')'\l"]; + q101 [label="101:\l parameter_type_list -> parameter_list . { ')' }\l parameter_type_list -> parameter_list . ',' T_ELLIPSIS\l parameter_list -> parameter_list . ',' parameter_declaration\l"]; + q102 [label="102:\l parameter_list -> parameter_declaration . { ')' ',' }\l"]; + q103 [label="103:\l direct_declarator -> direct_declarator '(' opt_identifier_list . ')'\l"]; + q104 [label="104:\l opt_identifier_list -> identifier_list . { ')' }\l identifier_list -> identifier_list . ',' any_id\l"]; + q105 [label="105:\l identifier_list -> any_id . { ')' ',' }\l"]; + q106 [label="106:\l braces -> T_LBRACE T_MATCHRBRACE . { ')' ',' ';' T_ASM T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q107 [label="107:\l struct_or_union_specifier -> struct_or_union any_id braces . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q108 [label="108:\l enum_specifier -> enumeration any_id braces . { ')' ',' ';' T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' }\l"]; + q109 [label="109:\l declaration -> any_typedef decl_specifiers $$1 . opt_declarator_list ';'\l opt_declarator_list -> . { ';' }\l opt_declarator_list -> . declarator_list\l declarator_list -> . declarator\l declarator_list -> . declarator_list ',' declarator\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q110 [label="110:\l init_declarator -> declarator . { ',' ';' }\l init_declarator -> declarator . '=' $$5 T_INITIALIZER\l"]; + q111 [label="111:\l init_declarator_list -> init_declarator_list ',' init_declarator . { ',' ';' }\l"]; + q112 [label="112:\l init_declarator -> declarator '=' $$5 . T_INITIALIZER\l"]; + q113 [label="113:\l function_definition -> decl_specifiers declarator $$2 opt_declaration_list . T_LBRACE $$3 T_MATCHRBRACE\l"]; + q114 [label="114:\l function_definition -> declarator $$4 opt_declaration_list T_LBRACE . T_MATCHRBRACE\l"]; + q115 [label="115:\l declaration_list -> declaration_list declaration . { T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME }\l"]; + q116 [label="116:\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> '(' . declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l parameter_type_list -> . parameter_list\l parameter_type_list -> . parameter_list ',' T_ELLIPSIS\l parameter_list -> . parameter_declaration\l parameter_list -> . parameter_list ',' parameter_declaration\l parameter_declaration -> . decl_specifiers declarator\l parameter_declaration -> . decl_specifiers abs_declarator\l parameter_declaration -> . decl_specifiers\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l abs_declarator -> . pointer\l abs_declarator -> . pointer direct_abs_declarator\l abs_declarator -> . direct_abs_declarator\l direct_abs_declarator -> . '(' abs_declarator ')'\l direct_abs_declarator -> '(' . abs_declarator ')'\l direct_abs_declarator -> . direct_abs_declarator T_BRACKETS\l direct_abs_declarator -> . T_BRACKETS\l direct_abs_declarator -> . direct_abs_declarator '(' parameter_type_list ')'\l direct_abs_declarator -> . direct_abs_declarator '(' ')'\l direct_abs_declarator -> . '(' parameter_type_list ')'\l direct_abs_declarator -> '(' . parameter_type_list ')'\l direct_abs_declarator -> . '(' ')'\l direct_abs_declarator -> '(' . ')'\l"]; + q117 [label="117:\l direct_abs_declarator -> T_BRACKETS . { ')' ',' T_BRACKETS '(' }\l"]; + q118 [label="118:\l parameter_declaration -> decl_specifiers declarator . { ')' ',' }\l"]; + q119 [label="119:\l parameter_declaration -> decl_specifiers abs_declarator . { ')' ',' }\l"]; + q120 [label="120:\l abs_declarator -> direct_abs_declarator . { ')' ',' }\l direct_abs_declarator -> direct_abs_declarator . T_BRACKETS\l direct_abs_declarator -> direct_abs_declarator . '(' parameter_type_list ')'\l direct_abs_declarator -> direct_abs_declarator . '(' ')'\l"]; + q121 [label="121:\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> pointer . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l abs_declarator -> pointer . { ')' ',' }\l abs_declarator -> pointer . direct_abs_declarator\l direct_abs_declarator -> . '(' abs_declarator ')'\l direct_abs_declarator -> . direct_abs_declarator T_BRACKETS\l direct_abs_declarator -> . T_BRACKETS\l direct_abs_declarator -> . direct_abs_declarator '(' parameter_type_list ')'\l direct_abs_declarator -> . direct_abs_declarator '(' ')'\l direct_abs_declarator -> . '(' parameter_type_list ')'\l direct_abs_declarator -> . '(' ')'\l"]; + q122 [label="122:\l direct_declarator -> direct_declarator '(' parameter_type_list ')' . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q123 [label="123:\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l parameter_type_list -> parameter_list ',' . T_ELLIPSIS\l parameter_list -> parameter_list ',' . parameter_declaration\l parameter_declaration -> . decl_specifiers declarator\l parameter_declaration -> . decl_specifiers abs_declarator\l parameter_declaration -> . decl_specifiers\l"]; + q124 [label="124:\l direct_declarator -> direct_declarator '(' opt_identifier_list ')' . { ')' '=' ',' ';' T_VA_DCL T_LBRACE T_BRACKETS T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME '(' }\l"]; + q125 [label="125:\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l identifier_list -> identifier_list ',' . any_id\l"]; + q126 [label="126:\l declarator_list -> declarator . { ',' ';' }\l"]; + q127 [label="127:\l declaration -> any_typedef decl_specifiers $$1 opt_declarator_list . ';'\l"]; + q128 [label="128:\l opt_declarator_list -> declarator_list . { ';' }\l declarator_list -> declarator_list . ',' declarator\l"]; + q129 [label="129:\l init_declarator -> declarator '=' $$5 T_INITIALIZER . { ',' ';' }\l"]; + q130 [label="130:\l $$3 -> . { T_MATCHRBRACE }\l function_definition -> decl_specifiers declarator $$2 opt_declaration_list T_LBRACE . $$3 T_MATCHRBRACE\l"]; + q131 [label="131:\l function_definition -> declarator $$4 opt_declaration_list T_LBRACE T_MATCHRBRACE . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q132 [label="132:\l direct_abs_declarator -> '(' ')' . { ')' ',' T_BRACKETS '(' }\l"]; + q133 [label="133:\l direct_abs_declarator -> '(' abs_declarator . ')'\l"]; + q134 [label="134:\l direct_abs_declarator -> '(' parameter_type_list . ')'\l"]; + q135 [label="135:\l decl_specifiers -> . decl_specifier\l decl_specifiers -> . decl_specifiers decl_specifier\l decl_specifier -> . storage_class\l decl_specifier -> . type_specifier\l decl_specifier -> . type_qualifier\l storage_class -> . T_AUTO\l storage_class -> . T_EXTERN\l storage_class -> . T_REGISTER\l storage_class -> . T_STATIC\l storage_class -> . T_INLINE\l storage_class -> . T_EXTENSION\l type_specifier -> . T_CHAR\l type_specifier -> . T_DOUBLE\l type_specifier -> . T_FLOAT\l type_specifier -> . T_INT\l type_specifier -> . T_LONG\l type_specifier -> . T_SHORT\l type_specifier -> . T_SIGNED\l type_specifier -> . T_UNSIGNED\l type_specifier -> . T_VOID\l type_specifier -> . T_Bool\l type_specifier -> . T_Complex\l type_specifier -> . T_Imaginary\l type_specifier -> . T_TYPEDEF_NAME\l type_specifier -> . struct_or_union_specifier\l type_specifier -> . enum_specifier\l type_qualifier -> . T_TYPE_QUALIFIER\l type_qualifier -> . T_DEFINE_NAME\l struct_or_union_specifier -> . struct_or_union any_id braces\l struct_or_union_specifier -> . struct_or_union braces\l struct_or_union_specifier -> . struct_or_union any_id\l struct_or_union -> . T_STRUCT\l struct_or_union -> . T_UNION\l enum_specifier -> . enumeration any_id braces\l enum_specifier -> . enumeration braces\l enum_specifier -> . enumeration any_id\l enumeration -> . T_ENUM\l parameter_type_list -> . parameter_list\l parameter_type_list -> . parameter_list ',' T_ELLIPSIS\l parameter_list -> . parameter_declaration\l parameter_list -> . parameter_list ',' parameter_declaration\l parameter_declaration -> . decl_specifiers declarator\l parameter_declaration -> . decl_specifiers abs_declarator\l parameter_declaration -> . decl_specifiers\l direct_abs_declarator -> direct_abs_declarator '(' . parameter_type_list ')'\l direct_abs_declarator -> direct_abs_declarator '(' . ')'\l"]; + q136 [label="136:\l direct_abs_declarator -> direct_abs_declarator T_BRACKETS . { ')' ',' T_BRACKETS '(' }\l"]; + q137 [label="137:\l abs_declarator -> pointer direct_abs_declarator . { ')' ',' }\l direct_abs_declarator -> direct_abs_declarator . T_BRACKETS\l direct_abs_declarator -> direct_abs_declarator . '(' parameter_type_list ')'\l direct_abs_declarator -> direct_abs_declarator . '(' ')'\l"]; + q138 [label="138:\l parameter_type_list -> parameter_list ',' T_ELLIPSIS . { ')' }\l"]; + q139 [label="139:\l parameter_list -> parameter_list ',' parameter_declaration . { ')' ',' }\l"]; + q140 [label="140:\l identifier_list -> identifier_list ',' any_id . { ')' ',' }\l"]; + q141 [label="141:\l declaration -> any_typedef decl_specifiers $$1 opt_declarator_list ';' . { ';' T_ASM T_LBRACE T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q142 [label="142:\l declarator_list -> declarator_list ',' . declarator\l any_id -> . T_IDENTIFIER\l any_id -> . T_TYPEDEF_NAME\l declarator -> . pointer direct_declarator\l declarator -> . direct_declarator\l direct_declarator -> . identifier_or_ref\l direct_declarator -> . '(' declarator ')'\l direct_declarator -> . direct_declarator T_BRACKETS\l direct_declarator -> . direct_declarator '(' parameter_type_list ')'\l direct_declarator -> . direct_declarator '(' opt_identifier_list ')'\l pointer -> . '*' opt_type_qualifiers\l pointer -> . '*' opt_type_qualifiers pointer\l identifier_or_ref -> . any_id\l identifier_or_ref -> . '&' any_id\l"]; + q143 [label="143:\l function_definition -> decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 . T_MATCHRBRACE\l"]; + q144 [label="144:\l direct_abs_declarator -> '(' abs_declarator ')' . { ')' ',' T_BRACKETS '(' }\l"]; + q145 [label="145:\l direct_abs_declarator -> '(' parameter_type_list ')' . { ')' ',' T_BRACKETS '(' }\l"]; + q146 [label="146:\l direct_abs_declarator -> direct_abs_declarator '(' ')' . { ')' ',' T_BRACKETS '(' }\l"]; + q147 [label="147:\l direct_abs_declarator -> direct_abs_declarator '(' parameter_type_list . ')'\l"]; + q148 [label="148:\l declarator_list -> declarator_list ',' declarator . { ',' ';' }\l"]; + q149 [label="149:\l function_definition -> decl_specifiers declarator $$2 opt_declaration_list T_LBRACE $$3 T_MATCHRBRACE . { ';' T_ASM T_TYPE_QUALIFIER T_Imaginary T_Complex T_Bool T_UNION T_STRUCT T_ENUM T_UNSIGNED T_SIGNED T_SHORT T_LONG T_VOID T_INT T_FLOAT T_DOUBLE T_CHAR T_EXTENSION T_INLINE T_TYPEDEF T_STATIC T_REGISTER T_EXTERN T_AUTO T_DEFINE_NAME T_TYPEDEF_NAME T_IDENTIFIER '&' '*' '(' error $end }\l"]; + q150 [label="150:\l direct_abs_declarator -> direct_abs_declarator '(' parameter_type_list ')' . { ')' ',' T_BRACKETS '(' }\l"]; + + q0 -> q1 [label="error"]; + q0 -> q2 [label="'('"]; + q0 -> q3 [label="'*'"]; + q0 -> q4 [label="'&'"]; + q0 -> q5 [label="T_IDENTIFIER"]; + q0 -> q6 [label="T_TYPEDEF_NAME"]; + q0 -> q7 [label="T_DEFINE_NAME"]; + q0 -> q8 [label="T_AUTO"]; + q0 -> q9 [label="T_EXTERN"]; + q0 -> q10 [label="T_REGISTER"]; + q0 -> q11 [label="T_STATIC"]; + q0 -> q12 [label="T_TYPEDEF"]; + q0 -> q13 [label="T_INLINE"]; + q0 -> q14 [label="T_EXTENSION"]; + q0 -> q15 [label="T_CHAR"]; + q0 -> q16 [label="T_DOUBLE"]; + q0 -> q17 [label="T_FLOAT"]; + q0 -> q18 [label="T_INT"]; + q0 -> q19 [label="T_VOID"]; + q0 -> q20 [label="T_LONG"]; + q0 -> q21 [label="T_SHORT"]; + q0 -> q22 [label="T_SIGNED"]; + q0 -> q23 [label="T_UNSIGNED"]; + q0 -> q24 [label="T_ENUM"]; + q0 -> q25 [label="T_STRUCT"]; + q0 -> q26 [label="T_UNION"]; + q0 -> q27 [label="T_Bool"]; + q0 -> q28 [label="T_Complex"]; + q0 -> q29 [label="T_Imaginary"]; + q0 -> q30 [label="T_TYPE_QUALIFIER"]; + q0 -> q31 [label="T_ASM"]; + q0 -> q32 [label="';'"]; + q0 -> q33 [label="program"]; + q0 -> q34 [label="decl_specifiers"]; + q0 -> q35 [label="decl_specifier"]; + q0 -> q36 [label="storage_class"]; + q0 -> q37 [label="type_specifier"]; + q0 -> q38 [label="type_qualifier"]; + q0 -> q39 [label="struct_or_union_specifier"]; + q0 -> q40 [label="enum_specifier"]; + q0 -> q41 [label="declarator"]; + q0 -> q42 [label="direct_declarator"]; + q0 -> q43 [label="struct_or_union"]; + q0 -> q44 [label="pointer"]; + q0 -> q45 [label="any_id"]; + q0 -> q46 [label="identifier_or_ref"]; + q0 -> q47 [label="enumeration"]; + q0 -> q48 [label="translation_unit"]; + q0 -> q49 [label="external_declaration"]; + q0 -> q50 [label="declaration"]; + q0 -> q51 [label="function_definition"]; + q0 -> q52 [label="linkage_specification"]; + q0 -> q53 [label="any_typedef"]; + q1 -> q54 [label="T_MATCHRBRACE"]; + q1 -> q55 [label="';'"]; + q2 -> q2 [label="'('"]; + q2 -> q3 [label="'*'"]; + q2 -> q4 [label="'&'"]; + q2 -> q5 [label="T_IDENTIFIER"]; + q2 -> q56 [label="T_TYPEDEF_NAME"]; + q2 -> q57 [label="declarator"]; + q2 -> q42 [label="direct_declarator"]; + q2 -> q44 [label="pointer"]; + q2 -> q45 [label="any_id"]; + q2 -> q46 [label="identifier_or_ref"]; + q3 -> q7 [label="T_DEFINE_NAME"]; + q3 -> q30 [label="T_TYPE_QUALIFIER"]; + q3 -> q58 [label="type_qualifier"]; + q3 -> q59 [label="opt_type_qualifiers"]; + q3 -> q60 [label="type_qualifier_list"]; + q4 -> q5 [label="T_IDENTIFIER"]; + q4 -> q56 [label="T_TYPEDEF_NAME"]; + q4 -> q61 [label="any_id"]; + q9 -> q62 [label="T_STRING_LITERAL"]; + q14 -> q63 [label="T_TYPEDEF"]; + q31 -> q64 [label="T_ASMARG"]; + q34 -> q2 [label="'('"]; + q34 -> q3 [label="'*'"]; + q34 -> q4 [label="'&'"]; + q34 -> q5 [label="T_IDENTIFIER"]; + q34 -> q6 [label="T_TYPEDEF_NAME"]; + q34 -> q7 [label="T_DEFINE_NAME"]; + q34 -> q8 [label="T_AUTO"]; + q34 -> q65 [label="T_EXTERN"]; + q34 -> q10 [label="T_REGISTER"]; + q34 -> q11 [label="T_STATIC"]; + q34 -> q13 [label="T_INLINE"]; + q34 -> q66 [label="T_EXTENSION"]; + q34 -> q15 [label="T_CHAR"]; + q34 -> q16 [label="T_DOUBLE"]; + q34 -> q17 [label="T_FLOAT"]; + q34 -> q18 [label="T_INT"]; + q34 -> q19 [label="T_VOID"]; + q34 -> q20 [label="T_LONG"]; + q34 -> q21 [label="T_SHORT"]; + q34 -> q22 [label="T_SIGNED"]; + q34 -> q23 [label="T_UNSIGNED"]; + q34 -> q24 [label="T_ENUM"]; + q34 -> q25 [label="T_STRUCT"]; + q34 -> q26 [label="T_UNION"]; + q34 -> q27 [label="T_Bool"]; + q34 -> q28 [label="T_Complex"]; + q34 -> q29 [label="T_Imaginary"]; + q34 -> q30 [label="T_TYPE_QUALIFIER"]; + q34 -> q67 [label="';'"]; + q34 -> q68 [label="decl_specifier"]; + q34 -> q36 [label="storage_class"]; + q34 -> q37 [label="type_specifier"]; + q34 -> q38 [label="type_qualifier"]; + q34 -> q39 [label="struct_or_union_specifier"]; + q34 -> q40 [label="enum_specifier"]; + q34 -> q69 [label="init_declarator_list"]; + q34 -> q70 [label="init_declarator"]; + q34 -> q71 [label="declarator"]; + q34 -> q42 [label="direct_declarator"]; + q34 -> q43 [label="struct_or_union"]; + q34 -> q44 [label="pointer"]; + q34 -> q45 [label="any_id"]; + q34 -> q46 [label="identifier_or_ref"]; + q34 -> q47 [label="enumeration"]; + q41 -> q72 [label="$$4"]; + q42 -> q73 [label="'('"]; + q42 -> q74 [label="T_BRACKETS"]; + q43 -> q5 [label="T_IDENTIFIER"]; + q43 -> q56 [label="T_TYPEDEF_NAME"]; + q43 -> q75 [label="T_LBRACE"]; + q43 -> q76 [label="any_id"]; + q43 -> q77 [label="braces"]; + q44 -> q2 [label="'('"]; + q44 -> q4 [label="'&'"]; + q44 -> q5 [label="T_IDENTIFIER"]; + q44 -> q56 [label="T_TYPEDEF_NAME"]; + q44 -> q78 [label="direct_declarator"]; + q44 -> q45 [label="any_id"]; + q44 -> q46 [label="identifier_or_ref"]; + q47 -> q5 [label="T_IDENTIFIER"]; + q47 -> q56 [label="T_TYPEDEF_NAME"]; + q47 -> q75 [label="T_LBRACE"]; + q47 -> q79 [label="any_id"]; + q47 -> q80 [label="braces"]; + q48 -> q1 [label="error"]; + q48 -> q2 [label="'('"]; + q48 -> q3 [label="'*'"]; + q48 -> q4 [label="'&'"]; + q48 -> q5 [label="T_IDENTIFIER"]; + q48 -> q6 [label="T_TYPEDEF_NAME"]; + q48 -> q7 [label="T_DEFINE_NAME"]; + q48 -> q8 [label="T_AUTO"]; + q48 -> q9 [label="T_EXTERN"]; + q48 -> q10 [label="T_REGISTER"]; + q48 -> q11 [label="T_STATIC"]; + q48 -> q12 [label="T_TYPEDEF"]; + q48 -> q13 [label="T_INLINE"]; + q48 -> q14 [label="T_EXTENSION"]; + q48 -> q15 [label="T_CHAR"]; + q48 -> q16 [label="T_DOUBLE"]; + q48 -> q17 [label="T_FLOAT"]; + q48 -> q18 [label="T_INT"]; + q48 -> q19 [label="T_VOID"]; + q48 -> q20 [label="T_LONG"]; + q48 -> q21 [label="T_SHORT"]; + q48 -> q22 [label="T_SIGNED"]; + q48 -> q23 [label="T_UNSIGNED"]; + q48 -> q24 [label="T_ENUM"]; + q48 -> q25 [label="T_STRUCT"]; + q48 -> q26 [label="T_UNION"]; + q48 -> q27 [label="T_Bool"]; + q48 -> q28 [label="T_Complex"]; + q48 -> q29 [label="T_Imaginary"]; + q48 -> q30 [label="T_TYPE_QUALIFIER"]; + q48 -> q31 [label="T_ASM"]; + q48 -> q32 [label="';'"]; + q48 -> q34 [label="decl_specifiers"]; + q48 -> q35 [label="decl_specifier"]; + q48 -> q36 [label="storage_class"]; + q48 -> q37 [label="type_specifier"]; + q48 -> q38 [label="type_qualifier"]; + q48 -> q39 [label="struct_or_union_specifier"]; + q48 -> q40 [label="enum_specifier"]; + q48 -> q41 [label="declarator"]; + q48 -> q42 [label="direct_declarator"]; + q48 -> q43 [label="struct_or_union"]; + q48 -> q44 [label="pointer"]; + q48 -> q45 [label="any_id"]; + q48 -> q46 [label="identifier_or_ref"]; + q48 -> q47 [label="enumeration"]; + q48 -> q81 [label="external_declaration"]; + q48 -> q50 [label="declaration"]; + q48 -> q51 [label="function_definition"]; + q48 -> q52 [label="linkage_specification"]; + q48 -> q53 [label="any_typedef"]; + q53 -> q82 [label="T_TYPEDEF_NAME"]; + q53 -> q7 [label="T_DEFINE_NAME"]; + q53 -> q8 [label="T_AUTO"]; + q53 -> q65 [label="T_EXTERN"]; + q53 -> q10 [label="T_REGISTER"]; + q53 -> q11 [label="T_STATIC"]; + q53 -> q13 [label="T_INLINE"]; + q53 -> q66 [label="T_EXTENSION"]; + q53 -> q15 [label="T_CHAR"]; + q53 -> q16 [label="T_DOUBLE"]; + q53 -> q17 [label="T_FLOAT"]; + q53 -> q18 [label="T_INT"]; + q53 -> q19 [label="T_VOID"]; + q53 -> q20 [label="T_LONG"]; + q53 -> q21 [label="T_SHORT"]; + q53 -> q22 [label="T_SIGNED"]; + q53 -> q23 [label="T_UNSIGNED"]; + q53 -> q24 [label="T_ENUM"]; + q53 -> q25 [label="T_STRUCT"]; + q53 -> q26 [label="T_UNION"]; + q53 -> q27 [label="T_Bool"]; + q53 -> q28 [label="T_Complex"]; + q53 -> q29 [label="T_Imaginary"]; + q53 -> q30 [label="T_TYPE_QUALIFIER"]; + q53 -> q83 [label="decl_specifiers"]; + q53 -> q35 [label="decl_specifier"]; + q53 -> q36 [label="storage_class"]; + q53 -> q37 [label="type_specifier"]; + q53 -> q38 [label="type_qualifier"]; + q53 -> q39 [label="struct_or_union_specifier"]; + q53 -> q40 [label="enum_specifier"]; + q53 -> q43 [label="struct_or_union"]; + q53 -> q47 [label="enumeration"]; + q57 -> q84 [label="')'"]; + q59 -> q3 [label="'*'"]; + q59 -> q85 [label="pointer"]; + q60 -> q7 [label="T_DEFINE_NAME"]; + q60 -> q30 [label="T_TYPE_QUALIFIER"]; + q60 -> q86 [label="type_qualifier"]; + q62 -> q82 [label="T_TYPEDEF_NAME"]; + q62 -> q7 [label="T_DEFINE_NAME"]; + q62 -> q8 [label="T_AUTO"]; + q62 -> q65 [label="T_EXTERN"]; + q62 -> q10 [label="T_REGISTER"]; + q62 -> q11 [label="T_STATIC"]; + q62 -> q12 [label="T_TYPEDEF"]; + q62 -> q13 [label="T_INLINE"]; + q62 -> q14 [label="T_EXTENSION"]; + q62 -> q15 [label="T_CHAR"]; + q62 -> q16 [label="T_DOUBLE"]; + q62 -> q17 [label="T_FLOAT"]; + q62 -> q18 [label="T_INT"]; + q62 -> q19 [label="T_VOID"]; + q62 -> q20 [label="T_LONG"]; + q62 -> q21 [label="T_SHORT"]; + q62 -> q22 [label="T_SIGNED"]; + q62 -> q23 [label="T_UNSIGNED"]; + q62 -> q24 [label="T_ENUM"]; + q62 -> q25 [label="T_STRUCT"]; + q62 -> q26 [label="T_UNION"]; + q62 -> q27 [label="T_Bool"]; + q62 -> q28 [label="T_Complex"]; + q62 -> q29 [label="T_Imaginary"]; + q62 -> q30 [label="T_TYPE_QUALIFIER"]; + q62 -> q75 [label="T_LBRACE"]; + q62 -> q87 [label="decl_specifiers"]; + q62 -> q35 [label="decl_specifier"]; + q62 -> q36 [label="storage_class"]; + q62 -> q37 [label="type_specifier"]; + q62 -> q38 [label="type_qualifier"]; + q62 -> q39 [label="struct_or_union_specifier"]; + q62 -> q40 [label="enum_specifier"]; + q62 -> q43 [label="struct_or_union"]; + q62 -> q47 [label="enumeration"]; + q62 -> q88 [label="declaration"]; + q62 -> q89 [label="braces"]; + q62 -> q53 [label="any_typedef"]; + q64 -> q90 [label="';'"]; + q69 -> q91 [label="';'"]; + q69 -> q92 [label="','"]; + q71 -> q93 [label="'='"]; + q71 -> q94 [label="$$2"]; + q72 -> q82 [label="T_TYPEDEF_NAME"]; + q72 -> q7 [label="T_DEFINE_NAME"]; + q72 -> q8 [label="T_AUTO"]; + q72 -> q65 [label="T_EXTERN"]; + q72 -> q10 [label="T_REGISTER"]; + q72 -> q11 [label="T_STATIC"]; + q72 -> q12 [label="T_TYPEDEF"]; + q72 -> q13 [label="T_INLINE"]; + q72 -> q14 [label="T_EXTENSION"]; + q72 -> q15 [label="T_CHAR"]; + q72 -> q16 [label="T_DOUBLE"]; + q72 -> q17 [label="T_FLOAT"]; + q72 -> q18 [label="T_INT"]; + q72 -> q19 [label="T_VOID"]; + q72 -> q20 [label="T_LONG"]; + q72 -> q21 [label="T_SHORT"]; + q72 -> q22 [label="T_SIGNED"]; + q72 -> q23 [label="T_UNSIGNED"]; + q72 -> q24 [label="T_ENUM"]; + q72 -> q25 [label="T_STRUCT"]; + q72 -> q26 [label="T_UNION"]; + q72 -> q27 [label="T_Bool"]; + q72 -> q28 [label="T_Complex"]; + q72 -> q29 [label="T_Imaginary"]; + q72 -> q30 [label="T_TYPE_QUALIFIER"]; + q72 -> q95 [label="T_VA_DCL"]; + q72 -> q87 [label="decl_specifiers"]; + q72 -> q35 [label="decl_specifier"]; + q72 -> q36 [label="storage_class"]; + q72 -> q37 [label="type_specifier"]; + q72 -> q38 [label="type_qualifier"]; + q72 -> q39 [label="struct_or_union_specifier"]; + q72 -> q40 [label="enum_specifier"]; + q72 -> q43 [label="struct_or_union"]; + q72 -> q47 [label="enumeration"]; + q72 -> q96 [label="declaration"]; + q72 -> q53 [label="any_typedef"]; + q72 -> q97 [label="opt_declaration_list"]; + q72 -> q98 [label="declaration_list"]; + q73 -> q5 [label="T_IDENTIFIER"]; + q73 -> q6 [label="T_TYPEDEF_NAME"]; + q73 -> q7 [label="T_DEFINE_NAME"]; + q73 -> q8 [label="T_AUTO"]; + q73 -> q65 [label="T_EXTERN"]; + q73 -> q10 [label="T_REGISTER"]; + q73 -> q11 [label="T_STATIC"]; + q73 -> q13 [label="T_INLINE"]; + q73 -> q66 [label="T_EXTENSION"]; + q73 -> q15 [label="T_CHAR"]; + q73 -> q16 [label="T_DOUBLE"]; + q73 -> q17 [label="T_FLOAT"]; + q73 -> q18 [label="T_INT"]; + q73 -> q19 [label="T_VOID"]; + q73 -> q20 [label="T_LONG"]; + q73 -> q21 [label="T_SHORT"]; + q73 -> q22 [label="T_SIGNED"]; + q73 -> q23 [label="T_UNSIGNED"]; + q73 -> q24 [label="T_ENUM"]; + q73 -> q25 [label="T_STRUCT"]; + q73 -> q26 [label="T_UNION"]; + q73 -> q27 [label="T_Bool"]; + q73 -> q28 [label="T_Complex"]; + q73 -> q29 [label="T_Imaginary"]; + q73 -> q30 [label="T_TYPE_QUALIFIER"]; + q73 -> q99 [label="decl_specifiers"]; + q73 -> q35 [label="decl_specifier"]; + q73 -> q36 [label="storage_class"]; + q73 -> q37 [label="type_specifier"]; + q73 -> q38 [label="type_qualifier"]; + q73 -> q39 [label="struct_or_union_specifier"]; + q73 -> q40 [label="enum_specifier"]; + q73 -> q100 [label="parameter_type_list"]; + q73 -> q101 [label="parameter_list"]; + q73 -> q102 [label="parameter_declaration"]; + q73 -> q103 [label="opt_identifier_list"]; + q73 -> q104 [label="identifier_list"]; + q73 -> q43 [label="struct_or_union"]; + q73 -> q105 [label="any_id"]; + q73 -> q47 [label="enumeration"]; + q75 -> q106 [label="T_MATCHRBRACE"]; + q76 -> q75 [label="T_LBRACE"]; + q76 -> q107 [label="braces"]; + q78 -> q73 [label="'('"]; + q78 -> q74 [label="T_BRACKETS"]; + q79 -> q75 [label="T_LBRACE"]; + q79 -> q108 [label="braces"]; + q83 -> q82 [label="T_TYPEDEF_NAME"]; + q83 -> q7 [label="T_DEFINE_NAME"]; + q83 -> q8 [label="T_AUTO"]; + q83 -> q65 [label="T_EXTERN"]; + q83 -> q10 [label="T_REGISTER"]; + q83 -> q11 [label="T_STATIC"]; + q83 -> q13 [label="T_INLINE"]; + q83 -> q66 [label="T_EXTENSION"]; + q83 -> q15 [label="T_CHAR"]; + q83 -> q16 [label="T_DOUBLE"]; + q83 -> q17 [label="T_FLOAT"]; + q83 -> q18 [label="T_INT"]; + q83 -> q19 [label="T_VOID"]; + q83 -> q20 [label="T_LONG"]; + q83 -> q21 [label="T_SHORT"]; + q83 -> q22 [label="T_SIGNED"]; + q83 -> q23 [label="T_UNSIGNED"]; + q83 -> q24 [label="T_ENUM"]; + q83 -> q25 [label="T_STRUCT"]; + q83 -> q26 [label="T_UNION"]; + q83 -> q27 [label="T_Bool"]; + q83 -> q28 [label="T_Complex"]; + q83 -> q29 [label="T_Imaginary"]; + q83 -> q30 [label="T_TYPE_QUALIFIER"]; + q83 -> q68 [label="decl_specifier"]; + q83 -> q36 [label="storage_class"]; + q83 -> q37 [label="type_specifier"]; + q83 -> q38 [label="type_qualifier"]; + q83 -> q39 [label="struct_or_union_specifier"]; + q83 -> q40 [label="enum_specifier"]; + q83 -> q43 [label="struct_or_union"]; + q83 -> q47 [label="enumeration"]; + q83 -> q109 [label="$$1"]; + q87 -> q2 [label="'('"]; + q87 -> q3 [label="'*'"]; + q87 -> q4 [label="'&'"]; + q87 -> q5 [label="T_IDENTIFIER"]; + q87 -> q6 [label="T_TYPEDEF_NAME"]; + q87 -> q7 [label="T_DEFINE_NAME"]; + q87 -> q8 [label="T_AUTO"]; + q87 -> q65 [label="T_EXTERN"]; + q87 -> q10 [label="T_REGISTER"]; + q87 -> q11 [label="T_STATIC"]; + q87 -> q13 [label="T_INLINE"]; + q87 -> q66 [label="T_EXTENSION"]; + q87 -> q15 [label="T_CHAR"]; + q87 -> q16 [label="T_DOUBLE"]; + q87 -> q17 [label="T_FLOAT"]; + q87 -> q18 [label="T_INT"]; + q87 -> q19 [label="T_VOID"]; + q87 -> q20 [label="T_LONG"]; + q87 -> q21 [label="T_SHORT"]; + q87 -> q22 [label="T_SIGNED"]; + q87 -> q23 [label="T_UNSIGNED"]; + q87 -> q24 [label="T_ENUM"]; + q87 -> q25 [label="T_STRUCT"]; + q87 -> q26 [label="T_UNION"]; + q87 -> q27 [label="T_Bool"]; + q87 -> q28 [label="T_Complex"]; + q87 -> q29 [label="T_Imaginary"]; + q87 -> q30 [label="T_TYPE_QUALIFIER"]; + q87 -> q67 [label="';'"]; + q87 -> q68 [label="decl_specifier"]; + q87 -> q36 [label="storage_class"]; + q87 -> q37 [label="type_specifier"]; + q87 -> q38 [label="type_qualifier"]; + q87 -> q39 [label="struct_or_union_specifier"]; + q87 -> q40 [label="enum_specifier"]; + q87 -> q69 [label="init_declarator_list"]; + q87 -> q70 [label="init_declarator"]; + q87 -> q110 [label="declarator"]; + q87 -> q42 [label="direct_declarator"]; + q87 -> q43 [label="struct_or_union"]; + q87 -> q44 [label="pointer"]; + q87 -> q45 [label="any_id"]; + q87 -> q46 [label="identifier_or_ref"]; + q87 -> q47 [label="enumeration"]; + q92 -> q2 [label="'('"]; + q92 -> q3 [label="'*'"]; + q92 -> q4 [label="'&'"]; + q92 -> q5 [label="T_IDENTIFIER"]; + q92 -> q56 [label="T_TYPEDEF_NAME"]; + q92 -> q111 [label="init_declarator"]; + q92 -> q110 [label="declarator"]; + q92 -> q42 [label="direct_declarator"]; + q92 -> q44 [label="pointer"]; + q92 -> q45 [label="any_id"]; + q92 -> q46 [label="identifier_or_ref"]; + q93 -> q112 [label="$$5"]; + q94 -> q82 [label="T_TYPEDEF_NAME"]; + q94 -> q7 [label="T_DEFINE_NAME"]; + q94 -> q8 [label="T_AUTO"]; + q94 -> q65 [label="T_EXTERN"]; + q94 -> q10 [label="T_REGISTER"]; + q94 -> q11 [label="T_STATIC"]; + q94 -> q12 [label="T_TYPEDEF"]; + q94 -> q13 [label="T_INLINE"]; + q94 -> q14 [label="T_EXTENSION"]; + q94 -> q15 [label="T_CHAR"]; + q94 -> q16 [label="T_DOUBLE"]; + q94 -> q17 [label="T_FLOAT"]; + q94 -> q18 [label="T_INT"]; + q94 -> q19 [label="T_VOID"]; + q94 -> q20 [label="T_LONG"]; + q94 -> q21 [label="T_SHORT"]; + q94 -> q22 [label="T_SIGNED"]; + q94 -> q23 [label="T_UNSIGNED"]; + q94 -> q24 [label="T_ENUM"]; + q94 -> q25 [label="T_STRUCT"]; + q94 -> q26 [label="T_UNION"]; + q94 -> q27 [label="T_Bool"]; + q94 -> q28 [label="T_Complex"]; + q94 -> q29 [label="T_Imaginary"]; + q94 -> q30 [label="T_TYPE_QUALIFIER"]; + q94 -> q95 [label="T_VA_DCL"]; + q94 -> q87 [label="decl_specifiers"]; + q94 -> q35 [label="decl_specifier"]; + q94 -> q36 [label="storage_class"]; + q94 -> q37 [label="type_specifier"]; + q94 -> q38 [label="type_qualifier"]; + q94 -> q39 [label="struct_or_union_specifier"]; + q94 -> q40 [label="enum_specifier"]; + q94 -> q43 [label="struct_or_union"]; + q94 -> q47 [label="enumeration"]; + q94 -> q96 [label="declaration"]; + q94 -> q53 [label="any_typedef"]; + q94 -> q113 [label="opt_declaration_list"]; + q94 -> q98 [label="declaration_list"]; + q97 -> q114 [label="T_LBRACE"]; + q98 -> q82 [label="T_TYPEDEF_NAME"]; + q98 -> q7 [label="T_DEFINE_NAME"]; + q98 -> q8 [label="T_AUTO"]; + q98 -> q65 [label="T_EXTERN"]; + q98 -> q10 [label="T_REGISTER"]; + q98 -> q11 [label="T_STATIC"]; + q98 -> q12 [label="T_TYPEDEF"]; + q98 -> q13 [label="T_INLINE"]; + q98 -> q14 [label="T_EXTENSION"]; + q98 -> q15 [label="T_CHAR"]; + q98 -> q16 [label="T_DOUBLE"]; + q98 -> q17 [label="T_FLOAT"]; + q98 -> q18 [label="T_INT"]; + q98 -> q19 [label="T_VOID"]; + q98 -> q20 [label="T_LONG"]; + q98 -> q21 [label="T_SHORT"]; + q98 -> q22 [label="T_SIGNED"]; + q98 -> q23 [label="T_UNSIGNED"]; + q98 -> q24 [label="T_ENUM"]; + q98 -> q25 [label="T_STRUCT"]; + q98 -> q26 [label="T_UNION"]; + q98 -> q27 [label="T_Bool"]; + q98 -> q28 [label="T_Complex"]; + q98 -> q29 [label="T_Imaginary"]; + q98 -> q30 [label="T_TYPE_QUALIFIER"]; + q98 -> q87 [label="decl_specifiers"]; + q98 -> q35 [label="decl_specifier"]; + q98 -> q36 [label="storage_class"]; + q98 -> q37 [label="type_specifier"]; + q98 -> q38 [label="type_qualifier"]; + q98 -> q39 [label="struct_or_union_specifier"]; + q98 -> q40 [label="enum_specifier"]; + q98 -> q43 [label="struct_or_union"]; + q98 -> q47 [label="enumeration"]; + q98 -> q115 [label="declaration"]; + q98 -> q53 [label="any_typedef"]; + q99 -> q116 [label="'('"]; + q99 -> q3 [label="'*'"]; + q99 -> q4 [label="'&'"]; + q99 -> q5 [label="T_IDENTIFIER"]; + q99 -> q6 [label="T_TYPEDEF_NAME"]; + q99 -> q7 [label="T_DEFINE_NAME"]; + q99 -> q8 [label="T_AUTO"]; + q99 -> q65 [label="T_EXTERN"]; + q99 -> q10 [label="T_REGISTER"]; + q99 -> q11 [label="T_STATIC"]; + q99 -> q13 [label="T_INLINE"]; + q99 -> q66 [label="T_EXTENSION"]; + q99 -> q15 [label="T_CHAR"]; + q99 -> q16 [label="T_DOUBLE"]; + q99 -> q17 [label="T_FLOAT"]; + q99 -> q18 [label="T_INT"]; + q99 -> q19 [label="T_VOID"]; + q99 -> q20 [label="T_LONG"]; + q99 -> q21 [label="T_SHORT"]; + q99 -> q22 [label="T_SIGNED"]; + q99 -> q23 [label="T_UNSIGNED"]; + q99 -> q24 [label="T_ENUM"]; + q99 -> q25 [label="T_STRUCT"]; + q99 -> q26 [label="T_UNION"]; + q99 -> q27 [label="T_Bool"]; + q99 -> q28 [label="T_Complex"]; + q99 -> q29 [label="T_Imaginary"]; + q99 -> q30 [label="T_TYPE_QUALIFIER"]; + q99 -> q117 [label="T_BRACKETS"]; + q99 -> q68 [label="decl_specifier"]; + q99 -> q36 [label="storage_class"]; + q99 -> q37 [label="type_specifier"]; + q99 -> q38 [label="type_qualifier"]; + q99 -> q39 [label="struct_or_union_specifier"]; + q99 -> q40 [label="enum_specifier"]; + q99 -> q118 [label="declarator"]; + q99 -> q42 [label="direct_declarator"]; + q99 -> q119 [label="abs_declarator"]; + q99 -> q120 [label="direct_abs_declarator"]; + q99 -> q43 [label="struct_or_union"]; + q99 -> q121 [label="pointer"]; + q99 -> q45 [label="any_id"]; + q99 -> q46 [label="identifier_or_ref"]; + q99 -> q47 [label="enumeration"]; + q100 -> q122 [label="')'"]; + q101 -> q123 [label="','"]; + q103 -> q124 [label="')'"]; + q104 -> q125 [label="','"]; + q109 -> q2 [label="'('"]; + q109 -> q3 [label="'*'"]; + q109 -> q4 [label="'&'"]; + q109 -> q5 [label="T_IDENTIFIER"]; + q109 -> q56 [label="T_TYPEDEF_NAME"]; + q109 -> q126 [label="declarator"]; + q109 -> q42 [label="direct_declarator"]; + q109 -> q44 [label="pointer"]; + q109 -> q45 [label="any_id"]; + q109 -> q46 [label="identifier_or_ref"]; + q109 -> q127 [label="opt_declarator_list"]; + q109 -> q128 [label="declarator_list"]; + q110 -> q93 [label="'='"]; + q112 -> q129 [label="T_INITIALIZER"]; + q113 -> q130 [label="T_LBRACE"]; + q114 -> q131 [label="T_MATCHRBRACE"]; + q116 -> q116 [label="'('"]; + q116 -> q3 [label="'*'"]; + q116 -> q4 [label="'&'"]; + q116 -> q5 [label="T_IDENTIFIER"]; + q116 -> q6 [label="T_TYPEDEF_NAME"]; + q116 -> q7 [label="T_DEFINE_NAME"]; + q116 -> q8 [label="T_AUTO"]; + q116 -> q65 [label="T_EXTERN"]; + q116 -> q10 [label="T_REGISTER"]; + q116 -> q11 [label="T_STATIC"]; + q116 -> q13 [label="T_INLINE"]; + q116 -> q66 [label="T_EXTENSION"]; + q116 -> q15 [label="T_CHAR"]; + q116 -> q16 [label="T_DOUBLE"]; + q116 -> q17 [label="T_FLOAT"]; + q116 -> q18 [label="T_INT"]; + q116 -> q19 [label="T_VOID"]; + q116 -> q20 [label="T_LONG"]; + q116 -> q21 [label="T_SHORT"]; + q116 -> q22 [label="T_SIGNED"]; + q116 -> q23 [label="T_UNSIGNED"]; + q116 -> q24 [label="T_ENUM"]; + q116 -> q25 [label="T_STRUCT"]; + q116 -> q26 [label="T_UNION"]; + q116 -> q27 [label="T_Bool"]; + q116 -> q28 [label="T_Complex"]; + q116 -> q29 [label="T_Imaginary"]; + q116 -> q30 [label="T_TYPE_QUALIFIER"]; + q116 -> q117 [label="T_BRACKETS"]; + q116 -> q132 [label="')'"]; + q116 -> q99 [label="decl_specifiers"]; + q116 -> q35 [label="decl_specifier"]; + q116 -> q36 [label="storage_class"]; + q116 -> q37 [label="type_specifier"]; + q116 -> q38 [label="type_qualifier"]; + q116 -> q39 [label="struct_or_union_specifier"]; + q116 -> q40 [label="enum_specifier"]; + q116 -> q57 [label="declarator"]; + q116 -> q42 [label="direct_declarator"]; + q116 -> q133 [label="abs_declarator"]; + q116 -> q120 [label="direct_abs_declarator"]; + q116 -> q134 [label="parameter_type_list"]; + q116 -> q101 [label="parameter_list"]; + q116 -> q102 [label="parameter_declaration"]; + q116 -> q43 [label="struct_or_union"]; + q116 -> q121 [label="pointer"]; + q116 -> q45 [label="any_id"]; + q116 -> q46 [label="identifier_or_ref"]; + q116 -> q47 [label="enumeration"]; + q120 -> q135 [label="'('"]; + q120 -> q136 [label="T_BRACKETS"]; + q121 -> q116 [label="'('"]; + q121 -> q4 [label="'&'"]; + q121 -> q5 [label="T_IDENTIFIER"]; + q121 -> q56 [label="T_TYPEDEF_NAME"]; + q121 -> q117 [label="T_BRACKETS"]; + q121 -> q78 [label="direct_declarator"]; + q121 -> q137 [label="direct_abs_declarator"]; + q121 -> q45 [label="any_id"]; + q121 -> q46 [label="identifier_or_ref"]; + q123 -> q82 [label="T_TYPEDEF_NAME"]; + q123 -> q7 [label="T_DEFINE_NAME"]; + q123 -> q8 [label="T_AUTO"]; + q123 -> q65 [label="T_EXTERN"]; + q123 -> q10 [label="T_REGISTER"]; + q123 -> q11 [label="T_STATIC"]; + q123 -> q13 [label="T_INLINE"]; + q123 -> q66 [label="T_EXTENSION"]; + q123 -> q15 [label="T_CHAR"]; + q123 -> q16 [label="T_DOUBLE"]; + q123 -> q17 [label="T_FLOAT"]; + q123 -> q18 [label="T_INT"]; + q123 -> q19 [label="T_VOID"]; + q123 -> q20 [label="T_LONG"]; + q123 -> q21 [label="T_SHORT"]; + q123 -> q22 [label="T_SIGNED"]; + q123 -> q23 [label="T_UNSIGNED"]; + q123 -> q24 [label="T_ENUM"]; + q123 -> q25 [label="T_STRUCT"]; + q123 -> q26 [label="T_UNION"]; + q123 -> q27 [label="T_Bool"]; + q123 -> q28 [label="T_Complex"]; + q123 -> q29 [label="T_Imaginary"]; + q123 -> q30 [label="T_TYPE_QUALIFIER"]; + q123 -> q138 [label="T_ELLIPSIS"]; + q123 -> q99 [label="decl_specifiers"]; + q123 -> q35 [label="decl_specifier"]; + q123 -> q36 [label="storage_class"]; + q123 -> q37 [label="type_specifier"]; + q123 -> q38 [label="type_qualifier"]; + q123 -> q39 [label="struct_or_union_specifier"]; + q123 -> q40 [label="enum_specifier"]; + q123 -> q139 [label="parameter_declaration"]; + q123 -> q43 [label="struct_or_union"]; + q123 -> q47 [label="enumeration"]; + q125 -> q5 [label="T_IDENTIFIER"]; + q125 -> q56 [label="T_TYPEDEF_NAME"]; + q125 -> q140 [label="any_id"]; + q127 -> q141 [label="';'"]; + q128 -> q142 [label="','"]; + q130 -> q143 [label="$$3"]; + q133 -> q144 [label="')'"]; + q134 -> q145 [label="')'"]; + q135 -> q82 [label="T_TYPEDEF_NAME"]; + q135 -> q7 [label="T_DEFINE_NAME"]; + q135 -> q8 [label="T_AUTO"]; + q135 -> q65 [label="T_EXTERN"]; + q135 -> q10 [label="T_REGISTER"]; + q135 -> q11 [label="T_STATIC"]; + q135 -> q13 [label="T_INLINE"]; + q135 -> q66 [label="T_EXTENSION"]; + q135 -> q15 [label="T_CHAR"]; + q135 -> q16 [label="T_DOUBLE"]; + q135 -> q17 [label="T_FLOAT"]; + q135 -> q18 [label="T_INT"]; + q135 -> q19 [label="T_VOID"]; + q135 -> q20 [label="T_LONG"]; + q135 -> q21 [label="T_SHORT"]; + q135 -> q22 [label="T_SIGNED"]; + q135 -> q23 [label="T_UNSIGNED"]; + q135 -> q24 [label="T_ENUM"]; + q135 -> q25 [label="T_STRUCT"]; + q135 -> q26 [label="T_UNION"]; + q135 -> q27 [label="T_Bool"]; + q135 -> q28 [label="T_Complex"]; + q135 -> q29 [label="T_Imaginary"]; + q135 -> q30 [label="T_TYPE_QUALIFIER"]; + q135 -> q146 [label="')'"]; + q135 -> q99 [label="decl_specifiers"]; + q135 -> q35 [label="decl_specifier"]; + q135 -> q36 [label="storage_class"]; + q135 -> q37 [label="type_specifier"]; + q135 -> q38 [label="type_qualifier"]; + q135 -> q39 [label="struct_or_union_specifier"]; + q135 -> q40 [label="enum_specifier"]; + q135 -> q147 [label="parameter_type_list"]; + q135 -> q101 [label="parameter_list"]; + q135 -> q102 [label="parameter_declaration"]; + q135 -> q43 [label="struct_or_union"]; + q135 -> q47 [label="enumeration"]; + q137 -> q135 [label="'('"]; + q137 -> q136 [label="T_BRACKETS"]; + q142 -> q2 [label="'('"]; + q142 -> q3 [label="'*'"]; + q142 -> q4 [label="'&'"]; + q142 -> q5 [label="T_IDENTIFIER"]; + q142 -> q56 [label="T_TYPEDEF_NAME"]; + q142 -> q148 [label="declarator"]; + q142 -> q42 [label="direct_declarator"]; + q142 -> q44 [label="pointer"]; + q142 -> q45 [label="any_id"]; + q142 -> q46 [label="identifier_or_ref"]; + q143 -> q149 [label="T_MATCHRBRACE"]; + q147 -> q150 [label="')'"]; +} diff --git a/test/grammar.error b/test/grammar.error new file mode 100644 index 0000000..d442f8a --- /dev/null +++ b/test/grammar.error @@ -0,0 +1 @@ +YACC: 1 shift/reduce conflict, 29 reduce/reduce conflicts. diff --git a/test/pure_calc.error b/test/pure_calc.error new file mode 100644 index 0000000..e69de29 diff --git a/test/pure_error.error b/test/pure_error.error new file mode 100644 index 0000000..e69de29 diff --git a/test/quote_calc-s.error b/test/quote_calc-s.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc-s.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc.error b/test/quote_calc.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc2-s.error b/test/quote_calc2-s.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc2-s.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc2.error b/test/quote_calc2.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc2.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc3-s.error b/test/quote_calc3-s.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc3-s.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc3.error b/test/quote_calc3.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc3.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc4-s.error b/test/quote_calc4-s.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc4-s.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/quote_calc4.error b/test/quote_calc4.error new file mode 100644 index 0000000..729d01c --- /dev/null +++ b/test/quote_calc4.error @@ -0,0 +1 @@ +YACC: 54 shift/reduce conflicts. diff --git a/test/run_test.sh b/test/run_test.sh index ae8591b..5c611eb 100755 --- a/test/run_test.sh +++ b/test/run_test.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: run_test.sh,v 1.8 2012/01/15 11:50:35 tom Exp $ +# $Id: run_test.sh,v 1.10 2014/03/21 23:49:21 tom Exp $ # vi:ts=4 sw=4: if test $# = 1 @@ -30,8 +30,12 @@ do OPTS= OPT2= - TYPE=".output .tab.c .tab.h" + TYPE=".error .output .tab.c .tab.h" case $input in + ${TEST_DIR}/grammar*) + OPTS="$OPTS -g" + TYPE="$TYPE .dot" + ;; ${TEST_DIR}/code_*) OPTS="$OPTS -r" TYPE="$TYPE .code.c" @@ -48,7 +52,7 @@ do for opt2 in "" $OPT2 do - $YACC $OPTS $opt2 -v -d -p $prefix -b $ROOT${opt2} $input + $YACC $OPTS $opt2 -v -d -p $prefix -b $ROOT${opt2} $input 2>&1 | sed -e "s%$YACC%YACC%" >${ROOT}${opt2}.error for type in $TYPE do REF=${TEST_DIR}/${root}${opt2}${type}