From 574853e2b50eaeca856064a74282de20bfc665b2 Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sun, 18 Aug 2013 10:32:27 +0200 Subject: [PATCH] imported peg-0.1.13 --- README.md | 3 + src/compile.c | 30 +++- src/leg.c | 418 ++++++++++++++++++++++++++++++-------------------- src/leg.leg | 4 +- src/peg.peg-c | 90 +++++++++-- src/version.h | 2 +- 6 files changed, 362 insertions(+), 185 deletions(-) diff --git a/README.md b/README.md index 2bd49f3..8679ed2 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,9 @@ distribute them any way you like. ## Version history +* **0.1.13** ([zip](../../archive/0.1.13.zip), [tar.gz](../../archive/0.1.13.tar.gz)) — 2013-08-16 +Predicate actions can refer to `yytext` (thanks to GrĂ©gory Pakosz). +Hexadecimal character escapes are supported by `leg` (thanks to Hugo Etchegoyen). * **0.1.12** ([zip](../../archive/0.1.12.zip), [tar.gz](../../archive/0.1.12.tar.gz)) — 2013-07-20 Use BSD-licensed `getopt()` in Windows build. Verbose mode handles Variable nodes. diff --git a/src/compile.c b/src/compile.c index bea5479..95058cf 100644 --- a/src/compile.c +++ b/src/compile.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007, 2012 by Ian Piumarta +/* Copyright (c) 2007--2013 by Ian Piumarta * All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -13,7 +13,7 @@ * * THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK. * - * Last edited: 2013-06-06 12:24:20 by piumarta on ubuntu + * Last edited: 2013-08-16 00:58:47 by piumarta on emilia */ #include @@ -40,7 +40,16 @@ static void charClassClear(unsigned char bits[], int c) { bits[c >> 3] &= ~(1 << typedef void (*setter)(unsigned char bits[], int c); -static inline int oigit(int c) { return '0' <= c && c <= '7'; } +static inline int oigit(int c) { return ('0' <= c && c <= '7'); } +static inline int higit(int c) { return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); } + +static inline int hexval(int c) +{ + if ('0' <= c && c <= '9') return c - '0'; + if ('A' <= c && c <= 'F') return 10 - 'A' + c; + if ('a' <= c && c <= 'f') return 10 - 'a' + c; + return 0; +} static int cnext(unsigned char **ccp) { @@ -60,6 +69,11 @@ static int cnext(unsigned char **ccp) case 'r': c= '\r'; break; /* cr */ case 't': c= '\t'; break; /* ht */ case 'v': c= '\v'; break; /* vt */ + case 'x': + c= 0; + if (higit(*cclass)) c= (c << 4) + hexval(*cclass++); + if (higit(*cclass)) c= (c << 4) + hexval(*cclass++); + break; default: if (oigit(c)) { @@ -159,7 +173,7 @@ static void Node_compile_c_ko(Node *node, int ko) else if (2 == len && '\\' == node->string.value[0]) fprintf(output, " if (!yymatchChar(yy, '%s')) goto l%d;", node->string.value, ko); - else + else fprintf(output, " if (!yymatchString(yy, \"%s\")) goto l%d;", node->string.value, ko); } break; @@ -173,7 +187,13 @@ static void Node_compile_c_ko(Node *node, int ko) break; case Predicate: - fprintf(output, " yyText(yy, yy->__begin, yy->__end); if (!(%s)) goto l%d;", node->action.text, ko); + fprintf(output, " yyText(yy, yy->__begin, yy->__end); {\n"); + fprintf(output, "#define yytext yy->__text\n"); + fprintf(output, "#define yyleng yy->__textlen\n"); + fprintf(output, "if (!(%s)) goto l%d;\n", node->action.text, ko); + fprintf(output, "#undef yytext\n"); + fprintf(output, "#undef yyleng\n"); + fprintf(output, " }"); break; case Error: diff --git a/src/leg.c b/src/leg.c index e7773d5..c0f3f75 100644 --- a/src/leg.c +++ b/src/leg.c @@ -1,4 +1,4 @@ -/* A recursive-descent parser generated by peg 0.1.12 */ +/* A recursive-descent parser generated by peg 0.1.13 */ #include #include @@ -722,15 +722,17 @@ 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 (!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 l23; - l25:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; 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; - } - l28:; goto l23; - l26:; yy->__pos= yypos23; yy->__thunkpos= yythunkpos23; - { int yypos29= yy->__pos, yythunkpos29= yy->__thunkpos; if (!yymatchChar(yy, '\\')) goto l29; goto l22; + 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; + } + 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; } l23:; @@ -742,405 +744,489 @@ YY_RULE(int) yy_char(yycontext *yy) } YY_RULE(int) yy_END(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(yy, '>')) goto l30; if (!yy__(yy)) goto l30; + yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(yy, '>')) goto l32; if (!yy__(yy)) goto l32; yyprintf((stderr, " ok %s @ %s\n", "END", yy->__buf+yy->__pos)); return 1; - l30:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l32:; 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 l31; if (!yy__(yy)) goto l31; + yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(yy, '<')) goto l33; if (!yy__(yy)) goto l33; yyprintf((stderr, " ok %s @ %s\n", "BEGIN", yy->__buf+yy->__pos)); return 1; - l31:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l33:; 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 l32; if (!yy__(yy)) goto l32; + yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(yy, '.')) goto l34; if (!yy__(yy)) goto l34; yyprintf((stderr, " ok %s @ %s\n", "DOT", yy->__buf+yy->__pos)); return 1; - l32:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l34:; 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 l33; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l33; - 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); if (!(YY_END)) goto l33; if (!yymatchChar(yy, ']')) goto l33; if (!yy__(yy)) goto l33; + yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(yy, '[')) goto l35; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l35; +#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; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l35; +#undef yytext +#undef yyleng + } if (!yymatchChar(yy, ']')) goto l35; if (!yy__(yy)) goto l35; yyprintf((stderr, " ok %s @ %s\n", "class", yy->__buf+yy->__pos)); return 1; - l33:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l35:; 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 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); if (!(YY_BEGIN)) goto l39; - 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); if (!(YY_END)) goto l39; 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); if (!(YY_BEGIN)) goto l37; - 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; + { 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); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l41; +#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; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l37; 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; + } if (!yy_char(yy)) goto l43; goto l42; + l43:; yy->__pos= yypos43; yy->__thunkpos= yythunkpos43; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l41; +#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); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l39; +#undef yytext +#undef yyleng } - l38:; + 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; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l39; +#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; + } + l40:; yyprintf((stderr, " ok %s @ %s\n", "literal", yy->__buf+yy->__pos)); return 1; - l37:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l39:; 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 l46; if (!yy__(yy)) goto l46; + yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(yy, ')')) goto l48; if (!yy__(yy)) goto l48; yyprintf((stderr, " ok %s @ %s\n", "CLOSE", yy->__buf+yy->__pos)); return 1; - l46:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l48:; 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 l47; if (!yy__(yy)) goto l47; + yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(yy, '(')) goto l49; if (!yy__(yy)) goto l49; yyprintf((stderr, " ok %s @ %s\n", "OPEN", yy->__buf+yy->__pos)); return 1; - l47:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l49:; 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 l48; if (!yy__(yy)) goto l48; + yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(yy, ':')) goto l50; if (!yy__(yy)) goto l50; yyprintf((stderr, " ok %s @ %s\n", "COLON", yy->__buf+yy->__pos)); return 1; - l48:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l50:; 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 l49; if (!yy__(yy)) goto l49; + yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(yy, '+')) goto l51; if (!yy__(yy)) goto l51; yyprintf((stderr, " ok %s @ %s\n", "PLUS", yy->__buf+yy->__pos)); return 1; - l49:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l51:; 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 l50; if (!yy__(yy)) goto l50; + yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(yy, '*')) goto l52; if (!yy__(yy)) goto l52; yyprintf((stderr, " ok %s @ %s\n", "STAR", yy->__buf+yy->__pos)); return 1; - l50:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l52:; 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 l51; if (!yy__(yy)) goto l51; + yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(yy, '?')) goto l53; if (!yy__(yy)) goto l53; yyprintf((stderr, " ok %s @ %s\n", "QUESTION", yy->__buf+yy->__pos)); return 1; - l51:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l53:; 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 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 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 yypos57= yy->__pos, yythunkpos57= yy->__thunkpos; if (!yy_EQUAL(yy)) goto l57; goto l56; l57:; yy->__pos= yypos57; yy->__thunkpos= yythunkpos57; - } 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); + } 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); } - l53:; + l55:; yyprintf((stderr, " ok %s @ %s\n", "primary", yy->__buf+yy->__pos)); return 1; - l52:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l54:; 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 l64; if (!yy__(yy)) goto l64; + yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(yy, '!')) goto l66; if (!yy__(yy)) goto l66; yyprintf((stderr, " ok %s @ %s\n", "NOT", yy->__buf+yy->__pos)); return 1; - l64:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l66:; 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 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); + 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); } - l68:; goto l67; - l66:; yy->__pos= yypos66; yy->__thunkpos= yythunkpos66; + l70:; goto l69; + l68:; yy->__pos= yypos68; yy->__thunkpos= yythunkpos68; } - l67:; + l69:; yyprintf((stderr, " ok %s @ %s\n", "suffix", yy->__buf+yy->__pos)); return 1; - l65:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l67:; 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 l71; if (!yy__(yy)) goto l71; + yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(yy, '&')) goto l73; if (!yy__(yy)) goto l73; yyprintf((stderr, " ok %s @ %s\n", "AND", yy->__buf+yy->__pos)); return 1; - l71:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l73:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "AND", 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 l72; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l72; - l73:; - { int yypos74= yy->__pos, yythunkpos74= yy->__thunkpos; if (!yy_braces(yy)) goto l74; goto l73; - l74:; yy->__pos= yypos74; yy->__thunkpos= yythunkpos74; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l72; if (!yymatchChar(yy, '}')) goto l72; if (!yy__(yy)) goto l72; + yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(yy, '{')) goto l74; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l74; +#undef yytext +#undef yyleng + } + l75:; + { int yypos76= yy->__pos, yythunkpos76= yy->__thunkpos; if (!yy_braces(yy)) goto l76; goto l75; + l76:; yy->__pos= yypos76; yy->__thunkpos= yythunkpos76; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l74; +#undef yytext +#undef yyleng + } if (!yymatchChar(yy, '}')) goto l74; if (!yy__(yy)) goto l74; yyprintf((stderr, " ok %s @ %s\n", "action", yy->__buf+yy->__pos)); return 1; - l72:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l74:; 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 l75; if (!yy__(yy)) goto l75; + yyprintf((stderr, "%s\n", "TILDE")); if (!yymatchChar(yy, '~')) goto l77; if (!yy__(yy)) goto l77; yyprintf((stderr, " ok %s @ %s\n", "TILDE", yy->__buf+yy->__pos)); return 1; - l75:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l77:; 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 yypos77= yy->__pos, yythunkpos77= yy->__thunkpos; if (!yy_AND(yy)) goto l78; if (!yy_action(yy)) goto l78; yyDo(yy, yy_1_prefix, yy->__begin, yy->__end); goto l77; - l78:; yy->__pos= yypos77; yy->__thunkpos= yythunkpos77; if (!yy_AND(yy)) goto l79; if (!yy_suffix(yy)) goto l79; yyDo(yy, yy_2_prefix, yy->__begin, yy->__end); goto l77; - l79:; yy->__pos= yypos77; yy->__thunkpos= yythunkpos77; if (!yy_NOT(yy)) goto l80; if (!yy_suffix(yy)) goto l80; yyDo(yy, yy_3_prefix, yy->__begin, yy->__end); goto l77; - l80:; yy->__pos= yypos77; yy->__thunkpos= yythunkpos77; if (!yy_suffix(yy)) goto l76; + { int yypos79= yy->__pos, yythunkpos79= yy->__thunkpos; if (!yy_AND(yy)) goto l80; if (!yy_action(yy)) goto l80; yyDo(yy, yy_1_prefix, yy->__begin, yy->__end); goto l79; + l80:; yy->__pos= yypos79; yy->__thunkpos= yythunkpos79; if (!yy_AND(yy)) goto l81; if (!yy_suffix(yy)) goto l81; yyDo(yy, yy_2_prefix, yy->__begin, yy->__end); goto l79; + l81:; yy->__pos= yypos79; yy->__thunkpos= yythunkpos79; if (!yy_NOT(yy)) goto l82; if (!yy_suffix(yy)) goto l82; yyDo(yy, yy_3_prefix, yy->__begin, yy->__end); goto l79; + l82:; yy->__pos= yypos79; yy->__thunkpos= yythunkpos79; if (!yy_suffix(yy)) goto l78; } - l77:; + l79:; yyprintf((stderr, " ok %s @ %s\n", "prefix", yy->__buf+yy->__pos)); return 1; - l76:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l78:; 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 l81; - { int yypos82= yy->__pos, yythunkpos82= yy->__thunkpos; if (!yy_TILDE(yy)) goto l82; if (!yy_action(yy)) goto l82; yyDo(yy, yy_1_error, yy->__begin, yy->__end); goto l83; - l82:; yy->__pos= yypos82; yy->__thunkpos= yythunkpos82; + 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; } - l83:; + l85:; yyprintf((stderr, " ok %s @ %s\n", "error", yy->__buf+yy->__pos)); return 1; - l81:; 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 l84; if (!yy__(yy)) goto l84; + 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; - l84:; 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 l85; - l86:; - { int yypos87= yy->__pos, yythunkpos87= yy->__thunkpos; if (!yy_error(yy)) goto l87; yyDo(yy, yy_1_sequence, yy->__begin, yy->__end); goto l86; - l87:; yy->__pos= yypos87; yy->__thunkpos= yythunkpos87; + 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; - l85:; 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 l88; if (!yy__(yy)) goto l88; + 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; - l88:; 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 l89; - l90:; - { int yypos91= yy->__pos, yythunkpos91= yy->__thunkpos; if (!yy_BAR(yy)) goto l91; if (!yy_sequence(yy)) goto l91; yyDo(yy, yy_1_expression, yy->__begin, yy->__end); goto l90; - l91:; yy->__pos= yypos91; yy->__thunkpos= yythunkpos91; + 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; - l89:; 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 l92; if (!yy__(yy)) goto l92; + 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; - l92:; 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; } YY_RULE(int) yy_identifier(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "identifier")); yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l93; 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 l93; - l94:; - { int yypos95= yy->__pos, yythunkpos95= 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 l95; goto l94; - l95:; yy->__pos= yypos95; yy->__thunkpos= yythunkpos95; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l93; if (!yy__(yy)) goto l93; + yyprintf((stderr, "%s\n", "identifier")); yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +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 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 l95; +#undef yytext +#undef yyleng + } if (!yy__(yy)) goto l95; yyprintf((stderr, " ok %s @ %s\n", "identifier", yy->__buf+yy->__pos)); return 1; - l93:; 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 l96; if (!yy__(yy)) goto l96; + 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; - l96:; 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_file(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "end_of_file")); - { int yypos98= yy->__pos, yythunkpos98= yy->__thunkpos; if (!yymatchDot(yy)) goto l98; goto l97; - l98:; yy->__pos= yypos98; yy->__thunkpos= yythunkpos98; + { int yypos100= yy->__pos, yythunkpos100= yy->__thunkpos; if (!yymatchDot(yy)) goto l100; goto l99; + l100:; yy->__pos= yypos100; yy->__thunkpos= yythunkpos100; } yyprintf((stderr, " ok %s @ %s\n", "end_of_file", yy->__buf+yy->__pos)); return 1; - l97:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l99:; 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 l99; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l99; - l100:; - { int yypos101= yy->__pos, yythunkpos101= yy->__thunkpos; if (!yymatchDot(yy)) goto l101; goto l100; - l101:; yy->__pos= yypos101; yy->__thunkpos= yythunkpos101; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l99; yyDo(yy, yy_1_trailer, yy->__begin, yy->__end); + yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(yy, "%%")) goto l101; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l101; +#undef yytext +#undef yyleng + } + l102:; + { int yypos103= yy->__pos, yythunkpos103= yy->__thunkpos; if (!yymatchDot(yy)) goto l103; goto l102; + l103:; yy->__pos= yypos103; yy->__thunkpos= yythunkpos103; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l101; +#undef yytext +#undef yyleng + } yyDo(yy, yy_1_trailer, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "trailer", yy->__buf+yy->__pos)); return 1; - l99:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l101:; 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 l102; yyDo(yy, yy_1_definition, yy->__begin, yy->__end); if (!yy_EQUAL(yy)) goto l102; if (!yy_expression(yy)) goto l102; yyDo(yy, yy_2_definition, yy->__begin, yy->__end); - { int yypos103= yy->__pos, yythunkpos103= yy->__thunkpos; if (!yy_SEMICOLON(yy)) goto l103; goto l104; - l103:; yy->__pos= yypos103; yy->__thunkpos= yythunkpos103; + yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(yy)) goto l104; yyDo(yy, yy_1_definition, yy->__begin, yy->__end); if (!yy_EQUAL(yy)) goto l104; if (!yy_expression(yy)) goto l104; yyDo(yy, yy_2_definition, yy->__begin, yy->__end); + { int yypos105= yy->__pos, yythunkpos105= yy->__thunkpos; if (!yy_SEMICOLON(yy)) goto l105; goto l106; + l105:; yy->__pos= yypos105; yy->__thunkpos= yythunkpos105; } - l104:; + l106:; yyprintf((stderr, " ok %s @ %s\n", "definition", yy->__buf+yy->__pos)); return 1; - l102:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l104:; 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 l105; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l105; - l106:; - { int yypos107= yy->__pos, yythunkpos107= yy->__thunkpos; - { int yypos108= yy->__pos, yythunkpos108= yy->__thunkpos; if (!yymatchString(yy, "%}")) goto l108; goto l107; - l108:; yy->__pos= yypos108; yy->__thunkpos= yythunkpos108; - } if (!yymatchDot(yy)) goto l107; goto l106; - l107:; yy->__pos= yypos107; yy->__thunkpos= yythunkpos107; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l105; if (!yy_RPERCENT(yy)) goto l105; yyDo(yy, yy_1_declaration, yy->__begin, yy->__end); + yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(yy, "%{")) goto l107; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l107; +#undef yytext +#undef yyleng + } + l108:; + { int yypos109= yy->__pos, yythunkpos109= yy->__thunkpos; + { int yypos110= yy->__pos, yythunkpos110= yy->__thunkpos; if (!yymatchString(yy, "%}")) goto l110; goto l109; + l110:; yy->__pos= yypos110; yy->__thunkpos= yythunkpos110; + } if (!yymatchDot(yy)) goto l109; goto l108; + l109:; yy->__pos= yypos109; yy->__thunkpos= yythunkpos109; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l107; +#undef yytext +#undef yyleng + } if (!yy_RPERCENT(yy)) goto l107; yyDo(yy, yy_1_declaration, yy->__begin, yy->__end); yyprintf((stderr, " ok %s @ %s\n", "declaration", yy->__buf+yy->__pos)); return 1; - l105:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l107:; 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", "_")); - l110:; - { int yypos111= yy->__pos, yythunkpos111= yy->__thunkpos; - { int yypos112= yy->__pos, yythunkpos112= yy->__thunkpos; if (!yy_space(yy)) goto l113; goto l112; - l113:; yy->__pos= yypos112; yy->__thunkpos= yythunkpos112; if (!yy_comment(yy)) goto l111; + l112:; + { int yypos113= yy->__pos, yythunkpos113= yy->__thunkpos; + { int yypos114= yy->__pos, yythunkpos114= yy->__thunkpos; if (!yy_space(yy)) goto l115; goto l114; + l115:; yy->__pos= yypos114; yy->__thunkpos= yythunkpos114; if (!yy_comment(yy)) goto l113; } - l112:; goto l110; - l111:; yy->__pos= yypos111; yy->__thunkpos= yythunkpos111; + l114:; goto l112; + l113:; yy->__pos= yypos113; yy->__thunkpos= yythunkpos113; } 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 l114; - { int yypos117= yy->__pos, yythunkpos117= yy->__thunkpos; if (!yy_declaration(yy)) goto l118; goto l117; - l118:; yy->__pos= yypos117; yy->__thunkpos= yythunkpos117; if (!yy_definition(yy)) goto l114; - } - l117:; - l115:; - { int yypos116= yy->__pos, yythunkpos116= yy->__thunkpos; + yyprintf((stderr, "%s\n", "grammar")); if (!yy__(yy)) goto l116; { int yypos119= yy->__pos, yythunkpos119= yy->__thunkpos; if (!yy_declaration(yy)) goto l120; goto l119; l120:; yy->__pos= yypos119; yy->__thunkpos= yythunkpos119; if (!yy_definition(yy)) goto l116; } - l119:; goto l115; - l116:; yy->__pos= yypos116; yy->__thunkpos= yythunkpos116; + l119:; + l117:; + { int yypos118= yy->__pos, yythunkpos118= yy->__thunkpos; + { 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; + } + l121:; goto l117; + l118:; yy->__pos= yypos118; yy->__thunkpos= yythunkpos118; } - { int yypos121= yy->__pos, yythunkpos121= yy->__thunkpos; if (!yy_trailer(yy)) goto l121; goto l122; - l121:; yy->__pos= yypos121; yy->__thunkpos= yythunkpos121; + { int yypos123= yy->__pos, yythunkpos123= yy->__thunkpos; if (!yy_trailer(yy)) goto l123; goto l124; + l123:; yy->__pos= yypos123; yy->__thunkpos= yythunkpos123; } - l122:; if (!yy_end_of_file(yy)) goto l114; + l124:; if (!yy_end_of_file(yy)) goto l116; yyprintf((stderr, " ok %s @ %s\n", "grammar", yy->__buf+yy->__pos)); return 1; - l114:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; + l116:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; yyprintf((stderr, " fail %s @ %s\n", "grammar", yy->__buf+yy->__pos)); return 0; } diff --git a/src/leg.leg b/src/leg.leg index b54a1cb..0995958 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: 2012-05-16 08:56:08 by piumarta on emilia +# Last edited: 2013-08-16 00:14:11 by piumarta on emilia %{ # include "tree.h" @@ -115,6 +115,8 @@ class= '[' < ( !']' range )* > ']' - range= char '-' char | char char= '\\' [-abefnrtv'"\[\]\\] +| '\\' 'x'[0-9A-Fa-f][0-9A-Fa-f] +| '\\' 'x'[0-9A-Fa-f] | '\\' [0-3][0-7][0-7] | '\\' [0-7][0-7]? | !'\\' . diff --git a/src/peg.peg-c b/src/peg.peg-c index 29e991d..dd103fd 100644 --- a/src/peg.peg-c +++ b/src/peg.peg-c @@ -1,4 +1,4 @@ -/* A recursive-descent parser generated by peg 0.1.12 */ +/* A recursive-descent parser generated by peg 0.1.13 */ #include #include @@ -671,14 +671,26 @@ YY_RULE(int) yy_DOT(yycontext *yy) } YY_RULE(int) yy_Class(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "Class")); if (!yymatchChar(yy, '[')) goto l32; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l32; + yyprintf((stderr, "%s\n", "Class")); if (!yymatchChar(yy, '[')) goto l32; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l32; +#undef yytext +#undef yyleng + } l33:; { int yypos34= yy->__pos, yythunkpos34= yy->__thunkpos; { int yypos35= yy->__pos, yythunkpos35= yy->__thunkpos; if (!yymatchChar(yy, ']')) goto l35; goto l34; l35:; yy->__pos= yypos35; yy->__thunkpos= yythunkpos35; } if (!yy_Range(yy)) goto l34; goto l33; l34:; yy->__pos= yypos34; yy->__thunkpos= yythunkpos34; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l32; if (!yymatchChar(yy, ']')) goto l32; if (!yy_Spacing(yy)) goto l32; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l32; +#undef yytext +#undef yyleng + } if (!yymatchChar(yy, ']')) goto l32; if (!yy_Spacing(yy)) goto l32; yyprintf((stderr, " ok %s @ %s\n", "Class", yy->__buf+yy->__pos)); return 1; l32:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; @@ -688,22 +700,46 @@ YY_RULE(int) yy_Class(yycontext *yy) YY_RULE(int) yy_Literal(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; yyprintf((stderr, "%s\n", "Literal")); - { int yypos37= yy->__pos, yythunkpos37= 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 l38; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l38; + { int yypos37= yy->__pos, yythunkpos37= 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 l38; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l38; +#undef yytext +#undef yyleng + } l39:; { int yypos40= yy->__pos, yythunkpos40= yy->__thunkpos; { int yypos41= yy->__pos, yythunkpos41= 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; goto l40; l41:; yy->__pos= yypos41; yy->__thunkpos= yythunkpos41; } if (!yy_Char(yy)) goto l40; goto l39; l40:; yy->__pos= yypos40; yy->__thunkpos= yythunkpos40; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l38; 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 l38; if (!yy_Spacing(yy)) goto l38; goto l37; - l38:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37; 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 l36; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l36; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l38; +#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 l38; if (!yy_Spacing(yy)) goto l38; goto l37; + l38:; yy->__pos= yypos37; yy->__thunkpos= yythunkpos37; 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 l36; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l36; +#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\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 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; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l36; 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 l36; if (!yy_Spacing(yy)) goto l36; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l36; +#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 l36; if (!yy_Spacing(yy)) goto l36; } l37:; yyprintf((stderr, " ok %s @ %s\n", "Literal", yy->__buf+yy->__pos)); @@ -808,11 +844,23 @@ YY_RULE(int) yy_Suffix(yycontext *yy) } YY_RULE(int) yy_Action(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "Action")); if (!yymatchChar(yy, '{')) goto l67; yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l67; + yyprintf((stderr, "%s\n", "Action")); if (!yymatchChar(yy, '{')) goto l67; yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l67; +#undef yytext +#undef yyleng + } l68:; { int yypos69= yy->__pos, yythunkpos69= yy->__thunkpos; if (!yymatchClass(yy, (unsigned char *)"\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\337\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377")) goto l69; goto l68; l69:; yy->__pos= yypos69; yy->__thunkpos= yythunkpos69; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l67; if (!yymatchChar(yy, '}')) goto l67; if (!yy_Spacing(yy)) goto l67; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l67; +#undef yytext +#undef yyleng + } if (!yymatchChar(yy, '}')) goto l67; if (!yy_Spacing(yy)) goto l67; yyprintf((stderr, " ok %s @ %s\n", "Action", yy->__buf+yy->__pos)); return 1; l67:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; @@ -893,11 +941,23 @@ YY_RULE(int) yy_LEFTARROW(yycontext *yy) } YY_RULE(int) yy_Identifier(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "Identifier")); yyText(yy, yy->__begin, yy->__end); if (!(YY_BEGIN)) goto l86; if (!yy_IdentStart(yy)) goto l86; + yyprintf((stderr, "%s\n", "Identifier")); yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_BEGIN)) goto l86; +#undef yytext +#undef yyleng + } if (!yy_IdentStart(yy)) goto l86; l87:; { int yypos88= yy->__pos, yythunkpos88= yy->__thunkpos; if (!yy_IdentCont(yy)) goto l88; goto l87; l88:; yy->__pos= yypos88; yy->__thunkpos= yythunkpos88; - } yyText(yy, yy->__begin, yy->__end); if (!(YY_END)) goto l86; if (!yy_Spacing(yy)) goto l86; + } yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!(YY_END)) goto l86; +#undef yytext +#undef yyleng + } if (!yy_Spacing(yy)) goto l86; yyprintf((stderr, " ok %s @ %s\n", "Identifier", yy->__buf+yy->__pos)); return 1; l86:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; @@ -918,7 +978,13 @@ YY_RULE(int) yy_EndOfFile(yycontext *yy) } YY_RULE(int) yy_Definition(yycontext *yy) { int yypos0= yy->__pos, yythunkpos0= yy->__thunkpos; - yyprintf((stderr, "%s\n", "Definition")); if (!yy_Identifier(yy)) goto l91; yyDo(yy, yy_1_Definition, yy->__begin, yy->__end); if (!yy_LEFTARROW(yy)) goto l91; if (!yy_Expression(yy)) goto l91; yyDo(yy, yy_2_Definition, yy->__begin, yy->__end); yyText(yy, yy->__begin, yy->__end); if (!( YYACCEPT )) goto l91; + yyprintf((stderr, "%s\n", "Definition")); if (!yy_Identifier(yy)) goto l91; yyDo(yy, yy_1_Definition, yy->__begin, yy->__end); if (!yy_LEFTARROW(yy)) goto l91; if (!yy_Expression(yy)) goto l91; yyDo(yy, yy_2_Definition, yy->__begin, yy->__end); yyText(yy, yy->__begin, yy->__end); { +#define yytext yy->__text +#define yyleng yy->__textlen +if (!( YYACCEPT )) goto l91; +#undef yytext +#undef yyleng + } yyprintf((stderr, " ok %s @ %s\n", "Definition", yy->__buf+yy->__pos)); return 1; l91:; yy->__pos= yypos0; yy->__thunkpos= yythunkpos0; diff --git a/src/version.h b/src/version.h index 9e63949..d0aae5b 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1,3 @@ #define PEG_MAJOR 0 #define PEG_MINOR 1 -#define PEG_LEVEL 12 +#define PEG_LEVEL 13