-/* Generated by re2c 0.15.2 on Sat Nov 28 18:04:39 2015*/
+/* Generated by re2c 0.15.2 on Tue Dec 1 12:58:01 2015 */
#line 1 "../src/parse/lex.re"
#include <stdlib.h>
#include <string.h>
yy119:
++YYCURSOR;
#line 257 "../src/parse/lex.re"
- { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return REGEXP; }
+ { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; }
#line 751 "src/parse/lex.cc"
yy121:
yych = (YYCTYPE)*++YYCURSOR;
yy122:
++YYCURSOR;
#line 256 "../src/parse/lex.re"
- { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return REGEXP; }
+ { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; }
#line 760 "src/parse/lex.cc"
yy124:
++YYCURSOR;
#line 271 "../src/parse/lex.re"
{
yylval.op = *tok;
- return STAR;
+ return TOKEN_STAR;
}
#line 777 "src/parse/lex.cc"
yy128:
#line 275 "../src/parse/lex.re"
{
yylval.op = *tok;
- return CLOSE;
+ return TOKEN_CLOSE;
}
#line 785 "src/parse/lex.cc"
yy130:
#line 359 "../src/parse/lex.re"
{
yylval.regexp = mkDot();
- return REGEXP;
+ return TOKEN_REGEXP;
}
#line 793 "src/parse/lex.cc"
yy132:
++YYCURSOR;
if ((yych = (YYCTYPE)*YYCURSOR) == '^') goto yy176;
#line 258 "../src/parse/lex.re"
- { yylval.regexp = lex_cls(false); return REGEXP; }
+ { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; }
#line 819 "src/parse/lex.cc"
yy138:
yych = (YYCTYPE)*++YYCURSOR;
fatal("curly braces for names only allowed with -F switch");
}
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
- return ID;
+ return TOKEN_ID;
}
#line 912 "src/parse/lex.cc"
yy150:
fatal ("repetition count overflow");
}
yylval.extop.max = yylval.extop.min;
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
#line 924 "src/parse/lex.cc"
yy152:
fatal ("repetition lower bound overflow");
}
yylval.extop.max = std::numeric_limits<uint32_t>::max();
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
#line 941 "src/parse/lex.cc"
yy155:
{
fatal ("repetition upper bound overflow");
}
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
#line 963 "src/parse/lex.cc"
yy159:
{
if (!opts->FFlag) {
yylval.str = new std::string (tok, tok_len());
- return ID;
+ return TOKEN_ID;
} else {
RegExp *r = NULL;
const bool casing = opts->bCaseInsensitive || opts->bCaseInverted;
r = doCat(r, casing ? ichr(c) : schr(c));
}
yylval.regexp = r ? r : new NullOp;
- return REGEXP;
+ return TOKEN_REGEXP;
}
}
#line 983 "src/parse/lex.cc"
#line 338 "../src/parse/lex.re"
{
yylval.str = new std::string (tok, tok_len ());
- return ID;
+ return TOKEN_ID;
}
#line 996 "src/parse/lex.cc"
yy164:
if (yych != ':') goto yy165;
++YYCURSOR;
#line 323 "../src/parse/lex.re"
- { lex_conf (); return CONF; }
+ { lex_conf (); return TOKEN_CONF; }
#line 1043 "src/parse/lex.cc"
yy171:
++YYCURSOR;
if (opts->FFlag)
{
lexer_state = LEX_FLEX_NAME;
- return FID;
+ return TOKEN_FID;
}
else
{
- return ID;
+ return TOKEN_ID;
}
}
#line 1060 "src/parse/lex.cc"
yy176:
++YYCURSOR;
#line 259 "../src/parse/lex.re"
- { yylval.regexp = lex_cls(true); return REGEXP; }
+ { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
#line 1079 "src/parse/lex.cc"
yy178:
++YYCURSOR;
#line 264 "../src/parse/lex.re"
{
- return SETUP;
+ return TOKEN_SETUP;
}
#line 1086 "src/parse/lex.cc"
yy180:
YYCURSOR = YYCTXMARKER;
#line 261 "../src/parse/lex.re"
{
- return NOCOND;
+ return TOKEN_NOCOND;
}
#line 1120 "src/parse/lex.cc"
yy185:
{
YYCURSOR = tok;
lexer_state = LEX_NORMAL;
- return FID_END;
+ return TOKEN_FID_END;
}
#line 1329 "src/parse/lex.cc"
yy227:
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
- CLOSE = 258,
- CLOSESIZE = 259,
+ TOKEN_CLOSE = 258,
+ TOKEN_CLOSESIZE = 259,
TOKEN_CODE = 260,
- CONF = 261,
- ID = 262,
- FID = 263,
- FID_END = 264,
- NOCOND = 265,
- REGEXP = 266,
- SETUP = 267,
- STAR = 268
+ TOKEN_CONF = 261,
+ TOKEN_ID = 262,
+ TOKEN_FID = 263,
+ TOKEN_FID_END = 264,
+ TOKEN_NOCOND = 265,
+ TOKEN_REGEXP = 266,
+ TOKEN_SETUP = 267,
+ TOKEN_STAR = 268
};
#endif
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
- "$end", "error", "$undefined", "CLOSE", "CLOSESIZE", "TOKEN_CODE",
- "CONF", "ID", "FID", "FID_END", "NOCOND", "REGEXP", "SETUP", "STAR",
- "'='", "';'", "'/'", "'<'", "'>'", "':'", "','", "'|'", "'\\\\'", "'('",
- "')'", "$accept", "spec", "decl", "rule", "cond", "clist", "newcond",
- "look", "expr", "diff", "term", "factor", "close", "primary", 0
+ "$end", "error", "$undefined", "TOKEN_CLOSE", "TOKEN_CLOSESIZE",
+ "TOKEN_CODE", "TOKEN_CONF", "TOKEN_ID", "TOKEN_FID", "TOKEN_FID_END",
+ "TOKEN_NOCOND", "TOKEN_REGEXP", "TOKEN_SETUP", "TOKEN_STAR", "'='",
+ "';'", "'/'", "'<'", "'>'", "':'", "','", "'|'", "'\\\\'", "'('", "')'",
+ "$accept", "spec", "decl", "rule", "cond", "clist", "newcond", "look",
+ "expr", "diff", "term", "factor", "close", "primary", 0
};
#endif
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
- CLOSE = 258,
- CLOSESIZE = 259,
+ TOKEN_CLOSE = 258,
+ TOKEN_CLOSESIZE = 259,
TOKEN_CODE = 260,
- CONF = 261,
- ID = 262,
- FID = 263,
- FID_END = 264,
- NOCOND = 265,
- REGEXP = 266,
- SETUP = 267,
- STAR = 268
+ TOKEN_CONF = 261,
+ TOKEN_ID = 262,
+ TOKEN_FID = 263,
+ TOKEN_FID_END = 264,
+ TOKEN_NOCOND = 265,
+ TOKEN_REGEXP = 266,
+ TOKEN_SETUP = 267,
+ TOKEN_STAR = 268
};
#endif
return 0;
}
- "'" { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return REGEXP; }
- "\"" { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return REGEXP; }
- "[" { yylval.regexp = lex_cls(false); return REGEXP; }
- "[^" { yylval.regexp = lex_cls(true); return REGEXP; }
+ "'" { yylval.regexp = lex_str('\'', opts->bCaseInsensitive || !opts->bCaseInverted); return TOKEN_REGEXP; }
+ "\"" { yylval.regexp = lex_str('"', opts->bCaseInsensitive || opts->bCaseInverted); return TOKEN_REGEXP; }
+ "[" { yylval.regexp = lex_cls(false); return TOKEN_REGEXP; }
+ "[^" { yylval.regexp = lex_cls(true); return TOKEN_REGEXP; }
"<>" / (space* ("{" | "=>" | ":=")) {
- return NOCOND;
+ return TOKEN_NOCOND;
}
"<!" {
- return SETUP;
+ return TOKEN_SETUP;
}
[<>,()|=;/\\] {
return *tok;
"*" {
yylval.op = *tok;
- return STAR;
+ return TOKEN_STAR;
}
[+?] {
yylval.op = *tok;
- return CLOSE;
+ return TOKEN_CLOSE;
}
"{" [0-9]+ "}" {
fatal ("repetition count overflow");
}
yylval.extop.max = yylval.extop.min;
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
"{" [0-9]+ "," [0-9]+ "}" {
{
fatal ("repetition upper bound overflow");
}
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
"{" [0-9]+ ",}" {
fatal ("repetition lower bound overflow");
}
yylval.extop.max = std::numeric_limits<uint32_t>::max();
- return CLOSESIZE;
+ return TOKEN_CLOSESIZE;
}
"{" [0-9]* "," {
fatal("curly braces for names only allowed with -F switch");
}
yylval.str = new std::string (tok + 1, tok_len () - 2); // -2 to omit braces
- return ID;
+ return TOKEN_ID;
}
- "re2c:" { lex_conf (); return CONF; }
+ "re2c:" { lex_conf (); return TOKEN_CONF; }
name / (space+ [^=>,]) {
yylval.str = new std::string (tok, tok_len ());
if (opts->FFlag)
{
lexer_state = LEX_FLEX_NAME;
- return FID;
+ return TOKEN_FID;
}
else
{
- return ID;
+ return TOKEN_ID;
}
}
name / (space* [=>,]) {
yylval.str = new std::string (tok, tok_len ());
- return ID;
+ return TOKEN_ID;
}
name / [^] {
if (!opts->FFlag) {
yylval.str = new std::string (tok, tok_len());
- return ID;
+ return TOKEN_ID;
} else {
RegExp *r = NULL;
const bool casing = opts->bCaseInsensitive || opts->bCaseInverted;
r = doCat(r, casing ? ichr(c) : schr(c));
}
yylval.regexp = r ? r : new NullOp;
- return REGEXP;
+ return TOKEN_REGEXP;
}
}
"." {
yylval.regexp = mkDot();
- return REGEXP;
+ return TOKEN_REGEXP;
}
space+ {
{
YYCURSOR = tok;
lexer_state = LEX_NORMAL;
- return FID_END;
+ return TOKEN_FID_END;
}
*
{
re2c::CondList * clist;
};
-%token CLOSE
-%token CLOSESIZE
+%token TOKEN_CLOSE
+%token TOKEN_CLOSESIZE
%token TOKEN_CODE
-%token CONF
-%token ID
-%token FID
-%token FID_END
-%token NOCOND
-%token REGEXP
-%token SETUP
-%token STAR
-
-%type <op> CLOSE STAR SETUP close
-%type <extop> CLOSESIZE
+%token TOKEN_CONF
+%token TOKEN_ID
+%token TOKEN_FID
+%token TOKEN_FID_END
+%token TOKEN_NOCOND
+%token TOKEN_REGEXP
+%token TOKEN_SETUP
+%token TOKEN_STAR
+
+%type <op> TOKEN_CLOSE TOKEN_STAR TOKEN_SETUP close
+%type <extop> TOKEN_CLOSESIZE
%type <code> TOKEN_CODE
-%type <regexp> REGEXP rule look expr diff term factor primary
-%type <str> ID FID newcond
+%type <regexp> TOKEN_REGEXP rule look expr diff term factor primary
+%type <str> TOKEN_ID TOKEN_FID newcond
%type <clist> cond clist
%%
;
decl:
- ID '=' expr ';'
+ TOKEN_ID '=' expr ';'
{
if (!symbol_table.insert (std::make_pair (* $1, $3)).second)
{
delete $1;
$3->ins_access = RegExp::PRIVATE;
}
- | FID expr FID_END
+ | TOKEN_FID expr TOKEN_FID_END
{
if (!symbol_table.insert (std::make_pair (* $1, $2)).second)
{
delete $1;
$2->ins_access = RegExp::PRIVATE;
}
- | ID '=' expr '/'
+ | TOKEN_ID '=' expr '/'
{
in->fatal("trailing contexts are not allowed in named definitions");
}
- | FID expr '/'
+ | TOKEN_FID expr '/'
{
in->fatal("trailing contexts are not allowed in named definitions");
}
- | CONF {}
+ | TOKEN_CONF {}
;
rule:
);
spec.add (rule);
}
- | STAR TOKEN_CODE /* default rule */
+ | TOKEN_STAR TOKEN_CODE /* default rule */
{
if (opts->cFlag)
in->fatal("condition or '<*>' required when using -c switch");
context_none($2);
delete $6;
}
- | '<' cond '>' STAR TOKEN_CODE /* default rule for conditions */
+ | '<' cond '>' TOKEN_STAR TOKEN_CODE /* default rule for conditions */
{
default_rule($2, $5);
}
- | '<' STAR '>' expr look newcond TOKEN_CODE
+ | '<' TOKEN_STAR '>' expr look newcond TOKEN_CODE
{
context_check(NULL);
RuleOp * rule = new RuleOp
specStar.push_back (rule);
delete $6;
}
- | '<' STAR '>' expr look ':' newcond
+ | '<' TOKEN_STAR '>' expr look ':' newcond
{
assert($7);
context_check(NULL);
specStar.push_back (rule);
delete $7;
}
- | '<' STAR '>' look newcond TOKEN_CODE
+ | '<' TOKEN_STAR '>' look newcond TOKEN_CODE
{
context_none(NULL);
delete $5;
}
- | '<' STAR '>' look ':' newcond
+ | '<' TOKEN_STAR '>' look ':' newcond
{
assert($6);
context_none(NULL);
delete $6;
}
- | '<' STAR '>' STAR TOKEN_CODE /* default rule for all conditions */
+ | '<' TOKEN_STAR '>' TOKEN_STAR TOKEN_CODE /* default rule for all conditions */
{
if (star_default)
{
, NULL
);
}
- | NOCOND newcond TOKEN_CODE
+ | TOKEN_NOCOND newcond TOKEN_CODE
{
context_check(NULL);
if (specNone)
);
delete $2;
}
- | NOCOND ':' newcond
+ | TOKEN_NOCOND ':' newcond
{
assert($3);
context_check(NULL);
);
delete $3;
}
- | SETUP STAR '>' TOKEN_CODE
+ | TOKEN_SETUP TOKEN_STAR '>' TOKEN_CODE
{
CondList *clist = new CondList();
clist->insert("*");
setup_rule(clist, $4);
}
- | SETUP cond '>' TOKEN_CODE
+ | TOKEN_SETUP cond '>' TOKEN_CODE
{
setup_rule($2, $4);
}
;
clist:
- ID
+ TOKEN_ID
{
$$ = new CondList();
$$->insert(* $1);
delete $1;
}
- | clist ',' ID
+ | clist ',' TOKEN_ID
{
$1->insert(* $3);
delete $3;
{
$$ = NULL;
}
- | '=' '>' ID
+ | '=' '>' TOKEN_ID
{
$$ = $3;
}
break;
}
}
- | primary CLOSESIZE
+ | primary TOKEN_CLOSESIZE
{
$1->ins_access = RegExp::PRIVATE;
if ($2.max == std::numeric_limits<uint32_t>::max())
;
close:
- CLOSE
+ TOKEN_CLOSE
{
$$ = $1;
}
- | STAR
+ | TOKEN_STAR
{
$$ = $1;
}
- | close CLOSE
+ | close TOKEN_CLOSE
{
$$ = ($1 == $2) ? $1 : '*';
}
- | close STAR
+ | close TOKEN_STAR
{
$$ = ($1 == $2) ? $1 : '*';
}
;
primary:
- ID
+ TOKEN_ID
{
symbol_table_t::iterator i = symbol_table.find (* $1);
delete $1;
}
$$ = i->second;
}
- | REGEXP
+ | TOKEN_REGEXP
{
$$ = $1;
}