-/* Generated by re2c 0.13.0.dev on Sat May 5 19:12:48 2007 */
+/* Generated by re2c 0.13.0.dev on Sun May 6 21:32:27 2007 */
#line 1 "scanner.re"
/* $Id$ */
#include <stdlib.h>
o.clear();
o += indent(ind++) + "enum " + mapCodeName["YYCONDTYPE"] + " {\n";
- for(RegExpMap::const_iterator it = specMap.begin(); it != specMap.end(); ++it)
+
+ RegExpIndices vCondList(specMap.size());
+
+ for(RegExpMap::const_iterator itSpecMap = specMap.begin(); itSpecMap != specMap.end(); ++itSpecMap)
+ {
+ vCondList[itSpecMap->second.first] = itSpecMap->first;
+ }
+
+ for(RegExpIndices::const_iterator itCondType = vCondList.begin(); itCondType != vCondList.end(); ++itCondType)
{
- o += indent(ind) + condEnumPrefix + it->first + ",\n";
+ o += indent(ind) + condEnumPrefix + *itCondType + ",\n";
}
+
o += indent(--ind) + "};\n";
}
/* Generated by re2c */
enum YYCONDTYPE {
- yyccomment,
yycnormal,
+ yyccomment,
};
#line 3 "condition_05.cgt.h"
enum YYCONDTYPE {
- yyccomment,
yycnormal,
+ yyccomment,
};
#line 57 "<stdout>"
enum YYCONDTYPE {
- EStateComment,
EStateNormal,
+ EStateComment,
EStateSkiptoeol,
EStateString,
};
enum ScanContition {
- EStateComment,
EStateNormal,
+ EStateComment,
EStateSkiptoeol,
EStateString,
};
enum ScanContition {
- EStateComment,
EStateNormal,
+ EStateComment,
EStateSkiptoeol,
EStateString,
};
enum ScanContition {
- EStateComment,
EStateNormal,
+ EStateComment,
EStateSkiptoeol,
EStateString,
};
{
s->cur = s->tok = s->lim = s->buffer;
s->eof = 0;
+ s->cond = EStateNormal;
+ s->state = -1;
return fill(s, 0);
}
void scan(Scanner *s)
{
+ s->tok = s->cur;
+
+ switch(s->state) {
+ default: goto yy0;
+ case 0: goto yyFillLabel0;
+ case 1: goto yyFillLabel1;
+ case 2: goto yyFillLabel2;
+ case 3: goto yyFillLabel3;
+ }
for(;;)
{
s->tok = s->cur;
{
- switch(s->state) {
- default: goto yy0;
- case 0: goto yyFillLabel0;
- case 1: goto yyFillLabel1;
- case 2: goto yyFillLabel2;
- case 3: goto yyFillLabel3;
- }
yy0:
if (s->cond < 2) {
if (s->cond < 1) {
}
yy24:
++s->cur;
- s->cond = EStateNormal;
+ s->cond = EStateComment;
{
goto yyc_Comment;
}
int main(int argc, char **argv)
{
Scanner in;
- char c;
if (argc != 2)
{
return 1;
}
- in.cond = EStateNormal;
-
if (init(&in) > 0)
{
scan(&in);
{
s->cur = s->tok = s->lim = s->buffer;
s->eof = 0;
+ s->cond = EStateNormal;
+ s->state = -1;
return fill(s, 0);
}
void scan(Scanner *s)
{
+ s->tok = s->cur;
+/*!re2c
+re2c:define:YYGETSTATE = "s->state";
+re2c:define:YYGETSTATE:naked = 1;
+re2c:define:YYCONDTYPE = ScanContition;
+re2c:indent:top = 1;
+*/
+/*!getstate:re2c */
for(;;)
{
s->tok = s->cur;
re2c:define:YYFILL = "if(fill(s, #) == ~0) break;";
re2c:define:YYSETSTATE@state = #;
re2c:define:YYSETSTATE = "s->state = #;";
-re2c:define:YYGETSTATE = "s->state";
-re2c:define:YYGETSTATE:naked = 1;
re2c:define:YYSETCONDITION = "s->cond = #;";
re2c:define:YYSETCONDITION@cond = #;
re2c:define:YYGETCONDITION = s->cond;
re2c:define:YYGETCONDITION:naked = 1;
-re2c:define:YYCONDTYPE = ScanContition;
re2c:variable:yych = s->yych;
re2c:yych:emit = 0;
re2c:indent:top = 2;
fputc('~', stdout);
continue;
}
-<Normal> "/*" => Normal
+<Normal> "/*" => Comment
{
goto yyc_Comment;
}
int main(int argc, char **argv)
{
Scanner in;
- char c;
if (argc != 2)
{
return 1;
}
- in.cond = EStateNormal;
-
if (init(&in) > 0)
{
scan(&in);
enum ScanContition {
- EStateComment,
EStateNormal,
+ EStateComment,
EStateSkiptoeol,
EStateString,
};
{
s->cur = s->tok = s->lim = s->buffer;
s->eof = 0;
+ s->cond = EStateNormal;
+ s->state = -1;
return fill(s, 0);
}
void scan(Scanner *s)
{
+ s->tok = s->cur;
+
+ switch(s->state) {
+ default: goto yy0;
+ case 0: goto yyFillLabel0;
+ case 1: goto yyFillLabel1;
+ case 2: goto yyFillLabel2;
+ case 3: goto yyFillLabel3;
+ }
for(;;)
{
s->tok = s->cur;
&&yyc_Skiptoeol,
&&yyc_String,
};
- switch(s->state) {
- default: goto yy0;
- case 0: goto yyFillLabel0;
- case 1: goto yyFillLabel1;
- case 2: goto yyFillLabel2;
- case 3: goto yyFillLabel3;
- }
yy0:
goto *yyctable[s->cond];
/* *********************************** */
}
yy24:
++s->cur;
- s->cond = EStateNormal;
+ s->cond = EStateComment;
{
goto yyc_Comment;
}
int main(int argc, char **argv)
{
Scanner in;
- char c;
if (argc != 2)
{
return 1;
}
- in.cond = EStateNormal;
-
if (init(&in) > 0)
{
scan(&in);
{
s->cur = s->tok = s->lim = s->buffer;
s->eof = 0;
+ s->cond = EStateNormal;
+ s->state = -1;
return fill(s, 0);
}
void scan(Scanner *s)
{
+ s->tok = s->cur;
+/*!re2c
+re2c:define:YYGETSTATE = "s->state";
+re2c:define:YYGETSTATE:naked = 1;
+re2c:define:YYCONDTYPE = ScanContition;
+re2c:indent:top = 1;
+*/
+/*!getstate:re2c */
for(;;)
{
s->tok = s->cur;
re2c:define:YYFILL = "if(fill(s, #) == ~0) break;";
re2c:define:YYSETSTATE@state = #;
re2c:define:YYSETSTATE = "s->state = #;";
-re2c:define:YYGETSTATE = "s->state";
-re2c:define:YYGETSTATE:naked = 1;
re2c:define:YYSETCONDITION = "s->cond = #;";
re2c:define:YYSETCONDITION@cond = #;
re2c:define:YYGETCONDITION = s->cond;
re2c:define:YYGETCONDITION:naked = 1;
-re2c:define:YYCONDTYPE = ScanContition;
re2c:variable:yych = s->yych;
re2c:yych:emit = 0;
re2c:indent:top = 2;
fputc('~', stdout);
continue;
}
-<Normal> "/*" => Normal
+<Normal> "/*" => Comment
{
goto yyc_Comment;
}
int main(int argc, char **argv)
{
Scanner in;
- char c;
if (argc != 2)
{
return 1;
}
- in.cond = EStateNormal;
-
if (init(&in) > 0)
{
scan(&in);