]> granicus.if.org Git - re2c/commitdiff
Simplified tracking of condition order.
authorUlya Trofimovich <skvadrik@gmail.com>
Wed, 26 Aug 2015 11:41:48 +0000 (12:41 +0100)
committerUlya Trofimovich <skvadrik@gmail.com>
Wed, 26 Aug 2015 11:41:48 +0000 (12:41 +0100)
In theory re2c makes no guarantee about the order of conditions in
the generated lexer. Users should use 'YYGETCONDITION'/'YYSETCONDITION'
interface and generate enum with condition names using either '-t'
option or '/*!types:re2c*/' directive. Only members of the generated
enum should be used with 'YYGETCONDITION' and 'YYSETCONDITION'.
This way code is independent of internal re2c condition numbering.

However, it turns out that some users (and notably, PHP) rely on
internal condition numbering: they manually hardcode condition numbers
and make re2c generate condition dispatch in such a way that it
doesn't mention condition names at all (e.g. with in the form of nested
'if' statements with '-b' or in the form of 'goto' table with '-g').
The code compiles, but change of code generation mode may break
compilation. Even worse, change of internal re2c condition numbering
may lead to epic runtime failures.

So re2c cannot just change internal condition numbering: it has to
preserve the existing numbering scheme (rather illogical and not
alphabetically sorted).

This commit tries to simplify tracking of condition numbers.

12 files changed:
re2c/bootstrap/src/parse/parser.cc
re2c/src/codegen/emit.h
re2c/src/codegen/emit_dfa.cc
re2c/src/codegen/output.cc
re2c/src/codegen/output.h
re2c/src/ir/dfa/dfa.h
re2c/src/parse/parser.h
re2c/src/parse/parser.ypp
re2c/test/condition_14.cif.c
re2c/test/php20150211_zend_ini_scanner.cDF--case-inverted.c
re2c/test/php20150211_zend_ini_scanner_trimmed.icF.c
re2c/test/php20150211_zend_language_scanner.cDF--case-inverted.c

index 8881a164b404083bd57356c5c1efdd62a72ef525..2dfa94bf49f4ea35d98e28dd933e50c3d47a98a0 100644 (file)
@@ -82,7 +82,6 @@
 #include "src/ir/regexp/regexp_cat.h"
 #include "src/ir/regexp/regexp_close.h"
 #include "src/ir/regexp/regexp_null.h"
-#include "src/codegen/emit.h" // genTypes
 #include "src/globals.h"
 #include "src/parse/code.h"
 #include "src/parse/extop.h"
@@ -102,6 +101,7 @@ void yyerror(const char*);
 }
 
 static counter_t<rule_rank_t> rank_counter;
+static std::vector<std::string> condnames;
 static re2c::RegExpMap  specMap;
 static RegExp           *spec = NULL, *specNone = NULL;
 static RuleOpList       specStar;
@@ -150,13 +150,12 @@ void context_rule(CondList *clist, RegExp *expr, RegExp *look, const std::string
 
                if (itRE != specMap.end())
                {
-                       itRE->second.second = mkAlt(itRE->second.second, rule);
+                       itRE->second = mkAlt(itRE->second, rule);
                }
                else
                {
-                       size_t nIndex = specMap.size() + 1; // 0 is reserved for "0"-spec
-                       assert( nIndex < 1u << 31);
-                       specMap[*it] = std::make_pair(int(nIndex), rule);
+                       specMap[*it] = rule;
+                       condnames.push_back (*it);
                }
                
        }
@@ -646,14 +645,14 @@ static const yytype_int8 yyrhs[] =
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   227,   227,   229,   233,   237,   246,   255,   259,   263,
-     272,   277,   282,   287,   292,   297,   302,   310,   314,   320,
-     324,   328,   334,   338,   344,   357,   362,   370,   375,   379,
-     384,   388,   392,   396,   402,   406,   410,   414,   421,   430,
-     439,   443,   449,   454,   460,   464,   470,   478,   483,   489,
-     495,   505,   517,   523,   531,   534,   541,   547,   557,   560,
-     568,   571,   578,   582,   589,   593,   600,   604,   611,   615,
-     630,   650,   654,   658,   662,   669,   679,   683
+       0,   226,   226,   228,   232,   236,   245,   254,   258,   262,
+     271,   276,   281,   286,   291,   296,   301,   309,   313,   319,
+     323,   327,   333,   337,   343,   356,   361,   369,   374,   378,
+     383,   387,   391,   395,   401,   405,   409,   413,   420,   429,
+     438,   442,   448,   453,   459,   463,   469,   477,   482,   488,
+     494,   504,   516,   522,   530,   533,   540,   546,   556,   559,
+     567,   570,   577,   581,   588,   592,   599,   603,   610,   614,
+     629,   649,   653,   657,   661,   668,   678,   682
 };
 #endif
 
@@ -2661,37 +2660,28 @@ void parse(Scanner& i, Output & o)
                                        // but compile it separately because of RegExp::PRIVATE attribute
                                        for (it = specMap.begin(); it != specMap.end(); ++it)
                                        {
-                                               assert(it->second.second);
+                                               assert(it->second);
                                                for (RuleOpList::const_iterator itOp = specStar.begin(); itOp != specStar.end(); ++itOp)
                                                {
-                                                       it->second.second = mkAlt(*itOp, it->second.second);
+                                                       it->second = mkAlt(*itOp, it->second);
                                                }
                                        }
                                }
        
                                if (specNone)
                                {
-                                       // After merging star rules merge none code to specmap
-                                       // this simplifies some stuff.
+                                       specMap["0"] = specNone;
                                        // Note that "0" inserts first, which is important.
-                                       specMap["0"] = std::make_pair(0, specNone);
-                               }
-                               else
-                               {
-                                       // We reserved 0 for specNone but it is not present,
-                                       // so we can decrease all specs.
-                                       for (it = specMap.begin(); it != specMap.end(); ++it)
-                                       {
-                                               it->second.first--;
-                                       }
+                                       condnames.insert (condnames.begin (), "0");
                                }
+                               o.types = condnames;
                        }
 
                        size_t nCount = specMap.size();
 
                        for (it = specMap.begin(); it != specMap.end(); ++it)
                        {
-                               assert(it->second.second);
+                               assert(it->second);
 
                                if (parseMode != Scanner::Reuse)
                                {
@@ -2716,7 +2706,7 @@ void parse(Scanner& i, Output & o)
                                        if (itRuleDefault != ruleDefaultMap.end())
                                        {
                                                RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), *(itRuleDefault->second), rank_counter.next (), RegExp::SHARED, NULL);
-                                               it->second.second = it->second.second ? mkAlt(def, it->second.second) : def;
+                                               it->second = it->second ? mkAlt(def, it->second) : def;
                                        }
                                        else
                                        {
@@ -2724,18 +2714,16 @@ void parse(Scanner& i, Output & o)
                                                if (itRuleDefault != ruleDefaultMap.end())
                                                {
                                                        RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), *(itRuleDefault->second), rank_counter.next (), RegExp::SHARED, NULL);
-                                                       it->second.second = it->second.second ? mkAlt(def, it->second.second) : def;
+                                                       it->second = it->second ? mkAlt(def, it->second) : def;
                                                }
                                        }
-                                       dfa_map[it->first] = genCode(it->second.second, o, topIndent, it->first);
+                                       dfa_map[it->first] = genCode(it->second, o, topIndent, it->first);
                                }
                                if (parseMode != Scanner::Rules && dfa_map.find(it->first) != dfa_map.end())
                                {
-                                       dfa_map[it->first]->emit(o, topIndent, &specMap, it->first, !--nCount, bPrologBrace);
+                                       dfa_map[it->first]->emit(o, topIndent, it->first, !--nCount, bPrologBrace);
                                }
                        }
-
-                       genTypes (o, specMap);
                }
                else
                {
@@ -2752,7 +2740,7 @@ void parse(Scanner& i, Output & o)
                                }
                                if (parseMode != Scanner::Rules && dfa_map.find("") != dfa_map.end())
                                {
-                                       dfa_map[""]->emit(o, topIndent, NULL, "", 0, bPrologBrace);
+                                       dfa_map[""]->emit(o, topIndent, "", 0, bPrologBrace);
                                }
                        }
                }
@@ -2794,6 +2782,7 @@ void parse_cleanup()
        RangeSuffix::freeList.clear();
        Code::freelist.clear();
        symbol_table.clear ();
+       condnames.clear ();
        specMap.clear();
        specStar.clear();
        specNone = NULL;
index 5c78ef18056dec8b0461ae4108c3667d12f09d4b..772ad62d1a6f012f2ea356f3a5eb95d62a880c8f 100644 (file)
@@ -21,7 +21,6 @@ void emit_action
 
 // helpers
 void genGoTo (OutputFile & o, uint32_t ind, const State * from, const State * to, bool & readCh);
-void genTypes (Output &, const RegExpMap &);
 
 template<typename _Ty> std::string replaceParam (std::string str, const std::string & param, const _Ty & value)
 {
index ad70102195d5f2f51ea647ea9167264636b20b7a..fa35858f7585a3521d998b6d63813c0d31ee62c9 100644 (file)
@@ -11,9 +11,9 @@ namespace re2c
 {
 
 static std::string genGetCondition ();
-static void genCondGotoSub (OutputFile & o, uint32_t ind, RegExpIndices & vCondList, uint32_t cMin, uint32_t cMax);
-static void genCondTable   (OutputFile & o, uint32_t ind, const RegExpMap & specMap);
-static void genCondGoto    (OutputFile & o, uint32_t ind, const RegExpMap & specMap);
+static void genCondGotoSub (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames, uint32_t cMin, uint32_t cMax);
+static void genCondTable   (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames);
+static void genCondGoto    (OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames);
 static void emit_state     (OutputFile & o, uint32_t ind, const State * s, bool used_label);
 
 std::string genGetCondition()
@@ -90,7 +90,7 @@ void DFA::count_used_labels (std::set<label_t> & used, label_t start, label_t in
        }
 }
 
-void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const std::string& condName, bool isLastCond, bool& bPrologBrace)
+void DFA::emit(Output & output, uint32_t& ind, const std::string& condName, bool isLastCond, bool& bPrologBrace)
 {
        OutputFile & o = output.source;
 
@@ -128,7 +128,7 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s
                else if ((!fFlag && o.get_used_yyaccept ())
                ||  (!fFlag && bEmitYYCh)
                ||  (bFlag && !cFlag && BitMap::first)
-               ||  (cFlag && !bWroteCondCheck && gFlag && specMap)
+               ||  (cFlag && !bWroteCondCheck && gFlag)
                ||  (fFlag && !bWroteGetState && gFlag)
                )
                {
@@ -159,9 +159,9 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s
        }
        if (bProlog)
        {
-               if (cFlag && !bWroteCondCheck && gFlag && specMap)
+               if (cFlag && !bWroteCondCheck && gFlag)
                {
-                       genCondTable(o, ind, *specMap);
+                       genCondTable(o, ind, output.types);
                }
                o.insert_state_goto (ind);
                if (cFlag && !DFlag)
@@ -172,9 +172,9 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s
                        }
                }
                o.write_user_start_label ();
-               if (cFlag && !bWroteCondCheck && specMap)
+               if (cFlag && !bWroteCondCheck)
                {
-                       genCondGoto(o, ind, *specMap);
+                       genCondGoto(o, ind, output.types);
                }
        }
 
@@ -240,44 +240,36 @@ void DFA::emit(Output & output, uint32_t& ind, const RegExpMap* specMap, const s
        }
 }
 
-void genCondTable(OutputFile & o, uint32_t ind, const RegExpMap& specMap)
+void genCondTable(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames)
 {
-       const uint32_t specMap_size = static_cast<uint32_t> (specMap.size ());
-       RegExpIndices  vCondList(specMap_size);
-
-       for(RegExpMap::const_iterator itSpec = specMap.begin(); itSpec != specMap.end(); ++itSpec)
+       const size_t conds = condnames.size ();
+       o << indent(ind++) << "static void *" << mapCodeName["yyctable"] << "[" << conds << "] = {\n";
+       for (size_t i = 0; i < conds; ++i)
        {
-               vCondList[itSpec->second.first] = itSpec->first;
-       }
-
-       o << indent(ind++) << "static void *" << mapCodeName["yyctable"] << "[" << specMap_size << "] = {\n";
-
-       for(RegExpIndices::const_iterator it = vCondList.begin(); it != vCondList.end(); ++it)
-       {
-               o << indent(ind) << "&&" << condPrefix << *it << ",\n";
+               o << indent(ind) << "&&" << condPrefix << condnames[i] << ",\n";
        }
        o << indent(--ind) << "};\n";
 }
 
-void genCondGotoSub(OutputFile & o, uint32_t ind, RegExpIndices& vCondList, uint32_t cMin, uint32_t cMax)
+void genCondGotoSub(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames, uint32_t cMin, uint32_t cMax)
 {
        if (cMin == cMax)
        {
-               o << indent(ind) << "goto " << condPrefix << vCondList[cMin] << ";\n";
+               o << indent(ind) << "goto " << condPrefix << condnames[cMin] << ";\n";
        }
        else
        {
                uint32_t cMid = cMin + ((cMax - cMin + 1) / 2);
 
                o << indent(ind) << "if (" << genGetCondition() << " < " << cMid << ") {\n";
-               genCondGotoSub(o, ind + 1, vCondList, cMin, cMid - 1);
+               genCondGotoSub(o, ind + 1, condnames, cMin, cMid - 1);
                o << indent(ind) << "} else {\n";
-               genCondGotoSub(o, ind + 1, vCondList, cMid, cMax);
+               genCondGotoSub(o, ind + 1, condnames, cMid, cMax);
                o << indent(ind) << "}\n";
        }
 }
 
-void genCondGoto(OutputFile & o, uint32_t ind, const RegExpMap& specMap)
+void genCondGoto(OutputFile & o, uint32_t ind, const std::vector<std::string> & condnames)
 {
        if (gFlag)
        {
@@ -285,30 +277,26 @@ void genCondGoto(OutputFile & o, uint32_t ind, const RegExpMap& specMap)
        }
        else
        {
+               const size_t conds = condnames.size ();
                if (sFlag)
                {
-                       RegExpIndices  vCondList(specMap.size());
-               
-                       for(RegExpMap::const_iterator it = specMap.begin(); it != specMap.end(); ++it)
-                       {
-                               vCondList[it->second.first] = it->first;
-                       }
-                       genCondGotoSub(o, ind, vCondList, 0, static_cast<uint32_t> (vCondList.size()) - 1);
+                       genCondGotoSub(o, ind, condnames, 0, static_cast<uint32_t> (conds) - 1);
                }
                else if (DFlag)
                {
-                       for(RegExpMap::const_iterator it = specMap.begin(); it != specMap.end(); ++it)
+                       for (size_t i = 0; i < conds; ++i)
                        {
-                               o << "0 -> " << it->first << " [label=\"state=" << it->first << "\"]\n";
+                               const std::string cond = condnames[i];
+                               o << "0 -> " << cond << " [label=\"state=" << cond << "\"]\n";
                        }
                }
                else
                {
                        o << indent(ind) << "switch (" << genGetCondition() << ") {\n";
-
-                       for(RegExpMap::const_iterator it = specMap.begin(); it != specMap.end(); ++it)
+                       for (size_t i = 0; i < conds; ++i)
                        {
-                               o << indent(ind) << "case " << condEnumPrefix << it->first << ": goto " << condPrefix << it->first << ";\n";
+                               const std::string & cond = condnames[i];
+                               o << indent(ind) << "case " << condEnumPrefix << cond << ": goto " << condPrefix << cond << ";\n";
                        }
                        o << indent(ind) << "}\n";
                }
@@ -316,15 +304,4 @@ void genCondGoto(OutputFile & o, uint32_t ind, const RegExpMap& specMap)
        bWroteCondCheck = true;
 }
 
-void genTypes(Output & output, const RegExpMap& specMap)
-{
-       output.types.resize (specMap.size());
-       for(RegExpMap::const_iterator itSpecMap = specMap.begin(); itSpecMap != specMap.end(); ++itSpecMap)
-       {
-               // If an entry is < 0 then we did the 0/empty correction twice.
-               assert(itSpecMap->second.first >= 0);
-               output.types[itSpecMap->second.first] = itSpecMap->first;
-       }
-}
-
 } // end namespace re2c
index a55a5c05fcb0a4e68052b365789952a23e57da24..71357e8741cacbd11e8593592cd80af8cbb83ab5 100644 (file)
@@ -146,6 +146,12 @@ OutputFile & operator << (OutputFile & u, uint32_t n)
        return u;
 }
 
+OutputFile & operator << (OutputFile & u, uint64_t n)
+{
+       u.stream () << n;
+       return u;
+}
+
 OutputFile & operator << (OutputFile & u, const std::string & s)
 {
        u.stream () << s;
index 22e871e03cca5ead21c313f6f3571c8f8d371ac1..cc79d4b821700fd367f9d586462a99fc0cb5656b 100644 (file)
@@ -78,6 +78,7 @@ public:
        void write_user_start_label ();
        friend OutputFile & operator << (OutputFile & o, char c);
        friend OutputFile & operator << (OutputFile & o, uint32_t n);
+       friend OutputFile & operator << (OutputFile & o, uint64_t n);
        friend OutputFile & operator << (OutputFile & o, const std::string & s);
        friend OutputFile & operator << (OutputFile & o, const char * s);
        friend OutputFile & operator << (OutputFile & o, label_t l);
index fc27ab684f84df925036f4b8318159a6d0807a64..7249fea105db26beca5b0780f9d824a43cd90f32 100644 (file)
@@ -8,8 +8,6 @@
 namespace re2c
 {
 
-typedef std::map<std::string, std::pair<int, RegExp *> > RegExpMap;
-
 class DFA
 {
 public:
@@ -36,7 +34,7 @@ public:
        void findBaseState ();
        void prepare (OutputFile & o, uint32_t &, const std::string & cond);
        void count_used_labels (std::set<label_t> & used, label_t prolog, label_t start, bool force_start) const;
-       void emit (Output &, uint32_t &, const RegExpMap *, const std::string &, bool, bool &);
+       void emit (Output &, uint32_t &, const std::string &, bool, bool &);
 
        friend std::ostream & operator << (std::ostream &, const DFA &);
 
index 7333374021e583e02facabd04c1580ca9ed8fe01..deb74995c7165f01194df28c0d8a61f5dd1c7b5a 100644 (file)
@@ -17,6 +17,7 @@ extern void parse_cleanup();
 
 typedef std::set<std::string> CondList;
 typedef std::list<RuleOp*> RuleOpList;
+typedef std::map<std::string, RegExp *> RegExpMap;
 typedef std::map<std::string, std::pair<uint32_t, std::string> > SetupMap;
 typedef std::map<std::string, const Code *> DefaultMap;
 typedef std::map<std::string, RegExp *> symbol_table_t;
index b7e54099a552a44bb1f388b82e4fdf6520e9da8a..a1d04cef694b72a5ec6501b1e90df46ef374c58b 100644 (file)
@@ -14,7 +14,6 @@
 #include "src/ir/regexp/regexp_cat.h"
 #include "src/ir/regexp/regexp_close.h"
 #include "src/ir/regexp/regexp_null.h"
-#include "src/codegen/emit.h" // genTypes
 #include "src/globals.h"
 #include "src/parse/code.h"
 #include "src/parse/extop.h"
@@ -34,6 +33,7 @@ void yyerror(const char*);
 }
 
 static counter_t<rule_rank_t> rank_counter;
+static std::vector<std::string> condnames;
 static re2c::RegExpMap  specMap;
 static RegExp           *spec = NULL, *specNone = NULL;
 static RuleOpList       specStar;
@@ -82,13 +82,12 @@ void context_rule(CondList *clist, RegExp *expr, RegExp *look, const std::string
 
                if (itRE != specMap.end())
                {
-                       itRE->second.second = mkAlt(itRE->second.second, rule);
+                       itRE->second = mkAlt(itRE->second, rule);
                }
                else
                {
-                       size_t nIndex = specMap.size() + 1; // 0 is reserved for "0"-spec
-                       assert( nIndex < 1u << 31);
-                       specMap[*it] = std::make_pair(int(nIndex), rule);
+                       specMap[*it] = rule;
+                       condnames.push_back (*it);
                }
                
        }
@@ -796,37 +795,28 @@ void parse(Scanner& i, Output & o)
                                        // but compile it separately because of RegExp::PRIVATE attribute
                                        for (it = specMap.begin(); it != specMap.end(); ++it)
                                        {
-                                               assert(it->second.second);
+                                               assert(it->second);
                                                for (RuleOpList::const_iterator itOp = specStar.begin(); itOp != specStar.end(); ++itOp)
                                                {
-                                                       it->second.second = mkAlt(*itOp, it->second.second);
+                                                       it->second = mkAlt(*itOp, it->second);
                                                }
                                        }
                                }
        
                                if (specNone)
                                {
-                                       // After merging star rules merge none code to specmap
-                                       // this simplifies some stuff.
+                                       specMap["0"] = specNone;
                                        // Note that "0" inserts first, which is important.
-                                       specMap["0"] = std::make_pair(0, specNone);
-                               }
-                               else
-                               {
-                                       // We reserved 0 for specNone but it is not present,
-                                       // so we can decrease all specs.
-                                       for (it = specMap.begin(); it != specMap.end(); ++it)
-                                       {
-                                               it->second.first--;
-                                       }
+                                       condnames.insert (condnames.begin (), "0");
                                }
+                               o.types = condnames;
                        }
 
                        size_t nCount = specMap.size();
 
                        for (it = specMap.begin(); it != specMap.end(); ++it)
                        {
-                               assert(it->second.second);
+                               assert(it->second);
 
                                if (parseMode != Scanner::Reuse)
                                {
@@ -851,7 +841,7 @@ void parse(Scanner& i, Output & o)
                                        if (itRuleDefault != ruleDefaultMap.end())
                                        {
                                                RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), *(itRuleDefault->second), rank_counter.next (), RegExp::SHARED, NULL);
-                                               it->second.second = it->second.second ? mkAlt(def, it->second.second) : def;
+                                               it->second = it->second ? mkAlt(def, it->second) : def;
                                        }
                                        else
                                        {
@@ -859,18 +849,16 @@ void parse(Scanner& i, Output & o)
                                                if (itRuleDefault != ruleDefaultMap.end())
                                                {
                                                        RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), *(itRuleDefault->second), rank_counter.next (), RegExp::SHARED, NULL);
-                                                       it->second.second = it->second.second ? mkAlt(def, it->second.second) : def;
+                                                       it->second = it->second ? mkAlt(def, it->second) : def;
                                                }
                                        }
-                                       dfa_map[it->first] = genCode(it->second.second, o, topIndent, it->first);
+                                       dfa_map[it->first] = genCode(it->second, o, topIndent, it->first);
                                }
                                if (parseMode != Scanner::Rules && dfa_map.find(it->first) != dfa_map.end())
                                {
-                                       dfa_map[it->first]->emit(o, topIndent, &specMap, it->first, !--nCount, bPrologBrace);
+                                       dfa_map[it->first]->emit(o, topIndent, it->first, !--nCount, bPrologBrace);
                                }
                        }
-
-                       genTypes (o, specMap);
                }
                else
                {
@@ -887,7 +875,7 @@ void parse(Scanner& i, Output & o)
                                }
                                if (parseMode != Scanner::Rules && dfa_map.find("") != dfa_map.end())
                                {
-                                       dfa_map[""]->emit(o, topIndent, NULL, "", 0, bPrologBrace);
+                                       dfa_map[""]->emit(o, topIndent, "", 0, bPrologBrace);
                                }
                        }
                }
@@ -929,6 +917,7 @@ void parse_cleanup()
        RangeSuffix::freeList.clear();
        Code::freelist.clear();
        symbol_table.clear ();
+       condnames.clear ();
        specMap.clear();
        specStar.clear();
        specNone = NULL;
index e1786dd306e392c44b8ff6bfc3990bd383c19263..233ddfff58d4490aab769e08859fe6e0a76548e4 100644 (file)
@@ -92,8 +92,8 @@ void scan(Scanner *s)
 
 yy0:
                switch (s->cond) {
-               case EStateComment: goto yyc_Comment;
                case EStateNormal: goto yyc_Normal;
+               case EStateComment: goto yyc_Comment;
                case EStateSkiptoeol: goto yyc_Skiptoeol;
                case EStateString: goto yyc_String;
                }
index fa63114b1454f7a61be6c483c72f14667e24e230..a4c239e5772c1ba75b98d96b65d3406d00eece6a 100644 (file)
@@ -7,13 +7,13 @@ re2c: warning: line 392: column 11: escape has no effect: '\[' [-Wuseless-escape
 digraph re2c {
 
 0 -> INITIAL [label="state=INITIAL"]
-0 -> ST_DOUBLE_QUOTES [label="state=ST_DOUBLE_QUOTES"]
 0 -> ST_OFFSET [label="state=ST_OFFSET"]
-0 -> ST_RAW [label="state=ST_RAW"]
-0 -> ST_SECTION_RAW [label="state=ST_SECTION_RAW"]
 0 -> ST_SECTION_VALUE [label="state=ST_SECTION_VALUE"]
 0 -> ST_VALUE [label="state=ST_VALUE"]
+0 -> ST_SECTION_RAW [label="state=ST_SECTION_RAW"]
+0 -> ST_DOUBLE_QUOTES [label="state=ST_DOUBLE_QUOTES"]
 0 -> ST_VARNAME [label="state=ST_VARNAME"]
+0 -> ST_RAW [label="state=ST_RAW"]
 /* *********************************** */
 INITIAL -> 2
 2 -> 3 [label="[0x00-0x08][0x0B-0x0C][0x0E-0x1F][#][0-9][A-E][G-M][P-S][U-X][Z][\\][_-e][g-m][p-s][u-x][z][0x7F-0xFF]"]
index e9dbfd783378e20225dbe9ede4fbe8290c1faa35..f6bd03fc280ea8636db1c59a3b1a7d604e362e36 100644 (file)
@@ -9,13 +9,13 @@ re2c: warning: line 12: column 11: escape has no effect: '\[' [-Wuseless-escape]
        unsigned int yyaccept = 0;
        switch (YYGETCONDITION()) {
        case yycINITIAL: goto yyc_INITIAL;
-       case yycST_DOUBLE_QUOTES: goto yyc_ST_DOUBLE_QUOTES;
        case yycST_OFFSET: goto yyc_ST_OFFSET;
-       case yycST_RAW: goto yyc_ST_RAW;
-       case yycST_SECTION_RAW: goto yyc_ST_SECTION_RAW;
        case yycST_SECTION_VALUE: goto yyc_ST_SECTION_VALUE;
        case yycST_VALUE: goto yyc_ST_VALUE;
+       case yycST_SECTION_RAW: goto yyc_ST_SECTION_RAW;
+       case yycST_DOUBLE_QUOTES: goto yyc_ST_DOUBLE_QUOTES;
        case yycST_VARNAME: goto yyc_ST_VARNAME;
+       case yycST_RAW: goto yyc_ST_RAW;
        }
 /* *********************************** */
 yyc_INITIAL:
index dfed811d25cc028804d0064aaaa7148c6aab365c..620e1c9f0a6deb2d6c3e5e4748d0abb25738ecad 100644 (file)
@@ -5,16 +5,16 @@ re2c: warning: line 1480: column 19: escape has no effect: '\*' [-Wuseless-escap
 
 digraph re2c {
 
-0 -> INITIAL [label="state=INITIAL"]
+0 -> ST_IN_SCRIPTING [label="state=ST_IN_SCRIPTING"]
+0 -> ST_LOOKING_FOR_PROPERTY [label="state=ST_LOOKING_FOR_PROPERTY"]
 0 -> ST_BACKQUOTE [label="state=ST_BACKQUOTE"]
 0 -> ST_DOUBLE_QUOTES [label="state=ST_DOUBLE_QUOTES"]
-0 -> ST_END_HEREDOC [label="state=ST_END_HEREDOC"]
 0 -> ST_HEREDOC [label="state=ST_HEREDOC"]
-0 -> ST_IN_SCRIPTING [label="state=ST_IN_SCRIPTING"]
-0 -> ST_LOOKING_FOR_PROPERTY [label="state=ST_LOOKING_FOR_PROPERTY"]
 0 -> ST_LOOKING_FOR_VARNAME [label="state=ST_LOOKING_FOR_VARNAME"]
-0 -> ST_NOWDOC [label="state=ST_NOWDOC"]
 0 -> ST_VAR_OFFSET [label="state=ST_VAR_OFFSET"]
+0 -> INITIAL [label="state=INITIAL"]
+0 -> ST_END_HEREDOC [label="state=ST_END_HEREDOC"]
+0 -> ST_NOWDOC [label="state=ST_NOWDOC"]
 /* *********************************** */
 INITIAL -> 2
 2 -> 5 [label="[0x00-;][=-0xFF]"]