]> granicus.if.org Git - re2c/commitdiff
- Split YYCONDITION into YYGETCONDITION and YYSETCONDITION
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Tue, 1 May 2007 14:55:50 +0000 (14:55 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Tue, 1 May 2007 14:55:50 +0000 (14:55 +0000)
- Synch YYGETCONDITION with YYGETSTATE
- Synch YYSETCONDITION with YYSETSTATE

25 files changed:
re2c/bootstrap/scanner.cc
re2c/code.cc
re2c/globals.h
re2c/main.cc
re2c/test/condition_01.c.c
re2c/test/condition_02.c.c
re2c/test/condition_02.cg.c
re2c/test/condition_03.cg.c
re2c/test/condition_04.cg.c
re2c/test/condition_05.cg.c
re2c/test/condition_05.cg.re
re2c/test/condition_05.cgitcondition_05.cgit.h.c
re2c/test/condition_05.cgitcondition_05.cgit.h.re
re2c/test/condition_05.cgtcondition_05.cgt.h.c
re2c/test/condition_05.cgtcondition_05.cgt.h.re
re2c/test/condition_05.cs.c
re2c/test/condition_05.cs.re
re2c/test/condition_06.cs.c
re2c/test/condition_06.cs.re
re2c/test/condition_07.cbi.c
re2c/test/condition_07.cbi.re
re2c/test/condition_08.cbi.re
re2c/test/condition_08.cbif.re
re2c/test/condition_09.cbif.re
re2c/test/condition_09.cgif.re

index 5d54c1578b39c4bc66718b6768270b1430a601a9..3a6073755bdcc5112f0f12830ad9ab153bbc81b4 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.0.dev on Tue May  1 09:40:03 2007 */
+/* Generated by re2c 0.13.0.dev on Tue May  1 09:59:49 2007 */
 #line 1 "scanner.re"
 /* $Id$ */
 #include <stdlib.h>
index 22820f3f38808f8d61ce9eac116e0c85faabbfb2..4d51e2e6feb74ee8268e80473629aae2c57e9cf7 100644 (file)
@@ -16,7 +16,7 @@ namespace re2c
 // there must be at least one span in list;  all spans must cover
 // same range
 
-std::string indent(uint ind)
+static std::string indent(uint ind)
 {
        std::string str;
 
@@ -27,6 +27,73 @@ std::string indent(uint ind)
        return str;
 }
 
+static std::string replaceParam(std::string str, const std::string& param, const std::string& value)
+{
+       std::string::size_type pos;
+
+       while((pos = str.find(param)) != std::string::npos)
+       {
+               str.replace(pos, param.length(), value);
+       }
+
+       return str;
+}
+
+static std::string replaceParam(std::string str, const std::string& param, int value)
+{
+       char tmp[16];
+
+       sprintf(tmp, "%d", value);
+
+       return replaceParam(str, param, tmp);
+}
+
+static void genYYFill(std::ostream &o, uint ind, uint need)
+{
+       if (bUseYYFillParam)
+       {
+               o << mapCodeName["YYFILL"];
+               if (!bUseYYFillNaked)
+               {
+                       o << "(" << need << ");";
+               }
+               o << "\n";
+       }
+       else
+       {
+               o << replaceParam(mapCodeName["YYFILL"], yyFillLength, need);
+               if (!bUseYYFillNaked)
+               {
+                       o << ";";
+               }
+               o << "\n";
+       }
+}
+
+static void genGetCondition(std::ostream &o)
+{
+       if (bUseYYGetConditionNaked)
+       {
+               o << mapCodeName["YYGETCONDITION"];
+       }
+       else
+       {
+               o << mapCodeName["YYGETCONDITION"] << "()";
+       }
+}
+
+static void genSetCondition(std::ostream& o, uint ind, const std::string& newcond)
+{
+       if (bUseYYSetConditionParam)
+       {
+               o << indent(ind) << mapCodeName["YYSETCONDITION"] << "(" << condEnumPrefix << newcond << ");\n";
+       }
+       else
+       {
+               o << indent(ind) << replaceParam(mapCodeName["YYSETCONDITION"], yySetConditionParam, condEnumPrefix + newcond) << "\n";
+       }
+}
+
 static std::string space(uint this_label)
 {
        int nl = next_label > 999999 ? 6 : next_label > 99999 ? 5 : next_label > 9999 ? 4 : next_label > 999 ? 3 : next_label > 99 ? 2 : next_label > 9 ? 1 : 0;
@@ -313,43 +380,6 @@ void genIf(std::ostream &o, uint ind, const char *cmp, uint v, bool &readCh)
        o << ") ";
 }
 
-static std::string replaceParam(std::string str, const std::string& param, int value)
-{
-       std::string::size_type pos;
-       char tmp[16];
-
-       sprintf(tmp, "%d", value);
-
-       while((pos = str.find(param)) != std::string::npos)
-       {
-               str.replace(pos, param.length(), tmp);
-       }
-
-       return str;
-}
-
-static void genYYFill(std::ostream &o, uint ind, uint need)
-{
-       if (bUseYYFillParam)
-       {
-               o << mapCodeName["YYFILL"];
-               if (!bUseYYFillNaked)
-               {
-                       o << "(" << need << ");";
-               }
-               o << "\n";
-       }
-       else
-       {
-               o << replaceParam(mapCodeName["YYFILL"], yyFillLength, need);
-               if (!bUseYYFillNaked)
-               {
-                       o << ";";
-               }
-               o << "\n";
-       }
-}
-
 static void need(std::ostream &o, uint ind, uint n, bool & readCh, bool bSetMarker)
 {
        uint fillIndex = next_fill_index;
@@ -639,7 +669,7 @@ void Rule::emit(std::ostream &o, uint ind, bool &) const
 
        if (rule->code->newcond)
        {
-               o << indent(ind) << mapCodeName["YYCONDITION"] << " = " << condEnumPrefix << rule->code->newcond << ";\n";
+               genSetCondition(o, ind, rule->code->newcond->to_string());
        }
 
        RuleLine rl(*rule);
@@ -1770,7 +1800,9 @@ static void genCondGotoSub(std::ostream &o, uint ind, RegExpIndices& vCondList,
        {
                uint cMid = cMin + ((cMax - cMin + 1) / 2);
 
-               o << indent(ind) << "if (" << mapCodeName["YYCONDITION"] << " < " << cMid << ") {\n";
+               o << indent(ind) << "if (";
+               genGetCondition(o);
+               o << " < " << cMid << ") {\n";
                genCondGotoSub(o, ind + 1, vCondList, cMin, cMid - 1);
                o << indent(ind) << "} else {\n";
                genCondGotoSub(o, ind + 1, vCondList, cMid, cMax);
@@ -1784,7 +1816,9 @@ void genCondGoto(std::ostream &o, uint ind, const RegExpMap& specMap)
        {
                if (gFlag)
                {
-                       o << indent(ind) << "goto *" << mapCodeName["yyctable"] << "[" << mapCodeName["YYCONDITION"] << "];\n";
+                       o << indent(ind) << "goto *" << mapCodeName["yyctable"] << "[";
+                       genGetCondition(o);
+                       o << "];\n";
                }
                else
                {
@@ -1800,7 +1834,9 @@ void genCondGoto(std::ostream &o, uint ind, const RegExpMap& specMap)
                        }
                        else
                        {
-                               o << indent(ind) << "switch(" << mapCodeName["YYCONDITION"] << ") {\n";
+                               o << indent(ind) << "switch(";
+                               genGetCondition(o);
+                               o << ") {\n";
        
                                for(RegExpMap::const_iterator it = specMap.begin(); it != specMap.end(); ++it)
                                {
@@ -1891,10 +1927,6 @@ void Scanner::config(const Str& cfg, int num)
        {
                bUseYYFillParam = num != 0;
        }
-       else if (cfg.to_string() == "define:YYFILL:naked")
-       {
-               bUseYYFillNaked = num != 0;
-       }
        else if (cfg.to_string() == "cgoto:threshold")
        {
                cGotoThreshold = num;
@@ -1916,13 +1948,24 @@ void Scanner::config(const Str& cfg, int num)
        {
                bEmitYYCh = num != 0;
        }
+       else if (cfg.to_string() == "define:YYFILL:naked")
+       {
+               bUseYYFillNaked = num != 0;
+       }
+       else if (cfg.to_string() == "define:YYGETCONDITION:naked")
+       {
+               bUseYYGetConditionNaked = num != 0;
+       }
        else if (cfg.to_string() == "define:YYGETSTATE:naked")
        {
                bUseYYGetStateNaked = num != 0;
        }
        else
        {
-               fatal("unrecognized configuration name or illegal integer value");
+               std::string msg = "unrecognized configuration name '";
+               msg += cfg.to_string();
+               msg += "' or illegal integer value";
+               fatal(msg.c_str());
        }
 }
 
@@ -1939,16 +1982,17 @@ void Scanner::config(const Str& cfg, const Str& val)
                mapVariableKeys.insert("variable:yych");
                mapVariableKeys.insert("variable:yyctable");
                mapVariableKeys.insert("variable:yytarget");
-               mapDefineKeys.insert("define:YYCONDITION");
                mapDefineKeys.insert("define:YYCONDTYPE");
                mapDefineKeys.insert("define:YYCTXMARKER");
                mapDefineKeys.insert("define:YYCTYPE");
                mapDefineKeys.insert("define:YYCURSOR");
                mapDefineKeys.insert("define:YYDEBUG");
                mapDefineKeys.insert("define:YYFILL");
+               mapDefineKeys.insert("define:YYGETCONDITION");
                mapDefineKeys.insert("define:YYGETSTATE");
                mapDefineKeys.insert("define:YYLIMIT");
                mapDefineKeys.insert("define:YYMARKER");
+               mapDefineKeys.insert("define:YYSETCONDITION");
                mapDefineKeys.insert("define:YYSETSTATE");
                mapLabelKeys.insert("label:yyFillLabel");
                mapLabelKeys.insert("label:yyNext");
@@ -1993,6 +2037,11 @@ void Scanner::config(const Str& cfg, const Str& val)
                yyFillLength = strVal;
                bUseYYFillParam = false;
        }
+       else if (cfg.to_string() == "define:YYSETCONDITION@cond")
+       {
+               yySetConditionParam = strVal;
+               bUseYYSetConditionParam = false;
+       }
        else if (cfg.to_string() == "define:YYSETSTATE@state")
        {
                yySetStateParam = strVal;
@@ -2027,7 +2076,10 @@ void Scanner::config(const Str& cfg, const Str& val)
     }
        else
        {
-               fatal("unrecognized configuration name or illegal string value");
+               std::string msg = "unrecognized configuration name '";
+               msg += cfg.to_string();
+               msg += "' or illegal string value";
+               fatal(msg.c_str());
        }
 }
 
index 2d9ec9ee8604b7dc9bea63017c1c9c3625ca8d17..b313d1c823aa694eeb6c857964d20c0f3e906596 100644 (file)
@@ -45,6 +45,7 @@ extern std::string condPrefix;
 extern std::string condEnumPrefix;
 extern std::string yychConversion;
 extern std::string yyFillLength;
+extern std::string yySetConditionParam;
 extern std::string yySetStateParam;
 extern uint maxFill;
 extern uint next_label;
@@ -60,6 +61,8 @@ extern bool bUseStateNext;
 extern bool bUseYYFill;
 extern bool bUseYYFillParam;
 extern bool bUseYYFillNaked;
+extern bool bUseYYSetConditionParam;
+extern bool bUseYYGetConditionNaked;
 extern bool bUseYYSetStateParam;
 extern bool bUseYYGetStateNaked;
 extern bool bWroteGetState;
index 29ddf8ca0845cc1fdeb0a00ad560369e2784728e..b659b17139613948024eacd89a3dd6004c00b2f2 100644 (file)
@@ -50,6 +50,8 @@ bool bUseStateNext   = false;
 bool bUseYYFill      = true;
 bool bUseYYFillParam = true;
 bool bUseYYFillNaked = false;
+bool bUseYYSetConditionParam = true;
+bool bUseYYGetConditionNaked = false;
 bool bUseYYSetStateParam = true;
 bool bUseYYGetStateNaked = false;
 
@@ -59,6 +61,7 @@ std::string condPrefix("yyc_");
 std::string condEnumPrefix("yyc");
 std::string yychConversion("");
 std::string yyFillLength("@@");
+std::string yySetConditionParam("@@");
 std::string yySetStateParam("@@");
 uint maxFill = 1;
 uint next_label = 0;
index 78557556d961c38dab4fa17e55f9b1be5627b68c..99afe6b5718c4827d22d184d1fb54c0867a640c7 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-       switch(YYCONDITION) {
+       switch(YYGETCONDITION()) {
        case yyca: goto yyc_a;
        case yycb: goto yyc_b;
        }
index f9b152ec0f01686f6812567e24a4ef8135987535..7667d77e1a4353e3249b99fe40bb17db82c96b61 100755 (executable)
@@ -4,7 +4,7 @@
 #line 5 "<stdout>"
 {
        YYCTYPE yych;
-       switch(YYCONDITION) {
+       switch(YYGETCONDITION()) {
        case yyc0: goto yyc_0;
        case yycr1: goto yyc_r1;
        case yycr2: goto yyc_r2;
index dfb1816f4f4ca727bfb5c2abdbce7fcc646ae326..732894e3059e2f2a00eec85d920c4e2e4affc67b 100755 (executable)
@@ -9,7 +9,7 @@
                &&yyc_r1,
                &&yyc_r2,
        };
-       goto *yyctable[YYCONDITION];
+       goto *yyctable[YYGETCONDITION()];
 /* *********************************** */
 yyc_0:
 
index 76a0da7e6b7c5faf7b097e62b96386515d0cb3ba..671b9b8cf4415b70bf7755988d1f1ce2299f724a 100755 (executable)
@@ -9,7 +9,7 @@
                &&yyc_r1,
                &&yyc_r2,
        };
-       goto *yyctable[YYCONDITION];
+       goto *yyctable[YYGETCONDITION()];
 /* *********************************** */
 yyc_0:
 
index b996a8d13b166d48b2d06cc1b9da7fbdfd751561..9346d662631248fd1ba070c77942bf04bbc1d989 100755 (executable)
@@ -8,7 +8,7 @@
                &&yyc_r1,
                &&yyc_r2,
        };
-       goto *yyctable[YYCONDITION];
+       goto *yyctable[YYGETCONDITION()];
 /* *********************************** */
 yyc_r1:
 
index 0f7c418ff7d7e559084eed2f93a3e513a79581a3..b19dc7442e674f121e158edaff0aae57e5473319 100755 (executable)
@@ -47,7 +47,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -62,7 +62,7 @@ char scan(Scanner *s)
                                &&yyc_normal,
                                &&yyc_comment,
                        };
-                       goto *yyctable[state];
+                       goto *yyctable[cond];
 /* *********************************** */
 yyc_comment:
 
@@ -72,7 +72,7 @@ yyc_comment:
                        ++s->cur;
                        if((yych = *s->cur) == '/') goto yy5;
 yy3:
-#line 82 "condition_05.cg.re"
+#line 83 "condition_05.cg.re"
                        {
                                goto yyc_comment;
                        }
@@ -82,7 +82,7 @@ yy4:
                        goto yy3;
 yy5:
                        ++s->cur;
-#line 78 "condition_05.cg.re"
+#line 79 "condition_05.cg.re"
                        {
                                continue;
                        }
@@ -95,7 +95,7 @@ yyc_normal:
                        ++s->cur;
                        if((yych = *s->cur) == '*') goto yy12;
 yy10:
-#line 73 "condition_05.cg.re"
+#line 74 "condition_05.cg.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -106,13 +106,13 @@ yy11:
                        goto yy10;
 yy12:
                        ++s->cur;
-#line 69 "condition_05.cg.re"
+#line 70 "condition_05.cg.re"
                        {
                                goto yyc_comment;
                        }
 #line 114 "<stdout>"
                }
-#line 86 "condition_05.cg.re"
+#line 87 "condition_05.cg.re"
 
        }
 }
index b70cb073c9f8aec7862896dfb335b3bfda8ef250..5e086513da864100f1f1e38823fc873a1f139289 100755 (executable)
@@ -45,7 +45,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -61,7 +61,8 @@ re2c:define:YYMARKER    = s->ptr;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 
index 1abbdb98184c9112a72307a9c152e5da7989f7ac..e2b4fcf9a0091cbb498d1aa8c901ee142da09442 100755 (executable)
@@ -46,7 +46,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -60,7 +60,7 @@ char scan(Scanner *s)
                                &&yyc_normal,
                                &&yyc_comment,
                        };
-                       goto *yyctable[state];
+                       goto *yyctable[cond];
 /* *********************************** */
 yyc_comment:
 
index b70cb073c9f8aec7862896dfb335b3bfda8ef250..5e086513da864100f1f1e38823fc873a1f139289 100755 (executable)
@@ -45,7 +45,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -61,7 +61,8 @@ re2c:define:YYMARKER    = s->ptr;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 
index a635939b05bdac18539c6f93f86659e83d571516..223e64acfb59c343504dfd82cdba8b21c8b5e10a 100755 (executable)
@@ -47,7 +47,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -62,7 +62,7 @@ char scan(Scanner *s)
                                &&yyc_normal,
                                &&yyc_comment,
                        };
-                       goto *yyctable[state];
+                       goto *yyctable[cond];
 /* *********************************** */
 yyc_comment:
 
@@ -72,7 +72,7 @@ yyc_comment:
                        ++s->cur;
                        if((yych = *s->cur) == '/') goto yy5;
 yy3:
-#line 82 "condition_05.cgtcondition_05.cgt.h.re"
+#line 83 "condition_05.cgtcondition_05.cgt.h.re"
                        {
                                goto yyc_comment;
                        }
@@ -82,7 +82,7 @@ yy4:
                        goto yy3;
 yy5:
                        ++s->cur;
-#line 78 "condition_05.cgtcondition_05.cgt.h.re"
+#line 79 "condition_05.cgtcondition_05.cgt.h.re"
                        {
                                continue;
                        }
@@ -95,7 +95,7 @@ yyc_normal:
                        ++s->cur;
                        if((yych = *s->cur) == '*') goto yy12;
 yy10:
-#line 73 "condition_05.cgtcondition_05.cgt.h.re"
+#line 74 "condition_05.cgtcondition_05.cgt.h.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -106,13 +106,13 @@ yy11:
                        goto yy10;
 yy12:
                        ++s->cur;
-#line 69 "condition_05.cgtcondition_05.cgt.h.re"
+#line 70 "condition_05.cgtcondition_05.cgt.h.re"
                        {
                                goto yyc_comment;
                        }
 #line 114 "<stdout>"
                }
-#line 86 "condition_05.cgtcondition_05.cgt.h.re"
+#line 87 "condition_05.cgtcondition_05.cgt.h.re"
 
        }
 }
index b70cb073c9f8aec7862896dfb335b3bfda8ef250..5e086513da864100f1f1e38823fc873a1f139289 100755 (executable)
@@ -45,7 +45,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -61,7 +61,8 @@ re2c:define:YYMARKER    = s->ptr;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 
index e9dfb1db9002c94e02b321eb5c370918ce393067..b458b551261f8b316a2e2a6c402c4b9d9bd40c9c 100755 (executable)
@@ -47,7 +47,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -58,7 +58,7 @@ char scan(Scanner *s)
 #line 59 "<stdout>"
                {
                        unsigned char yych;
-                       if (state < 1) {
+                       if (cond < 1) {
                                goto yyc_normal;
                        } else {
                                goto yyc_comment;
@@ -72,7 +72,7 @@ yyc_comment:
                        ++s->cur;
                        if((yych = *s->cur) == '/') goto yy5;
 yy3:
-#line 82 "condition_05.cs.re"
+#line 83 "condition_05.cs.re"
                        {
                                goto yyc_comment;
                        }
@@ -82,7 +82,7 @@ yy4:
                        goto yy3;
 yy5:
                        ++s->cur;
-#line 78 "condition_05.cs.re"
+#line 79 "condition_05.cs.re"
                        {
                                continue;
                        }
@@ -95,7 +95,7 @@ yyc_normal:
                        ++s->cur;
                        if((yych = *s->cur) == '*') goto yy12;
 yy10:
-#line 73 "condition_05.cs.re"
+#line 74 "condition_05.cs.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -106,13 +106,13 @@ yy11:
                        goto yy10;
 yy12:
                        ++s->cur;
-#line 69 "condition_05.cs.re"
+#line 70 "condition_05.cs.re"
                        {
                                goto yyc_comment;
                        }
 #line 114 "<stdout>"
                }
-#line 86 "condition_05.cs.re"
+#line 87 "condition_05.cs.re"
 
        }
 }
index b70cb073c9f8aec7862896dfb335b3bfda8ef250..5e086513da864100f1f1e38823fc873a1f139289 100755 (executable)
@@ -45,7 +45,7 @@ int fill(Scanner *s, int len)
 
 char scan(Scanner *s)
 {
-       int state = 1;
+       int cond = 1;
        
        fill(s, 0);
 
@@ -61,7 +61,8 @@ re2c:define:YYMARKER    = s->ptr;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 
index 7b861603e5d6a9fb2895354e4f58e83bd5937e35..81b20862f801cc607c021ec61f13d43d246e3d1e 100755 (executable)
@@ -66,7 +66,7 @@ enum YYCONDTYPE {
 
 void scan(Scanner *s)
 {
-       int state = EStateNormal;
+       int cond = EStateNormal;
        
        fill(s, 0);
 
@@ -77,14 +77,14 @@ void scan(Scanner *s)
 #line 78 "<stdout>"
                {
                        unsigned char yych;
-                       if (state < 2) {
-                               if (state < 1) {
+                       if (cond < 2) {
+                               if (cond < 1) {
                                        goto yyc_Normal;
                                } else {
                                        goto yyc_Comment;
                                }
                        } else {
-                               if (state < 3) {
+                               if (cond < 3) {
                                        goto yyc_Skiptoeol;
                                } else {
                                        goto yyc_String;
@@ -99,7 +99,7 @@ yyc_Comment:
                        ++s->cur;
                        if((yych = *s->cur) == '/') goto yy5;
 yy3:
-#line 148 "condition_06.cs.re"
+#line 149 "condition_06.cs.re"
                        {
                                goto yyc_Comment;
                        }
@@ -109,7 +109,7 @@ yy4:
                        goto yy3;
 yy5:
                        ++s->cur;
-#line 144 "condition_06.cs.re"
+#line 145 "condition_06.cs.re"
                        {
                                continue;
                        }
@@ -128,7 +128,7 @@ yyc_Normal:
                        yych = *(s->tok = ++s->cur);
                        if(yych == '?') goto yy19;
 yy10:
-#line 139 "condition_06.cs.re"
+#line 140 "condition_06.cs.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -141,7 +141,7 @@ yy11:
                        goto yy10;
 yy12:
                        ++s->cur;
-#line 133 "condition_06.cs.re"
+#line 134 "condition_06.cs.re"
                        {
                                fputc(*s->tok, stdout);
                                state = EStateString;
@@ -153,14 +153,14 @@ yy14:
                        goto yy10;
 yy15:
                        ++s->cur;
-#line 129 "condition_06.cs.re"
+#line 130 "condition_06.cs.re"
                        {
                                goto yyc_Skiptoeol;
                        }
 #line 161 "<stdout>"
 yy17:
                        ++s->cur;
-#line 125 "condition_06.cs.re"
+#line 126 "condition_06.cs.re"
                        {
                                goto yyc_Comment;
                        }
@@ -184,7 +184,7 @@ yy20:
                        goto yy10;
 yy21:
                        ++s->cur;
-#line 80 "condition_06.cs.re"
+#line 81 "condition_06.cs.re"
                        {
                                fputc('[', stdout);
                                continue;
@@ -192,7 +192,7 @@ yy21:
 #line 193 "<stdout>"
 yy23:
                        ++s->cur;
-#line 85 "condition_06.cs.re"
+#line 86 "condition_06.cs.re"
                        {
                                fputc(']', stdout);
                                continue;
@@ -200,7 +200,7 @@ yy23:
 #line 201 "<stdout>"
 yy25:
                        ++s->cur;
-#line 90 "condition_06.cs.re"
+#line 91 "condition_06.cs.re"
                        {
                                fputc('{', stdout);
                                continue;
@@ -208,7 +208,7 @@ yy25:
 #line 209 "<stdout>"
 yy27:
                        ++s->cur;
-#line 95 "condition_06.cs.re"
+#line 96 "condition_06.cs.re"
                        {
                                fputc('}', stdout);
                                continue;
@@ -216,7 +216,7 @@ yy27:
 #line 217 "<stdout>"
 yy29:
                        ++s->cur;
-#line 100 "condition_06.cs.re"
+#line 101 "condition_06.cs.re"
                        {
                                fputc('#', stdout);
                                continue;
@@ -224,7 +224,7 @@ yy29:
 #line 225 "<stdout>"
 yy31:
                        ++s->cur;
-#line 105 "condition_06.cs.re"
+#line 106 "condition_06.cs.re"
                        {
                                fputc('\\', stdout);
                                continue;
@@ -232,7 +232,7 @@ yy31:
 #line 233 "<stdout>"
 yy33:
                        ++s->cur;
-#line 110 "condition_06.cs.re"
+#line 111 "condition_06.cs.re"
                        {
                                fputc('^', stdout);
                                continue;
@@ -240,7 +240,7 @@ yy33:
 #line 241 "<stdout>"
 yy35:
                        ++s->cur;
-#line 115 "condition_06.cs.re"
+#line 116 "condition_06.cs.re"
                        {
                                fputc('|', stdout);
                                continue;
@@ -248,7 +248,7 @@ yy35:
 #line 249 "<stdout>"
 yy37:
                        ++s->cur;
-#line 120 "condition_06.cs.re"
+#line 121 "condition_06.cs.re"
                        {
                                fputc('~', stdout);
                                continue;
@@ -270,7 +270,7 @@ yy41:
                        yych = *(s->tok = ++s->cur);
                        if(yych == '?') goto yy51;
 yy42:
-#line 164 "condition_06.cs.re"
+#line 165 "condition_06.cs.re"
                        {
                                goto yyc_Skiptoeol;
                        }
@@ -282,7 +282,7 @@ yy43:
                        goto yy42;
 yy44:
                        ++s->cur;
-#line 160 "condition_06.cs.re"
+#line 161 "condition_06.cs.re"
                        {
                                continue;
                        }
@@ -298,7 +298,7 @@ yy48:
                        goto yy42;
 yy49:
                        ++s->cur;
-#line 156 "condition_06.cs.re"
+#line 157 "condition_06.cs.re"
                        {
                                goto yyc_Skiptoeol;
                        }
@@ -313,7 +313,7 @@ yy51:
                        if(yych != 0x0A) goto yy48;
 yy54:
                        ++s->cur;
-#line 152 "condition_06.cs.re"
+#line 153 "condition_06.cs.re"
                        {
                                goto yyc_Skiptoeol;
                        }
@@ -327,7 +327,7 @@ yyc_String:
                        ++s->cur;
                        if((yych = *s->cur) != 0x0A) goto yy63;
 yy59:
-#line 178 "condition_06.cs.re"
+#line 179 "condition_06.cs.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -335,7 +335,7 @@ yy59:
 #line 336 "<stdout>"
 yy60:
                        ++s->cur;
-#line 173 "condition_06.cs.re"
+#line 174 "condition_06.cs.re"
                        {
                                fputc(*s->tok, stdout);
                                continue;
@@ -346,14 +346,14 @@ yy62:
                        goto yy59;
 yy63:
                        ++s->cur;
-#line 168 "condition_06.cs.re"
+#line 169 "condition_06.cs.re"
                        {
                                fputl((const char*)s->tok, 2, stdout);
                                continue;
                        }
 #line 355 "<stdout>"
                }
-#line 182 "condition_06.cs.re"
+#line 183 "condition_06.cs.re"
 
        }
 }
index e9d3187258acc70cea41ea46d22e7b36cfd83a9b..b851162a93ce79330d6d64818c7fe8199cf46f41 100755 (executable)
@@ -55,7 +55,7 @@ void fputl(const char *s, size_t len, FILE *stream)
 
 void scan(Scanner *s)
 {
-       int state = EStateNormal;
+       int cond = EStateNormal;
        
        fill(s, 0);
 
@@ -71,7 +71,8 @@ re2c:define:YYMARKER    = s->tok;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 re2c:condenumprefix     = EState;
index 5d8096bb66391f985efd75783ab19eec67558b0f..c34ba254c814b4dd382c410d85a0dbbfa20e6df0 100755 (executable)
@@ -61,7 +61,7 @@ enum YYCONDTYPE {
 
 void scan(Scanner *s)
 {
-       int state = EStateR1;
+       int cond = EStateR1;
        
        fill(s, 0);
 
@@ -71,7 +71,7 @@ void scan(Scanner *s)
 
                {
                        unsigned char yych;
-                       if (state < 1) {
+                       if (cond < 1) {
                                goto yyc_R1;
                        } else {
                                goto yyc_R2;
index 921056cecda19ef293b9727cd5c0bf9ea0e20991..5a1c4c79e9fdf1d4e20f4db313b61e775f605831 100755 (executable)
@@ -55,7 +55,7 @@ void fputl(const char *s, size_t len, FILE *stream)
 
 void scan(Scanner *s)
 {
-       int state = EStateR1;
+       int cond = EStateR1;
        
        fill(s, 0);
 
@@ -71,7 +71,8 @@ re2c:define:YYMARKER    = s->tok;
 re2c:define:YYFILL@len  = #;
 re2c:define:YYFILL:naked= 1;
 re2c:define:YYFILL      = "{ if(fill(s, #) >= 0) break; }";
-re2c:define:YYCONDITION = state;
+re2c:define:YYGETCONDITION       = cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:yyfill:parameter   = 0;
 re2c:indent:top         = 2;
 re2c:condenumprefix     = EState;
index 1e4fb32d58a6bfba694466b9cafd4bb3260edcc3..975632e991d0f05ceb02e3a11aa1e5b94eb62f09 100755 (executable)
@@ -76,7 +76,8 @@ re2c:define:YYSETSTATE@state = #;
 re2c:define:YYSETSTATE       = "s->state = #;";
 re2c:define:YYGETSTATE       = "s->state";
 re2c:define:YYGETSTATE:naked = 1;
-re2c:define:YYCONDITION      = s->cond;
+re2c:define:YYGETCONDITION       = s->cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:define:YYCONDTYPE       = ScanContition;
 re2c:variable:yych           = s->yych;
 re2c:yych:emit               = 0;
index 1e4fb32d58a6bfba694466b9cafd4bb3260edcc3..975632e991d0f05ceb02e3a11aa1e5b94eb62f09 100755 (executable)
@@ -76,7 +76,8 @@ re2c:define:YYSETSTATE@state = #;
 re2c:define:YYSETSTATE       = "s->state = #;";
 re2c:define:YYGETSTATE       = "s->state";
 re2c:define:YYGETSTATE:naked = 1;
-re2c:define:YYCONDITION      = s->cond;
+re2c:define:YYGETCONDITION       = s->cond;
+re2c:define:YYGETCONDITION:naked = 1;
 re2c:define:YYCONDTYPE       = ScanContition;
 re2c:variable:yych           = s->yych;
 re2c:yych:emit               = 0;
index 2480b9349611691bf78037d3c289a1e964f9fc89..40b603039f9371f09c997d6dc5265ee5c15be826 100755 (executable)
@@ -76,7 +76,10 @@ re2c:define:YYSETSTATE@state = #;
 re2c:define:YYSETSTATE       = "s->state = #;";
 re2c:define:YYGETSTATE       = "s->state";
 re2c:define:YYGETSTATE:naked = 1;
-re2c:define:YYCONDITION      = s->cond;
+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;
index 2480b9349611691bf78037d3c289a1e964f9fc89..40b603039f9371f09c997d6dc5265ee5c15be826 100755 (executable)
@@ -76,7 +76,10 @@ re2c:define:YYSETSTATE@state = #;
 re2c:define:YYSETSTATE       = "s->state = #;";
 re2c:define:YYGETSTATE       = "s->state";
 re2c:define:YYGETSTATE:naked = 1;
-re2c:define:YYCONDITION      = s->cond;
+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;