Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bumped to 0.4.1, added error blocks to the grammar, e.g. ~{} after a …

…syntactic element is called if not matched, which allows much finer error reporting, of which nagaqueen and rock already take advantage.
  • Loading branch information...
commit 91c0b9d5b2537be6f48df2e746266da3e0170004 1 parent 6ba208b
Amos Wenger nddrylliog authored

Showing 5 changed files with 297 additions and 244 deletions. Show diff stats Hide diff stats

  1. +14 4 compile.c
  2. +256 218 greg.c
  3. +8 4 greg.g
  4. +18 18 greg.h
  5. +1 0  tree.c
18 compile.c
@@ -121,6 +121,10 @@ static void jump(int n) { fprintf(output, " goto l%d;", n); }
121 121 static void save(int n) { fprintf(output, " int yypos%d= G->pos, yythunkpos%d= G->thunkpos;", n, n); }
122 122 static void restore(int n) { fprintf(output, " G->pos= yypos%d; G->thunkpos= yythunkpos%d;", n, n); }
123 123
  124 +static void callErrBlock(Node * node) {
  125 + fprintf(output, " { YY_XTYPE YY_XVAR = (YY_XTYPE) G->data; %s; }", ((struct Any*) node)->errblock);
  126 +}
  127 +
124 128 static void Node_compile_c_ko(Node *node, int ko)
125 129 {
126 130 assert(node);
@@ -136,9 +140,15 @@ static void Node_compile_c_ko(Node *node, int ko)
136 140 break;
137 141
138 142 case Name:
139   - fprintf(output, " if (!yy_%s(G)) goto l%d;", node->name.rule->rule.name, ko);
140   - if (node->name.variable)
141   - fprintf(output, " yyDo(G, yySet, %d, 0);", node->name.variable->variable.offset);
  143 + {
  144 + fprintf(output, " if (!yy_%s(G)) {", node->name.rule->rule.name);
  145 + if(((struct Any*) node)->errblock) {
  146 + callErrBlock(node);
  147 + }
  148 + fprintf(output, " goto l%d; }", ko);
  149 + if (node->name.variable)
  150 + fprintf(output, " yyDo(G, yySet, %d, 0);", node->name.variable->variable.offset);
  151 + }
142 152 break;
143 153
144 154 case Character:
@@ -435,7 +445,7 @@ typedef struct _GREG {\n\
435 445 YY_LOCAL(int) yyrefill(GREG *G)\n\
436 446 {\n\
437 447 int yyn;\n\
438   - YY_XTYPE YY_XVAR = (YY_XTYPE)G->data;\n\
  448 + YY_XTYPE YY_XVAR = (YY_XTYPE) G->data;\n\
439 449 while (G->buflen - G->pos < 512)\n\
440 450 {\n\
441 451 G->buflen *= 2;\n\
474 greg.c
... ... @@ -1,10 +1,10 @@
1   -/* A recursive-descent parser generated by greg 0.2.0 */
  1 +/* A recursive-descent parser generated by greg 0.4.1 */
2 2
3 3 #include <stdio.h>
4 4 #include <stdlib.h>
5 5 #include <string.h>
6 6 struct _GREG;
7   -#define YYRULECOUNT 36
  7 +#define YYRULECOUNT 37
8 8
9 9 # include "greg.h"
10 10
@@ -59,72 +59,85 @@ struct _GREG;
59 59 #define YY_FREE free
60 60 #endif
61 61 #ifndef YY_LOCAL
62   -#define YY_LOCAL(T) static T
  62 +#define YY_LOCAL(T) static T
63 63 #endif
64 64 #ifndef YY_ACTION
65   -#define YY_ACTION(T) static T
  65 +#define YY_ACTION(T) static T
66 66 #endif
67 67 #ifndef YY_RULE
68   -#define YY_RULE(T) static T
  68 +#define YY_RULE(T) static T
69 69 #endif
70 70 #ifndef YY_PARSE
71   -#define YY_PARSE(T) T
  71 +#define YY_PARSE(T) T
72 72 #endif
73 73 #ifndef YY_NAME
74 74 #define YY_NAME(N) yy##N
75 75 #endif
76 76 #ifndef YY_INPUT
77   -#define YY_INPUT(buf, result, max_size) \
78   - { \
79   - int yyc= getchar(); \
80   - result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \
81   - yyprintf((stderr, "<%c>", yyc)); \
  77 +#define YY_INPUT(buf, result, max_size) \
  78 + { \
  79 + int yyc= getchar(); \
  80 + result= (EOF == yyc) ? 0 : (*(buf)= yyc, 1); \
  81 + yyprintf((stderr, "<%c>", yyc)); \
82 82 }
83 83 #endif
84 84 #ifndef YY_BEGIN
85   -#define YY_BEGIN ( G->begin= G->pos, 1)
  85 +#define YY_BEGIN ( G->begin= G->pos, 1)
86 86 #endif
87 87 #ifndef YY_END
88   -#define YY_END ( G->end= G->pos, 1)
  88 +#define YY_END ( G->end= G->pos, 1)
89 89 #endif
90 90 #ifdef YY_DEBUG
91   -# define yyprintf(args) fprintf args
  91 +# define yyprintf(args) fprintf args
92 92 #else
93 93 # define yyprintf(args)
94 94 #endif
95 95 #ifndef YYSTYPE
96   -#define YYSTYPE int
  96 +#define YYSTYPE int
  97 +#endif
  98 +#ifndef YY_XTYPE
  99 +#define YY_XTYPE void *
  100 +#endif
  101 +#ifndef YY_XVAR
  102 +#define YY_XVAR yyxvar
  103 +#endif
  104 +
  105 +#ifndef YY_STACK_SIZE
  106 +#define YY_STACK_SIZE 128
97 107 #endif
98 108
99 109 #ifndef YY_PART
100 110 #define yydata G->data
101 111 #define yy G->ss
102 112
103   -typedef void (*yyaction)(struct _GREG *G, char *yytext, int yyleng);
  113 +struct _yythunk; // forward declaration
  114 +typedef void (*yyaction)(struct _GREG *G, char *yytext, int yyleng, struct _yythunk *thunkpos, YY_XTYPE YY_XVAR);
104 115 typedef struct _yythunk { int begin, end; yyaction action; struct _yythunk *next; } yythunk;
105 116
106 117 typedef struct _GREG {
107 118 char *buf;
108 119 int buflen;
109   - int pos;
110   - int limit;
  120 + int offset;
  121 + int pos;
  122 + int limit;
111 123 char *text;
112   - int textlen;
113   - int begin;
114   - int end;
  124 + int textlen;
  125 + int begin;
  126 + int end;
115 127 yythunk *thunks;
116   - int thunkslen;
  128 + int thunkslen;
117 129 int thunkpos;
118 130 YYSTYPE ss;
119 131 YYSTYPE *val;
120 132 YYSTYPE *vals;
121 133 int valslen;
122   - void *data;
  134 + YY_XTYPE data;
123 135 } GREG;
124 136
125 137 YY_LOCAL(int) yyrefill(GREG *G)
126 138 {
127 139 int yyn;
  140 + YY_XTYPE YY_XVAR = (YY_XTYPE) G->data;
128 141 while (G->buflen - G->pos < 512)
129 142 {
130 143 G->buflen *= 2;
@@ -209,10 +222,10 @@ YY_LOCAL(int) yyText(GREG *G, int begin, int end)
209 222 else
210 223 {
211 224 while (G->textlen < (yyleng - 1))
212   - {
213   - G->textlen *= 2;
214   - G->text= YY_REALLOC(G->text, G->textlen, G->data);
215   - }
  225 + {
  226 + G->textlen *= 2;
  227 + G->text= YY_REALLOC(G->text, G->textlen, G->data);
  228 + }
216 229 memcpy(G->text, G->buf + begin, yyleng);
217 230 }
218 231 G->text[yyleng]= '\0';
@@ -222,12 +235,12 @@ YY_LOCAL(int) yyText(GREG *G, int begin, int end)
222 235 YY_LOCAL(void) yyDone(GREG *G)
223 236 {
224 237 int pos;
225   - for (pos= 0; pos < G->thunkpos; ++pos)
  238 + for (pos= 0; pos < G->thunkpos; ++pos)
226 239 {
227 240 yythunk *thunk= &G->thunks[pos];
228 241 int yyleng= thunk->end ? yyText(G, thunk->begin, thunk->end) : thunk->begin;
229 242 yyprintf((stderr, "DO [%d] %p %s\n", pos, thunk->action, G->text));
230   - thunk->action(G, G->text, yyleng);
  243 + thunk->action(G, G->text, yyleng, thunk, G->data);
231 244 }
232 245 G->thunkpos= 0;
233 246 }
@@ -238,6 +251,7 @@ YY_LOCAL(void) yyCommit(GREG *G)
238 251 {
239 252 memmove(G->buf, G->buf + G->pos, G->limit);
240 253 }
  254 + G->offset += G->pos;
241 255 G->begin -= G->pos;
242 256 G->end -= G->pos;
243 257 G->pos= G->thunkpos= 0;
@@ -258,20 +272,21 @@ YY_LOCAL(int) yyAccept(GREG *G, int tp0)
258 272 return 1;
259 273 }
260 274
261   -YY_LOCAL(void) yyPush(GREG *G, char *text, int count) { G->val += count; }
262   -YY_LOCAL(void) yyPop(GREG *G, char *text, int count) { G->val -= count; }
263   -YY_LOCAL(void) yySet(GREG *G, char *text, int count) { G->val[count]= G->ss; }
  275 +YY_LOCAL(void) yyPush(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) { G->val += count; }
  276 +YY_LOCAL(void) yyPop(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) { G->val -= count; }
  277 +YY_LOCAL(void) yySet(GREG *G, char *text, int count, yythunk *thunk, YY_XTYPE YY_XVAR) { G->val[count]= G->ss; }
264 278
265 279 #endif /* YY_PART */
266 280
267   -#define YYACCEPT yyAccept(G, yythunkpos0)
  281 +#define YYACCEPT yyAccept(G, yythunkpos0)
268 282
269   -YY_RULE(int) yy_end_of_line(GREG *G); /* 36 */
270   -YY_RULE(int) yy_comment(GREG *G); /* 35 */
271   -YY_RULE(int) yy_space(GREG *G); /* 34 */
272   -YY_RULE(int) yy_braces(GREG *G); /* 33 */
273   -YY_RULE(int) yy_range(GREG *G); /* 32 */
274   -YY_RULE(int) yy_char(GREG *G); /* 31 */
  283 +YY_RULE(int) yy_end_of_line(GREG *G); /* 37 */
  284 +YY_RULE(int) yy_comment(GREG *G); /* 36 */
  285 +YY_RULE(int) yy_space(GREG *G); /* 35 */
  286 +YY_RULE(int) yy_braces(GREG *G); /* 34 */
  287 +YY_RULE(int) yy_range(GREG *G); /* 33 */
  288 +YY_RULE(int) yy_char(GREG *G); /* 32 */
  289 +YY_RULE(int) yy_errblock(GREG *G); /* 31 */
275 290 YY_RULE(int) yy_END(GREG *G); /* 30 */
276 291 YY_RULE(int) yy_BEGIN(GREG *G); /* 29 */
277 292 YY_RULE(int) yy_DOT(GREG *G); /* 28 */
@@ -303,108 +318,113 @@ YY_RULE(int) yy_declaration(GREG *G); /* 3 */
303 318 YY_RULE(int) yy__(GREG *G); /* 2 */
304 319 YY_RULE(int) yy_grammar(GREG *G); /* 1 */
305 320
306   -YY_ACTION(void) yy_9_primary(GREG *G, char *yytext, int yyleng)
  321 +YY_ACTION(void) yy_10_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
  322 +{
  323 + yyprintf((stderr, "do yy_10_primary\n"));
  324 + Node *node = pop(); ((struct Any *) node)->errblock = strdup(yytext); push(node); ;
  325 +}
  326 +YY_ACTION(void) yy_9_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
307 327 {
308 328 yyprintf((stderr, "do yy_9_primary\n"));
309 329 push(makePredicate("YY_END")); ;
310 330 }
311   -YY_ACTION(void) yy_8_primary(GREG *G, char *yytext, int yyleng)
  331 +YY_ACTION(void) yy_8_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
312 332 {
313 333 yyprintf((stderr, "do yy_8_primary\n"));
314 334 push(makePredicate("YY_BEGIN")); ;
315 335 }
316   -YY_ACTION(void) yy_7_primary(GREG *G, char *yytext, int yyleng)
  336 +YY_ACTION(void) yy_7_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
317 337 {
318 338 yyprintf((stderr, "do yy_7_primary\n"));
319 339 push(makeAction(yytext)); ;
320 340 }
321   -YY_ACTION(void) yy_6_primary(GREG *G, char *yytext, int yyleng)
  341 +YY_ACTION(void) yy_6_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
322 342 {
323 343 yyprintf((stderr, "do yy_6_primary\n"));
324 344 push(makeDot()); ;
325 345 }
326   -YY_ACTION(void) yy_5_primary(GREG *G, char *yytext, int yyleng)
  346 +YY_ACTION(void) yy_5_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
327 347 {
328 348 yyprintf((stderr, "do yy_5_primary\n"));
329 349 push(makeClass(yytext)); ;
330 350 }
331   -YY_ACTION(void) yy_4_primary(GREG *G, char *yytext, int yyleng)
  351 +YY_ACTION(void) yy_4_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
332 352 {
333 353 yyprintf((stderr, "do yy_4_primary\n"));
334 354 push(makeString(yytext)); ;
335 355 }
336   -YY_ACTION(void) yy_3_primary(GREG *G, char *yytext, int yyleng)
  356 +YY_ACTION(void) yy_3_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
337 357 {
338 358 yyprintf((stderr, "do yy_3_primary\n"));
339 359 push(makeName(findRule(yytext))); ;
340 360 }
341   -YY_ACTION(void) yy_2_primary(GREG *G, char *yytext, int yyleng)
  361 +YY_ACTION(void) yy_2_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
342 362 {
343 363 yyprintf((stderr, "do yy_2_primary\n"));
344 364 Node *name= makeName(findRule(yytext)); name->name.variable= pop(); push(name); ;
345 365 }
346   -YY_ACTION(void) yy_1_primary(GREG *G, char *yytext, int yyleng)
  366 +YY_ACTION(void) yy_1_primary(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
347 367 {
348 368 yyprintf((stderr, "do yy_1_primary\n"));
349 369 push(makeVariable(yytext)); ;
350 370 }
351   -YY_ACTION(void) yy_3_suffix(GREG *G, char *yytext, int yyleng)
  371 +YY_ACTION(void) yy_3_suffix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
352 372 {
353 373 yyprintf((stderr, "do yy_3_suffix\n"));
354 374 push(makePlus (pop())); ;
355 375 }
356   -YY_ACTION(void) yy_2_suffix(GREG *G, char *yytext, int yyleng)
  376 +YY_ACTION(void) yy_2_suffix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
357 377 {
358 378 yyprintf((stderr, "do yy_2_suffix\n"));
359 379 push(makeStar (pop())); ;
360 380 }
361   -YY_ACTION(void) yy_1_suffix(GREG *G, char *yytext, int yyleng)
  381 +YY_ACTION(void) yy_1_suffix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
362 382 {
363 383 yyprintf((stderr, "do yy_1_suffix\n"));
364 384 push(makeQuery(pop())); ;
365 385 }
366   -YY_ACTION(void) yy_3_prefix(GREG *G, char *yytext, int yyleng)
  386 +YY_ACTION(void) yy_3_prefix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
367 387 {
368 388 yyprintf((stderr, "do yy_3_prefix\n"));
369 389 push(makePeekNot(pop())); ;
370 390 }
371   -YY_ACTION(void) yy_2_prefix(GREG *G, char *yytext, int yyleng)
  391 +YY_ACTION(void) yy_2_prefix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
372 392 {
373 393 yyprintf((stderr, "do yy_2_prefix\n"));
374 394 push(makePeekFor(pop())); ;
375 395 }
376   -YY_ACTION(void) yy_1_prefix(GREG *G, char *yytext, int yyleng)
  396 +YY_ACTION(void) yy_1_prefix(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
377 397 {
378 398 yyprintf((stderr, "do yy_1_prefix\n"));
379 399 push(makePredicate(yytext)); ;
380 400 }
381   -YY_ACTION(void) yy_1_sequence(GREG *G, char *yytext, int yyleng)
  401 +YY_ACTION(void) yy_1_sequence(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
382 402 {
383 403 yyprintf((stderr, "do yy_1_sequence\n"));
384 404 Node *f= pop(); push(Sequence_append(pop(), f)); ;
385 405 }
386   -YY_ACTION(void) yy_1_expression(GREG *G, char *yytext, int yyleng)
  406 +YY_ACTION(void) yy_1_expression(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
387 407 {
388 408 yyprintf((stderr, "do yy_1_expression\n"));
389 409 Node *f= pop(); push(Alternate_append(pop(), f)); ;
390 410 }
391   -YY_ACTION(void) yy_2_definition(GREG *G, char *yytext, int yyleng)
  411 +YY_ACTION(void) yy_2_definition(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
392 412 {
393 413 yyprintf((stderr, "do yy_2_definition\n"));
394 414 Node *e= pop(); Rule_setExpression(pop(), e); ;
395 415 }
396   -YY_ACTION(void) yy_1_definition(GREG *G, char *yytext, int yyleng)
  416 +YY_ACTION(void) yy_1_definition(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
397 417 {
398 418 yyprintf((stderr, "do yy_1_definition\n"));
399 419 if (push(beginRule(findRule(yytext)))->rule.expression)
400 420 fprintf(stderr, "rule '%s' redefined\n", yytext); ;
401 421 }
402   -YY_ACTION(void) yy_1_trailer(GREG *G, char *yytext, int yyleng)
  422 +YY_ACTION(void) yy_1_trailer(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
403 423 {
404 424 yyprintf((stderr, "do yy_1_trailer\n"));
405 425 makeTrailer(yytext); ;
406 426 }
407   -YY_ACTION(void) yy_1_declaration(GREG *G, char *yytext, int yyleng)
  427 +YY_ACTION(void) yy_1_declaration(GREG *G, char *yytext, int yyleng, yythunk *thunk, YY_XTYPE YY_XVAR)
408 428 {
409 429 yyprintf((stderr, "do yy_1_declaration\n"));
410 430 makeHeader(yytext); ;
@@ -429,11 +449,11 @@ YY_RULE(int) yy_comment(GREG *G)
429 449 yyprintf((stderr, "%s\n", "comment")); if (!yymatchChar(G, '#')) goto l5;
430 450 l6:;
431 451 { int yypos7= G->pos, yythunkpos7= G->thunkpos;
432   - { int yypos8= G->pos, yythunkpos8= G->thunkpos; if (!yy_end_of_line(G)) goto l8; goto l7;
  452 + { int yypos8= G->pos, yythunkpos8= G->thunkpos; if (!yy_end_of_line(G)) { goto l8; } goto l7;
433 453 l8:; G->pos= yypos8; G->thunkpos= yythunkpos8;
434 454 } if (!yymatchDot(G)) goto l7; goto l6;
435 455 l7:; G->pos= yypos7; G->thunkpos= yythunkpos7;
436   - } if (!yy_end_of_line(G)) goto l5;
  456 + } if (!yy_end_of_line(G)) { goto l5; }
437 457 yyprintf((stderr, " ok %s @ %s\n", "comment", G->buf+G->pos));
438 458 return 1;
439 459 l5:; G->pos= yypos0; G->thunkpos= yythunkpos0;
@@ -445,7 +465,7 @@ YY_RULE(int) yy_space(GREG *G)
445 465 yyprintf((stderr, "%s\n", "space"));
446 466 { int yypos10= G->pos, yythunkpos10= G->thunkpos; if (!yymatchChar(G, ' ')) goto l11; goto l10;
447 467 l11:; G->pos= yypos10; G->thunkpos= yythunkpos10; if (!yymatchChar(G, '\t')) goto l12; goto l10;
448   - l12:; G->pos= yypos10; G->thunkpos= yythunkpos10; if (!yy_end_of_line(G)) goto l9;
  468 + l12:; G->pos= yypos10; G->thunkpos= yythunkpos10; if (!yy_end_of_line(G)) { goto l9; }
449 469 }
450 470 l10:;
451 471 yyprintf((stderr, " ok %s @ %s\n", "space", G->buf+G->pos));
@@ -480,8 +500,8 @@ YY_RULE(int) yy_braces(GREG *G)
480 500 YY_RULE(int) yy_range(GREG *G)
481 501 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
482 502 yyprintf((stderr, "%s\n", "range"));
483   - { int yypos21= G->pos, yythunkpos21= G->thunkpos; if (!yy_char(G)) goto l22; if (!yymatchChar(G, '-')) goto l22; if (!yy_char(G)) goto l22; goto l21;
484   - l22:; G->pos= yypos21; G->thunkpos= yythunkpos21; if (!yy_char(G)) goto l20;
  503 + { int yypos21= G->pos, yythunkpos21= G->thunkpos; if (!yy_char(G)) { goto l22; } if (!yymatchChar(G, '-')) goto l22; if (!yy_char(G)) { goto l22; } goto l21;
  504 + l22:; G->pos= yypos21; G->thunkpos= yythunkpos21; if (!yy_char(G)) { goto l20; }
485 505 }
486 506 l21:;
487 507 yyprintf((stderr, " ok %s @ %s\n", "range", G->buf+G->pos));
@@ -512,385 +532,402 @@ YY_RULE(int) yy_char(GREG *G)
512 532 yyprintf((stderr, " fail %s @ %s\n", "char", G->buf+G->pos));
513 533 return 0;
514 534 }
  535 +YY_RULE(int) yy_errblock(GREG *G)
  536 +{ int yypos0= G->pos, yythunkpos0= G->thunkpos;
  537 + yyprintf((stderr, "%s\n", "errblock")); if (!yymatchString(G, "~{")) goto l31; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l31;
  538 + l32:;
  539 + { int yypos33= G->pos, yythunkpos33= G->thunkpos; if (!yy_braces(G)) { goto l33; } goto l32;
  540 + l33:; G->pos= yypos33; G->thunkpos= yythunkpos33;
  541 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l31; if (!yymatchChar(G, '}')) goto l31; if (!yy__(G)) { goto l31; }
  542 + yyprintf((stderr, " ok %s @ %s\n", "errblock", G->buf+G->pos));
  543 + return 1;
  544 + l31:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  545 + yyprintf((stderr, " fail %s @ %s\n", "errblock", G->buf+G->pos));
  546 + return 0;
  547 +}
515 548 YY_RULE(int) yy_END(GREG *G)
516 549 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
517   - yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(G, '>')) goto l31; if (!yy__(G)) goto l31;
  550 + yyprintf((stderr, "%s\n", "END")); if (!yymatchChar(G, '>')) goto l34; if (!yy__(G)) { goto l34; }
518 551 yyprintf((stderr, " ok %s @ %s\n", "END", G->buf+G->pos));
519 552 return 1;
520   - l31:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  553 + l34:; G->pos= yypos0; G->thunkpos= yythunkpos0;
521 554 yyprintf((stderr, " fail %s @ %s\n", "END", G->buf+G->pos));
522 555 return 0;
523 556 }
524 557 YY_RULE(int) yy_BEGIN(GREG *G)
525 558 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
526   - yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(G, '<')) goto l32; if (!yy__(G)) goto l32;
  559 + yyprintf((stderr, "%s\n", "BEGIN")); if (!yymatchChar(G, '<')) goto l35; if (!yy__(G)) { goto l35; }
527 560 yyprintf((stderr, " ok %s @ %s\n", "BEGIN", G->buf+G->pos));
528 561 return 1;
529   - l32:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  562 + l35:; G->pos= yypos0; G->thunkpos= yythunkpos0;
530 563 yyprintf((stderr, " fail %s @ %s\n", "BEGIN", G->buf+G->pos));
531 564 return 0;
532 565 }
533 566 YY_RULE(int) yy_DOT(GREG *G)
534 567 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
535   - yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(G, '.')) goto l33; if (!yy__(G)) goto l33;
  568 + yyprintf((stderr, "%s\n", "DOT")); if (!yymatchChar(G, '.')) goto l36; if (!yy__(G)) { goto l36; }
536 569 yyprintf((stderr, " ok %s @ %s\n", "DOT", G->buf+G->pos));
537 570 return 1;
538   - l33:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  571 + l36:; G->pos= yypos0; G->thunkpos= yythunkpos0;
539 572 yyprintf((stderr, " fail %s @ %s\n", "DOT", G->buf+G->pos));
540 573 return 0;
541 574 }
542 575 YY_RULE(int) yy_class(GREG *G)
543 576 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
544   - yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(G, '[')) goto l34; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l34;
545   - l35:;
546   - { int yypos36= G->pos, yythunkpos36= G->thunkpos;
547   - { int yypos37= G->pos, yythunkpos37= G->thunkpos; if (!yymatchChar(G, ']')) goto l37; goto l36;
548   - l37:; G->pos= yypos37; G->thunkpos= yythunkpos37;
549   - } if (!yy_range(G)) goto l36; goto l35;
550   - l36:; G->pos= yypos36; G->thunkpos= yythunkpos36;
551   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l34; if (!yymatchChar(G, ']')) goto l34; if (!yy__(G)) goto l34;
  577 + yyprintf((stderr, "%s\n", "class")); if (!yymatchChar(G, '[')) goto l37; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l37;
  578 + l38:;
  579 + { int yypos39= G->pos, yythunkpos39= G->thunkpos;
  580 + { int yypos40= G->pos, yythunkpos40= G->thunkpos; if (!yymatchChar(G, ']')) goto l40; goto l39;
  581 + l40:; G->pos= yypos40; G->thunkpos= yythunkpos40;
  582 + } if (!yy_range(G)) { goto l39; } goto l38;
  583 + l39:; G->pos= yypos39; G->thunkpos= yythunkpos39;
  584 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l37; if (!yymatchChar(G, ']')) goto l37; if (!yy__(G)) { goto l37; }
552 585 yyprintf((stderr, " ok %s @ %s\n", "class", G->buf+G->pos));
553 586 return 1;
554   - l34:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  587 + l37:; G->pos= yypos0; G->thunkpos= yythunkpos0;
555 588 yyprintf((stderr, " fail %s @ %s\n", "class", G->buf+G->pos));
556 589 return 0;
557 590 }
558 591 YY_RULE(int) yy_literal(GREG *G)
559 592 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
560 593 yyprintf((stderr, "%s\n", "literal"));
561   - { int yypos39= G->pos, yythunkpos39= G->thunkpos; if (!yymatchClass(G, (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 l40; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l40;
562   - l41:;
563   - { int yypos42= G->pos, yythunkpos42= G->thunkpos;
564   - { int yypos43= G->pos, yythunkpos43= G->thunkpos; if (!yymatchClass(G, (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 l43; goto l42;
565   - l43:; G->pos= yypos43; G->thunkpos= yythunkpos43;
566   - } if (!yy_char(G)) goto l42; goto l41;
567   - l42:; G->pos= yypos42; G->thunkpos= yythunkpos42;
568   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l40; if (!yymatchClass(G, (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 l40; if (!yy__(G)) goto l40; goto l39;
569   - l40:; G->pos= yypos39; G->thunkpos= yythunkpos39; if (!yymatchClass(G, (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 l38; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l38;
  594 + { int yypos42= G->pos, yythunkpos42= G->thunkpos; if (!yymatchClass(G, (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 l43; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l43;
570 595 l44:;
571 596 { int yypos45= G->pos, yythunkpos45= G->thunkpos;
572   - { int yypos46= G->pos, yythunkpos46= G->thunkpos; if (!yymatchClass(G, (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 l46; goto l45;
  597 + { int yypos46= G->pos, yythunkpos46= G->thunkpos; if (!yymatchClass(G, (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 l46; goto l45;
573 598 l46:; G->pos= yypos46; G->thunkpos= yythunkpos46;
574   - } if (!yy_char(G)) goto l45; goto l44;
  599 + } if (!yy_char(G)) { goto l45; } goto l44;
575 600 l45:; G->pos= yypos45; G->thunkpos= yythunkpos45;
576   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l38; if (!yymatchClass(G, (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 l38; if (!yy__(G)) goto l38;
  601 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l43; if (!yymatchClass(G, (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 l43; if (!yy__(G)) { goto l43; } goto l42;
  602 + l43:; G->pos= yypos42; G->thunkpos= yythunkpos42; if (!yymatchClass(G, (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 l41; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l41;
  603 + l47:;
  604 + { int yypos48= G->pos, yythunkpos48= G->thunkpos;
  605 + { int yypos49= G->pos, yythunkpos49= G->thunkpos; if (!yymatchClass(G, (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 l49; goto l48;
  606 + l49:; G->pos= yypos49; G->thunkpos= yythunkpos49;
  607 + } if (!yy_char(G)) { goto l48; } goto l47;
  608 + l48:; G->pos= yypos48; G->thunkpos= yythunkpos48;
  609 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l41; if (!yymatchClass(G, (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 l41; if (!yy__(G)) { goto l41; }
577 610 }
578   - l39:;
  611 + l42:;
579 612 yyprintf((stderr, " ok %s @ %s\n", "literal", G->buf+G->pos));
580 613 return 1;
581   - l38:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  614 + l41:; G->pos= yypos0; G->thunkpos= yythunkpos0;
582 615 yyprintf((stderr, " fail %s @ %s\n", "literal", G->buf+G->pos));
583 616 return 0;
584 617 }
585 618 YY_RULE(int) yy_CLOSE(GREG *G)
586 619 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
587   - yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(G, ')')) goto l47; if (!yy__(G)) goto l47;
  620 + yyprintf((stderr, "%s\n", "CLOSE")); if (!yymatchChar(G, ')')) goto l50; if (!yy__(G)) { goto l50; }
588 621 yyprintf((stderr, " ok %s @ %s\n", "CLOSE", G->buf+G->pos));
589 622 return 1;
590   - l47:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  623 + l50:; G->pos= yypos0; G->thunkpos= yythunkpos0;
591 624 yyprintf((stderr, " fail %s @ %s\n", "CLOSE", G->buf+G->pos));
592 625 return 0;
593 626 }
594 627 YY_RULE(int) yy_OPEN(GREG *G)
595 628 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
596   - yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(G, '(')) goto l48; if (!yy__(G)) goto l48;
  629 + yyprintf((stderr, "%s\n", "OPEN")); if (!yymatchChar(G, '(')) goto l51; if (!yy__(G)) { goto l51; }
597 630 yyprintf((stderr, " ok %s @ %s\n", "OPEN", G->buf+G->pos));
598 631 return 1;
599   - l48:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  632 + l51:; G->pos= yypos0; G->thunkpos= yythunkpos0;
600 633 yyprintf((stderr, " fail %s @ %s\n", "OPEN", G->buf+G->pos));
601 634 return 0;
602 635 }
603 636 YY_RULE(int) yy_COLON(GREG *G)
604 637 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
605   - yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(G, ':')) goto l49; if (!yy__(G)) goto l49;
  638 + yyprintf((stderr, "%s\n", "COLON")); if (!yymatchChar(G, ':')) goto l52; if (!yy__(G)) { goto l52; }
606 639 yyprintf((stderr, " ok %s @ %s\n", "COLON", G->buf+G->pos));
607 640 return 1;
608   - l49:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  641 + l52:; G->pos= yypos0; G->thunkpos= yythunkpos0;
609 642 yyprintf((stderr, " fail %s @ %s\n", "COLON", G->buf+G->pos));
610 643 return 0;
611 644 }
612 645 YY_RULE(int) yy_PLUS(GREG *G)
613 646 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
614   - yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(G, '+')) goto l50; if (!yy__(G)) goto l50;
  647 + yyprintf((stderr, "%s\n", "PLUS")); if (!yymatchChar(G, '+')) goto l53; if (!yy__(G)) { goto l53; }
615 648 yyprintf((stderr, " ok %s @ %s\n", "PLUS", G->buf+G->pos));
616 649 return 1;
617   - l50:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  650 + l53:; G->pos= yypos0; G->thunkpos= yythunkpos0;
618 651 yyprintf((stderr, " fail %s @ %s\n", "PLUS", G->buf+G->pos));
619 652 return 0;
620 653 }
621 654 YY_RULE(int) yy_STAR(GREG *G)
622 655 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
623   - yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(G, '*')) goto l51; if (!yy__(G)) goto l51;
  656 + yyprintf((stderr, "%s\n", "STAR")); if (!yymatchChar(G, '*')) goto l54; if (!yy__(G)) { goto l54; }
624 657 yyprintf((stderr, " ok %s @ %s\n", "STAR", G->buf+G->pos));
625 658 return 1;
626   - l51:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  659 + l54:; G->pos= yypos0; G->thunkpos= yythunkpos0;
627 660 yyprintf((stderr, " fail %s @ %s\n", "STAR", G->buf+G->pos));
628 661 return 0;
629 662 }
630 663 YY_RULE(int) yy_QUESTION(GREG *G)
631 664 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
632   - yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(G, '?')) goto l52; if (!yy__(G)) goto l52;
  665 + yyprintf((stderr, "%s\n", "QUESTION")); if (!yymatchChar(G, '?')) goto l55; if (!yy__(G)) { goto l55; }
633 666 yyprintf((stderr, " ok %s @ %s\n", "QUESTION", G->buf+G->pos));
634 667 return 1;
635   - l52:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  668 + l55:; G->pos= yypos0; G->thunkpos= yythunkpos0;
636 669 yyprintf((stderr, " fail %s @ %s\n", "QUESTION", G->buf+G->pos));
637 670 return 0;
638 671 }
639 672 YY_RULE(int) yy_primary(GREG *G)
640 673 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
641 674 yyprintf((stderr, "%s\n", "primary"));
642   - { int yypos54= G->pos, yythunkpos54= G->thunkpos; if (!yy_identifier(G)) goto l55; yyDo(G, yy_1_primary, G->begin, G->end); if (!yy_COLON(G)) goto l55; if (!yy_identifier(G)) goto l55;
643   - { int yypos56= G->pos, yythunkpos56= G->thunkpos; if (!yy_EQUAL(G)) goto l56; goto l55;
644   - l56:; G->pos= yypos56; G->thunkpos= yythunkpos56;
645   - } yyDo(G, yy_2_primary, G->begin, G->end); goto l54;
646   - l55:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_identifier(G)) goto l57;
647   - { int yypos58= G->pos, yythunkpos58= G->thunkpos; if (!yy_EQUAL(G)) goto l58; goto l57;
648   - l58:; G->pos= yypos58; G->thunkpos= yythunkpos58;
649   - } yyDo(G, yy_3_primary, G->begin, G->end); goto l54;
650   - l57:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_OPEN(G)) goto l59; if (!yy_expression(G)) goto l59; if (!yy_CLOSE(G)) goto l59; goto l54;
651   - l59:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_literal(G)) goto l60; yyDo(G, yy_4_primary, G->begin, G->end); goto l54;
652   - l60:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_class(G)) goto l61; yyDo(G, yy_5_primary, G->begin, G->end); goto l54;
653   - l61:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_DOT(G)) goto l62; yyDo(G, yy_6_primary, G->begin, G->end); goto l54;
654   - l62:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_action(G)) goto l63; yyDo(G, yy_7_primary, G->begin, G->end); goto l54;
655   - l63:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_BEGIN(G)) goto l64; yyDo(G, yy_8_primary, G->begin, G->end); goto l54;
656   - l64:; G->pos= yypos54; G->thunkpos= yythunkpos54; if (!yy_END(G)) goto l53; yyDo(G, yy_9_primary, G->begin, G->end);
  675 + { int yypos57= G->pos, yythunkpos57= G->thunkpos; if (!yy_identifier(G)) { goto l58; } yyDo(G, yy_1_primary, G->begin, G->end); if (!yy_COLON(G)) { goto l58; } if (!yy_identifier(G)) { goto l58; }
  676 + { int yypos59= G->pos, yythunkpos59= G->thunkpos; if (!yy_EQUAL(G)) { goto l59; } goto l58;
  677 + l59:; G->pos= yypos59; G->thunkpos= yythunkpos59;
  678 + } yyDo(G, yy_2_primary, G->begin, G->end); goto l57;
  679 + l58:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_identifier(G)) { goto l60; }
  680 + { int yypos61= G->pos, yythunkpos61= G->thunkpos; if (!yy_EQUAL(G)) { goto l61; } goto l60;
  681 + l61:; G->pos= yypos61; G->thunkpos= yythunkpos61;
  682 + } yyDo(G, yy_3_primary, G->begin, G->end); goto l57;
  683 + l60:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_OPEN(G)) { goto l62; } if (!yy_expression(G)) { goto l62; } if (!yy_CLOSE(G)) { goto l62; } goto l57;
  684 + l62:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_literal(G)) { goto l63; } yyDo(G, yy_4_primary, G->begin, G->end); goto l57;
  685 + l63:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_class(G)) { goto l64; } yyDo(G, yy_5_primary, G->begin, G->end); goto l57;
  686 + l64:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_DOT(G)) { goto l65; } yyDo(G, yy_6_primary, G->begin, G->end); goto l57;
  687 + l65:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_action(G)) { goto l66; } yyDo(G, yy_7_primary, G->begin, G->end); goto l57;
  688 + l66:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_BEGIN(G)) { goto l67; } yyDo(G, yy_8_primary, G->begin, G->end); goto l57;
  689 + l67:; G->pos= yypos57; G->thunkpos= yythunkpos57; if (!yy_END(G)) { goto l56; } yyDo(G, yy_9_primary, G->begin, G->end);
  690 + }
  691 + l57:;
  692 + { int yypos68= G->pos, yythunkpos68= G->thunkpos; if (!yy_errblock(G)) { goto l68; } yyDo(G, yy_10_primary, G->begin, G->end); goto l69;
  693 + l68:; G->pos= yypos68; G->thunkpos= yythunkpos68;
657 694 }
658   - l54:;
  695 + l69:;
659 696 yyprintf((stderr, " ok %s @ %s\n", "primary", G->buf+G->pos));
660 697 return 1;
661   - l53:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  698 + l56:; G->pos= yypos0; G->thunkpos= yythunkpos0;
662 699 yyprintf((stderr, " fail %s @ %s\n", "primary", G->buf+G->pos));
663 700 return 0;
664 701 }
665 702 YY_RULE(int) yy_NOT(GREG *G)
666 703 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
667   - yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(G, '!')) goto l65; if (!yy__(G)) goto l65;
  704 + yyprintf((stderr, "%s\n", "NOT")); if (!yymatchChar(G, '!')) goto l70; if (!yy__(G)) { goto l70; }
668 705 yyprintf((stderr, " ok %s @ %s\n", "NOT", G->buf+G->pos));
669 706 return 1;
670   - l65:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  707 + l70:; G->pos= yypos0; G->thunkpos= yythunkpos0;
671 708 yyprintf((stderr, " fail %s @ %s\n", "NOT", G->buf+G->pos));
672 709 return 0;
673 710 }
674 711 YY_RULE(int) yy_suffix(GREG *G)
675 712 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
676   - yyprintf((stderr, "%s\n", "suffix")); if (!yy_primary(G)) goto l66;
677   - { int yypos67= G->pos, yythunkpos67= G->thunkpos;
678   - { int yypos69= G->pos, yythunkpos69= G->thunkpos; if (!yy_QUESTION(G)) goto l70; yyDo(G, yy_1_suffix, G->begin, G->end); goto l69;
679   - l70:; G->pos= yypos69; G->thunkpos= yythunkpos69; if (!yy_STAR(G)) goto l71; yyDo(G, yy_2_suffix, G->begin, G->end); goto l69;
680   - l71:; G->pos= yypos69; G->thunkpos= yythunkpos69; if (!yy_PLUS(G)) goto l67; yyDo(G, yy_3_suffix, G->begin, G->end);
  713 + yyprintf((stderr, "%s\n", "suffix")); if (!yy_primary(G)) { goto l71; }
  714 + { int yypos72= G->pos, yythunkpos72= G->thunkpos;
  715 + { int yypos74= G->pos, yythunkpos74= G->thunkpos; if (!yy_QUESTION(G)) { goto l75; } yyDo(G, yy_1_suffix, G->begin, G->end); goto l74;
  716 + l75:; G->pos= yypos74; G->thunkpos= yythunkpos74; if (!yy_STAR(G)) { goto l76; } yyDo(G, yy_2_suffix, G->begin, G->end); goto l74;
  717 + l76:; G->pos= yypos74; G->thunkpos= yythunkpos74; if (!yy_PLUS(G)) { goto l72; } yyDo(G, yy_3_suffix, G->begin, G->end);
681 718 }
682   - l69:; goto l68;
683   - l67:; G->pos= yypos67; G->thunkpos= yythunkpos67;
  719 + l74:; goto l73;
  720 + l72:; G->pos= yypos72; G->thunkpos= yythunkpos72;
684 721 }
685   - l68:;
  722 + l73:;
686 723 yyprintf((stderr, " ok %s @ %s\n", "suffix", G->buf+G->pos));
687 724 return 1;
688   - l66:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  725 + l71:; G->pos= yypos0; G->thunkpos= yythunkpos0;
689 726 yyprintf((stderr, " fail %s @ %s\n", "suffix", G->buf+G->pos));
690 727 return 0;
691 728 }
692 729 YY_RULE(int) yy_action(GREG *G)
693 730 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
694   - yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(G, '{')) goto l72; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l72;
695   - l73:;
696   - { int yypos74= G->pos, yythunkpos74= G->thunkpos; if (!yy_braces(G)) goto l74; goto l73;
697   - l74:; G->pos= yypos74; G->thunkpos= yythunkpos74;
698   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l72; if (!yymatchChar(G, '}')) goto l72; if (!yy__(G)) goto l72;
  731 + yyprintf((stderr, "%s\n", "action")); if (!yymatchChar(G, '{')) goto l77; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l77;
  732 + l78:;
  733 + { int yypos79= G->pos, yythunkpos79= G->thunkpos; if (!yy_braces(G)) { goto l79; } goto l78;
  734 + l79:; G->pos= yypos79; G->thunkpos= yythunkpos79;
  735 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l77; if (!yymatchChar(G, '}')) goto l77; if (!yy__(G)) { goto l77; }
699 736 yyprintf((stderr, " ok %s @ %s\n", "action", G->buf+G->pos));
700 737 return 1;
701   - l72:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  738 + l77:; G->pos= yypos0; G->thunkpos= yythunkpos0;
702 739 yyprintf((stderr, " fail %s @ %s\n", "action", G->buf+G->pos));
703 740 return 0;
704 741 }
705 742 YY_RULE(int) yy_AND(GREG *G)
706 743 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
707   - yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(G, '&')) goto l75; if (!yy__(G)) goto l75;
  744 + yyprintf((stderr, "%s\n", "AND")); if (!yymatchChar(G, '&')) goto l80; if (!yy__(G)) { goto l80; }
708 745 yyprintf((stderr, " ok %s @ %s\n", "AND", G->buf+G->pos));
709 746 return 1;
710   - l75:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  747 + l80:; G->pos= yypos0; G->thunkpos= yythunkpos0;
711 748 yyprintf((stderr, " fail %s @ %s\n", "AND", G->buf+G->pos));
712 749 return 0;
713 750 }
714 751 YY_RULE(int) yy_prefix(GREG *G)
715 752 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
716 753 yyprintf((stderr, "%s\n", "prefix"));
717   - { int yypos77= G->pos, yythunkpos77= G->thunkpos; if (!yy_AND(G)) goto l78; if (!yy_action(G)) goto l78; yyDo(G, yy_1_prefix, G->begin, G->end); goto l77;
718   - l78:; G->pos= yypos77; G->thunkpos= yythunkpos77; if (!yy_AND(G)) goto l79; if (!yy_suffix(G)) goto l79; yyDo(G, yy_2_prefix, G->begin, G->end); goto l77;
719   - l79:; G->pos= yypos77; G->thunkpos= yythunkpos77; if (!yy_NOT(G)) goto l80; if (!yy_suffix(G)) goto l80; yyDo(G, yy_3_prefix, G->begin, G->end); goto l77;
720   - l80:; G->pos= yypos77; G->thunkpos= yythunkpos77; if (!yy_suffix(G)) goto l76;
  754 + { int yypos82= G->pos, yythunkpos82= G->thunkpos; if (!yy_AND(G)) { goto l83; } if (!yy_action(G)) { goto l83; } yyDo(G, yy_1_prefix, G->begin, G->end); goto l82;
  755 + l83:; G->pos= yypos82; G->thunkpos= yythunkpos82; if (!yy_AND(G)) { goto l84; } if (!yy_suffix(G)) { goto l84; } yyDo(G, yy_2_prefix, G->begin, G->end); goto l82;
  756 + l84:; G->pos= yypos82; G->thunkpos= yythunkpos82; if (!yy_NOT(G)) { goto l85; } if (!yy_suffix(G)) { goto l85; } yyDo(G, yy_3_prefix, G->begin, G->end); goto l82;
  757 + l85:; G->pos= yypos82; G->thunkpos= yythunkpos82; if (!yy_suffix(G)) { goto l81; }
721 758 }
722   - l77:;
  759 + l82:;
723 760 yyprintf((stderr, " ok %s @ %s\n", "prefix", G->buf+G->pos));
724 761 return 1;
725   - l76:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  762 + l81:; G->pos= yypos0; G->thunkpos= yythunkpos0;
726 763 yyprintf((stderr, " fail %s @ %s\n", "prefix", G->buf+G->pos));
727 764 return 0;
728 765 }
729 766 YY_RULE(int) yy_BAR(GREG *G)
730 767 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
731   - yyprintf((stderr, "%s\n", "BAR")); if (!yymatchChar(G, '|')) goto l81; if (!yy__(G)) goto l81;
  768 + yyprintf((stderr, "%s\n", "BAR")); if (!yymatchChar(G, '|')) goto l86; if (!yy__(G)) { goto l86; }
732 769 yyprintf((stderr, " ok %s @ %s\n", "BAR", G->buf+G->pos));
733 770 return 1;
734   - l81:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  771 + l86:; G->pos= yypos0; G->thunkpos= yythunkpos0;
735 772 yyprintf((stderr, " fail %s @ %s\n", "BAR", G->buf+G->pos));
736 773 return 0;
737 774 }
738 775 YY_RULE(int) yy_sequence(GREG *G)
739 776 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
740   - yyprintf((stderr, "%s\n", "sequence")); if (!yy_prefix(G)) goto l82;
741   - l83:;
742   - { int yypos84= G->pos, yythunkpos84= G->thunkpos; if (!yy_prefix(G)) goto l84; yyDo(G, yy_1_sequence, G->begin, G->end); goto l83;
743   - l84:; G->pos= yypos84; G->thunkpos= yythunkpos84;
  777 + yyprintf((stderr, "%s\n", "sequence")); if (!yy_prefix(G)) { goto l87; }
  778 + l88:;
  779 + { int yypos89= G->pos, yythunkpos89= G->thunkpos; if (!yy_prefix(G)) { goto l89; } yyDo(G, yy_1_sequence, G->begin, G->end); goto l88;
  780 + l89:; G->pos= yypos89; G->thunkpos= yythunkpos89;
744 781 }
745 782 yyprintf((stderr, " ok %s @ %s\n", "sequence", G->buf+G->pos));
746 783 return 1;
747   - l82:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  784 + l87:; G->pos= yypos0; G->thunkpos= yythunkpos0;
748 785 yyprintf((stderr, " fail %s @ %s\n", "sequence", G->buf+G->pos));
749 786 return 0;
750 787 }
751 788 YY_RULE(int) yy_SEMICOLON(GREG *G)
752 789 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
753   - yyprintf((stderr, "%s\n", "SEMICOLON")); if (!yymatchChar(G, ';')) goto l85; if (!yy__(G)) goto l85;
  790 + yyprintf((stderr, "%s\n", "SEMICOLON")); if (!yymatchChar(G, ';')) goto l90; if (!yy__(G)) { goto l90; }
754 791 yyprintf((stderr, " ok %s @ %s\n", "SEMICOLON", G->buf+G->pos));
755 792 return 1;
756   - l85:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  793 + l90:; G->pos= yypos0; G->thunkpos= yythunkpos0;
757 794 yyprintf((stderr, " fail %s @ %s\n", "SEMICOLON", G->buf+G->pos));
758 795 return 0;
759 796 }
760 797 YY_RULE(int) yy_expression(GREG *G)
761 798 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
762   - yyprintf((stderr, "%s\n", "expression")); if (!yy_sequence(G)) goto l86;
763   - l87:;
764   - { int yypos88= G->pos, yythunkpos88= G->thunkpos; if (!yy_BAR(G)) goto l88; if (!yy_sequence(G)) goto l88; yyDo(G, yy_1_expression, G->begin, G->end); goto l87;
765   - l88:; G->pos= yypos88; G->thunkpos= yythunkpos88;
  799 + yyprintf((stderr, "%s\n", "expression")); if (!yy_sequence(G)) { goto l91; }
  800 + l92:;
  801 + { int yypos93= G->pos, yythunkpos93= G->thunkpos; if (!yy_BAR(G)) { goto l93; } if (!yy_sequence(G)) { goto l93; } yyDo(G, yy_1_expression, G->begin, G->end); goto l92;
  802 + l93:; G->pos= yypos93; G->thunkpos= yythunkpos93;
766 803 }
767 804 yyprintf((stderr, " ok %s @ %s\n", "expression", G->buf+G->pos));
768 805 return 1;
769   - l86:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  806 + l91:; G->pos= yypos0; G->thunkpos= yythunkpos0;
770 807 yyprintf((stderr, " fail %s @ %s\n", "expression", G->buf+G->pos));
771 808 return 0;
772 809 }
773 810 YY_RULE(int) yy_EQUAL(GREG *G)
774 811 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
775   - yyprintf((stderr, "%s\n", "EQUAL")); if (!yymatchChar(G, '=')) goto l89; if (!yy__(G)) goto l89;
  812 + yyprintf((stderr, "%s\n", "EQUAL")); if (!yymatchChar(G, '=')) goto l94; if (!yy__(G)) { goto l94; }
776 813 yyprintf((stderr, " ok %s @ %s\n", "EQUAL", G->buf+G->pos));
777 814 return 1;
778   - l89:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  815 + l94:; G->pos= yypos0; G->thunkpos= yythunkpos0;
779 816 yyprintf((stderr, " fail %s @ %s\n", "EQUAL", G->buf+G->pos));
780 817 return 0;
781 818 }
782 819 YY_RULE(int) yy_identifier(GREG *G)
783 820 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
784   - yyprintf((stderr, "%s\n", "identifier")); yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l90; if (!yymatchClass(G, (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 l90;
785   - l91:;
786   - { int yypos92= G->pos, yythunkpos92= G->thunkpos; if (!yymatchClass(G, (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 l92; goto l91;
787   - l92:; G->pos= yypos92; G->thunkpos= yythunkpos92;
788   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l90; if (!yy__(G)) goto l90;
  821 + yyprintf((stderr, "%s\n", "identifier")); yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l95; if (!yymatchClass(G, (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;
  822 + l96:;
  823 + { int yypos97= G->pos, yythunkpos97= G->thunkpos; if (!yymatchClass(G, (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;
  824 + l97:; G->pos= yypos97; G->thunkpos= yythunkpos97;
  825 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l95; if (!yy__(G)) { goto l95; }
789 826 yyprintf((stderr, " ok %s @ %s\n", "identifier", G->buf+G->pos));
790 827 return 1;
791   - l90:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  828 + l95:; G->pos= yypos0; G->thunkpos= yythunkpos0;
792 829 yyprintf((stderr, " fail %s @ %s\n", "identifier", G->buf+G->pos));
793 830 return 0;
794 831 }
795 832 YY_RULE(int) yy_RPERCENT(GREG *G)
796 833 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
797   - yyprintf((stderr, "%s\n", "RPERCENT")); if (!yymatchString(G, "%}")) goto l93; if (!yy__(G)) goto l93;
  834 + yyprintf((stderr, "%s\n", "RPERCENT")); if (!yymatchString(G, "%}")) goto l98; if (!yy__(G)) { goto l98; }
798 835 yyprintf((stderr, " ok %s @ %s\n", "RPERCENT", G->buf+G->pos));
799 836 return 1;
800   - l93:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  837 + l98:; G->pos= yypos0; G->thunkpos= yythunkpos0;
801 838 yyprintf((stderr, " fail %s @ %s\n", "RPERCENT", G->buf+G->pos));
802 839 return 0;
803 840 }
804 841 YY_RULE(int) yy_end_of_file(GREG *G)
805 842 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
806 843 yyprintf((stderr, "%s\n", "end_of_file"));
807   - { int yypos95= G->pos, yythunkpos95= G->thunkpos; if (!yymatchDot(G)) goto l95; goto l94;
808   - l95:; G->pos= yypos95; G->thunkpos= yythunkpos95;
  844 + { int yypos100= G->pos, yythunkpos100= G->thunkpos; if (!yymatchDot(G)) goto l100; goto l99;
  845 + l100:; G->pos= yypos100; G->thunkpos= yythunkpos100;
809 846 }
810 847 yyprintf((stderr, " ok %s @ %s\n", "end_of_file", G->buf+G->pos));
811 848 return 1;
812   - l94:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  849 + l99:; G->pos= yypos0; G->thunkpos= yythunkpos0;
813 850 yyprintf((stderr, " fail %s @ %s\n", "end_of_file", G->buf+G->pos));
814 851 return 0;
815 852 }
816 853 YY_RULE(int) yy_trailer(GREG *G)
817 854 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
818   - yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(G, "%%")) goto l96; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l96;
819   - l97:;
820   - { int yypos98= G->pos, yythunkpos98= G->thunkpos; if (!yymatchDot(G)) goto l98; goto l97;
821   - l98:; G->pos= yypos98; G->thunkpos= yythunkpos98;
822   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l96; yyDo(G, yy_1_trailer, G->begin, G->end);
  855 + yyprintf((stderr, "%s\n", "trailer")); if (!yymatchString(G, "%%")) goto l101; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l101;
  856 + l102:;
  857 + { int yypos103= G->pos, yythunkpos103= G->thunkpos; if (!yymatchDot(G)) goto l103; goto l102;
  858 + l103:; G->pos= yypos103; G->thunkpos= yythunkpos103;
  859 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l101; yyDo(G, yy_1_trailer, G->begin, G->end);
823 860 yyprintf((stderr, " ok %s @ %s\n", "trailer", G->buf+G->pos));
824 861 return 1;
825   - l96:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  862 + l101:; G->pos= yypos0; G->thunkpos= yythunkpos0;
826 863 yyprintf((stderr, " fail %s @ %s\n", "trailer", G->buf+G->pos));
827 864 return 0;
828 865 }
829 866 YY_RULE(int) yy_definition(GREG *G)
830 867 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
831   - yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(G)) goto l99; yyDo(G, yy_1_definition, G->begin, G->end); if (!yy_EQUAL(G)) goto l99; if (!yy_expression(G)) goto l99; yyDo(G, yy_2_definition, G->begin, G->end);
832   - { int yypos100= G->pos, yythunkpos100= G->thunkpos; if (!yy_SEMICOLON(G)) goto l100; goto l101;
833   - l100:; G->pos= yypos100; G->thunkpos= yythunkpos100;
  868 + yyprintf((stderr, "%s\n", "definition")); if (!yy_identifier(G)) { goto l104; } yyDo(G, yy_1_definition, G->begin, G->end); if (!yy_EQUAL(G)) { goto l104; } if (!yy_expression(G)) { goto l104; } yyDo(G, yy_2_definition, G->begin, G->end);
  869 + { int yypos105= G->pos, yythunkpos105= G->thunkpos; if (!yy_SEMICOLON(G)) { goto l105; } goto l106;
  870 + l105:; G->pos= yypos105; G->thunkpos= yythunkpos105;
834 871 }
835   - l101:;
  872 + l106:;
836 873 yyprintf((stderr, " ok %s @ %s\n", "definition", G->buf+G->pos));
837 874 return 1;
838   - l99:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  875 + l104:; G->pos= yypos0; G->thunkpos= yythunkpos0;
839 876 yyprintf((stderr, " fail %s @ %s\n", "definition", G->buf+G->pos));
840 877 return 0;
841 878 }
842 879 YY_RULE(int) yy_declaration(GREG *G)
843 880 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
844   - yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(G, "%{")) goto l102; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l102;
845   - l103:;
846   - { int yypos104= G->pos, yythunkpos104= G->thunkpos;
847   - { int yypos105= G->pos, yythunkpos105= G->thunkpos; if (!yymatchString(G, "%}")) goto l105; goto l104;
848   - l105:; G->pos= yypos105; G->thunkpos= yythunkpos105;
849   - } if (!yymatchDot(G)) goto l104; goto l103;
850   - l104:; G->pos= yypos104; G->thunkpos= yythunkpos104;
851   - } yyText(G, G->begin, G->end); if (!(YY_END)) goto l102; if (!yy_RPERCENT(G)) goto l102; yyDo(G, yy_1_declaration, G->begin, G->end);
  881 + yyprintf((stderr, "%s\n", "declaration")); if (!yymatchString(G, "%{")) goto l107; yyText(G, G->begin, G->end); if (!(YY_BEGIN)) goto l107;
  882 + l108:;
  883 + { int yypos109= G->pos, yythunkpos109= G->thunkpos;
  884 + { int yypos110= G->pos, yythunkpos110= G->thunkpos; if (!yymatchString(G, "%}")) goto l110; goto l109;
  885 + l110:; G->pos= yypos110; G->thunkpos= yythunkpos110;
  886 + } if (!yymatchDot(G)) goto l109; goto l108;
  887 + l109:; G->pos= yypos109; G->thunkpos= yythunkpos109;
  888 + } yyText(G, G->begin, G->end); if (!(YY_END)) goto l107; if (!yy_RPERCENT(G)) { goto l107; } yyDo(G, yy_1_declaration, G->begin, G->end);
852 889 yyprintf((stderr, " ok %s @ %s\n", "declaration", G->buf+G->pos));
853 890 return 1;
854   - l102:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  891 + l107:; G->pos= yypos0; G->thunkpos= yythunkpos0;
855 892 yyprintf((stderr, " fail %s @ %s\n", "declaration", G->buf+G->pos));
856 893 return 0;
857 894 }
858 895 YY_RULE(int) yy__(GREG *G)
859 896 {
860 897 yyprintf((stderr, "%s\n", "_"));
861   - l107:;
862   - { int yypos108= G->pos, yythunkpos108= G->thunkpos;
863   - { int yypos109= G->pos, yythunkpos109= G->thunkpos; if (!yy_space(G)) goto l110; goto l109;
864   - l110:; G->pos= yypos109; G->thunkpos= yythunkpos109; if (!yy_comment(G)) goto l108;
  898 + l112:;
  899 + { int yypos113= G->pos, yythunkpos113= G->thunkpos;
  900 + { int yypos114= G->pos, yythunkpos114= G->thunkpos; if (!yy_space(G)) { goto l115; } goto l114;
  901 + l115:; G->pos= yypos114; G->thunkpos= yythunkpos114; if (!yy_comment(G)) { goto l113; }
865 902 }
866   - l109:; goto l107;
867   - l108:; G->pos= yypos108; G->thunkpos= yythunkpos108;
  903 + l114:; goto l112;
  904 + l113:; G->pos= yypos113; G->thunkpos= yythunkpos113;
868 905 }
869 906 yyprintf((stderr, " ok %s @ %s\n", "_", G->buf+G->pos));
870 907 return 1;
871 908 }
872 909 YY_RULE(int) yy_grammar(GREG *G)
873 910 { int yypos0= G->pos, yythunkpos0= G->thunkpos;
874   - yyprintf((stderr, "%s\n", "grammar")); if (!yy__(G)) goto l111;
875   - { int yypos114= G->pos, yythunkpos114= G->thunkpos; if (!yy_declaration(G)) goto l115; goto l114;
876   - l115:; G->pos= yypos114; G->thunkpos= yythunkpos114; if (!yy_definition(G)) goto l111;
877   - }
878   - l114:;
879   - l112:;
880   - { int yypos113= G->pos, yythunkpos113= G->thunkpos;
881   - { int yypos116= G->pos, yythunkpos116= G->thunkpos; if (!yy_declaration(G)) goto l117; goto l116;
882   - l117:; G->pos= yypos116; G->thunkpos= yythunkpos116; if (!yy_definition(G)) goto l113;
  911 + yyprintf((stderr, "%s\n", "grammar")); if (!yy__(G)) { goto l116; }
  912 + { int yypos119= G->pos, yythunkpos119= G->thunkpos; if (!yy_declaration(G)) { goto l120; } goto l119;
  913 + l120:; G->pos= yypos119; G->thunkpos= yythunkpos119; if (!yy_definition(G)) { goto l116; }
883 914 }
884   - l116:; goto l112;
885   - l113:; G->pos= yypos113; G->thunkpos= yythunkpos113;
  915 + l119:;
  916 + l117:;
  917 + { int yypos118= G->pos, yythunkpos118= G->thunkpos;
  918 + { int yypos121= G->pos, yythunkpos121= G->thunkpos; if (!yy_declaration(G)) { goto l122; } goto l121;
  919 + l122:; G->pos= yypos121; G->thunkpos= yythunkpos121; if (!yy_definition(G)) { goto l118; }
886 920 }
887   - { int yypos118= G->pos, yythunkpos118= G->thunkpos; if (!yy_trailer(G)) goto l118; goto l119;
  921 + l121:; goto l117;
888 922 l118:; G->pos= yypos118; G->thunkpos= yythunkpos118;
889 923 }
890   - l119:; if (!yy_end_of_file(G)) goto l111;
  924 + { int yypos123= G->pos, yythunkpos123= G->thunkpos; if (!yy_trailer(G)) { goto l123; } goto l124;
  925 + l123:; G->pos= yypos123; G->thunkpos= yythunkpos123;
  926 + }
  927 + l124:; if (!yy_end_of_file(G)) { goto l116; }
891 928 yyprintf((stderr, " ok %s @ %s\n", "grammar", G->buf+G->pos));
892 929 return 1;
893   - l111:; G->pos= yypos0; G->thunkpos= yythunkpos0;
  930 + l116:; G->pos= yypos0; G->thunkpos= yythunkpos0;
894 931 yyprintf((stderr, " fail %s @ %s\n", "grammar", G->buf+G->pos));
895 932 return 0;
896 933 }
@@ -908,12 +945,13 @@ YY_PARSE(int) YY_NAME(parse_from)(GREG *G, yyrule yystart)
908 945 G->buf= YY_ALLOC(G->buflen, G->data);
909 946 G->textlen= 1024;
910 947 G->text= YY_ALLOC(G->textlen, G->data);
911   - G->thunkslen= 32;
  948 + G->thunkslen= YY_STACK_SIZE;
912 949 G->thunks= YY_ALLOC(sizeof(yythunk) * G->thunkslen, G->data);
913   - G->valslen= 32;
  950 + G->valslen= YY_STACK_SIZE;
914 951 G->vals= YY_ALLOC(sizeof(YYSTYPE) * G->valslen, G->data);
915 952 G->begin= G->end= G->pos= G->limit= G->thunkpos= 0;
916 953 }
  954 + G->pos = 0;
917 955 G->begin= G->end= G->pos;
918 956 G->thunkpos= 0;
919 957 G->val= G->vals;
@@ -941,7 +979,7 @@ YY_PARSE(int) YY_NAME(parse)(GREG *G)
941 979 return YY_NAME(parse_from)(G, yy_grammar);
942 980 }
943 981
944   -YY_PARSE(GREG *) YY_NAME(parse_new)(void *data)
  982 +YY_PARSE(GREG *) YY_NAME(parse_new)(YY_XTYPE data)
945 983 {
946 984 GREG *G = (GREG *)YY_CALLOC(1, sizeof(GREG), G->data);
947 985 G->data = data;
12 greg.g
@@ -84,11 +84,12 @@ prefix= AND action { push(makePredicate(yytext)); }
84 84 | suffix
85 85
86 86 suffix= primary (QUESTION { push(makeQuery(pop())); }
87   - | STAR { push(makeStar (pop())); }
88   - | PLUS { push(makePlus (pop())); }
89   - )?
  87 + | STAR { push(makeStar (pop())); }
  88 + | PLUS { push(makePlus (pop())); }
  89 + )?
90 90
91   -primary= identifier { push(makeVariable(yytext)); }
  91 +primary= (
  92 + identifier { push(makeVariable(yytext)); }
92 93 COLON identifier !EQUAL { Node *name= makeName(findRule(yytext)); name->name.variable= pop(); push(name); }
93 94 | identifier !EQUAL { push(makeName(findRule(yytext))); }
94 95 | OPEN expression CLOSE
@@ -98,6 +99,7 @@ primary= identifier { push(makeVariable(yytext)); }
98 99 | action { push(makeAction(yytext)); }
99 100 | BEGIN { push(makePredicate("YY_BEGIN")); }
100 101 | END { push(makePredicate("YY_END")); }
  102 + ) (errblock { Node *node = pop(); ((struct Any *) node)->errblock = strdup(yytext); push(node); })?
101 103
102 104 # Lexical syntax
103 105
@@ -115,6 +117,8 @@ char= '\\' [abefnrtv'"\[\]\\]
115 117 | '\\' [0-7][0-7]?
116 118 | !'\\' .
117 119
  120 +
  121 +errblock= '~{' < braces* > '}' -
118 122 action= '{' < braces* > '}' -
119 123
120 124 braces= '{' (!'}' .)* '}'
36 greg.h
@@ -20,7 +20,7 @@
20 20
21 21 #define GREG_MAJOR 0
22 22 #define GREG_MINOR 4
23   -#define GREG_LEVEL 0
  23 +#define GREG_LEVEL 1
24 24
25 25 enum { Unknown= 0, Rule, Variable, Name, Dot, Character, String, Class, Action, Predicate, Alternate, Sequence, PeekFor, PeekNot, Query, Star, Plus };
26 26
@@ -31,23 +31,23 @@ enum {
31 31
32 32 typedef union Node Node;
33 33
34   -struct Rule { int type; Node *next; char *name; Node *variables; Node *expression; int id; int flags; };
35   -struct Variable { int type; Node *next; char *name; Node *value; int offset; };
36   -struct Name { int type; Node *next; Node *rule; Node *variable; };
37   -struct Dot { int type; Node *next; };
38   -struct Character { int type; Node *next; char *value; };
39   -struct String { int type; Node *next; char *value; };
40   -struct Class { int type; Node *next; unsigned char *value; };
41   -struct Action { int type; Node *next; char *text; Node *list; char *name; Node *rule; };
42   -struct Predicate { int type; Node *next; char *text; };
43   -struct Alternate { int type; Node *next; Node *first; Node *last; };
44   -struct Sequence { int type; Node *next; Node *first; Node *last; };
45   -struct PeekFor { int type; Node *next; Node *element; };
46   -struct PeekNot { int type; Node *next; Node *element; };
47   -struct Query { int type; Node *next; Node *element; };
48   -struct Star { int type; Node *next; Node *element; };
49   -struct Plus { int type; Node *next; Node *element; };
50   -struct Any { int type; Node *next; };
  34 +struct Rule { int type; Node *next; char *errblock; char *name; Node *variables; Node *expression; int id; int flags; };
  35 +struct Variable { int type; Node *next; char *errblock; char *name; Node *value; int offset; };
  36 +struct Name { int type; Node *next; char *errblock; Node *rule; Node *variable; };
  37 +struct Dot { int type; Node *next; char *errblock; };
  38 +struct Character { int type; Node *next; char *errblock; char *value; };
  39 +struct String { int type; Node *next; char *errblock; char *value; };
  40 +struct Class { int type; Node *next; char *errblock; unsigned char *value; };
  41 +struct Action { int type; Node *next; char *errblock; char *text; Node *list; char *name; Node *rule; };
  42 +struct Predicate { int type; Node *next; char *errblock; char *text; };
  43 +struct Alternate { int type; Node *next; char *errblock; Node *first; Node *last; };
  44 +struct Sequence { int type; Node *next; char *errblock; Node *first; Node *last; };
  45 +struct PeekFor { int type; Node *next; char *errblock; Node *element; };
  46 +struct PeekNot { int type; Node *next; char *errblock; Node *element; };
  47 +struct Query { int type; Node *next; char *errblock; Node *element; };
  48 +struct Star { int type; Node *next; char *errblock; Node *element; };
  49 +struct Plus { int type; Node *next; char *errblock; Node *element; };
  50 +struct Any { int type; Node *next; char *errblock; };
51 51
52 52 union Node
53 53 {
1  tree.c
@@ -38,6 +38,7 @@ static inline Node *_newNode(int type, int size)
38 38 {
39 39 Node *node= calloc(1, size);
40 40 node->type= type;
  41 + ((struct Any *) node)->errblock= NULL;
41 42 return node;
42 43 }
43 44

0 comments on commit 91c0b9d

Please sign in to comment.
Something went wrong with that request. Please try again.