#include "src/codegen/dfa_emit.h" // genTypes
#include "src/globals.h"
#include "src/parse/parser.h"
+#include "src/parse/symbol.h"
#include "src/util/c99_stdint.h"
#include "src/util/smart_ptr.h"
/* Line 189 of yacc.c */
-#line 220 "./parser.cc"
+#line 221 "./parser.cc"
/* Enabling traces. */
#ifndef YYDEBUG
{
/* Line 214 of yacc.c */
-#line 150 "../src/parse/parser.ypp"
+#line 151 "../src/parse/parser.ypp"
re2c::Symbol *symbol;
re2c::RegExp *regexp;
/* Line 214 of yacc.c */
-#line 284 "./parser.cc"
+#line 285 "./parser.cc"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
/* Line 264 of yacc.c */
-#line 296 "./parser.cc"
+#line 297 "./parser.cc"
#ifdef short
# undef short
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 179, 179, 181, 185, 189, 198, 207, 211, 215,
- 221, 229, 238, 247, 251, 256, 261, 267, 271, 279,
- 287, 292, 298, 304, 316, 328, 334, 342, 345, 352,
- 357, 366, 369, 377, 380, 387, 391, 398, 402, 413,
- 417, 424, 428, 443, 450, 454, 458, 462, 469, 477,
- 481, 485
+ 0, 180, 180, 182, 186, 190, 199, 208, 212, 216,
+ 222, 230, 239, 248, 252, 257, 262, 268, 272, 280,
+ 288, 293, 299, 305, 317, 329, 335, 343, 346, 353,
+ 358, 367, 370, 378, 381, 388, 392, 399, 403, 414,
+ 418, 425, 429, 444, 451, 455, 459, 463, 470, 478,
+ 482, 486
};
#endif
case 2:
/* Line 1464 of yacc.c */
-#line 179 "../src/parse/parser.ypp"
+#line 180 "../src/parse/parser.ypp"
{
;}
break;
case 3:
/* Line 1464 of yacc.c */
-#line 182 "../src/parse/parser.ypp"
+#line 183 "../src/parse/parser.ypp"
{
foundRules = true;
;}
case 5:
/* Line 1464 of yacc.c */
-#line 190 "../src/parse/parser.ypp"
+#line 191 "../src/parse/parser.ypp"
{
if ((yyvsp[(1) - (4)].symbol)->re)
{
case 6:
/* Line 1464 of yacc.c */
-#line 199 "../src/parse/parser.ypp"
+#line 200 "../src/parse/parser.ypp"
{
if ((yyvsp[(1) - (2)].symbol)->re)
{
case 7:
/* Line 1464 of yacc.c */
-#line 208 "../src/parse/parser.ypp"
+#line 209 "../src/parse/parser.ypp"
{
in->fatal("trailing contexts are not allowed in named definitions");
;}
case 8:
/* Line 1464 of yacc.c */
-#line 212 "../src/parse/parser.ypp"
+#line 213 "../src/parse/parser.ypp"
{
in->fatal("trailing contexts are not allowed in named definitions");
;}
case 9:
/* Line 1464 of yacc.c */
-#line 216 "../src/parse/parser.ypp"
+#line 217 "../src/parse/parser.ypp"
{
in->config((yyvsp[(1) - (4)].str)->to_string (), *(yyvsp[(3) - (4)].str));
delete (yyvsp[(1) - (4)].str);
case 10:
/* Line 1464 of yacc.c */
-#line 222 "../src/parse/parser.ypp"
+#line 223 "../src/parse/parser.ypp"
{
in->config((yyvsp[(1) - (4)].str)->to_string (), (yyvsp[(3) - (4)].number));
delete (yyvsp[(1) - (4)].str);
case 11:
/* Line 1464 of yacc.c */
-#line 230 "../src/parse/parser.ypp"
+#line 231 "../src/parse/parser.ypp"
{
if (cFlag)
{
case 12:
/* Line 1464 of yacc.c */
-#line 239 "../src/parse/parser.ypp"
+#line 240 "../src/parse/parser.ypp"
{
if (cFlag)
in->fatal("condition or '<*>' required when using -c switch");
case 13:
/* Line 1464 of yacc.c */
-#line 248 "../src/parse/parser.ypp"
+#line 249 "../src/parse/parser.ypp"
{
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(6) - (7)].str), (yyvsp[(7) - (7)].token));
;}
case 14:
/* Line 1464 of yacc.c */
-#line 252 "../src/parse/parser.ypp"
+#line 253 "../src/parse/parser.ypp"
{
assert((yyvsp[(7) - (7)].str));
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].str), NULL);
case 15:
/* Line 1464 of yacc.c */
-#line 257 "../src/parse/parser.ypp"
+#line 258 "../src/parse/parser.ypp"
{
context_none((yyvsp[(2) - (6)].clist));
delete (yyvsp[(5) - (6)].str);
case 16:
/* Line 1464 of yacc.c */
-#line 262 "../src/parse/parser.ypp"
+#line 263 "../src/parse/parser.ypp"
{
assert((yyvsp[(6) - (6)].str));
context_none((yyvsp[(2) - (6)].clist));
case 17:
/* Line 1464 of yacc.c */
-#line 268 "../src/parse/parser.ypp"
+#line 269 "../src/parse/parser.ypp"
{
default_rule((yyvsp[(2) - (5)].clist), (yyvsp[(5) - (5)].token));
;}
case 18:
/* Line 1464 of yacc.c */
-#line 272 "../src/parse/parser.ypp"
+#line 273 "../src/parse/parser.ypp"
{
context_check(NULL);
Token *token = new Token((yyvsp[(7) - (7)].token), (yyvsp[(7) - (7)].token)->source, (yyvsp[(7) - (7)].token)->line, (yyvsp[(6) - (7)].str));
case 19:
/* Line 1464 of yacc.c */
-#line 280 "../src/parse/parser.ypp"
+#line 281 "../src/parse/parser.ypp"
{
assert((yyvsp[(7) - (7)].str));
context_check(NULL);
case 20:
/* Line 1464 of yacc.c */
-#line 288 "../src/parse/parser.ypp"
+#line 289 "../src/parse/parser.ypp"
{
context_none(NULL);
delete (yyvsp[(5) - (6)].str);
case 21:
/* Line 1464 of yacc.c */
-#line 293 "../src/parse/parser.ypp"
+#line 294 "../src/parse/parser.ypp"
{
assert((yyvsp[(6) - (6)].str));
context_none(NULL);
case 22:
/* Line 1464 of yacc.c */
-#line 299 "../src/parse/parser.ypp"
+#line 300 "../src/parse/parser.ypp"
{
CondList *clist = new CondList();
clist->insert("*");
case 23:
/* Line 1464 of yacc.c */
-#line 305 "../src/parse/parser.ypp"
+#line 306 "../src/parse/parser.ypp"
{
context_check(NULL);
if (specNone)
case 24:
/* Line 1464 of yacc.c */
-#line 317 "../src/parse/parser.ypp"
+#line 318 "../src/parse/parser.ypp"
{
assert((yyvsp[(3) - (3)].str));
context_check(NULL);
case 25:
/* Line 1464 of yacc.c */
-#line 329 "../src/parse/parser.ypp"
+#line 330 "../src/parse/parser.ypp"
{
CondList *clist = new CondList();
clist->insert("*");
case 26:
/* Line 1464 of yacc.c */
-#line 335 "../src/parse/parser.ypp"
+#line 336 "../src/parse/parser.ypp"
{
setup_rule((yyvsp[(2) - (4)].clist), (yyvsp[(4) - (4)].token));
;}
case 27:
/* Line 1464 of yacc.c */
-#line 342 "../src/parse/parser.ypp"
+#line 343 "../src/parse/parser.ypp"
{
in->fatal("unnamed condition not supported");
;}
case 28:
/* Line 1464 of yacc.c */
-#line 346 "../src/parse/parser.ypp"
+#line 347 "../src/parse/parser.ypp"
{
(yyval.clist) = (yyvsp[(1) - (1)].clist);
;}
case 29:
/* Line 1464 of yacc.c */
-#line 353 "../src/parse/parser.ypp"
+#line 354 "../src/parse/parser.ypp"
{
(yyval.clist) = new CondList();
(yyval.clist)->insert((yyvsp[(1) - (1)].symbol)->GetName().to_string());
case 30:
/* Line 1464 of yacc.c */
-#line 358 "../src/parse/parser.ypp"
+#line 359 "../src/parse/parser.ypp"
{
(yyvsp[(1) - (3)].clist)->insert((yyvsp[(3) - (3)].symbol)->GetName().to_string());
(yyval.clist) = (yyvsp[(1) - (3)].clist);
case 31:
/* Line 1464 of yacc.c */
-#line 366 "../src/parse/parser.ypp"
+#line 367 "../src/parse/parser.ypp"
{
(yyval.str) = NULL;
;}
case 32:
/* Line 1464 of yacc.c */
-#line 370 "../src/parse/parser.ypp"
+#line 371 "../src/parse/parser.ypp"
{
(yyval.str) = new Str((yyvsp[(3) - (3)].symbol)->GetName().to_string().c_str());
;}
case 33:
/* Line 1464 of yacc.c */
-#line 377 "../src/parse/parser.ypp"
+#line 378 "../src/parse/parser.ypp"
{
(yyval.regexp) = new NullOp;
;}
case 34:
/* Line 1464 of yacc.c */
-#line 381 "../src/parse/parser.ypp"
+#line 382 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(2) - (2)].regexp);
;}
case 35:
/* Line 1464 of yacc.c */
-#line 388 "../src/parse/parser.ypp"
+#line 389 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 36:
/* Line 1464 of yacc.c */
-#line 392 "../src/parse/parser.ypp"
+#line 393 "../src/parse/parser.ypp"
{
(yyval.regexp) = mkAlt((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
;}
case 37:
/* Line 1464 of yacc.c */
-#line 399 "../src/parse/parser.ypp"
+#line 400 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 38:
/* Line 1464 of yacc.c */
-#line 403 "../src/parse/parser.ypp"
+#line 404 "../src/parse/parser.ypp"
{
(yyval.regexp) = mkDiff((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
if(!(yyval.regexp))
case 39:
/* Line 1464 of yacc.c */
-#line 414 "../src/parse/parser.ypp"
+#line 415 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 40:
/* Line 1464 of yacc.c */
-#line 418 "../src/parse/parser.ypp"
+#line 419 "../src/parse/parser.ypp"
{
(yyval.regexp) = new CatOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].regexp));
;}
case 41:
/* Line 1464 of yacc.c */
-#line 425 "../src/parse/parser.ypp"
+#line 426 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 42:
/* Line 1464 of yacc.c */
-#line 429 "../src/parse/parser.ypp"
+#line 430 "../src/parse/parser.ypp"
{
switch((yyvsp[(2) - (2)].op))
{
case 43:
/* Line 1464 of yacc.c */
-#line 444 "../src/parse/parser.ypp"
+#line 445 "../src/parse/parser.ypp"
{
(yyval.regexp) = new CloseVOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].extop).minsize, (yyvsp[(2) - (2)].extop).maxsize);
;}
case 44:
/* Line 1464 of yacc.c */
-#line 451 "../src/parse/parser.ypp"
+#line 452 "../src/parse/parser.ypp"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
;}
case 45:
/* Line 1464 of yacc.c */
-#line 455 "../src/parse/parser.ypp"
+#line 456 "../src/parse/parser.ypp"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
;}
case 46:
/* Line 1464 of yacc.c */
-#line 459 "../src/parse/parser.ypp"
+#line 460 "../src/parse/parser.ypp"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
;}
case 47:
/* Line 1464 of yacc.c */
-#line 463 "../src/parse/parser.ypp"
+#line 464 "../src/parse/parser.ypp"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
;}
case 48:
/* Line 1464 of yacc.c */
-#line 470 "../src/parse/parser.ypp"
+#line 471 "../src/parse/parser.ypp"
{
if(!(yyvsp[(1) - (1)].symbol)->re)
{
case 49:
/* Line 1464 of yacc.c */
-#line 478 "../src/parse/parser.ypp"
+#line 479 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 50:
/* Line 1464 of yacc.c */
-#line 482 "../src/parse/parser.ypp"
+#line 483 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
;}
case 51:
/* Line 1464 of yacc.c */
-#line 486 "../src/parse/parser.ypp"
+#line 487 "../src/parse/parser.ypp"
{
(yyval.regexp) = (yyvsp[(2) - (3)].regexp);
;}
/* Line 1464 of yacc.c */
-#line 2096 "./parser.cc"
+#line 2097 "./parser.cc"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
/* Line 1684 of yacc.c */
-#line 491 "../src/parse/parser.ypp"
+#line 492 "../src/parse/parser.ypp"
extern "C" {