1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
/* Generated by re2c */
// re2c $INPUT -o $OUTPUT -i
// In this example initial state coincides with fallback state
// which must update 'yyaccept'. There is a loop through initial
// state that changes 'yyaccept' value, so if the initial state
// forgets to update 'yyaccept', the wrong rule will match.
{
YYCTYPE yych;
unsigned int yyaccept = 0;
goto yy0;
yy1:
yyaccept = 0;
++YYCURSOR;
yy0:
YYMARKER = YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
case 'a': goto yy3;
default: goto yy2;
}
yy2:
{ 1 }
yy3:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
case 'b': goto yy5;
default: goto yy4;
}
yy4:
YYCURSOR = YYMARKER;
if (yyaccept == 0) goto yy2;
else goto yy6;
yy5:
yyaccept = 1;
YYMARKER = ++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
case 'a': goto yy7;
default: goto yy6;
}
yy6:
{ 2 }
yy7:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
case 'b': goto yy1;
default: goto yy4;
}
}
yyaccept_initial.re:9:12: warning: rule matches empty string [-Wmatch-empty-string]
yyaccept_initial.re:10:12: warning: rule matches empty string [-Wmatch-empty-string]
|