From 25b45a2dc8d3a73a76408a8fcd1eb94ee34fdbea Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 18 Jul 2016 15:19:52 +0200 Subject: [PATCH] imported peg-0.1.17 --- ChangeLog | 7 + README.md | 2 + src/leg.c | 614 +++++++++++++++++++++++++++----------------------- src/leg.leg | 40 ++-- src/peg.peg-c | 2 +- src/version.h | 2 +- 6 files changed, 369 insertions(+), 298 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09cd764..d0c0bcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2016-07-14 Ian Piumarta + + * src/version.h: 0.1.17 + + * src/leg.leg: Remember line numbers for headers and trailer. + Emit #line directives in the generated file. + 2016-06-25 piumarta * src/version.h: 0.1.16 diff --git a/README.md b/README.md index c16e424..0cd62b8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ distribute them any way you like. ## Version history +* **0.1.17** ([zip](../../archive/0.1.17.zip), [tar.gz](../../archive/0.1.17.tar.gz)) — 2016-07-14 +Emit `#line` directives for header and trailer in the generated source file. * **0.1.16** ([zip](../../archive/0.1.16.zip), [tar.gz](../../archive/0.1.16.tar.gz)) — 2016-06-25 Add `@{...}` actions that are performed during matching. * **0.1.15** ([zip](../../archive/0.1.15.zip), [tar.gz](../../archive/0.1.15.tar.gz)) — 2013-12-17 diff --git a/src/leg.c b/src/leg.c index 8480ee1..fbfff6d 100644 --- a/src/leg.c +++ b/src/leg.c @@ -1,9 +1,10 @@ -/* A recursive-descent parser generated by peg 0.1.16 */ +/* A recursive-descent parser generated by peg 0.1.17 */ #include #include #include #define YYRULECOUNT 39 +#line 20 "src/leg.leg" # include "tree.h" # include "version.h" @@ -18,6 +19,7 @@ typedef struct Header Header; struct Header { + int line; char *text; Header *next; }; @@ -27,20 +29,22 @@ int verboseFlag= 0; static int lineNumber= 0; + static int headerLine= 0; static char *fileName= 0; + static int trailerLine= 0; static char *trailer= 0; static Header *headers= 0; - void makeHeader(char *text); - void makeTrailer(char *text); + void makeHeader(int line, char *text); + void makeTrailer(int line, char *text); void yyerror(char *message); -# define YY_INPUT(buf, result, max) \ - { \ - int c= getc(input); \ - if ('\n' == c || '\r' == c) ++lineNumber; \ - result= (EOF == c) ? 0 : (*(buf)= c, 1); \ +# define YY_INPUT(buf, result, max) \ + { \ + int c= getc(input); \ + /* if ('\n' == c || '\r' == c) ++lineNumber; */ \ + result= (EOF == c) ? 0 : (*(buf)= c, 1); \ } # define YY_LOCAL(T) static T @@ -314,39 +318,39 @@ YY_LOCAL(void) yySet(yycontext *yy, char *text, int count) { yy->__val[count]= #define YYACCEPT yyAccept(yy, yythunkpos0) -YY_RULE(int) yy_end_of_line(yycontext *yy); /* 39 */ -YY_RULE(int) yy_comment(yycontext *yy); /* 38 */ -YY_RULE(int) yy_space(yycontext *yy); /* 37 */ -YY_RULE(int) yy_braces(yycontext *yy); /* 36 */ -YY_RULE(int) yy_range(yycontext *yy); /* 35 */ -YY_RULE(int) yy_char(yycontext *yy); /* 34 */ -YY_RULE(int) yy_END(yycontext *yy); /* 33 */ -YY_RULE(int) yy_BEGIN(yycontext *yy); /* 32 */ -YY_RULE(int) yy_DOT(yycontext *yy); /* 31 */ -YY_RULE(int) yy_class(yycontext *yy); /* 30 */ -YY_RULE(int) yy_literal(yycontext *yy); /* 29 */ -YY_RULE(int) yy_CLOSE(yycontext *yy); /* 28 */ -YY_RULE(int) yy_OPEN(yycontext *yy); /* 27 */ -YY_RULE(int) yy_COLON(yycontext *yy); /* 26 */ -YY_RULE(int) yy_PLUS(yycontext *yy); /* 25 */ -YY_RULE(int) yy_STAR(yycontext *yy); /* 24 */ -YY_RULE(int) yy_QUESTION(yycontext *yy); /* 23 */ -YY_RULE(int) yy_primary(yycontext *yy); /* 22 */ -YY_RULE(int) yy_NOT(yycontext *yy); /* 21 */ -YY_RULE(int) yy_suffix(yycontext *yy); /* 20 */ -YY_RULE(int) yy_AND(yycontext *yy); /* 19 */ -YY_RULE(int) yy_AT(yycontext *yy); /* 18 */ -YY_RULE(int) yy_action(yycontext *yy); /* 17 */ -YY_RULE(int) yy_TILDE(yycontext *yy); /* 16 */ -YY_RULE(int) yy_prefix(yycontext *yy); /* 15 */ -YY_RULE(int) yy_error(yycontext *yy); /* 14 */ -YY_RULE(int) yy_BAR(yycontext *yy); /* 13 */ -YY_RULE(int) yy_sequence(yycontext *yy); /* 12 */ -YY_RULE(int) yy_SEMICOLON(yycontext *yy); /* 11 */ -YY_RULE(int) yy_expression(yycontext *yy); /* 10 */ -YY_RULE(int) yy_EQUAL(yycontext *yy); /* 9 */ -YY_RULE(int) yy_identifier(yycontext *yy); /* 8 */ -YY_RULE(int) yy_RPERCENT(yycontext *yy); /* 7 */ +YY_RULE(int) yy_comment(yycontext *yy); /* 39 */ +YY_RULE(int) yy_space(yycontext *yy); /* 38 */ +YY_RULE(int) yy_braces(yycontext *yy); /* 37 */ +YY_RULE(int) yy_range(yycontext *yy); /* 36 */ +YY_RULE(int) yy_char(yycontext *yy); /* 35 */ +YY_RULE(int) yy_END(yycontext *yy); /* 34 */ +YY_RULE(int) yy_BEGIN(yycontext *yy); /* 33 */ +YY_RULE(int) yy_DOT(yycontext *yy); /* 32 */ +YY_RULE(int) yy_class(yycontext *yy); /* 31 */ +YY_RULE(int) yy_literal(yycontext *yy); /* 30 */ +YY_RULE(int) yy_CLOSE(yycontext *yy); /* 29 */ +YY_RULE(int) yy_OPEN(yycontext *yy); /* 28 */ +YY_RULE(int) yy_COLON(yycontext *yy); /* 27 */ +YY_RULE(int) yy_PLUS(yycontext *yy); /* 26 */ +YY_RULE(int) yy_STAR(yycontext *yy); /* 25 */ +YY_RULE(int) yy_QUESTION(yycontext *yy); /* 24 */ +YY_RULE(int) yy_primary(yycontext *yy); /* 23 */ +YY_RULE(int) yy_NOT(yycontext *yy); /* 22 */ +YY_RULE(int) yy_suffix(yycontext *yy); /* 21 */ +YY_RULE(int) yy_AND(yycontext *yy); /* 20 */ +YY_RULE(int) yy_AT(yycontext *yy); /* 19 */ +YY_RULE(int) yy_action(yycontext *yy); /* 18 */ +YY_RULE(int) yy_TILDE(yycontext *yy); /* 17 */ +YY_RULE(int) yy_prefix(yycontext *yy); /* 16 */ +YY_RULE(int) yy_error(yycontext *yy); /* 15 */ +YY_RULE(int) yy_BAR(yycontext *yy); /* 14 */ +YY_RULE(int) yy_sequence(yycontext *yy); /* 13 */ +YY_RULE(int) yy_SEMICOLON(yycontext *yy); /* 12 */ +YY_RULE(int) yy_expression(yycontext *yy); /* 11 */ +YY_RULE(int) yy_EQUAL(yycontext *yy); /* 10 */ +YY_RULE(int) yy_identifier(yycontext *yy); /* 9 */ +YY_RULE(int) yy_RPERCENT(yycontext *yy); /* 8 */ +YY_RULE(int) yy_end_of_line(yycontext *yy); /* 7 */ YY_RULE(int) yy_end_of_file(yycontext *yy); /* 6 */ YY_RULE(int) yy_trailer(yycontext *yy); /* 5 */ YY_RULE(int) yy_definition(yycontext *yy); /* 4 */ @@ -354,6 +358,19 @@ YY_RULE(int) yy_declaration(yycontext *yy); /* 3 */ YY_RULE(int) yy__(yycontext *yy); /* 2 */ YY_RULE(int) yy_grammar(yycontext *yy); /* 1 */ +YY_ACTION(void) yy_1_end_of_line(yycontext *yy, char *yytext, int yyleng) +{ +#define __ yy->__ +#define yypos yy->__pos +#define yythunkpos yy->__thunkpos + yyprintf((stderr, "do yy_1_end_of_line\n")); + { + ++lineNumber ; + } +#undef yythunkpos +#undef yypos +#undef yy +} YY_ACTION(void) yy_9_primary(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ @@ -628,6 +645,19 @@ YY_ACTION(void) yy_1_definition(yycontext *yy, char *yytext, int yyleng) #undef yypos #undef yy } +YY_ACTION(void) yy_2_trailer(yycontext *yy, char *yytext, int yyleng) +{ +#define __ yy->__ +#define yypos yy->__pos +#define yythunkpos yy->__thunkpos + yyprintf((stderr, "do yy_2_trailer\n")); + { + makeTrailer(headerLine, yytext); ; + } +#undef yythunkpos +#undef yypos +#undef yy +} YY_ACTION(void) yy_1_trailer(yycontext *yy, char *yytext, int yyleng) { #define __ yy->__ @@ -635,7 +665,20 @@ YY_ACTION(void) yy_1_trailer(yycontext *yy, char *yytext, int yyleng) #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_trailer\n")); { - makeTrailer(yytext); ; + headerLine= lineNumber ; + } +#undef yythunkpos +#undef yypos +#undef yy +} +YY_ACTION(void) yy_2_declaration(yycontext *yy, char *yytext, int yyleng) +{ +#define __ yy->__ +#define yypos yy->__pos +#define yythunkpos yy->__thunkpos + yyprintf((stderr, "do yy_2_declaration\n")); + { + makeHeader(headerLine, yytext); ; } #undef yythunkpos #undef yypos @@ -648,458 +691,448 @@ YY_ACTION(void) yy_1_declaration(yycontext *yy, char *yytext, int yyleng) #define yythunkpos yy->__thunkpos yyprintf((stderr, "do yy_1_declaration\n")); { - makeHeader(yytext); ; + headerLine= lineNumber; ; } #undef yythunkpos #undef yypos #undef yy } -YY_RULE(int) yy_end_of_line(yycontext *yy) -{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "end_of_line")); - { int yypos2= yy->__pos, yythunkpos2= yy->__thunkpos; if (!yymatchString(yy, "\r\n")) goto l3; goto l2; - l3:; yy->__pos= yypos2; yy->__thunkpos= yythunkpos2; if (!yymatchChar(yy, '\n')) goto l4; goto l2; - l4:; yy->__pos= yypos2; yy->__thunkpos= yythunkpos2; if (!yymatchChar(yy, '\r')) goto l1; - } - l2:; - yyprintf((stderr, " ok %s @ %s\n", "end_of_line", yy->__buf+yy->__pos)); - return 1; - l1:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; - yyprintf((stderr, " fail %s @ %s\n", "end_of_line", yy->__buf+yy->__pos)); - return 0; -} YY_RULE(int) yy_comment(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "comment")); if (!yymatchChar(yy, '#')) goto l5; - l6:; - { int yypos7= yy->__pos, yythunkpos7= yy->__thunkpos; - { int yypos8= yy->__pos, yythunkpos8= yy->__thunkpos; if (!yy_end_of_line(yy)) goto l8; goto l7; - l8:; yy->__pos= yypos8; yy->__thunkpos= yythunkpos8; - } if (!yymatchDot(yy)) goto l7; goto l6; - l7:; yy->__pos= yypos7; yy->__thunkpos= yythunkpos7; - } if (!yy_end_of_line(yy)) goto l5; + yyprintf((stderr, "%s\n", "comment")); if (!yymatchChar(yy, '#')) goto l1; + l2:; + { int yypos3= yy->__pos, yythunkpos3= yy->__thunkpos; + { int yypos4= yy->__pos, yythunkpos4= yy->__thunkpos; if (!yy_end_of_line(yy)) goto l4; goto l3; + l4:; yy->__pos= yypos4; yy->__thunkpos= yythunkpos4; + } if (!yymatchDot(yy)) goto l3; goto l2; + l3:; yy->__pos= yypos3; yy->__thunkpos= yythunkpos3; + } if (!yy_end_of_line(yy)) goto l1; yyprintf((stderr, " ok %s @ %s\n", "comment", yy->__buf+yy->__pos)); return 1; - l5:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l1:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "comment", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_space(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "space")); - { int yypos10= yy->__pos, yythunkpos10= yy->__thunkpos; if (!yymatchChar(yy, ' ')) goto l11; goto l10; - l11:; yy->__pos= yypos10; yy->__thunkpos= yythunkpos10; if (!yymatchChar(yy, '\t')) goto l12; goto l10; - l12:; yy->__pos= yypos10; yy->__thunkpos= yythunkpos10; if (!yy_end_of_line(yy)) goto l9; + { int yypos6= yy->__pos, yythunkpos6= yy->__thunkpos; if (!yymatchChar(yy, ' ')) goto l7; goto l6; + l7:; yy->__pos= yypos6; yy->__thunkpos= yythunkpos6; if (!yymatchChar(yy, '\t')) goto l8; goto l6; + l8:; yy->__pos= yypos6; yy->__thunkpos= yythunkpos6; if (!yy_end_of_line(yy)) goto l5; } - l10:; + l6:; yyprintf((stderr, " ok %s @ %s\n", "space", yy->__buf+yy->__pos)); return 1; - l9:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l5:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "space", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_braces(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "braces")); - { int yypos14= yy->__pos, yythunkpos14= yy->__thunkpos; if (!yymatchChar(yy, '{')) goto l15; - l16:; - { int yypos17= yy->__pos, yythunkpos17= yy->__thunkpos; if (!yy_braces(yy)) goto l17; goto l16; - l17:; yy->__pos= yypos17; yy->__thunkpos= yythunkpos17; - } if (!yymatchChar(yy, '}')) goto l15; goto l14; - l15:; yy->__pos= yypos14; yy->__thunkpos= yythunkpos14; - { int yypos18= yy->__pos, yythunkpos18= yy->__thunkpos; if (!yymatchChar(yy, '}')) goto l18; goto l13; - l18:; yy->__pos= yypos18; yy->__thunkpos= yythunkpos18; - } if (!yymatchDot(yy)) goto l13; + { int yypos10= yy->__pos, yythunkpos10= yy->__thunkpos; if (!yymatchChar(yy, '{')) goto l11; + l12:; + { int yypos13= yy->__pos, yythunkpos13= yy->__thunkpos; if (!yy_braces(yy)) goto l13; goto l12; + l13:; yy->__pos= yypos13; yy->__thunkpos= yythunkpos13; + } if (!yymatchChar(yy, '}')) goto l11; goto l10; + l11:; yy->__pos= yypos10; yy->__thunkpos= yythunkpos10; + { int yypos14= yy->__pos, yythunkpos14= yy->__thunkpos; if (!yymatchChar(yy, '}')) goto l14; goto l9; + l14:; yy->__pos= yypos14; yy->__thunkpos= yythunkpos14; + } + { int yypos15= yy->__pos, yythunkpos15= yy->__thunkpos; if (!yy_end_of_line(yy)) goto l16; goto l15; + l16:; yy->__pos= yypos15; yy->__thunkpos= yythunkpos15; if (!yymatchDot(yy)) goto l9; + } + l15:; } - l14:; + l10:; yyprintf((stderr, " ok %s @ %s\n", "braces", yy->__buf+yy->__pos)); return 1; - l13:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l9:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "braces", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_range(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "range")); - { int yypos20= yy->__pos, yythunkpos20= yy->__thunkpos; if (!yy_char(yy)) goto l21; if (!yymatchChar(yy, '-')) goto l21; if (!yy_char(yy)) goto l21; goto l20; - l21:; yy->__pos= yypos20; yy->__thunkpos= yythunkpos20; if (!yy_char(yy)) goto l19; + { int yypos18= yy->__pos, yythunkpos18= yy->__thunkpos; if (!yy_char(yy)) goto l19; if (!yymatchChar(yy, '-')) goto l19; if (!yy_char(yy)) goto l19; goto l18; + l19:; yy->__pos= yypos18; yy->__thunkpos= yythunkpos18; if (!yy_char(yy)) goto l17; } - l20:; + l18:; yyprintf((stderr, " ok %s @ %s\n", "range", yy->__buf+yy->__pos)); return 1; - l19:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l17:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "range", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_char(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "char")); - { int yypos23= yy->__pos, yythunkpos23= yy->__thunkpos; if (!yymatchChar(yy, '\\')) goto l24; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\204\040\000\000\000\000\000\070\146\100\124\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l24; goto l23; - l24:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; if (!yymatchChar(yy, '\\')) goto l25; if (!yymatchChar(yy, 'x')) goto l25; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; goto l23; - l25:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; if (!yymatchChar(yy, '\\')) goto l26; if (!yymatchChar(yy, 'x')) goto l26; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l26; goto l23; - l26:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; if (!yymatchChar(yy, '\\')) goto l27; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l27; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l27; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l27; goto l23; - l27:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; if (!yymatchChar(yy, '\\')) goto l28; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l28; - { int yypos29= yy->__pos, yythunkpos29= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l29; goto l30; - l29:; yy->__pos= yypos29; yy->__thunkpos= yythunkpos29; + { int yypos21= yy->__pos, yythunkpos21= yy->__thunkpos; if (!yymatchChar(yy, '\\')) goto l22; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\204\040\000\000\000\000\000\070\146\100\124\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l22; goto l21; + l22:; yy->__pos= yypos21; yy->__thunkpos= yythunkpos21; if (!yymatchChar(yy, '\\')) goto l23; if (!yymatchChar(yy, 'x')) goto l23; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l23; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l23; goto l21; + l23:; yy->__pos= yypos21; yy->__thunkpos= yythunkpos21; if (!yymatchChar(yy, '\\')) goto l24; if (!yymatchChar(yy, 'x')) goto l24; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\003\176\000\000\000\176\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l24; goto l21; + l24:; yy->__pos= yypos21; yy->__thunkpos= yythunkpos21; if (!yymatchChar(yy, '\\')) goto l25; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l25; goto l21; + l25:; yy->__pos= yypos21; yy->__thunkpos= yythunkpos21; if (!yymatchChar(yy, '\\')) goto l26; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l26; + { int yypos27= yy->__pos, yythunkpos27= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\000\377\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l27; goto l28; + l27:; yy->__pos= yypos27; yy->__thunkpos= yythunkpos27; } - l30:; goto l23; - l28:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; - { int yypos31= yy->__pos, yythunkpos31= yy->__thunkpos; if (!yymatchChar(yy, '\\')) goto l31; goto l22; - l31:; yy->__pos= yypos31; yy->__thunkpos= yythunkpos31; - } if (!yymatchDot(yy)) goto l22; + l28:; goto l21; + l26:; yy->__pos= yypos21; yy->__thunkpos= yythunkpos21; + { int yypos29= yy->__pos, yythunkpos29= yy->__thunkpos; if (!yymatchChar(yy, '\\')) goto l29; goto l20; + l29:; yy->__pos= yypos29; yy->__thunkpos= yythunkpos29; + } if (!yymatchDot(yy)) goto l20; } - l23:; + l21:; yyprintf((stderr, " ok %s @ %s\n", "char", yy->__buf+yy->__pos)); return 1; - l22:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l20:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "char", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_END(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(yy, '>')) goto l32; if (!yy__(yy)) goto l32; + yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(yy, '>')) goto l30; if (!yy__(yy)) goto l30; yyprintf((stderr, " ok %s @ %s\n", "END", yy->__buf+yy->__pos)); return 1; - l32:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l30:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "END", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_BEGIN(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(yy, '<')) goto l33; if (!yy__(yy)) goto l33; + yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(yy, '<')) goto l31; if (!yy__(yy)) goto l31; yyprintf((stderr, " ok %s @ %s\n", "BEGIN", yy->__buf+yy->__pos)); return 1; - l33:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l31:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "BEGIN", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_DOT(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(yy, '.')) goto l34; if (!yy__(yy)) goto l34; + yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(yy, '.')) goto l32; if (!yy__(yy)) goto l32; yyprintf((stderr, " ok %s @ %s\n", "DOT", yy->__buf+yy->__pos)); return 1; - l34:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l32:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "DOT", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_class(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(yy, '[')) goto l35; yyText(yy, yy->__begin, yy->__end); { + yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(yy, '[')) goto l33; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l35; +if (!(YY_BEGIN)) goto l33; #undef yytext #undef yyleng } - l36:; - { int yypos37= yy->__pos, yythunkpos37= yy->__thunkpos; - { int yypos38= yy->__pos, yythunkpos38= yy->__thunkpos; if (!yymatchChar(yy, ']')) goto l38; goto l37; - l38:; yy->__pos= yypos38; yy->__thunkpos= yythunkpos38; - } if (!yy_range(yy)) goto l37; goto l36; - l37:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37; + l34:; + { int yypos35= yy->__pos, yythunkpos35= yy->__thunkpos; + { int yypos36= yy->__pos, yythunkpos36= yy->__thunkpos; if (!yymatchChar(yy, ']')) goto l36; goto l35; + l36:; yy->__pos= yypos36; yy->__thunkpos= yythunkpos36; + } if (!yy_range(yy)) goto l35; goto l34; + l35:; yy->__pos= yypos35; yy->__thunkpos= yythunkpos35; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l35; +if (!(YY_END)) goto l33; #undef yytext #undef yyleng - } if (!yymatchChar(yy, ']')) goto l35; if (!yy__(yy)) goto l35; + } if (!yymatchChar(yy, ']')) goto l33; if (!yy__(yy)) goto l33; yyprintf((stderr, " ok %s @ %s\n", "class", yy->__buf+yy->__pos)); return 1; - l35:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l33:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "class", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_literal(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "literal")); - { int yypos40= yy->__pos, yythunkpos40= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l41; yyText(yy, yy->__begin, yy->__end); { + { int yypos38= yy->__pos, yythunkpos38= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l41; +if (!(YY_BEGIN)) goto l39; #undef yytext #undef yyleng } - l42:; - { int yypos43= yy->__pos, yythunkpos43= yy->__thunkpos; - { int yypos44= yy->__pos, yythunkpos44= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l44; goto l43; - l44:; yy->__pos= yypos44; yy->__thunkpos= yythunkpos44; - } if (!yy_char(yy)) goto l43; goto l42; - l43:; yy->__pos= yypos43; yy->__thunkpos= yythunkpos43; + l40:; + { int yypos41= yy->__pos, yythunkpos41= yy->__thunkpos; + { int yypos42= yy->__pos, yythunkpos42= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l42; goto l41; + l42:; yy->__pos= yypos42; yy->__thunkpos= yythunkpos42; + } if (!yy_char(yy)) goto l41; goto l40; + l41:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l41; +if (!(YY_END)) goto l39; #undef yytext #undef yyleng - } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l41; if (!yy__(yy)) goto l41; goto l40; - l41:; yy->__pos= yypos40; yy->__thunkpos= yythunkpos40; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; yyText(yy, yy->__begin, yy->__end); { + } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\200\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; if (!yy__(yy)) goto l39; goto l38; + l39:; yy->__pos= yypos38; yy->__thunkpos= yythunkpos38; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l37; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l39; +if (!(YY_BEGIN)) goto l37; #undef yytext #undef yyleng } - l45:; - { int yypos46= yy->__pos, yythunkpos46= yy->__thunkpos; - { int yypos47= yy->__pos, yythunkpos47= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l47; goto l46; - l47:; yy->__pos= yypos47; yy->__thunkpos= yythunkpos47; - } if (!yy_char(yy)) goto l46; goto l45; - l46:; yy->__pos= yypos46; yy->__thunkpos= yythunkpos46; + l43:; + { int yypos44= yy->__pos, yythunkpos44= yy->__thunkpos; + { int yypos45= yy->__pos, yythunkpos45= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l45; goto l44; + l45:; yy->__pos= yypos45; yy->__thunkpos= yythunkpos45; + } if (!yy_char(yy)) goto l44; goto l43; + l44:; yy->__pos= yypos44; yy->__thunkpos= yythunkpos44; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l39; +if (!(YY_END)) goto l37; #undef yytext #undef yyleng - } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l39; if (!yy__(yy)) goto l39; + } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l37; if (!yy__(yy)) goto l37; } - l40:; + l38:; yyprintf((stderr, " ok %s @ %s\n", "literal", yy->__buf+yy->__pos)); return 1; - l39:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l37:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "literal", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_CLOSE(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(yy, ')')) goto l48; if (!yy__(yy)) goto l48; + yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(yy, ')')) goto l46; if (!yy__(yy)) goto l46; yyprintf((stderr, " ok %s @ %s\n", "CLOSE", yy->__buf+yy->__pos)); return 1; - l48:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l46:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "CLOSE", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_OPEN(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(yy, '(')) goto l49; if (!yy__(yy)) goto l49; + yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(yy, '(')) goto l47; if (!yy__(yy)) goto l47; yyprintf((stderr, " ok %s @ %s\n", "OPEN", yy->__buf+yy->__pos)); return 1; - l49:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l47:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "OPEN", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_COLON(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(yy, ':')) goto l50; if (!yy__(yy)) goto l50; + yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(yy, ':')) goto l48; if (!yy__(yy)) goto l48; yyprintf((stderr, " ok %s @ %s\n", "COLON", yy->__buf+yy->__pos)); return 1; - l50:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l48:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "COLON", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_PLUS(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(yy, '+')) goto l51; if (!yy__(yy)) goto l51; + yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(yy, '+')) goto l49; if (!yy__(yy)) goto l49; yyprintf((stderr, " ok %s @ %s\n", "PLUS", yy->__buf+yy->__pos)); return 1; - l51:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l49:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "PLUS", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_STAR(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(yy, '*')) goto l52; if (!yy__(yy)) goto l52; + yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(yy, '*')) goto l50; if (!yy__(yy)) goto l50; yyprintf((stderr, " ok %s @ %s\n", "STAR", yy->__buf+yy->__pos)); return 1; - l52:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l50:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "STAR", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_QUESTION(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(yy, '?')) goto l53; if (!yy__(yy)) goto l53; + yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(yy, '?')) goto l51; if (!yy__(yy)) goto l51; yyprintf((stderr, " ok %s @ %s\n", "QUESTION", yy->__buf+yy->__pos)); return 1; - l53:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l51:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "QUESTION", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_primary(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "primary")); - { int yypos55= yy->__pos, yythunkpos55= yy->__thunkpos; if (!yy_identifier(yy)) goto l56; yyDo(yy, yy_1_primary, yy->__begin, yy->__end); if (!yy_COLON(yy)) goto l56; if (!yy_identifier(yy)) goto l56; + { int yypos53= yy->__pos, yythunkpos53= yy->__thunkpos; if (!yy_identifier(yy)) goto l54; yyDo(yy, yy_1_primary, yy->__begin, yy->__end); if (!yy_COLON(yy)) goto l54; if (!yy_identifier(yy)) goto l54; + { int yypos55= yy->__pos, yythunkpos55= yy->__thunkpos; if (!yy_EQUAL(yy)) goto l55; goto l54; + l55:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; + } yyDo(yy, yy_2_primary, yy->__begin, yy->__end); goto l53; + l54:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_identifier(yy)) goto l56; { int yypos57= yy->__pos, yythunkpos57= yy->__thunkpos; if (!yy_EQUAL(yy)) goto l57; goto l56; l57:; yy->__pos= yypos57; yy->__thunkpos= yythunkpos57; - } yyDo(yy, yy_2_primary, yy->__begin, yy->__end); goto l55; - l56:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_identifier(yy)) goto l58; - { int yypos59= yy->__pos, yythunkpos59= yy->__thunkpos; if (!yy_EQUAL(yy)) goto l59; goto l58; - l59:; yy->__pos= yypos59; yy->__thunkpos= yythunkpos59; - } yyDo(yy, yy_3_primary, yy->__begin, yy->__end); goto l55; - l58:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_OPEN(yy)) goto l60; if (!yy_expression(yy)) goto l60; if (!yy_CLOSE(yy)) goto l60; goto l55; - l60:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_literal(yy)) goto l61; yyDo(yy, yy_4_primary, yy->__begin, yy->__end); goto l55; - l61:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_class(yy)) goto l62; yyDo(yy, yy_5_primary, yy->__begin, yy->__end); goto l55; - l62:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_DOT(yy)) goto l63; yyDo(yy, yy_6_primary, yy->__begin, yy->__end); goto l55; - l63:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_action(yy)) goto l64; yyDo(yy, yy_7_primary, yy->__begin, yy->__end); goto l55; - l64:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_BEGIN(yy)) goto l65; yyDo(yy, yy_8_primary, yy->__begin, yy->__end); goto l55; - l65:; yy->__pos= yypos55; yy->__thunkpos= yythunkpos55; if (!yy_END(yy)) goto l54; yyDo(yy, yy_9_primary, yy->__begin, yy->__end); + } yyDo(yy, yy_3_primary, yy->__begin, yy->__end); goto l53; + l56:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_OPEN(yy)) goto l58; if (!yy_expression(yy)) goto l58; if (!yy_CLOSE(yy)) goto l58; goto l53; + l58:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_literal(yy)) goto l59; yyDo(yy, yy_4_primary, yy->__begin, yy->__end); goto l53; + l59:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_class(yy)) goto l60; yyDo(yy, yy_5_primary, yy->__begin, yy->__end); goto l53; + l60:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_DOT(yy)) goto l61; yyDo(yy, yy_6_primary, yy->__begin, yy->__end); goto l53; + l61:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_action(yy)) goto l62; yyDo(yy, yy_7_primary, yy->__begin, yy->__end); goto l53; + l62:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_BEGIN(yy)) goto l63; yyDo(yy, yy_8_primary, yy->__begin, yy->__end); goto l53; + l63:; yy->__pos= yypos53; yy->__thunkpos= yythunkpos53; if (!yy_END(yy)) goto l52; yyDo(yy, yy_9_primary, yy->__begin, yy->__end); } - l55:; + l53:; yyprintf((stderr, " ok %s @ %s\n", "primary", yy->__buf+yy->__pos)); return 1; - l54:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l52:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "primary", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_NOT(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(yy, '!')) goto l66; if (!yy__(yy)) goto l66; + yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(yy, '!')) goto l64; if (!yy__(yy)) goto l64; yyprintf((stderr, " ok %s @ %s\n", "NOT", yy->__buf+yy->__pos)); return 1; - l66:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l64:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "NOT", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_suffix(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "suffix")); if (!yy_primary(yy)) goto l67; - { int yypos68= yy->__pos, yythunkpos68= yy->__thunkpos; - { int yypos70= yy->__pos, yythunkpos70= yy->__thunkpos; if (!yy_QUESTION(yy)) goto l71; yyDo(yy, yy_1_suffix, yy->__begin, yy->__end); goto l70; - l71:; yy->__pos= yypos70; yy->__thunkpos= yythunkpos70; if (!yy_STAR(yy)) goto l72; yyDo(yy, yy_2_suffix, yy->__begin, yy->__end); goto l70; - l72:; yy->__pos= yypos70; yy->__thunkpos= yythunkpos70; if (!yy_PLUS(yy)) goto l68; yyDo(yy, yy_3_suffix, yy->__begin, yy->__end); + yyprintf((stderr, "%s\n", "suffix")); if (!yy_primary(yy)) goto l65; + { int yypos66= yy->__pos, yythunkpos66= yy->__thunkpos; + { int yypos68= yy->__pos, yythunkpos68= yy->__thunkpos; if (!yy_QUESTION(yy)) goto l69; yyDo(yy, yy_1_suffix, yy->__begin, yy->__end); goto l68; + l69:; yy->__pos= yypos68; yy->__thunkpos= yythunkpos68; if (!yy_STAR(yy)) goto l70; yyDo(yy, yy_2_suffix, yy->__begin, yy->__end); goto l68; + l70:; yy->__pos= yypos68; yy->__thunkpos= yythunkpos68; if (!yy_PLUS(yy)) goto l66; yyDo(yy, yy_3_suffix, yy->__begin, yy->__end); } - l70:; goto l69; - l68:; yy->__pos= yypos68; yy->__thunkpos= yythunkpos68; + l68:; goto l67; + l66:; yy->__pos= yypos66; yy->__thunkpos= yythunkpos66; } - l69:; + l67:; yyprintf((stderr, " ok %s @ %s\n", "suffix", yy->__buf+yy->__pos)); return 1; - l67:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l65:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "suffix", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_AND(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(yy, '&')) goto l73; if (!yy__(yy)) goto l73; + yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(yy, '&')) goto l71; if (!yy__(yy)) goto l71; yyprintf((stderr, " ok %s @ %s\n", "AND", yy->__buf+yy->__pos)); return 1; - l73:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l71:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "AND", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_AT(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "AT")); if (!yymatchChar(yy, '@')) goto l74; if (!yy__(yy)) goto l74; + yyprintf((stderr, "%s\n", "AT")); if (!yymatchChar(yy, '@')) goto l72; if (!yy__(yy)) goto l72; yyprintf((stderr, " ok %s @ %s\n", "AT", yy->__buf+yy->__pos)); return 1; - l74:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l72:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "AT", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_action(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(yy, '{')) goto l75; yyText(yy, yy->__begin, yy->__end); { + yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(yy, '{')) goto l73; yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l75; +if (!(YY_BEGIN)) goto l73; #undef yytext #undef yyleng } - l76:; - { int yypos77= yy->__pos, yythunkpos77= yy->__thunkpos; if (!yy_braces(yy)) goto l77; goto l76; - l77:; yy->__pos= yypos77; yy->__thunkpos= yythunkpos77; + l74:; + { int yypos75= yy->__pos, yythunkpos75= yy->__thunkpos; if (!yy_braces(yy)) goto l75; goto l74; + l75:; yy->__pos= yypos75; yy->__thunkpos= yythunkpos75; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l75; +if (!(YY_END)) goto l73; #undef yytext #undef yyleng - } if (!yymatchChar(yy, '}')) goto l75; if (!yy__(yy)) goto l75; + } if (!yymatchChar(yy, '}')) goto l73; if (!yy__(yy)) goto l73; yyprintf((stderr, " ok %s @ %s\n", "action", yy->__buf+yy->__pos)); return 1; - l75:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l73:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "action", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_TILDE(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "TILDE")); if (!yymatchChar(yy, '~')) goto l78; if (!yy__(yy)) goto l78; + yyprintf((stderr, "%s\n", "TILDE")); if (!yymatchChar(yy, '~')) goto l76; if (!yy__(yy)) goto l76; yyprintf((stderr, " ok %s @ %s\n", "TILDE", yy->__buf+yy->__pos)); return 1; - l78:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l76:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "TILDE", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_prefix(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "prefix")); - { int yypos80= yy->__pos, yythunkpos80= yy->__thunkpos; if (!yy_AT(yy)) goto l81; if (!yy_action(yy)) goto l81; yyDo(yy, yy_1_prefix, yy->__begin, yy->__end); goto l80; - l81:; yy->__pos= yypos80; yy->__thunkpos= yythunkpos80; if (!yy_AND(yy)) goto l82; if (!yy_action(yy)) goto l82; yyDo(yy, yy_2_prefix, yy->__begin, yy->__end); goto l80; - l82:; yy->__pos= yypos80; yy->__thunkpos= yythunkpos80; if (!yy_AND(yy)) goto l83; if (!yy_suffix(yy)) goto l83; yyDo(yy, yy_3_prefix, yy->__begin, yy->__end); goto l80; - l83:; yy->__pos= yypos80; yy->__thunkpos= yythunkpos80; if (!yy_NOT(yy)) goto l84; if (!yy_suffix(yy)) goto l84; yyDo(yy, yy_4_prefix, yy->__begin, yy->__end); goto l80; - l84:; yy->__pos= yypos80; yy->__thunkpos= yythunkpos80; if (!yy_suffix(yy)) goto l79; + { int yypos78= yy->__pos, yythunkpos78= yy->__thunkpos; if (!yy_AT(yy)) goto l79; if (!yy_action(yy)) goto l79; yyDo(yy, yy_1_prefix, yy->__begin, yy->__end); goto l78; + l79:; yy->__pos= yypos78; yy->__thunkpos= yythunkpos78; if (!yy_AND(yy)) goto l80; if (!yy_action(yy)) goto l80; yyDo(yy, yy_2_prefix, yy->__begin, yy->__end); goto l78; + l80:; yy->__pos= yypos78; yy->__thunkpos= yythunkpos78; if (!yy_AND(yy)) goto l81; if (!yy_suffix(yy)) goto l81; yyDo(yy, yy_3_prefix, yy->__begin, yy->__end); goto l78; + l81:; yy->__pos= yypos78; yy->__thunkpos= yythunkpos78; if (!yy_NOT(yy)) goto l82; if (!yy_suffix(yy)) goto l82; yyDo(yy, yy_4_prefix, yy->__begin, yy->__end); goto l78; + l82:; yy->__pos= yypos78; yy->__thunkpos= yythunkpos78; if (!yy_suffix(yy)) goto l77; } - l80:; + l78:; yyprintf((stderr, " ok %s @ %s\n", "prefix", yy->__buf+yy->__pos)); return 1; - l79:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l77:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "prefix", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_error(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "error")); if (!yy_prefix(yy)) goto l85; - { int yypos86= yy->__pos, yythunkpos86= yy->__thunkpos; if (!yy_TILDE(yy)) goto l86; if (!yy_action(yy)) goto l86; yyDo(yy, yy_1_error, yy->__begin, yy->__end); goto l87; - l86:; yy->__pos= yypos86; yy->__thunkpos= yythunkpos86; + yyprintf((stderr, "%s\n", "error")); if (!yy_prefix(yy)) goto l83; + { int yypos84= yy->__pos, yythunkpos84= yy->__thunkpos; if (!yy_TILDE(yy)) goto l84; if (!yy_action(yy)) goto l84; yyDo(yy, yy_1_error, yy->__begin, yy->__end); goto l85; + l84:; yy->__pos= yypos84; yy->__thunkpos= yythunkpos84; } - l87:; + l85:; yyprintf((stderr, " ok %s @ %s\n", "error", yy->__buf+yy->__pos)); return 1; - l85:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l83:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "error", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_BAR(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "BAR")); if (!yymatchChar(yy, '|')) goto l88; if (!yy__(yy)) goto l88; + yyprintf((stderr, "%s\n", "BAR")); if (!yymatchChar(yy, '|')) goto l86; if (!yy__(yy)) goto l86; yyprintf((stderr, " ok %s @ %s\n", "BAR", yy->__buf+yy->__pos)); return 1; - l88:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l86:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "BAR", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_sequence(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "sequence")); if (!yy_error(yy)) goto l89; - l90:; - { int yypos91= yy->__pos, yythunkpos91= yy->__thunkpos; if (!yy_error(yy)) goto l91; yyDo(yy, yy_1_sequence, yy->__begin, yy->__end); goto l90; - l91:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; + yyprintf((stderr, "%s\n", "sequence")); if (!yy_error(yy)) goto l87; + l88:; + { int yypos89= yy->__pos, yythunkpos89= yy->__thunkpos; if (!yy_error(yy)) goto l89; yyDo(yy, yy_1_sequence, yy->__begin, yy->__end); goto l88; + l89:; yy->__pos= yypos89; yy->__thunkpos= yythunkpos89; } yyprintf((stderr, " ok %s @ %s\n", "sequence", yy->__buf+yy->__pos)); return 1; - l89:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l87:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "sequence", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_SEMICOLON(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "SEMICOLON")); if (!yymatchChar(yy, ';')) goto l92; if (!yy__(yy)) goto l92; + yyprintf((stderr, "%s\n", "SEMICOLON")); if (!yymatchChar(yy, ';')) goto l90; if (!yy__(yy)) goto l90; yyprintf((stderr, " ok %s @ %s\n", "SEMICOLON", yy->__buf+yy->__pos)); return 1; - l92:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l90:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "SEMICOLON", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_expression(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "expression")); if (!yy_sequence(yy)) goto l93; - l94:; - { int yypos95= yy->__pos, yythunkpos95= yy->__thunkpos; if (!yy_BAR(yy)) goto l95; if (!yy_sequence(yy)) goto l95; yyDo(yy, yy_1_expression, yy->__begin, yy->__end); goto l94; - l95:; yy->__pos= yypos95; yy->__thunkpos= yythunkpos95; + yyprintf((stderr, "%s\n", "expression")); if (!yy_sequence(yy)) goto l91; + l92:; + { int yypos93= yy->__pos, yythunkpos93= yy->__thunkpos; if (!yy_BAR(yy)) goto l93; if (!yy_sequence(yy)) goto l93; yyDo(yy, yy_1_expression, yy->__begin, yy->__end); goto l92; + l93:; yy->__pos= yypos93; yy->__thunkpos= yythunkpos93; } yyprintf((stderr, " ok %s @ %s\n", "expression", yy->__buf+yy->__pos)); return 1; - l93:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l91:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "expression", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_EQUAL(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "EQUAL")); if (!yymatchChar(yy, '=')) goto l96; if (!yy__(yy)) goto l96; + yyprintf((stderr, "%s\n", "EQUAL")); if (!yymatchChar(yy, '=')) goto l94; if (!yy__(yy)) goto l94; yyprintf((stderr, " ok %s @ %s\n", "EQUAL", yy->__buf+yy->__pos)); return 1; - l96:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l94:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "EQUAL", yy->__buf+yy->__pos)); return 0; } @@ -1108,149 +1141,167 @@ YY_RULE(int) yy_identifier(yycontext *yy) yyprintf((stderr, "%s\n", "identifier")); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l97; +if (!(YY_BEGIN)) goto l95; #undef yytext #undef yyleng - } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\040\000\000\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l97; - l98:; - { int yypos99= yy->__pos, yythunkpos99= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\040\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l99; goto l98; - l99:; yy->__pos= yypos99; yy->__thunkpos= yythunkpos99; + } if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\040\000\000\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l95; + l96:; + { int yypos97= yy->__pos, yythunkpos97= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\000\000\000\000\000\040\377\003\376\377\377\207\376\377\377\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")) goto l97; goto l96; + l97:; yy->__pos= yypos97; yy->__thunkpos= yythunkpos97; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l97; +if (!(YY_END)) goto l95; #undef yytext #undef yyleng - } if (!yy__(yy)) goto l97; + } if (!yy__(yy)) goto l95; yyprintf((stderr, " ok %s @ %s\n", "identifier", yy->__buf+yy->__pos)); return 1; - l97:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l95:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "identifier", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_RPERCENT(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "RPERCENT")); if (!yymatchString(yy, "%}")) goto l100; if (!yy__(yy)) goto l100; + yyprintf((stderr, "%s\n", "RPERCENT")); if (!yymatchString(yy, "%}")) goto l98; if (!yy__(yy)) goto l98; yyprintf((stderr, " ok %s @ %s\n", "RPERCENT", yy->__buf+yy->__pos)); return 1; - l100:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l98:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "RPERCENT", yy->__buf+yy->__pos)); return 0; } +YY_RULE(int) yy_end_of_line(yycontext *yy) +{ int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; + yyprintf((stderr, "%s\n", "end_of_line")); + { int yypos100= yy->__pos, yythunkpos100= yy->__thunkpos; if (!yymatchString(yy, "\r\n")) goto l101; goto l100; + l101:; yy->__pos= yypos100; yy->__thunkpos= yythunkpos100; if (!yymatchChar(yy, '\n')) goto l102; goto l100; + l102:; yy->__pos= yypos100; yy->__thunkpos= yythunkpos100; if (!yymatchChar(yy, '\r')) goto l99; + } + l100:; yyDo(yy, yy_1_end_of_line, yy->__begin, yy->__end); + yyprintf((stderr, " ok %s @ %s\n", "end_of_line", yy->__buf+yy->__pos)); + return 1; + l99:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + yyprintf((stderr, " fail %s @ %s\n", "end_of_line", yy->__buf+yy->__pos)); + return 0; +} YY_RULE(int) yy_end_of_file(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "end_of_file")); - { int yypos102= yy->__pos, yythunkpos102= yy->__thunkpos; if (!yymatchDot(yy)) goto l102; goto l101; - l102:; yy->__pos= yypos102; yy->__thunkpos= yythunkpos102; + { int yypos104= yy->__pos, yythunkpos104= yy->__thunkpos; if (!yymatchDot(yy)) goto l104; goto l103; + l104:; yy->__pos= yypos104; yy->__thunkpos= yythunkpos104; } yyprintf((stderr, " ok %s @ %s\n", "end_of_file", yy->__buf+yy->__pos)); return 1; - l101:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l103:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "end_of_file", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_trailer(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(yy, "%%")) goto l103; yyText(yy, yy->__begin, yy->__end); { + yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(yy, "%%")) goto l105; yyDo(yy, yy_1_trailer, yy->__begin, yy->__end); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l103; +if (!(YY_BEGIN)) goto l105; #undef yytext #undef yyleng } - l104:; - { int yypos105= yy->__pos, yythunkpos105= yy->__thunkpos; if (!yymatchDot(yy)) goto l105; goto l104; - l105:; yy->__pos= yypos105; yy->__thunkpos= yythunkpos105; + l106:; + { int yypos107= yy->__pos, yythunkpos107= yy->__thunkpos; if (!yymatchDot(yy)) goto l107; goto l106; + l107:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l103; +if (!(YY_END)) goto l105; #undef yytext #undef yyleng - } yyDo(yy, yy_1_trailer, yy->__begin, yy->__end); + } yyDo(yy, yy_2_trailer, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "trailer", yy->__buf+yy->__pos)); return 1; - l103:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l105:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "trailer", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_definition(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(yy)) goto l106; yyDo(yy, yy_1_definition, yy->__begin, yy->__end); if (!yy_EQUAL(yy)) goto l106; if (!yy_expression(yy)) goto l106; yyDo(yy, yy_2_definition, yy->__begin, yy->__end); - { int yypos107= yy->__pos, yythunkpos107= yy->__thunkpos; if (!yy_SEMICOLON(yy)) goto l107; goto l108; - l107:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107; + yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(yy)) goto l108; yyDo(yy, yy_1_definition, yy->__begin, yy->__end); if (!yy_EQUAL(yy)) goto l108; if (!yy_expression(yy)) goto l108; yyDo(yy, yy_2_definition, yy->__begin, yy->__end); + { int yypos109= yy->__pos, yythunkpos109= yy->__thunkpos; if (!yy_SEMICOLON(yy)) goto l109; goto l110; + l109:; yy->__pos= yypos109; yy->__thunkpos= yythunkpos109; } - l108:; + l110:; yyprintf((stderr, " ok %s @ %s\n", "definition", yy->__buf+yy->__pos)); return 1; - l106:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l108:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "definition", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy_declaration(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(yy, "%{")) goto l109; yyText(yy, yy->__begin, yy->__end); { + yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(yy, "%{")) goto l111; yyDo(yy, yy_1_declaration, yy->__begin, yy->__end); yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_BEGIN)) goto l109; +if (!(YY_BEGIN)) goto l111; #undef yytext #undef yyleng } - l110:; - { int yypos111= yy->__pos, yythunkpos111= yy->__thunkpos; - { int yypos112= yy->__pos, yythunkpos112= yy->__thunkpos; if (!yymatchString(yy, "%}")) goto l112; goto l111; - l112:; yy->__pos= yypos112; yy->__thunkpos= yythunkpos112; - } if (!yymatchDot(yy)) goto l111; goto l110; - l111:; yy->__pos= yypos111; yy->__thunkpos= yythunkpos111; + l112:; + { int yypos113= yy->__pos, yythunkpos113= yy->__thunkpos; + { int yypos114= yy->__pos, yythunkpos114= yy->__thunkpos; if (!yymatchString(yy, "%}")) goto l114; goto l113; + l114:; yy->__pos= yypos114; yy->__thunkpos= yythunkpos114; + } + { int yypos115= yy->__pos, yythunkpos115= yy->__thunkpos; if (!yy_end_of_line(yy)) goto l116; goto l115; + l116:; yy->__pos= yypos115; yy->__thunkpos= yythunkpos115; if (!yymatchDot(yy)) goto l113; + } + l115:; goto l112; + l113:; yy->__pos= yypos113; yy->__thunkpos= yythunkpos113; } yyText(yy, yy->__begin, yy->__end); { #define yytext yy->__text #define yyleng yy->__textlen -if (!(YY_END)) goto l109; +if (!(YY_END)) goto l111; #undef yytext #undef yyleng - } if (!yy_RPERCENT(yy)) goto l109; yyDo(yy, yy_1_declaration, yy->__begin, yy->__end); + } if (!yy_RPERCENT(yy)) goto l111; yyDo(yy, yy_2_declaration, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "declaration", yy->__buf+yy->__pos)); return 1; - l109:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l111:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "declaration", yy->__buf+yy->__pos)); return 0; } YY_RULE(int) yy__(yycontext *yy) { yyprintf((stderr, "%s\n", "_")); - l114:; - { int yypos115= yy->__pos, yythunkpos115= yy->__thunkpos; - { int yypos116= yy->__pos, yythunkpos116= yy->__thunkpos; if (!yy_space(yy)) goto l117; goto l116; - l117:; yy->__pos= yypos116; yy->__thunkpos= yythunkpos116; if (!yy_comment(yy)) goto l115; + l118:; + { int yypos119= yy->__pos, yythunkpos119= yy->__thunkpos; + { int yypos120= yy->__pos, yythunkpos120= yy->__thunkpos; if (!yy_space(yy)) goto l121; goto l120; + l121:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; if (!yy_comment(yy)) goto l119; } - l116:; goto l114; - l115:; yy->__pos= yypos115; yy->__thunkpos= yythunkpos115; + l120:; goto l118; + l119:; yy->__pos= yypos119; yy->__thunkpos= yythunkpos119; } yyprintf((stderr, " ok %s @ %s\n", "_", yy->__buf+yy->__pos)); return 1; } YY_RULE(int) yy_grammar(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "grammar")); if (!yy__(yy)) goto l118; - { int yypos121= yy->__pos, yythunkpos121= yy->__thunkpos; if (!yy_declaration(yy)) goto l122; goto l121; - l122:; yy->__pos= yypos121; yy->__thunkpos= yythunkpos121; if (!yy_definition(yy)) goto l118; + yyprintf((stderr, "%s\n", "grammar")); if (!yy__(yy)) goto l122; + { int yypos125= yy->__pos, yythunkpos125= yy->__thunkpos; if (!yy_declaration(yy)) goto l126; goto l125; + l126:; yy->__pos= yypos125; yy->__thunkpos= yythunkpos125; if (!yy_definition(yy)) goto l122; } - l121:; - l119:; - { int yypos120= yy->__pos, yythunkpos120= yy->__thunkpos; - { int yypos123= yy->__pos, yythunkpos123= yy->__thunkpos; if (!yy_declaration(yy)) goto l124; goto l123; - l124:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; if (!yy_definition(yy)) goto l120; + l125:; + l123:; + { int yypos124= yy->__pos, yythunkpos124= yy->__thunkpos; + { int yypos127= yy->__pos, yythunkpos127= yy->__thunkpos; if (!yy_declaration(yy)) goto l128; goto l127; + l128:; yy->__pos= yypos127; yy->__thunkpos= yythunkpos127; if (!yy_definition(yy)) goto l124; } - l123:; goto l119; - l120:; yy->__pos= yypos120; yy->__thunkpos= yythunkpos120; + l127:; goto l123; + l124:; yy->__pos= yypos124; yy->__thunkpos= yythunkpos124; } - { int yypos125= yy->__pos, yythunkpos125= yy->__thunkpos; if (!yy_trailer(yy)) goto l125; goto l126; - l125:; yy->__pos= yypos125; yy->__thunkpos= yythunkpos125; + { int yypos129= yy->__pos, yythunkpos129= yy->__thunkpos; if (!yy_trailer(yy)) goto l129; goto l130; + l129:; yy->__pos= yypos129; yy->__thunkpos= yythunkpos129; } - l126:; if (!yy_end_of_file(yy)) goto l118; + l130:; if (!yy_end_of_file(yy)) goto l122; yyprintf((stderr, " ok %s @ %s\n", "grammar", yy->__buf+yy->__pos)); return 1; - l118:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l122:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "grammar", yy->__buf+yy->__pos)); return 0; } @@ -1302,6 +1353,7 @@ YY_PARSE(yycontext *) YYRELEASE(yycontext *yyctx) } #endif +#line 160 "src/leg.leg" void yyerror(char *message) @@ -1329,16 +1381,18 @@ void yyerror(char *message) exit(1); } -void makeHeader(char *text) +void makeHeader(int line, char *text) { Header *header= (Header *)malloc(sizeof(Header)); + header->line= line; header->text= strdup(text); header->next= headers; headers= header; } -void makeTrailer(char *text) +void makeTrailer(int line, char *text) { + trailerLine= line; trailer= strdup(text); } @@ -1439,13 +1493,13 @@ int main(int argc, char **argv) Rule_compile_c_header(); for (; headers; headers= headers->next) - fprintf(output, "%s\n", headers->text); + fprintf(output, "#line %i \"%s\"\n%s\n", headers->line, fileName, headers->text); if (rules) Rule_compile_c(rules); if (trailer) - fprintf(output, "%s\n", trailer); + fprintf(output, "#line %i \"%s\"\n%s\n", trailerLine, fileName, trailer); return 0; } diff --git a/src/leg.leg b/src/leg.leg index ceed2b5..c26755f 100644 --- a/src/leg.leg +++ b/src/leg.leg @@ -15,7 +15,7 @@ # # THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. # -# Last edited: 2016-02-19 11:04:51 by piumarta on zora +# Last edited: 2016-07-14 20:26:22 by piumarta on zora %{ # include "tree.h" @@ -31,6 +31,7 @@ typedef struct Header Header; struct Header { + int line; char *text; Header *next; }; @@ -40,20 +41,22 @@ int verboseFlag= 0; static int lineNumber= 0; + static int headerLine= 0; static char *fileName= 0; + static int trailerLine= 0; static char *trailer= 0; static Header *headers= 0; - void makeHeader(char *text); - void makeTrailer(char *text); + void makeHeader(int line, char *text); + void makeTrailer(int line, char *text); void yyerror(char *message); -# define YY_INPUT(buf, result, max) \ - { \ - int c= getc(input); \ - if ('\n' == c || '\r' == c) ++lineNumber; \ - result= (EOF == c) ? 0 : (*(buf)= c, 1); \ +# define YY_INPUT(buf, result, max) \ + { \ + int c= getc(input); \ + /* if ('\n' == c || '\r' == c) ++lineNumber; */ \ + result= (EOF == c) ? 0 : (*(buf)= c, 1); \ } # define YY_LOCAL(T) static T @@ -64,9 +67,12 @@ grammar= - ( declaration | definition )+ trailer? end-of-file -declaration= '%{' < ( !'%}' . )* > RPERCENT { makeHeader(yytext); } #{YYACCEPT} +declaration= '%{' { headerLine= lineNumber; } + < ( !'%}' (end-of-line | .) )* > + RPERCENT { makeHeader(headerLine, yytext); } #{YYACCEPT} -trailer= '%%' < .* > { makeTrailer(yytext); } #{YYACCEPT} +trailer= '%%' { headerLine= lineNumber } + < .* > { makeTrailer(headerLine, yytext); } #{YYACCEPT} definition= identifier { if (push(beginRule(findRule(yytext)))->rule.expression) fprintf(stderr, "rule '%s' redefined\n", yytext); } @@ -125,7 +131,7 @@ char= '\\' [-abefnrtv'"\[\]\\] action= '{' < braces* > '}' - braces= '{' braces* '}' -| !'}' . +| !'}' ( end-of-line | . ) EQUAL= '=' - COLON= ':' - @@ -148,7 +154,7 @@ RPERCENT= '%}' - -= (space | comment)* space= ' ' | '\t' | end-of-line comment= '#' (!end-of-line .)* end-of-line -end-of-line= '\r\n' | '\n' | '\r' +end-of-line= ( '\r\n' | '\n' | '\r' ) { ++lineNumber } end-of-file= !. %% @@ -178,16 +184,18 @@ void yyerror(char *message) exit(1); } -void makeHeader(char *text) +void makeHeader(int line, char *text) { Header *header= (Header *)malloc(sizeof(Header)); + header->line= line; header->text= strdup(text); header->next= headers; headers= header; } -void makeTrailer(char *text) +void makeTrailer(int line, char *text) { + trailerLine= line; trailer= strdup(text); } @@ -288,13 +296,13 @@ int main(int argc, char **argv) Rule_compile_c_header(); for (; headers; headers= headers->next) - fprintf(output, "%s\n", headers->text); + fprintf(output, "#line %i \"%s\"\n%s\n", headers->line, fileName, headers->text); if (rules) Rule_compile_c(rules); if (trailer) - fprintf(output, "%s\n", trailer); + fprintf(output, "#line %i \"%s\"\n%s\n", trailerLine, fileName, trailer); return 0; } diff --git a/src/peg.peg-c b/src/peg.peg-c index f6f52e8..f7738ef 100644 --- a/src/peg.peg-c +++ b/src/peg.peg-c @@ -1,4 +1,4 @@ -/* A recursive-descent parser generated by peg 0.1.16 */ +/* A recursive-descent parser generated by peg 0.1.17 */ #include #include diff --git a/src/version.h b/src/version.h index d8a791d..7ad6a85 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1,3 @@ #define PEG_MAJOR 0 #define PEG_MINOR 1 -#define PEG_LEVEL 16 +#define PEG_LEVEL 17