-/* Generated by re2c 0.16 on Thu Dec 22 16:22:48 2016 */
+/* Generated by re2c 0.16 on Thu Dec 22 17:23:18 2016 */
#line 1 "../src/parse/lex.re"
#include "src/util/c99_stdint.h"
#include <stddef.h>
extern "C" {
-int yylex(Scanner &in);
-void yyerror(Scanner &in, const char*);
+int yylex(Scanner &in, context_t&);
+void yyerror(Scanner &in, context_t&, const char*);
} // extern "C"
-static std::vector<std::string> condnames;
-static re2c::SpecMap specMap;
-static SetupMap ruleSetupMap;
-static symbol_table_t symbol_table;
-
/* Bison version 1.875 emits a definition that is not working
* with several g++ version. Hence we disable it here.
*/
#define __attribute__(x)
#endif
+static void parse_cleanup(re2c::context_t &context)
+{
+ RegExp::flist.clear();
+ Range::vFreeList.clear();
+ RangeSuffix::freeList.clear();
+ context.clear();
+}
+
static void check(const Spec &spec, const std::string &cond)
{
Spec::const_iterator b = spec.begin(), e = spec.end(), i, j;
}
}
-static void make_rule(Scanner &in, CondList *clist, RegExpRule *rule,
- Code *code, const std::string *newcond)
+static void make_rule(Scanner &in, context_t &context, CondList *clist,
+ RegExpRule *rule, Code *code, const std::string *newcond)
{
if (!clist) {
clist = new CondList;
for(CondList::const_iterator i = clist->begin(); i != clist->end(); ++i) {
const std::string &cond = *i;
- if (cond != "" && cond != "*" && specMap.find(cond) == specMap.end()) {
- condnames.push_back(cond);
+ if (cond != "" && cond != "*" && context.specMap.find(cond) == context.specMap.end()) {
+ context.condnames.push_back(cond);
}
- specMap[cond].push_back(rule);
+ context.specMap[cond].push_back(rule);
}
delete clist;
}
-static void make_setup(Scanner &in, CondList *clist, const Code *code)
+static void make_setup(Scanner &in, SetupMap &ruleSetupMap,
+ CondList *clist, const Code *code)
{
assert(clist);
assert(code);
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 198, 198, 200, 201, 202, 206, 213, 218, 221,
- 225, 225, 228, 232, 236, 240, 244, 248, 252, 256,
- 261, 267, 274, 275, 279, 283, 288, 293, 297, 304,
- 308, 315, 319, 326, 330, 347, 366, 370, 374, 378,
- 385, 395, 399
+ 0, 204, 204, 206, 207, 208, 212, 219, 224, 227,
+ 231, 231, 234, 238, 242, 246, 250, 254, 258, 262,
+ 267, 273, 280, 281, 285, 289, 294, 299, 303, 310,
+ 314, 321, 325, 332, 336, 353, 372, 376, 380, 384,
+ 391, 401, 405
};
#endif
} \
else \
{ \
- yyerror (in, YY_("syntax error: cannot back up")); \
+ yyerror (in, context, YY_("syntax error: cannot back up")); \
YYERROR; \
} \
while (YYID (0))
#ifdef YYLEX_PARAM
# define YYLEX yylex (YYLEX_PARAM)
#else
-# define YYLEX yylex (in)
+# define YYLEX yylex (in, context)
#endif
/* Enable debugging if requested. */
{ \
YYFPRINTF (stderr, "%s ", Title); \
yy_symbol_print (stderr, \
- Type, Value, in); \
+ Type, Value, in, context); \
YYFPRINTF (stderr, "\n"); \
} \
} while (YYID (0))
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Scanner &in)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Scanner &in, context_t &context)
#else
static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, in)
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, in, context)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
Scanner ∈
+ context_t &context;
#endif
{
if (!yyvaluep)
return;
YYUSE (in);
+ YYUSE (context);
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Scanner &in)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, Scanner &in, context_t &context)
#else
static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, in)
+yy_symbol_print (yyoutput, yytype, yyvaluep, in, context)
FILE *yyoutput;
int yytype;
YYSTYPE const * const yyvaluep;
Scanner ∈
+ context_t &context;
#endif
{
if (yytype < YYNTOKENS)
else
YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, in);
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, in, context);
YYFPRINTF (yyoutput, ")");
}
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Scanner &in)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, Scanner &in, context_t &context)
#else
static void
-yy_reduce_print (yyvsp, yyrule, in)
+yy_reduce_print (yyvsp, yyrule, in, context)
YYSTYPE *yyvsp;
int yyrule;
Scanner ∈
+ context_t &context;
#endif
{
int yynrhs = yyr2[yyrule];
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
- , in);
+ , in, context);
YYFPRINTF (stderr, "\n");
}
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (yyvsp, Rule, in); \
+ yy_reduce_print (yyvsp, Rule, in, context); \
} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Scanner &in)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Scanner &in, context_t &context)
#else
static void
-yydestruct (yymsg, yytype, yyvaluep, in)
+yydestruct (yymsg, yytype, yyvaluep, in, context)
const char *yymsg;
int yytype;
YYSTYPE *yyvaluep;
Scanner ∈
+ context_t &context;
#endif
{
YYUSE (yyvaluep);
YYUSE (in);
+ YYUSE (context);
if (!yymsg)
yymsg = "Deleting";
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
-int yyparse (Scanner &in);
+int yyparse (Scanner &in, context_t &context);
#else
int yyparse ();
#endif
#if (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
int
-yyparse (Scanner &in)
+yyparse (Scanner &in, context_t &context)
#else
int
-yyparse (in)
+yyparse (in, context)
Scanner ∈
+ context_t &context;
#endif
#endif
{
case 6:
{
- if (!symbol_table.insert(std::make_pair(*(yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].regexp))).second) {
+ if (!context.symbol_table.insert(std::make_pair(*(yyvsp[(1) - (3)].str), (yyvsp[(2) - (3)].regexp))).second) {
in.fatal("sym already defined");
}
delete (yyvsp[(1) - (3)].str);
case 12:
{
- make_rule(in, NULL, (yyvsp[(1) - (2)].rule), (yyvsp[(2) - (2)].code), NULL);
+ make_rule(in, context, NULL, (yyvsp[(1) - (2)].rule), (yyvsp[(2) - (2)].code), NULL);
;}
break;
case 13:
{
- make_rule(in, (yyvsp[(2) - (5)].clist), (yyvsp[(4) - (5)].rule), (yyvsp[(5) - (5)].code), NULL);
+ make_rule(in, context, (yyvsp[(2) - (5)].clist), (yyvsp[(4) - (5)].rule), (yyvsp[(5) - (5)].code), NULL);
;}
break;
case 14:
{
- make_rule(in, (yyvsp[(2) - (8)].clist), (yyvsp[(4) - (8)].rule), (yyvsp[(8) - (8)].code), (yyvsp[(7) - (8)].str));
+ make_rule(in, context, (yyvsp[(2) - (8)].clist), (yyvsp[(4) - (8)].rule), (yyvsp[(8) - (8)].code), (yyvsp[(7) - (8)].str));
;}
break;
case 15:
{
- make_rule(in, (yyvsp[(2) - (8)].clist), (yyvsp[(4) - (8)].rule), NULL, (yyvsp[(8) - (8)].str));
+ make_rule(in, context, (yyvsp[(2) - (8)].clist), (yyvsp[(4) - (8)].rule), NULL, (yyvsp[(8) - (8)].str));
;}
break;
case 16:
{
- make_rule(in, NULL, NULL, (yyvsp[(3) - (3)].code), NULL);
+ make_rule(in, context, NULL, NULL, (yyvsp[(3) - (3)].code), NULL);
;}
break;
case 17:
{
- make_rule(in, NULL, NULL, (yyvsp[(6) - (6)].code), (yyvsp[(5) - (6)].str));
+ make_rule(in, context, NULL, NULL, (yyvsp[(6) - (6)].code), (yyvsp[(5) - (6)].str));
;}
break;
case 18:
{
- make_rule(in, NULL, NULL, NULL, (yyvsp[(6) - (6)].str));
+ make_rule(in, context, NULL, NULL, NULL, (yyvsp[(6) - (6)].str));
;}
break;
case 19:
{
- make_setup(in, (yyvsp[(3) - (5)].clist), (yyvsp[(5) - (5)].code));
+ make_setup(in, context.ruleSetupMap, (yyvsp[(3) - (5)].clist), (yyvsp[(5) - (5)].code));
;}
break;
case 40:
{
- symbol_table_t::iterator i = symbol_table.find (* (yyvsp[(1) - (1)].str));
+ symbol_table_t::iterator i = context.symbol_table.find (* (yyvsp[(1) - (1)].str));
delete (yyvsp[(1) - (1)].str);
- if (i == symbol_table.end ())
+ if (i == context.symbol_table.end ())
{
in.fatal("can't find symbol");
}
{
++yynerrs;
#if ! YYERROR_VERBOSE
- yyerror (in, YY_("syntax error"));
+ yyerror (in, context, YY_("syntax error"));
#else
{
YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
if (0 < yysize && yysize <= yymsg_alloc)
{
(void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (in, yymsg);
+ yyerror (in, context, yymsg);
}
else
{
- yyerror (in, YY_("syntax error"));
+ yyerror (in, context, YY_("syntax error"));
if (yysize != 0)
goto yyexhaustedlab;
}
else
{
yydestruct ("Error: discarding",
- yytoken, &yylval, in);
+ yytoken, &yylval, in, context);
yychar = YYEMPTY;
}
}
yydestruct ("Error: popping",
- yystos[yystate], yyvsp, in);
+ yystos[yystate], yyvsp, in, context);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
yyexhaustedlab:
- yyerror (in, YY_("memory exhausted"));
+ yyerror (in, context, YY_("memory exhausted"));
yyresult = 2;
/* Fall through. */
#endif
yyreturn:
if (yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval, in);
+ yytoken, &yylval, in, context);
/* Do not reclaim the symbols of the rule which action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, in);
+ yystos[*yyssp], yyvsp, in, context);
YYPOPSTACK (1);
}
#ifndef yyoverflow
extern "C" {
-void yyerror(Scanner &in, const char* s)
+void yyerror(Scanner &in, context_t&, const char* s)
{
in.fatal(s);
}
-int yylex(Scanner &in)
+int yylex(Scanner &in, context_t&)
{
return in.scan();
}
void parse(Scanner &in, Output & o)
{
dfa_map_t dfa_map;
+ context_t context;
ScannerState rules_state, curr_state;
Opt &opts = in.opts;
{
dfa_map.clear();
}
- specMap.clear();
- yyparse(in);
+ context.specMap.clear();
+ yyparse(in, context);
if (opts->rFlag && mode == Scanner::Reuse) {
- if (!specMap.empty() || opts->encoding != encodingOld) {
+ if (!context.specMap.empty() || opts->encoding != encodingOld) {
// Re-parse rules
mode = Scanner::Parse;
in.restore_state(rules_state);
in.reuse();
dfa_map.clear();
- parse_cleanup();
- specMap.clear();
- yyparse(in);
+ parse_cleanup(context);
+ context.specMap.clear();
+ yyparse(in, context);
// Now append potential new rules
in.restore_state(curr_state);
mode = Scanner::Parse;
- yyparse(in);
+ yyparse(in, context);
}
encodingOld = opts->encoding;
}
o.source.block().line = in.get_cline();
- o.source.block().types = condnames;
+ o.source.block().types = context.condnames;
// compile regular expressions to automata
if (mode != Scanner::Reuse) {
SpecMap::iterator it;
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
check(it->second, it->first);
}
// merge <*> rules to all conditions except "0" with lowest priority
Spec star;
- if ((it = specMap.find("*")) != specMap.end()) {
+ if ((it = context.specMap.find("*")) != context.specMap.end()) {
star = it->second;
- specMap.erase(it);
+ context.specMap.erase(it);
}
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
if (it->first == "0") continue;
for (size_t j = 0; j < star.size(); ++j) {
it->second.push_back(star[j]);
}
}
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
delay_default(it->second);
dfa_map[it->first] = compile(it->second, o, it->first, opts->encoding.nCodeUnits ());
}
uint32_t ind = opts->topIndent;
size_t nCount = dfa_map.size();
for (dfa_map_t::const_iterator i = dfa_map.begin(); i != dfa_map.end(); ++i) {
- o.source.block().setup_rule = find_setup_rule(ruleSetupMap, i->first);
+ o.source.block().setup_rule = find_setup_rule(context.ruleSetupMap, i->first);
i->second->emit(o, ind, !--nCount, bPrologBrace);
}
}
}
SetupMap::const_iterator itRuleSetup;
- for (itRuleSetup = ruleSetupMap.begin(); itRuleSetup != ruleSetupMap.end(); ++itRuleSetup) {
- if (itRuleSetup->first != "*" && specMap.find(itRuleSetup->first) == specMap.end()) {
+ for (itRuleSetup = context.ruleSetupMap.begin(); itRuleSetup != context.ruleSetupMap.end(); ++itRuleSetup) {
+ if (itRuleSetup->first != "*" && context.specMap.find(itRuleSetup->first) == context.specMap.end()) {
in.fatalf_at(itRuleSetup->second.first, "setup for non existing rule '%s' found", itRuleSetup->first.c_str());
}
}
- if (specMap.size() < ruleSetupMap.size()) {
+ if (context.specMap.size() < context.ruleSetupMap.size()) {
uint32_t line = in.get_cline();
- itRuleSetup = ruleSetupMap.find("*");
- if (itRuleSetup != ruleSetupMap.end()) {
+ itRuleSetup = context.ruleSetupMap.find("*");
+ if (itRuleSetup != context.ruleSetupMap.end()) {
line = itRuleSetup->second.first;
}
in.fatalf_at(line, "setup for all rules with '*' not possible when all rules are setup explicitly");
emit_epilog (o.source, o.skeletons);
}
- parse_cleanup();
-}
-
-void parse_cleanup()
-{
- RegExp::flist.clear();
- Range::vFreeList.clear();
- RangeSuffix::freeList.clear();
- symbol_table.clear ();
- condnames.clear ();
- specMap.clear();
+ parse_cleanup(context);
}
} // end namespace re2c
struct DFA;
-extern void parse(Scanner &, Output &);
-extern void parse_cleanup();
+void parse(Scanner &, Output &);
typedef std::set<std::string> CondList;
typedef std::vector<const RegExpRule*> Spec;
typedef std::map<std::string, const RegExp *> symbol_table_t;
typedef std::map<std::string, smart_ptr<DFA> > dfa_map_t;
+struct context_t
+{
+ std::vector<std::string> condnames;
+ SpecMap specMap;
+ SetupMap ruleSetupMap;
+ symbol_table_t symbol_table;
+
+ context_t()
+ : condnames()
+ , specMap()
+ , ruleSetupMap()
+ , symbol_table()
+ {}
+ void clear()
+ {
+ condnames.clear();
+ specMap.clear();
+ ruleSetupMap.clear();
+ symbol_table.clear();
+ }
+};
+
} // namespace re2c
#endif // _RE2C_PARSE_PARSER_
extern "C" {
-int yylex(Scanner &in);
-void yyerror(Scanner &in, const char*);
+int yylex(Scanner &in, context_t&);
+void yyerror(Scanner &in, context_t&, const char*);
} // extern "C"
-static std::vector<std::string> condnames;
-static re2c::SpecMap specMap;
-static SetupMap ruleSetupMap;
-static symbol_table_t symbol_table;
-
/* Bison version 1.875 emits a definition that is not working
* with several g++ version. Hence we disable it here.
*/
#define __attribute__(x)
#endif
+static void parse_cleanup(re2c::context_t &context)
+{
+ RegExp::flist.clear();
+ Range::vFreeList.clear();
+ RangeSuffix::freeList.clear();
+ context.clear();
+}
+
static void check(const Spec &spec, const std::string &cond)
{
Spec::const_iterator b = spec.begin(), e = spec.end(), i, j;
}
}
-static void make_rule(Scanner &in, CondList *clist, RegExpRule *rule,
- Code *code, const std::string *newcond)
+static void make_rule(Scanner &in, context_t &context, CondList *clist,
+ RegExpRule *rule, Code *code, const std::string *newcond)
{
if (!clist) {
clist = new CondList;
for(CondList::const_iterator i = clist->begin(); i != clist->end(); ++i) {
const std::string &cond = *i;
- if (cond != "" && cond != "*" && specMap.find(cond) == specMap.end()) {
- condnames.push_back(cond);
+ if (cond != "" && cond != "*" && context.specMap.find(cond) == context.specMap.end()) {
+ context.condnames.push_back(cond);
}
- specMap[cond].push_back(rule);
+ context.specMap[cond].push_back(rule);
}
delete clist;
}
-static void make_setup(Scanner &in, CondList *clist, const Code *code)
+static void make_setup(Scanner &in, SetupMap &ruleSetupMap,
+ CondList *clist, const Code *code)
{
assert(clist);
assert(code);
%lex-param {Scanner &in}
%parse-param {Scanner &in}
+%lex-param {context_t &context}
+%parse-param {context_t &context}
%union {
const re2c::RegExp * regexp;
def
: name expr enddef {
- if (!symbol_table.insert(std::make_pair(*$1, $2)).second) {
+ if (!context.symbol_table.insert(std::make_pair(*$1, $2)).second) {
in.fatal("sym already defined");
}
delete $1;
rule
: trailexpr TOKEN_CODE {
- make_rule(in, NULL, $1, $2, NULL);
+ make_rule(in, context, NULL, $1, $2, NULL);
}
| '<' clist '>' trailexpr TOKEN_CODE {
- make_rule(in, $2, $4, $5, NULL);
+ make_rule(in, context, $2, $4, $5, NULL);
}
| '<' clist '>' trailexpr '=' '>' TOKEN_ID TOKEN_CODE {
- make_rule(in, $2, $4, $8, $7);
+ make_rule(in, context, $2, $4, $8, $7);
}
| '<' clist '>' trailexpr ':' '=' '>' TOKEN_ID {
- make_rule(in, $2, $4, NULL, $8);
+ make_rule(in, context, $2, $4, NULL, $8);
}
| '<' '>' TOKEN_CODE {
- make_rule(in, NULL, NULL, $3, NULL);
+ make_rule(in, context, NULL, NULL, $3, NULL);
}
| '<' '>' '=' '>' TOKEN_ID TOKEN_CODE {
- make_rule(in, NULL, NULL, $6, $5);
+ make_rule(in, context, NULL, NULL, $6, $5);
}
| '<' '>' ':' '=' '>' TOKEN_ID {
- make_rule(in, NULL, NULL, NULL, $6);
+ make_rule(in, context, NULL, NULL, NULL, $6);
}
| '<' '!' clist '>' TOKEN_CODE {
- make_setup(in, $3, $5);
+ make_setup(in, context.ruleSetupMap, $3, $5);
};
clist
primary:
TOKEN_ID
{
- symbol_table_t::iterator i = symbol_table.find (* $1);
+ symbol_table_t::iterator i = context.symbol_table.find (* $1);
delete $1;
- if (i == symbol_table.end ())
+ if (i == context.symbol_table.end ())
{
in.fatal("can't find symbol");
}
extern "C" {
-void yyerror(Scanner &in, const char* s)
+void yyerror(Scanner &in, context_t&, const char* s)
{
in.fatal(s);
}
-int yylex(Scanner &in)
+int yylex(Scanner &in, context_t&)
{
return in.scan();
}
void parse(Scanner &in, Output & o)
{
dfa_map_t dfa_map;
+ context_t context;
ScannerState rules_state, curr_state;
Opt &opts = in.opts;
{
dfa_map.clear();
}
- specMap.clear();
- yyparse(in);
+ context.specMap.clear();
+ yyparse(in, context);
if (opts->rFlag && mode == Scanner::Reuse) {
- if (!specMap.empty() || opts->encoding != encodingOld) {
+ if (!context.specMap.empty() || opts->encoding != encodingOld) {
// Re-parse rules
mode = Scanner::Parse;
in.restore_state(rules_state);
in.reuse();
dfa_map.clear();
- parse_cleanup();
- specMap.clear();
- yyparse(in);
+ parse_cleanup(context);
+ context.specMap.clear();
+ yyparse(in, context);
// Now append potential new rules
in.restore_state(curr_state);
mode = Scanner::Parse;
- yyparse(in);
+ yyparse(in, context);
}
encodingOld = opts->encoding;
}
o.source.block().line = in.get_cline();
- o.source.block().types = condnames;
+ o.source.block().types = context.condnames;
// compile regular expressions to automata
if (mode != Scanner::Reuse) {
SpecMap::iterator it;
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
check(it->second, it->first);
}
// merge <*> rules to all conditions except "0" with lowest priority
Spec star;
- if ((it = specMap.find("*")) != specMap.end()) {
+ if ((it = context.specMap.find("*")) != context.specMap.end()) {
star = it->second;
- specMap.erase(it);
+ context.specMap.erase(it);
}
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
if (it->first == "0") continue;
for (size_t j = 0; j < star.size(); ++j) {
it->second.push_back(star[j]);
}
}
- for (it = specMap.begin(); it != specMap.end(); ++it) {
+ for (it = context.specMap.begin(); it != context.specMap.end(); ++it) {
delay_default(it->second);
dfa_map[it->first] = compile(it->second, o, it->first, opts->encoding.nCodeUnits ());
}
uint32_t ind = opts->topIndent;
size_t nCount = dfa_map.size();
for (dfa_map_t::const_iterator i = dfa_map.begin(); i != dfa_map.end(); ++i) {
- o.source.block().setup_rule = find_setup_rule(ruleSetupMap, i->first);
+ o.source.block().setup_rule = find_setup_rule(context.ruleSetupMap, i->first);
i->second->emit(o, ind, !--nCount, bPrologBrace);
}
}
}
SetupMap::const_iterator itRuleSetup;
- for (itRuleSetup = ruleSetupMap.begin(); itRuleSetup != ruleSetupMap.end(); ++itRuleSetup) {
- if (itRuleSetup->first != "*" && specMap.find(itRuleSetup->first) == specMap.end()) {
+ for (itRuleSetup = context.ruleSetupMap.begin(); itRuleSetup != context.ruleSetupMap.end(); ++itRuleSetup) {
+ if (itRuleSetup->first != "*" && context.specMap.find(itRuleSetup->first) == context.specMap.end()) {
in.fatalf_at(itRuleSetup->second.first, "setup for non existing rule '%s' found", itRuleSetup->first.c_str());
}
}
- if (specMap.size() < ruleSetupMap.size()) {
+ if (context.specMap.size() < context.ruleSetupMap.size()) {
uint32_t line = in.get_cline();
- itRuleSetup = ruleSetupMap.find("*");
- if (itRuleSetup != ruleSetupMap.end()) {
+ itRuleSetup = context.ruleSetupMap.find("*");
+ if (itRuleSetup != context.ruleSetupMap.end()) {
line = itRuleSetup->second.first;
}
in.fatalf_at(line, "setup for all rules with '*' not possible when all rules are setup explicitly");
emit_epilog (o.source, o.skeletons);
}
- parse_cleanup();
-}
-
-void parse_cleanup()
-{
- RegExp::flist.clear();
- Range::vFreeList.clear();
- RangeSuffix::freeList.clear();
- symbol_table.clear ();
- condnames.clear ();
- specMap.clear();
+ parse_cleanup(context);
}
} // end namespace re2c
-re2c: warning: line 10: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
-re2c: warning: line 10: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
-re2c: error: line 13, column 9: code to setup rule 'r1' is already defined
+/* Generated by re2c */
+
+
+
+
+{
+ YYCTYPE yych;
+ static void *yyctable[2] = {
+ &&yyc_r1,
+ &&yyc_r2,
+ };
+ goto *yyctable[YYGETCONDITION()];
+/* *********************************** */
+yyc_r1:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ {
+ static void *yytarget[256] = {
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy3, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy6, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy8, &&yy10, &&yy12, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4
+ };
+ goto *yytarget[yych];
+ }
+yy3:
+yy4:
+ ++YYCURSOR;
+ { return "SETUP - r1"; }
+ { return "."; }
+yy6:
+ ++YYCURSOR;
+ { return "SETUP - r1"; }
+ { return "1"; }
+yy8:
+ ++YYCURSOR;
+ { return "SETUP - r1"; }
+ { return "a"; }
+yy10:
+ ++YYCURSOR;
+ { return "SETUP - r1"; }
+ { return "b"; }
+yy12:
+ ++YYCURSOR;
+ { return "SETUP - r1"; }
+ { return "c"; }
+/* *********************************** */
+yyc_r2:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '`') {
+ if (yych != '\n') goto yy17;
+ } else {
+ if (yych <= 'a') goto yy19;
+ if (yych == 'c') goto yy21;
+ goto yy17;
+ }
+yy17:
+ ++YYCURSOR;
+ { return "."; }
+yy19:
+ ++YYCURSOR;
+ { return "a"; }
+yy21:
+ ++YYCURSOR;
+ { return "c"; }
+}
+
+
+
+{
+ YYCTYPE yych;
+ static void *yyctable[2] = {
+ &&yyc_r1,
+ &&yyc_r2,
+ };
+ goto *yyctable[YYGETCONDITION()];
+/* *********************************** */
+yyc_r1:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ {
+ static void *yytarget[256] = {
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy3, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy6, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy8, &&yy10, &&yy12, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4
+ };
+ goto *yytarget[yych];
+ }
+yy3:
+yy4:
+ ++YYCURSOR;
+ { return "."; }
+yy6:
+ ++YYCURSOR;
+ { return "2"; }
+yy8:
+ ++YYCURSOR;
+ { return "a"; }
+yy10:
+ ++YYCURSOR;
+ { return "b"; }
+yy12:
+ ++YYCURSOR;
+ { return "c"; }
+/* *********************************** */
+yyc_r2:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '`') {
+ if (yych != '\n') goto yy17;
+ } else {
+ if (yych <= 'a') goto yy19;
+ if (yych == 'c') goto yy21;
+ goto yy17;
+ }
+yy17:
+ ++YYCURSOR;
+ { return "SETUP - r2"; }
+ { return "."; }
+yy19:
+ ++YYCURSOR;
+ { return "SETUP - r2"; }
+ { return "a"; }
+yy21:
+ ++YYCURSOR;
+ { return "SETUP - r2"; }
+ { return "c"; }
+}
+
+re2c: warning: line 7: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 7: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 12: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 12: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 17: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 12: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order]
+re2c: warning: line 17: looks like you use hardcoded numbers instead of autogenerated condition names: better add '/*!types:re2c*/' directive or '-t, --type-header' option and don't rely on fixed condition order. [-Wcondition-order]
-// This test currently fails with error
-// 're2c: error: line 13, column 9: code to setup rule 'r1' is already defined'
-// This must be fixed later
/*!rules:re2c
<*> "a" { return "a"; }
<r1> "1" { return "1"; }
*/
-/* !use:re2c
+/*!use:re2c
<!r2> { return "SETUP - r2"; }
<r1> "2" { return "2"; }
*/
-re2c: warning: line 17: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
-re2c: warning: line 17: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
-re2c: error: line 11, column 9: code to setup rule 'r1' is already defined
+/* Generated by re2c */
+
+enum YYCONDTYPE {
+ yycr1,
+ yycr2,
+};
+
+
+void scan(unsigned char* in)
+{
+
+{
+ YYCTYPE yych;
+ static void *yyctable[2] = {
+ &&yyc_r1,
+ &&yyc_r2,
+ };
+ goto *yyctable[YYGETCONDITION()];
+/* *********************************** */
+yyc_r1:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ {
+ static void *yytarget[256] = {
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy3, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy6, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy8, &&yy10, &&yy12, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4
+ };
+ goto *yytarget[yych];
+ }
+yy3:
+yy4:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "."; }
+yy6:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "1"; }
+yy8:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "a"; }
+yy10:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "b"; }
+yy12:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "c"; }
+/* *********************************** */
+yyc_r2:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '`') {
+ if (yych != '\n') goto yy17;
+ } else {
+ if (yych <= 'a') goto yy19;
+ if (yych == 'c') goto yy21;
+ goto yy17;
+ }
+yy17:
+ ++YYCURSOR;
+ { return "SETUP-r2"; }
+ { return "."; }
+yy19:
+ ++YYCURSOR;
+ { return "SETUP-r2"; }
+ { return "a"; }
+yy21:
+ ++YYCURSOR;
+ { return "SETUP-r2"; }
+ { return "c"; }
+}
+
+
+}
+
+void scan(unsigned short* in)
+{
+
+{
+ YYCTYPE yych;
+ static void *yyctable[2] = {
+ &&yyc_r1,
+ &&yyc_r2,
+ };
+ goto *yyctable[YYGETCONDITION()];
+/* *********************************** */
+yyc_r1:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ {
+ static void *yytarget[256] = {
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy3, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy6, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy8, &&yy10, &&yy12, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4,
+ &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4, &&yy4
+ };
+ goto *yytarget[yych];
+ }
+yy3:
+yy4:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "."; }
+yy6:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "2"; }
+yy8:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "a"; }
+yy10:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "b"; }
+yy12:
+ ++YYCURSOR;
+ { return "SETUP-r1"; }
+ { return "c"; }
+/* *********************************** */
+yyc_r2:
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= '`') {
+ if (yych != '\n') goto yy17;
+ } else {
+ if (yych <= 'a') goto yy19;
+ if (yych == 'c') goto yy21;
+ goto yy17;
+ }
+yy17:
+ ++YYCURSOR;
+ { return "."; }
+yy19:
+ ++YYCURSOR;
+ { return "a"; }
+yy21:
+ ++YYCURSOR;
+ { return "c"; }
+}
+
+}
+re2c: warning: line 14: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 14: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 19: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 19: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 29: control flow in condition 'r1' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
+re2c: warning: line 29: control flow in condition 'r2' is undefined for strings that match '\xA', use default rule '*' [-Wundefined-control-flow]
-// This test currently fails with error
-// 're2c: error: line 11, column 9: code to setup rule 'r1' is already defined'
-// This must be fixed later
/*!types:re2c */