- Added support for DOS line endings.
- Added experimental unicode support.
- Added config_w32.h to build out of the box on windows (using msvc 2002+).
+- Applied #1411087 variable length trailing context.
- Applied #1408326 do not generate goto next state.
- Applied #1408282 CharSet initialization fix.
- Applied #1408278 readsome with MSVC.
break;
case CTXT:
- o << "term " << ((RuleOp*) i.i.link)->accept;
+ o << "ctxt";
break;
case TERM:
{
exp->calcSize(rep);
ctx->calcSize(rep);
- size = exp->size + ctx->size + 1;
+ size = exp->size + (ctx->size ? ctx->size + 2 : 1);
}
void RuleOp::compile(Char *rep, Ins *i)
ins = i;
exp->compile(rep, &i[0]);
i += exp->size;
- ctx->compile(rep, &i[0]);
- i += ctx->size;
+ if (ctx->size)
+ {
+ i->i.tag = CTXT;
+ i->i.link = &i[1];
+ i++;
+ ctx->compile(rep, &i[0]);
+ i += ctx->size;
+ }
i->i.tag = TERM;
i->i.link = this;
}
-/* Generated by re2c 0.10.0.dev on Thu Jan 19 23:45:52 2006 */
+/* Generated by re2c 0.10.0.dev on Fri Jan 20 21:17:47 2006 */
#line 1 "scanner.re"
/* $Id$ */
#include <stdlib.h>
{
YYCTYPE yych;
unsigned int yyaccept = 0;
+yy0:
if((YYLIMIT - YYCURSOR) < 11) YYFILL(11);
yych = *YYCURSOR;
if(yych <= ')') {
{
goto echo;
}
-#line 114 "scanner.cc"
+#line 115 "scanner.cc"
yy4:
yych = *++YYCURSOR;
if(yych == '/') goto yy10;
tok = pos = cursor; cline++; oline++;
goto echo;
}
-#line 127 "scanner.cc"
+#line 128 "scanner.cc"
yy7:
++YYCURSOR;
#line 131 "scanner.re"
RETURN(0);
}
}
-#line 137 "scanner.cc"
+#line 138 "scanner.cc"
yy9:
yych = *++YYCURSOR;
goto yy3;
tok = pos = cursor;
goto echo;
}
-#line 153 "scanner.cc"
+#line 154 "scanner.cc"
yy12:
yych = *++YYCURSOR;
if(yych == '!') goto yy14;
tok = cursor;
RETURN(1);
}
-#line 185 "scanner.cc"
+#line 186 "scanner.cc"
yy21:
yych = *++YYCURSOR;
if(yych != 'x') goto yy13;
ignore_eoc = true;
goto echo;
}
-#line 207 "scanner.cc"
+#line 208 "scanner.cc"
}
#line 140 "scanner.re"
goto value;
}
-#line 232 "scanner.cc"
+#line 233 "scanner.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
{ depth = 1;
goto code;
}
-#line 310 "scanner.cc"
+#line 311 "scanner.cc"
yy33:
++YYCURSOR;
if((yych = *YYCURSOR) == '*') goto yy92;
yy34:
#line 192 "scanner.re"
{ RETURN(*tok); }
-#line 317 "scanner.cc"
+#line 318 "scanner.cc"
yy35:
++YYCURSOR;
if((yych = *YYCURSOR) == '/') goto yy90;
#line 194 "scanner.re"
{ yylval.op = *tok;
RETURN(CLOSE); }
-#line 325 "scanner.cc"
+#line 326 "scanner.cc"
yy37:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
yy38:
#line 179 "scanner.re"
{ fatal("unterminated string constant (missing \")"); }
-#line 333 "scanner.cc"
+#line 334 "scanner.cc"
yy39:
yyaccept = 2;
yych = *(YYMARKER = ++YYCURSOR);
yy40:
#line 180 "scanner.re"
{ fatal("unterminated string constant (missing ')"); }
-#line 341 "scanner.cc"
+#line 342 "scanner.cc"
yy41:
yyaccept = 3;
yych = *(YYMARKER = ++YYCURSOR);
yy42:
#line 190 "scanner.re"
{ fatal("unterminated range (missing ])"); }
-#line 351 "scanner.cc"
+#line 352 "scanner.cc"
yy43:
yych = *++YYCURSOR;
goto yy34;
{ cur = cursor;
yylval.symbol = Symbol::find(token());
return ID; }
-#line 367 "scanner.cc"
+#line 368 "scanner.cc"
yy47:
yych = *++YYCURSOR;
goto yy61;
yylval.regexp = mkDot();
return RANGE;
}
-#line 378 "scanner.cc"
+#line 379 "scanner.cc"
yy50:
++YYCURSOR;
yych = *YYCURSOR;
yy51:
#line 230 "scanner.re"
{ goto scan; }
-#line 386 "scanner.cc"
+#line 387 "scanner.cc"
yy52:
++YYCURSOR;
yy53:
pos = cursor; cline++;
goto scan;
}
-#line 395 "scanner.cc"
+#line 396 "scanner.cc"
yy54:
++YYCURSOR;
if((yych = *YYCURSOR) == 0x0A) goto yy57;
}
goto scan;
}
-#line 413 "scanner.cc"
+#line 414 "scanner.cc"
yy56:
yych = *++YYCURSOR;
goto yy55;
yylval.str = new Str(token());
return CONFIG;
}
-#line 498 "scanner.cc"
+#line 499 "scanner.cc"
yy70:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
{ cur = cursor;
yylval.regexp = ranToRE(token());
return RANGE; }
-#line 536 "scanner.cc"
+#line 537 "scanner.cc"
yy77:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
{ cur = cursor;
yylval.regexp = invToRE(token());
return RANGE; }
-#line 549 "scanner.cc"
+#line 550 "scanner.cc"
yy80:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
{ cur = cursor;
yylval.regexp = strToCaseInsensitiveRE(token());
return STRING; }
-#line 573 "scanner.cc"
+#line 574 "scanner.cc"
yy85:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
{ cur = cursor;
yylval.regexp = strToRE(token());
return STRING; }
-#line 597 "scanner.cc"
+#line 598 "scanner.cc"
yy90:
++YYCURSOR;
#line 168 "scanner.re"
{ tok = cursor;
RETURN(0); }
-#line 603 "scanner.cc"
+#line 604 "scanner.cc"
yy92:
++YYCURSOR;
#line 165 "scanner.re"
{ depth = 1;
goto comment; }
-#line 609 "scanner.cc"
+#line 610 "scanner.cc"
yy94:
yych = *++YYCURSOR;
if(yych == ',') goto yy108;
yy98:
#line 212 "scanner.re"
{ fatal("illegal closure form, use '{n}', '{n,}', '{n,m}' where n and m are numbers"); }
-#line 632 "scanner.cc"
+#line 633 "scanner.cc"
yy99:
++YYCURSOR;
#line 200 "scanner.re"
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = atoi((char *)tok+1);
RETURN(CLOSESIZE); }
-#line 639 "scanner.cc"
+#line 640 "scanner.cc"
yy101:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = -1;
RETURN(CLOSESIZE); }
-#line 651 "scanner.cc"
+#line 652 "scanner.cc"
yy104:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
{ yylval.extop.minsize = atoi((char *)tok+1);
yylval.extop.maxsize = MAX(yylval.extop.minsize,atoi(strchr((char *)tok, ',')+1));
RETURN(CLOSESIZE); }
-#line 664 "scanner.cc"
+#line 665 "scanner.cc"
yy108:
yyaccept = 6;
yych = *(YYMARKER = ++YYCURSOR);
#line 197 "scanner.re"
{ yylval.op = '*';
RETURN(CLOSE); }
-#line 675 "scanner.cc"
+#line 676 "scanner.cc"
}
#line 249 "scanner.re"
code:
-#line 682 "scanner.cc"
+#line 683 "scanner.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
return CODE;
}
goto code; }
-#line 713 "scanner.cc"
+#line 714 "scanner.cc"
yy115:
++YYCURSOR;
#line 259 "scanner.re"
{ ++depth;
goto code; }
-#line 719 "scanner.cc"
+#line 720 "scanner.cc"
yy117:
++YYCURSOR;
#line 261 "scanner.re"
pos = cursor; cline++;
goto code;
}
-#line 727 "scanner.cc"
+#line 728 "scanner.cc"
yy119:
++YYCURSOR;
yy120:
#line 265 "scanner.re"
{ goto code; }
-#line 733 "scanner.cc"
+#line 734 "scanner.cc"
yy121:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
comment:
-#line 790 "scanner.cc"
+#line 791 "scanner.cc"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yy133:
#line 281 "scanner.re"
{ goto comment; }
-#line 809 "scanner.cc"
+#line 810 "scanner.cc"
yy134:
yych = *++YYCURSOR;
if(yych == '*') goto yy138;
tok = pos = cursor; cline++;
goto comment;
}
-#line 821 "scanner.cc"
+#line 822 "scanner.cc"
yy137:
yych = *++YYCURSOR;
goto yy133;
{ ++depth;
fatal("ambiguous /* found");
goto comment; }
-#line 831 "scanner.cc"
+#line 832 "scanner.cc"
yy140:
++YYCURSOR;
#line 270 "scanner.re"
goto scan;
else
goto comment; }
-#line 839 "scanner.cc"
+#line 840 "scanner.cc"
}
#line 282 "scanner.re"
config:
-#line 846 "scanner.cc"
+#line 847 "scanner.cc"
{
YYCTYPE yych;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yy145:
#line 286 "scanner.re"
{ goto config; }
-#line 865 "scanner.cc"
+#line 866 "scanner.cc"
yy146:
++YYCURSOR;
yych = *YYCURSOR;
cur = cursor;
RETURN('=');
}
-#line 876 "scanner.cc"
+#line 877 "scanner.cc"
yy148:
++YYCURSOR;
#line 291 "scanner.re"
{ fatal("missing '='"); }
-#line 881 "scanner.cc"
+#line 882 "scanner.cc"
yy150:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
value:
-#line 904 "scanner.cc"
+#line 905 "scanner.cc"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
iscfg = 0;
return VALUE;
}
-#line 944 "scanner.cc"
+#line 945 "scanner.cc"
yy157:
++YYCURSOR;
if((yych = *YYCURSOR) <= 0x0D) {
iscfg = 0;
return NUMBER;
}
-#line 965 "scanner.cc"
+#line 966 "scanner.cc"
yy159:
yych = *++YYCURSOR;
if(yych <= '0') goto yy163;
{
uint back = rule->ctx->fixedLength();
- if (back != ~0u && back > 0u)
+ if (back != 0u)
{
- o << indent(ind) << "YYCURSOR -= " << back << ";";
+ o << indent(ind) << "YYCURSOR = yyctxmarker;\n";
+ oline++;
}
line_source(rule->code->line, o);
o << indent(ind) << "YYDEBUG(" << label << ", *YYCURSOR);\n";
oline++;
}
+ if (isPreCtxt)
+ {
+ o << indent(ind) << "yyctxmarker = YYCURSOR + 1;\n";
+ oline++;
+ bUsedCtxMarker = true;
+ }
action->emit(o, ind, readCh);
}
oline += 2;
}
+ if (bUsedCtxMarker)
+ {
+ o << indent(ind) << "YYCTYPE *yyctxmarker = YYCURSOR;\n";
+ oline++;
+ }
+
if (hasFillLabels == true)
{
vUsedLabels.insert(start_label);
, depth(0)
, kCount(0)
, kernel(NULL)
- , isBase(0)
+ , isPreCtxt(false)
+ , isBase(false)
, go()
, action(NULL)
{
cP = closure(cP, i + 1);
i = (Ins*) i->i.link;
}
- else if (i->i.tag == GOTO)
+ else if (i->i.tag == GOTO || i->i.tag == CTXT)
{
i = (Ins*) i->i.link;
}
if (!s->rule || ((RuleOp*) i->i.link)->accept < s->rule->accept)
s->rule = (RuleOp*) i->i.link;
}
+ else if (i->i.tag == CTXT)
+ {
+ s->isPreCtxt = true;
+ }
}
for (j = 0; j < nGoTos; ++j)
for (iP = kernel; (i = *iP); ++iP)
{
- if (i->i.tag == CHAR || i->i.tag == TERM)
+ if (i->i.tag == CHAR || i->i.tag == TERM || i->i.tag == CTXT)
{
*cP++ = i;
}
uint kCount;
Ins **kernel;
+ bool isPreCtxt;
bool isBase;
Go go;
Action *action;
extern bool wFlag;
extern bool bUsedYYAccept;
+extern bool bUsedCtxMarker;
extern bool bUseStartLabel;
extern std::string startLabelName;
extern unsigned int oline;
bool sFlag = false;
bool wFlag = false;
bool bUsedYYAccept = false;
+bool bUsedCtxMarker= false;
bool bUseStartLabel= true;
std::string startLabelName;
unsigned int oline = 1;
--- /dev/null
+/* Generated by re2c */
+#line 1 "ctx.b.re"
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+{
+ static unsigned char yybm[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 128, 128, 128, 128, 128, 128, 128, 128,
+ 128, 128, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ };
+
+#line 83 "<stdout>"
+ {
+ YYCTYPE yych;
+ YYCTYPE *yyctxmarker = YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if(yych <= ' ') {
+ if(yych <= 0x09) {
+ if(yych <= 0x08) goto yy9;
+ goto yy6;
+ } else {
+ if(yych <= 0x0A) goto yy8;
+ if(yych <= 0x1F) goto yy9;
+ goto yy6;
+ }
+ } else {
+ if(yych <= '9') {
+ if(yych <= '/') goto yy9;
+ goto yy4;
+ } else {
+ if(yych <= '`') goto yy9;
+ if(yych >= 'c') goto yy9;
+ }
+ }
+ yyctxmarker = YYCURSOR + 1;
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy3;
+ if(yych == '1') goto yy15;
+ if(yych <= '9') goto yy12;
+yy3:
+#line 58 "ctx.b.re"
+ {
+ return UNEXPECTED;
+ }
+#line 118 "<stdout>"
+yy4:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy11;
+yy5:
+#line 48 "ctx.b.re"
+ { return NUMBER; }
+#line 126 "<stdout>"
+yy6:
+ ++YYCURSOR;
+yy7:
+#line 51 "ctx.b.re"
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+#line 137 "<stdout>"
+yy8:
+ yych = *++YYCURSOR;
+ goto yy7;
+yy9:
+ yych = *++YYCURSOR;
+ goto yy3;
+yy10:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy11:
+ if(yybm[0+yych] & 128) {
+ goto yy10;
+ }
+ goto yy5;
+yy12:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '/') goto yy14;
+ if(yych <= '9') goto yy12;
+yy14:
+ YYCURSOR = yyctxmarker;
+#line 47 "ctx.b.re"
+ { return KEYWORD; }
+#line 163 "<stdout>"
+yy15:
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy16;
+ if(yych <= '9') goto yy12;
+yy16:
+ YYCURSOR = yyctxmarker;
+#line 46 "ctx.b.re"
+ { return KEYWORD; }
+#line 172 "<stdout>"
+ }
+}
+#line 61 "ctx.b.re"
+
+}
+
+#define YYMAXFILL 3
+
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
--- /dev/null
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+/*!re2c
+
+("a"|"b")/[1] { return KEYWORD; }
+("a"|"b")/[0-9]+ { return KEYWORD; }
+[0-9]+ { return NUMBER; }
+
+[ \t\n]
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+.
+ {
+ return UNEXPECTED;
+ }
+*/
+}
+
+/*!max:re2c */
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
--- /dev/null
+/* Generated by re2c */
+#line 1 "ctx.re"
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+
+#line 48 "<stdout>"
+{
+ YYCTYPE yych;
+ YYCTYPE *yyctxmarker = YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ switch(yych){
+ case 0x09:
+ case ' ': goto yy6;
+ case 0x0A: goto yy8;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy4;
+ case 'a':
+ case 'b': goto yy2;
+ default: goto yy9;
+ }
+yy2:
+ yyctxmarker = YYCURSOR + 1;
+ ++YYCURSOR;
+ switch((yych = *YYCURSOR)) {
+ case '0':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy12;
+ case '1': goto yy15;
+ default: goto yy3;
+ }
+yy3:
+#line 58 "ctx.re"
+ {
+ return UNEXPECTED;
+ }
+#line 92 "<stdout>"
+yy4:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy11;
+yy5:
+#line 48 "ctx.re"
+ { return NUMBER; }
+#line 100 "<stdout>"
+yy6:
+ ++YYCURSOR;
+yy7:
+#line 51 "ctx.re"
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+#line 111 "<stdout>"
+yy8:
+ yych = *++YYCURSOR;
+ goto yy7;
+yy9:
+ yych = *++YYCURSOR;
+ goto yy3;
+yy10:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy11:
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy10;
+ default: goto yy5;
+ }
+yy12:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ switch(yych){
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy12;
+ default: goto yy14;
+ }
+yy14:
+ YYCURSOR = yyctxmarker;
+#line 47 "ctx.re"
+ { return KEYWORD; }
+#line 157 "<stdout>"
+yy15:
+ ++YYCURSOR;
+ switch((yych = *YYCURSOR)) {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9': goto yy12;
+ default: goto yy16;
+ }
+yy16:
+ YYCURSOR = yyctxmarker;
+#line 46 "ctx.re"
+ { return KEYWORD; }
+#line 177 "<stdout>"
+}
+#line 61 "ctx.re"
+
+}
+
+#define YYMAXFILL 3
+
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
--- /dev/null
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+/*!re2c
+
+("a"|"b")/[1] { return KEYWORD; }
+("a"|"b")/[0-9]+ { return KEYWORD; }
+[0-9]+ { return NUMBER; }
+
+[ \t\n]
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+.
+ {
+ return UNEXPECTED;
+ }
+*/
+}
+
+/*!max:re2c */
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
--- /dev/null
+/* Generated by re2c */
+#line 1 "ctx.s.re"
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+
+#line 48 "<stdout>"
+{
+ YYCTYPE yych;
+ YYCTYPE *yyctxmarker = YYCURSOR;
+yy0:
+ if((YYLIMIT - YYCURSOR) < 3) YYFILL(3);
+ yych = *YYCURSOR;
+ if(yych <= ' ') {
+ if(yych <= 0x09) {
+ if(yych <= 0x08) goto yy9;
+ goto yy6;
+ } else {
+ if(yych <= 0x0A) goto yy8;
+ if(yych <= 0x1F) goto yy9;
+ goto yy6;
+ }
+ } else {
+ if(yych <= '9') {
+ if(yych <= '/') goto yy9;
+ goto yy4;
+ } else {
+ if(yych <= '`') goto yy9;
+ if(yych >= 'c') goto yy9;
+ }
+ }
+ yyctxmarker = YYCURSOR + 1;
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy3;
+ if(yych == '1') goto yy15;
+ if(yych <= '9') goto yy12;
+yy3:
+#line 58 "ctx.s.re"
+ {
+ return UNEXPECTED;
+ }
+#line 83 "<stdout>"
+yy4:
+ ++YYCURSOR;
+ yych = *YYCURSOR;
+ goto yy11;
+yy5:
+#line 48 "ctx.s.re"
+ { return NUMBER; }
+#line 91 "<stdout>"
+yy6:
+ ++YYCURSOR;
+yy7:
+#line 51 "ctx.s.re"
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+#line 102 "<stdout>"
+yy8:
+ yych = *++YYCURSOR;
+ goto yy7;
+yy9:
+ yych = *++YYCURSOR;
+ goto yy3;
+yy10:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+yy11:
+ if(yych <= '/') goto yy5;
+ if(yych <= '9') goto yy10;
+ goto yy5;
+yy12:
+ ++YYCURSOR;
+ if(YYLIMIT == YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if(yych <= '/') goto yy14;
+ if(yych <= '9') goto yy12;
+yy14:
+ YYCURSOR = yyctxmarker;
+#line 47 "ctx.s.re"
+ { return KEYWORD; }
+#line 127 "<stdout>"
+yy15:
+ ++YYCURSOR;
+ if((yych = *YYCURSOR) <= '/') goto yy16;
+ if(yych <= '9') goto yy12;
+yy16:
+ YYCURSOR = yyctxmarker;
+#line 46 "ctx.s.re"
+ { return KEYWORD; }
+#line 136 "<stdout>"
+}
+#line 61 "ctx.s.re"
+
+}
+
+#define YYMAXFILL 3
+
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
--- /dev/null
+#include <cstring>
+#include <iostream>
+
+struct Scanner
+{
+ Scanner(char *txt)
+ : cur(txt), lim(txt + strlen(txt))
+ {
+ }
+
+ char *cur;
+ char *lim;
+ char *ptr;
+ char *tok;
+};
+
+#define YYCTYPE char
+#define YYCURSOR s.cur
+#define YYLIMIT s.lim
+#define YYMARKER s.ptr
+#define YYFILL(n)
+
+enum What
+{
+ UNEXPECTED,
+ KEYWORD,
+ NUMBER,
+ EOI
+};
+
+char * tokens[] = { "UNEXPECTED", "KEYWORD", "NUMBER", "EOI" };
+
+
+int scan(Scanner &s)
+{
+ YYCTYPE *cursor = s.cur;
+
+ if(cursor == s.lim)
+ return EOI;
+
+std:
+ s.tok = cursor;
+
+/*!re2c
+
+("a"|"b")/[1] { return KEYWORD; }
+("a"|"b")/[0-9]+ { return KEYWORD; }
+[0-9]+ { return NUMBER; }
+
+[ \t\n]
+ {
+ if(s.cur == s.lim)
+ return EOI;
+ cursor = s.cur;
+ goto std;
+ }
+.
+ {
+ return UNEXPECTED;
+ }
+*/
+}
+
+/*!max:re2c */
+
+int main(int,char**)
+{
+ Scanner s("a77 a1 b8 b1");
+
+ int t, n = 0;
+ while ((t = scan(s)) != EOI)
+ {
+ std::cout << (++n) << ": " << tokens[t] << " = \""; std::cout.write(s.tok, s.cur-s.tok); std::cout << "\"" << std::endl;
+ }
+}
{
YYCTYPE yych;
unsigned int yyaccept = 0;
+ YYCTYPE *yyctxmarker = YYCURSOR;
yy0:
if((YYLIMIT - YYCURSOR) < 15) YYFILL(15);
yych = *YYCURSOR;
yy3:
#line 79 "modula.re"
{RETURN(9);}
-#line 171 "<stdout>"
+#line 172 "<stdout>"
yy4:
+ yyctxmarker = YYCURSOR + 1;
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
goto yy292;
yy5:
#line 69 "modula.re"
{RETURN(1);}
-#line 179 "<stdout>"
+#line 181 "<stdout>"
yy6:
+ yyctxmarker = YYCURSOR + 1;
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
goto yy278;
printf("unexpected character: %c\n", *s->tok);
goto std;
}
-#line 197 "<stdout>"
+#line 200 "<stdout>"
yy9:
yyaccept = 1;
yych = *(YYMARKER = ++YYCURSOR);
++YYCURSOR;
#line 77 "modula.re"
{RETURN(7);}
-#line 209 "<stdout>"
+#line 212 "<stdout>"
yy12:
++YYCURSOR;
#line 78 "modula.re"
{RETURN(8);}
-#line 214 "<stdout>"
+#line 217 "<stdout>"
yy14:
++YYCURSOR;
#line 80 "modula.re"
{RETURN(10);}
-#line 219 "<stdout>"
+#line 222 "<stdout>"
yy16:
++YYCURSOR;
#line 81 "modula.re"
{RETURN(11);}
-#line 224 "<stdout>"
+#line 227 "<stdout>"
yy18:
++YYCURSOR;
#line 82 "modula.re"
{RETURN(12);}
-#line 229 "<stdout>"
+#line 232 "<stdout>"
yy20:
++YYCURSOR;
#line 83 "modula.re"
{RETURN(13);}
-#line 234 "<stdout>"
+#line 237 "<stdout>"
yy22:
++YYCURSOR;
#line 84 "modula.re"
{RETURN(14);}
-#line 239 "<stdout>"
+#line 242 "<stdout>"
yy24:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy25:
#line 85 "modula.re"
{RETURN(15);}
-#line 249 "<stdout>"
+#line 252 "<stdout>"
yy26:
++YYCURSOR;
#line 87 "modula.re"
{RETURN(17);}
-#line 254 "<stdout>"
+#line 257 "<stdout>"
yy28:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy29:
#line 88 "modula.re"
{RETURN(18);}
-#line 264 "<stdout>"
+#line 267 "<stdout>"
yy30:
++YYCURSOR;
#line 90 "modula.re"
{RETURN(20);}
-#line 269 "<stdout>"
+#line 272 "<stdout>"
yy32:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy33:
#line 91 "modula.re"
{RETURN(21);}
-#line 280 "<stdout>"
+#line 283 "<stdout>"
yy34:
++YYCURSOR;
#line 94 "modula.re"
{RETURN(24);}
-#line 285 "<stdout>"
+#line 288 "<stdout>"
yy36:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy37:
#line 95 "modula.re"
{RETURN(25);}
-#line 295 "<stdout>"
+#line 298 "<stdout>"
yy38:
++YYCURSOR;
#line 97 "modula.re"
{RETURN(27);}
-#line 300 "<stdout>"
+#line 303 "<stdout>"
yy40:
++YYCURSOR;
#line 98 "modula.re"
{RETURN(28);}
-#line 305 "<stdout>"
+#line 308 "<stdout>"
yy42:
++YYCURSOR;
#line 99 "modula.re"
{RETURN(29);}
-#line 310 "<stdout>"
+#line 313 "<stdout>"
yy44:
++YYCURSOR;
#line 100 "modula.re"
{RETURN(30);}
-#line 315 "<stdout>"
+#line 318 "<stdout>"
yy46:
++YYCURSOR;
#line 101 "modula.re"
{RETURN(31);}
-#line 320 "<stdout>"
+#line 323 "<stdout>"
yy48:
++YYCURSOR;
#line 102 "modula.re"
{RETURN(32);}
-#line 325 "<stdout>"
+#line 328 "<stdout>"
yy50:
++YYCURSOR;
#line 103 "modula.re"
{RETURN(33);}
-#line 330 "<stdout>"
+#line 333 "<stdout>"
yy52:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy53:
#line 146 "modula.re"
{RETURN(74);}
-#line 341 "<stdout>"
+#line 344 "<stdout>"
yy54:
yych = *++YYCURSOR;
switch(yych){
yy74:
#line 148 "modula.re"
{ goto std; }
-#line 474 "<stdout>"
+#line 477 "<stdout>"
yy75:
++YYCURSOR;
#line 151 "modula.re"
s->pos = cursor; s->line++;
goto std;
}
-#line 483 "<stdout>"
+#line 486 "<stdout>"
yy77:
yych = *++YYCURSOR;
goto yy8;
yy86:
#line 144 "modula.re"
{RETURN(73);}
-#line 650 "<stdout>"
+#line 653 "<stdout>"
yy87:
yych = *++YYCURSOR;
switch(yych){
yy90:
#line 143 "modula.re"
{RETURN(72);}
-#line 731 "<stdout>"
+#line 734 "<stdout>"
yy91:
yych = *++YYCURSOR;
switch(yych){
yy93:
#line 142 "modula.re"
{RETURN(71);}
-#line 806 "<stdout>"
+#line 809 "<stdout>"
yy94:
yych = *++YYCURSOR;
switch(yych){
yy98:
#line 141 "modula.re"
{RETURN(70);}
-#line 893 "<stdout>"
+#line 896 "<stdout>"
yy99:
yych = *++YYCURSOR;
switch(yych){
yy101:
#line 139 "modula.re"
{RETURN(68);}
-#line 968 "<stdout>"
+#line 971 "<stdout>"
yy102:
yych = *++YYCURSOR;
switch(yych){
yy105:
#line 140 "modula.re"
{RETURN(69);}
-#line 1049 "<stdout>"
+#line 1052 "<stdout>"
yy106:
yych = *++YYCURSOR;
switch(yych){
yy108:
#line 138 "modula.re"
{RETURN(67);}
-#line 1124 "<stdout>"
+#line 1127 "<stdout>"
yy109:
yych = *++YYCURSOR;
switch(yych){
yy111:
#line 137 "modula.re"
{RETURN(66);}
-#line 1199 "<stdout>"
+#line 1202 "<stdout>"
yy112:
yych = *++YYCURSOR;
switch(yych){
yy119:
#line 136 "modula.re"
{RETURN(65);}
-#line 1306 "<stdout>"
+#line 1309 "<stdout>"
yy120:
yych = *++YYCURSOR;
switch(yych){
yy123:
#line 135 "modula.re"
{RETURN(64);}
-#line 1387 "<stdout>"
+#line 1390 "<stdout>"
yy124:
yych = *++YYCURSOR;
switch(yych){
yy127:
#line 134 "modula.re"
{RETURN(63);}
-#line 1468 "<stdout>"
+#line 1471 "<stdout>"
yy128:
yych = *++YYCURSOR;
switch(yych){
yy136:
#line 133 "modula.re"
{RETURN(62);}
-#line 1579 "<stdout>"
+#line 1582 "<stdout>"
yy137:
yych = *++YYCURSOR;
switch(yych){
yy146:
#line 132 "modula.re"
{RETURN(61);}
-#line 1696 "<stdout>"
+#line 1699 "<stdout>"
yy147:
yych = *++YYCURSOR;
switch(yych){
yy152:
#line 131 "modula.re"
{RETURN(60);}
-#line 1789 "<stdout>"
+#line 1792 "<stdout>"
yy153:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy154:
#line 129 "modula.re"
{RETURN(58);}
-#line 1858 "<stdout>"
+#line 1861 "<stdout>"
yy155:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy156:
#line 130 "modula.re"
{RETURN(59);}
-#line 1927 "<stdout>"
+#line 1930 "<stdout>"
yy157:
yych = *++YYCURSOR;
switch(yych){
yy159:
#line 128 "modula.re"
{RETURN(57);}
-#line 2002 "<stdout>"
+#line 2005 "<stdout>"
yy160:
yych = *++YYCURSOR;
switch(yych){
yy162:
#line 126 "modula.re"
{RETURN(55);}
-#line 2076 "<stdout>"
+#line 2079 "<stdout>"
yy163:
yych = *++YYCURSOR;
switch(yych){
yy166:
#line 127 "modula.re"
{RETURN(56);}
-#line 2157 "<stdout>"
+#line 2160 "<stdout>"
yy167:
yych = *++YYCURSOR;
switch(yych){
yy170:
#line 125 "modula.re"
{RETURN(54);}
-#line 2238 "<stdout>"
+#line 2241 "<stdout>"
yy171:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy172:
#line 121 "modula.re"
{RETURN(50);}
-#line 2307 "<stdout>"
+#line 2310 "<stdout>"
yy173:
yych = *++YYCURSOR;
switch(yych){
yy175:
#line 124 "modula.re"
{RETURN(53);}
-#line 2382 "<stdout>"
+#line 2385 "<stdout>"
yy176:
yych = *++YYCURSOR;
switch(yych){
yy181:
#line 123 "modula.re"
{RETURN(52);}
-#line 2476 "<stdout>"
+#line 2479 "<stdout>"
yy182:
yych = *++YYCURSOR;
switch(yych){
yy192:
#line 122 "modula.re"
{RETURN(51);}
-#line 2599 "<stdout>"
+#line 2602 "<stdout>"
yy193:
yych = *++YYCURSOR;
switch(yych){
yy197:
#line 120 "modula.re"
{RETURN(49);}
-#line 2686 "<stdout>"
+#line 2689 "<stdout>"
yy198:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy199:
#line 119 "modula.re"
{RETURN(48);}
-#line 2755 "<stdout>"
+#line 2758 "<stdout>"
yy200:
yych = *++YYCURSOR;
switch(yych){
yy208:
#line 118 "modula.re"
{RETURN(47);}
-#line 2867 "<stdout>"
+#line 2870 "<stdout>"
yy209:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy210:
#line 117 "modula.re"
{RETURN(46);}
-#line 2936 "<stdout>"
+#line 2939 "<stdout>"
yy211:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy212:
#line 116 "modula.re"
{RETURN(45);}
-#line 3005 "<stdout>"
+#line 3008 "<stdout>"
yy213:
yych = *++YYCURSOR;
switch(yych){
yy215:
#line 114 "modula.re"
{RETURN(43);}
-#line 3081 "<stdout>"
+#line 3084 "<stdout>"
yy216:
yych = *++YYCURSOR;
switch(yych){
yy218:
#line 115 "modula.re"
{RETURN(44);}
-#line 3156 "<stdout>"
+#line 3159 "<stdout>"
yy219:
yych = *++YYCURSOR;
switch(yych){
yy222:
#line 113 "modula.re"
{RETURN(42);}
-#line 3237 "<stdout>"
+#line 3240 "<stdout>"
yy223:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy224:
#line 112 "modula.re"
{RETURN(41);}
-#line 3306 "<stdout>"
+#line 3309 "<stdout>"
yy225:
yych = *++YYCURSOR;
switch(yych){
yy233:
#line 111 "modula.re"
{RETURN(40);}
-#line 3417 "<stdout>"
+#line 3420 "<stdout>"
yy234:
yych = *++YYCURSOR;
switch(yych){
yy239:
#line 110 "modula.re"
{RETURN(39);}
-#line 3510 "<stdout>"
+#line 3513 "<stdout>"
yy240:
yych = *++YYCURSOR;
switch(yych){
yy242:
#line 109 "modula.re"
{RETURN(38);}
-#line 3585 "<stdout>"
+#line 3588 "<stdout>"
yy243:
yych = *++YYCURSOR;
switch(yych){
yy245:
#line 108 "modula.re"
{RETURN(37);}
-#line 3660 "<stdout>"
+#line 3663 "<stdout>"
yy246:
yych = *++YYCURSOR;
switch(yych){
yy249:
#line 107 "modula.re"
{RETURN(36);}
-#line 3741 "<stdout>"
+#line 3744 "<stdout>"
yy250:
yych = *++YYCURSOR;
switch(yych){
yy255:
#line 106 "modula.re"
{RETURN(35);}
-#line 3834 "<stdout>"
+#line 3837 "<stdout>"
yy256:
++YYCURSOR;
switch((yych = *YYCURSOR)) {
yy257:
#line 105 "modula.re"
{RETURN(34);}
-#line 3903 "<stdout>"
+#line 3906 "<stdout>"
yy258:
++YYCURSOR;
#line 96 "modula.re"
{RETURN(26);}
-#line 3908 "<stdout>"
+#line 3911 "<stdout>"
yy260:
++YYCURSOR;
#line 93 "modula.re"
{RETURN(23);}
-#line 3913 "<stdout>"
+#line 3916 "<stdout>"
yy262:
++YYCURSOR;
#line 92 "modula.re"
{RETURN(22);}
-#line 3918 "<stdout>"
+#line 3921 "<stdout>"
yy264:
++YYCURSOR;
#line 89 "modula.re"
{RETURN(19);}
-#line 3923 "<stdout>"
+#line 3926 "<stdout>"
yy266:
++YYCURSOR;
#line 86 "modula.re"
{RETURN(16);}
-#line 3928 "<stdout>"
+#line 3931 "<stdout>"
yy268:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
++YYCURSOR;
#line 75 "modula.re"
{RETURN(6);}
-#line 3952 "<stdout>"
+#line 3955 "<stdout>"
yy273:
++YYCURSOR;
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy276:
#line 74 "modula.re"
{RETURN(5);}
-#line 3973 "<stdout>"
+#line 3976 "<stdout>"
yy277:
+ yyctxmarker = YYCURSOR + 1;
yyaccept = 0;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
++YYCURSOR;
#line 73 "modula.re"
{RETURN(4);}
-#line 4028 "<stdout>"
+#line 4032 "<stdout>"
yy283:
++YYCURSOR;
- YYCURSOR -= 2;#line 70 "modula.re"
+ YYCURSOR = yyctxmarker;
+#line 70 "modula.re"
{RETURN(1);}
-#line 4033 "<stdout>"
+#line 4038 "<stdout>"
yy285:
yyaccept = 2;
YYMARKER = ++YYCURSOR;
default: goto yy276;
}
yy291:
+ yyctxmarker = YYCURSOR + 1;
yyaccept = 0;
YYMARKER = ++YYCURSOR;
if((YYLIMIT - YYCURSOR) < 4) YYFILL(4);
yy294:
#line 71 "modula.re"
{RETURN(2);}
-#line 4153 "<stdout>"
+#line 4159 "<stdout>"
yy295:
yyaccept = 4;
yych = *(YYMARKER = ++YYCURSOR);
yy296:
#line 72 "modula.re"
{RETURN(3);}
-#line 4179 "<stdout>"
+#line 4185 "<stdout>"
yy297:
++YYCURSOR;
#line 67 "modula.re"
{ depth = 1; goto comment; }
-#line 4184 "<stdout>"
+#line 4190 "<stdout>"
}
#line 162 "modula.re"
comment:
-#line 4190 "<stdout>"
+#line 4196 "<stdout>"
{
YYCTYPE yych;
+ YYCTYPE *yyctxmarker = YYCURSOR;
if((YYLIMIT - YYCURSOR) < 2) YYFILL(2);
yych = *YYCURSOR;
switch(yych){
yy302:
#line 179 "modula.re"
{ goto comment; }
-#line 4210 "<stdout>"
+#line 4217 "<stdout>"
yy303:
yych = *++YYCURSOR;
switch(yych){
s->tok = s->pos = cursor; s->line++;
goto comment;
}
-#line 4225 "<stdout>"
+#line 4232 "<stdout>"
yy306:
yych = *++YYCURSOR;
goto yy302;
++YYCURSOR;
#line 172 "modula.re"
{ ++depth; goto comment; }
-#line 4233 "<stdout>"
+#line 4240 "<stdout>"
yy309:
++YYCURSOR;
#line 166 "modula.re"
else
goto comment;
}
-#line 4243 "<stdout>"
+#line 4250 "<stdout>"
}
#line 180 "modula.re"