void context_rule(CondList *clist, RegExp *expr, RegExp *look, Str *newcond, Token *code)
{
context_check(clist);
- bool condchange = !newcond || clist->size() > 1
- || clist->find(newcond->to_string()) == clist->end();
for(CondList::const_iterator it = clist->begin(); it != clist->end(); ++it)
{
- Str *condcpy = newcond ? new Str(*newcond) : newcond;
- Token *token = new Token(code, in->get_line(), condcpy, condchange);
+ //Str *condcpy = newcond ? new Str(*newcond) : newcond;
+ Token *token = new Token(code, in->get_line(), newcond);//condcpy);
RuleOp *rule = new RuleOp(expr, look, token, accept++);
RegExpMap::iterator itRE = specMap.find(*it);
}
delete clist;
+ delete newcond;
delete code;
}
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 107 "parser.y"
+#line 106 "parser.y"
{
re2c::Symbol *symbol;
re2c::RegExp *regexp;
re2c::CondList *clist;
}
/* Line 187 of yacc.c. */
-#line 237 "parser.cc"
+#line 236 "parser.cc"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
/* Line 216 of yacc.c. */
-#line 250 "parser.cc"
+#line 249 "parser.cc"
#ifdef short
# undef short
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 136, 136, 140, 141, 145, 153, 157, 163, 171,
- 180, 184, 189, 193, 198, 204, 211, 215, 220, 230,
- 245, 248, 255, 260, 269, 272, 280, 283, 290, 294,
- 301, 305, 316, 320, 327, 331, 346, 353, 357, 361,
- 365, 372, 380, 384, 388
+ 0, 135, 135, 139, 140, 144, 152, 156, 162, 170,
+ 179, 183, 188, 193, 199, 207, 215, 220, 226, 238,
+ 254, 257, 264, 269, 278, 281, 289, 292, 299, 303,
+ 310, 314, 325, 329, 336, 340, 355, 362, 366, 370,
+ 374, 381, 389, 393, 397
};
#endif
switch (yyn)
{
case 2:
-#line 136 "parser.y"
+#line 135 "parser.y"
{
accept = 0;
spec = NULL;
break;
case 5:
-#line 146 "parser.y"
+#line 145 "parser.y"
{
if((yyvsp[(1) - (4)].symbol)->re)
{
break;
case 6:
-#line 154 "parser.y"
+#line 153 "parser.y"
{
in->fatal("trailing contexts are not allowed in named definitions");
}
break;
case 7:
-#line 158 "parser.y"
+#line 157 "parser.y"
{
in->config(*(yyvsp[(1) - (4)].str), *(yyvsp[(3) - (4)].str));
delete (yyvsp[(1) - (4)].str);
break;
case 8:
-#line 164 "parser.y"
+#line 163 "parser.y"
{
in->config(*(yyvsp[(1) - (4)].str), (yyvsp[(3) - (4)].number));
delete (yyvsp[(1) - (4)].str);
break;
case 9:
-#line 172 "parser.y"
+#line 171 "parser.y"
{
if (cFlag)
{
break;
case 10:
-#line 181 "parser.y"
+#line 180 "parser.y"
{
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(6) - (7)].str), (yyvsp[(7) - (7)].token));
}
break;
case 11:
-#line 185 "parser.y"
+#line 184 "parser.y"
{
assert((yyvsp[(7) - (7)].str));
context_rule((yyvsp[(2) - (7)].clist), (yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].str), NULL);
break;
case 12:
-#line 190 "parser.y"
+#line 189 "parser.y"
{
context_none((yyvsp[(2) - (6)].clist));
+ delete (yyvsp[(5) - (6)].str);
}
break;
{
assert((yyvsp[(6) - (6)].str));
context_none((yyvsp[(2) - (6)].clist));
+ delete (yyvsp[(6) - (6)].str);
}
break;
case 14:
-#line 199 "parser.y"
+#line 200 "parser.y"
{
context_check(NULL);
- (yyvsp[(7) - (7)].token)->newcond = (yyvsp[(6) - (7)].str);
- specStar.push_back(new RuleOp((yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), (yyvsp[(7) - (7)].token), accept++));
+ Token *token = new Token((yyvsp[(7) - (7)].token), (yyvsp[(7) - (7)].token)->line, (yyvsp[(6) - (7)].str));
+ delete (yyvsp[(7) - (7)].token);
+ delete (yyvsp[(6) - (7)].str);
+ specStar.push_back(new RuleOp((yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), token, accept++));
}
break;
case 15:
-#line 205 "parser.y"
+#line 208 "parser.y"
{
assert((yyvsp[(7) - (7)].str));
context_check(NULL);
- Token *token = new Token(NULL, in->get_line(), (yyvsp[(7) - (7)].str), true);
+ Token *token = new Token(NULL, in->get_line(), (yyvsp[(7) - (7)].str));
+ delete (yyvsp[(7) - (7)].str);
specStar.push_back(new RuleOp((yyvsp[(4) - (7)].regexp), (yyvsp[(5) - (7)].regexp), token, accept++));
}
break;
case 16:
-#line 212 "parser.y"
+#line 216 "parser.y"
{
context_none(NULL);
+ delete (yyvsp[(5) - (6)].str);
}
break;
case 17:
-#line 216 "parser.y"
+#line 221 "parser.y"
{
assert((yyvsp[(6) - (6)].str));
context_none(NULL);
+ delete (yyvsp[(6) - (6)].str);
}
break;
case 18:
-#line 221 "parser.y"
+#line 227 "parser.y"
{
context_check(NULL);
if (specNone)
{
in->fatal("code to handle illegal condition already defined");
}
- (yyvsp[(3) - (3)].token)->newcond = (yyvsp[(2) - (3)].str);
- (yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), (yyvsp[(3) - (3)].token), accept++);
+ Token *token = new Token((yyvsp[(3) - (3)].token), (yyvsp[(3) - (3)].token)->line, (yyvsp[(2) - (3)].str));
+ delete (yyvsp[(2) - (3)].str);
+ delete (yyvsp[(3) - (3)].token);
+ (yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++);
}
break;
case 19:
-#line 231 "parser.y"
+#line 239 "parser.y"
{
assert((yyvsp[(3) - (3)].str));
context_check(NULL);
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token(NULL, in->get_line(), (yyvsp[(3) - (3)].str), true);
+ Token *token = new Token(NULL, in->get_line(), (yyvsp[(3) - (3)].str));
+ delete (yyvsp[(3) - (3)].str);
(yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++);
}
break;
case 20:
-#line 245 "parser.y"
+#line 254 "parser.y"
{
in->fatal("unnamed condition not supported");
}
break;
case 21:
-#line 249 "parser.y"
+#line 258 "parser.y"
{
(yyval.clist) = (yyvsp[(1) - (1)].clist);
}
break;
case 22:
-#line 256 "parser.y"
+#line 265 "parser.y"
{
(yyval.clist) = new CondList();
(yyval.clist)->insert((yyvsp[(1) - (1)].symbol)->GetName().to_string());
break;
case 23:
-#line 261 "parser.y"
+#line 270 "parser.y"
{
(yyvsp[(1) - (3)].clist)->insert((yyvsp[(3) - (3)].symbol)->GetName().to_string());
(yyval.clist) = (yyvsp[(1) - (3)].clist);
break;
case 24:
-#line 269 "parser.y"
+#line 278 "parser.y"
{
(yyval.str) = NULL;
}
break;
case 25:
-#line 273 "parser.y"
+#line 282 "parser.y"
{
(yyval.str) = new Str((yyvsp[(3) - (3)].symbol)->GetName().to_string().c_str());
}
break;
case 26:
-#line 280 "parser.y"
+#line 289 "parser.y"
{
(yyval.regexp) = new NullOp;
}
break;
case 27:
-#line 284 "parser.y"
+#line 293 "parser.y"
{
(yyval.regexp) = (yyvsp[(2) - (2)].regexp);
}
break;
case 28:
-#line 291 "parser.y"
+#line 300 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 29:
-#line 295 "parser.y"
+#line 304 "parser.y"
{
(yyval.regexp) = mkAlt((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
}
break;
case 30:
-#line 302 "parser.y"
+#line 311 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 31:
-#line 306 "parser.y"
+#line 315 "parser.y"
{
(yyval.regexp) = mkDiff((yyvsp[(1) - (3)].regexp), (yyvsp[(3) - (3)].regexp));
if(!(yyval.regexp))
break;
case 32:
-#line 317 "parser.y"
+#line 326 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 33:
-#line 321 "parser.y"
+#line 330 "parser.y"
{
(yyval.regexp) = new CatOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].regexp));
}
break;
case 34:
-#line 328 "parser.y"
+#line 337 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 35:
-#line 332 "parser.y"
+#line 341 "parser.y"
{
switch((yyvsp[(2) - (2)].op))
{
break;
case 36:
-#line 347 "parser.y"
+#line 356 "parser.y"
{
(yyval.regexp) = new CloseVOp((yyvsp[(1) - (2)].regexp), (yyvsp[(2) - (2)].extop).minsize, (yyvsp[(2) - (2)].extop).maxsize);
}
break;
case 37:
-#line 354 "parser.y"
+#line 363 "parser.y"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
}
break;
case 38:
-#line 358 "parser.y"
+#line 367 "parser.y"
{
(yyval.op) = (yyvsp[(1) - (1)].op);
}
break;
case 39:
-#line 362 "parser.y"
+#line 371 "parser.y"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
}
break;
case 40:
-#line 366 "parser.y"
+#line 375 "parser.y"
{
(yyval.op) = ((yyvsp[(1) - (2)].op) == (yyvsp[(2) - (2)].op)) ? (yyvsp[(1) - (2)].op) : '*';
}
break;
case 41:
-#line 373 "parser.y"
+#line 382 "parser.y"
{
if(!(yyvsp[(1) - (1)].symbol)->re)
{
break;
case 42:
-#line 381 "parser.y"
+#line 390 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 43:
-#line 385 "parser.y"
+#line 394 "parser.y"
{
(yyval.regexp) = (yyvsp[(1) - (1)].regexp);
}
break;
case 44:
-#line 389 "parser.y"
+#line 398 "parser.y"
{
(yyval.regexp) = (yyvsp[(2) - (3)].regexp);
}
/* Line 1267 of yacc.c. */
-#line 1851 "parser.cc"
+#line 1860 "parser.cc"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
}
-#line 394 "parser.y"
+#line 403 "parser.y"
extern "C" {
}
else
{
- // We reserved 0 for specNone but is isn't present,
+ // We reserved 0 for specNone but it is not present,
// so we can decrease all specs.
for(it = specMap.begin(); it != specMap.end(); ++it)
{
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
-#line 107 "parser.y"
+#line 106 "parser.y"
{
re2c::Symbol *symbol;
re2c::RegExp *regexp;
}
}
-void Match::emit(std::ostream &o, uint ind, bool &readCh) const
+void Match::emit(std::ostream &o, uint ind, bool &readCh, const std::string&) const
{
if (state->link)
{
}
}
-void Enter::emit(std::ostream &o, uint ind, bool &readCh) const
+void Enter::emit(std::ostream &o, uint ind, bool &readCh, const std::string&) const
{
if (state->link)
{
}
}
-void Initial::emit(std::ostream &o, uint ind, bool &readCh) const
+void Initial::emit(std::ostream &o, uint ind, bool &readCh, const std::string&) const
{
if (!cFlag && !startLabelName.empty())
{
}
}
-void Save::emit(std::ostream &o, uint ind, bool &readCh) const
+void Save::emit(std::ostream &o, uint ind, bool &readCh, const std::string&) const
{
if (bUsedYYAccept)
{
;
}
-void Move::emit(std::ostream &, uint, bool &) const
+void Move::emit(std::ostream &, uint, bool &, const std::string&) const
{
;
}
}
}
-void Accept::emit(std::ostream &o, uint ind, bool &readCh) const
+void Accept::emit(std::ostream &o, uint ind, bool &readCh, const std::string&) const
{
if (mapRules.size() > 0)
{
;
}
-void Rule::emit(std::ostream &o, uint ind, bool &) const
+void Rule::emit(std::ostream &o, uint ind, bool &, const std::string& condName) const
{
uint back = rule->ctx->fixedLength();
o << indent(ind) << mapCodeName["YYCURSOR"] << " = " << mapCodeName["YYCTXMARKER"] << ";\n";
}
- if (rule->code->newcond && rule->code->condchange)
+ if (rule->code->newcond.length() && condName != rule->code->newcond)
{
- // TODO: rather than using condchange we can do this by comparing the
- // sourcecondition with the destination condition.
- genSetCondition(o, ind, rule->code->newcond->to_string());
+ genSetCondition(o, ind, rule->code->newcond);
}
RuleLine rl(*rule);
o << indent(ind);
if (rule->code->autogen)
{
- std::string condLabel(condPrefix);
- condLabel += rule->code->newcond->to_string();
- o << replaceParam(condGoto, condGotoParam, condLabel);
+ o << replaceParam(condGoto, condGotoParam, condPrefix + rule->code->newcond);
}
else
{
genBase(o, ind, from, next, readCh, 0);
}
-void State::emit(std::ostream &o, uint ind, bool &readCh) const
+void State::emit(std::ostream &o, uint ind, bool &readCh, const std::string& condName) const
{
if (vUsedLabels.count(label))
{
{
o << indent(ind) << mapCodeName["YYCTXMARKER"] << " = " << mapCodeName["YYCURSOR"] << " + 1;\n";
}
- action->emit(o, ind, readCh);
+ action->emit(o, ind, readCh, condName);
}
uint merge(Span *x0, State *fg, State *bg)
for (s = head; s; s = s->next)
{
bool readCh = false;
- s->emit(null_dev, ind, readCh);
+ s->emit(null_dev, ind, readCh, condName);
s->go.genGoto(null_dev, ind, s, s->next, readCh);
}
if (last_fill_index < next_fill_index)
for (s = head; s; s = s->next)
{
bool readCh = false;
- s->emit(o, ind, readCh);
+ s->emit(o, ind, readCh, condName);
s->go.genGoto(o, ind, s, s->next, readCh);
}
Action(State*);
virtual ~Action();
- virtual void emit(std::ostream&, uint, bool&) const = 0;
+ virtual void emit(std::ostream&, uint, bool&, const std::string&) const = 0;
virtual bool isRule() const;
virtual bool isMatch() const;
virtual bool isInitial() const;
{
public:
Match(State*);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
bool isMatch() const;
};
public:
Enter(State*, uint);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
};
class Initial: public Enter
public:
Initial(State*, uint, bool);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
bool isInitial() const;
};
public:
Save(State*, uint);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
bool isMatch() const;
};
public:
Move(State*);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
};
class Accept: public Action
public:
Accept(State*, uint, uint*, State**);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
void emitBinary(std::ostream &o, uint ind, uint l, uint r, bool &readCh) const;
void genRuleMap();
public:
Rule(State*, RuleOp*);
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
bool isRule() const;
#ifdef PEDANTIC
public:
State();
~State();
- void emit(std::ostream&, uint, bool&) const;
+ void emit(std::ostream&, uint, bool&, const std::string&) const;
friend std::ostream& operator<<(std::ostream&, const State&);
friend std::ostream& operator<<(std::ostream&, const State*);
void context_rule(CondList *clist, RegExp *expr, RegExp *look, Str *newcond, Token *code)
{
context_check(clist);
- bool condchange = !newcond || clist->size() > 1
- || clist->find(newcond->to_string()) == clist->end();
for(CondList::const_iterator it = clist->begin(); it != clist->end(); ++it)
{
- Str *condcpy = newcond ? new Str(*newcond) : newcond;
- Token *token = new Token(code, in->get_line(), condcpy, condchange);
+ //Str *condcpy = newcond ? new Str(*newcond) : newcond;
+ Token *token = new Token(code, in->get_line(), newcond);//condcpy);
RuleOp *rule = new RuleOp(expr, look, token, accept++);
RegExpMap::iterator itRE = specMap.find(*it);
}
delete clist;
+ delete newcond;
delete code;
}
| '<' cond '>' look newcond CODE
{
context_none($2);
+ delete $5;
}
| '<' cond '>' look ':' newcond
{
assert($6);
context_none($2);
+ delete $6;
}
| '<' STAR '>' expr look newcond CODE
{
context_check(NULL);
- $7->newcond = $6;
- specStar.push_back(new RuleOp($4, $5, $7, accept++));
+ Token *token = new Token($7, $7->line, $6);
+ delete $7;
+ delete $6;
+ specStar.push_back(new RuleOp($4, $5, token, accept++));
}
| '<' STAR '>' expr look ':' newcond
{
assert($7);
context_check(NULL);
- Token *token = new Token(NULL, in->get_line(), $7, true);
+ Token *token = new Token(NULL, in->get_line(), $7);
+ delete $7;
specStar.push_back(new RuleOp($4, $5, token, accept++));
}
| '<' STAR '>' look newcond CODE
{
context_none(NULL);
+ delete $5;
}
| '<' STAR '>' look ':' newcond
{
assert($6);
context_none(NULL);
+ delete $6;
}
| NOCOND newcond CODE
{
{
in->fatal("code to handle illegal condition already defined");
}
- $3->newcond = $2;
- $$ = specNone = new RuleOp(new NullOp(), new NullOp(), $3, accept++);
+ Token *token = new Token($3, $3->line, $2);
+ delete $2;
+ delete $3;
+ $$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++);
}
| NOCOND ':' newcond
{
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token(NULL, in->get_line(), $3, true);
+ Token *token = new Token(NULL, in->get_line(), $3);
+ delete $3;
$$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++);
}
;
inline std::string SubStr::to_string() const
{
- return std::string(str, len);
+ return str && len ? std::string(str, len) : std::string();
}
inline uint SubStr::ofs() const
/* *********************************** */
yyc_0:
+ YYSETCONDITION(yycr1);
#line 3 "condition_11.cg.re"
{ return NULL; }
-#line 19 "<stdout>"
+#line 20 "<stdout>"
/* *********************************** */
yyc_r1:
if(YYLIMIT == YYCURSOR) YYFILL(1);
++YYCURSOR;
#line 5 "condition_11.cg.re"
{ return "2"; }
-#line 38 "<stdout>"
+#line 39 "<stdout>"
yy8:
++YYCURSOR;
#line 4 "condition_11.cg.re"
{ return "1"; }
-#line 43 "<stdout>"
+#line 44 "<stdout>"
yy10:
++YYCURSOR;
YYSETCONDITION(yycr2);
#line 6 "condition_11.cg.re"
{ return "a"; }
-#line 49 "<stdout>"
+#line 50 "<stdout>"
yy12:
++YYCURSOR;
YYSETCONDITION(yycr2);
#line 7 "condition_11.cg.re"
{ return "b"; }
-#line 55 "<stdout>"
+#line 56 "<stdout>"
/* *********************************** */
yyc_r2:
if(YYLIMIT == YYCURSOR) YYFILL(1);
yy16:
yy17:
++YYCURSOR;
+ YYSETCONDITION(yycr1);
#line 5 "condition_11.cg.re"
{ return "2"; }
-#line 72 "<stdout>"
+#line 74 "<stdout>"
yy19:
++YYCURSOR;
+ YYSETCONDITION(yycr1);
#line 4 "condition_11.cg.re"
{ return "1"; }
-#line 77 "<stdout>"
+#line 80 "<stdout>"
yy21:
++YYCURSOR;
- YYSETCONDITION(yyc);
#line 7 "condition_11.cg.re"
{ return "b"; }
-#line 83 "<stdout>"
+#line 85 "<stdout>"
}
#line 9 "condition_11.cg.re"
yy5:
yy6:
++YYCURSOR;
- YYSETCONDITION(yycr1);
#line 5 "condition_13.cg.re"
goto yyc_r1;
-#line 40 "<stdout>"
+#line 39 "<stdout>"
yy8:
++YYCURSOR;
- YYSETCONDITION(yycr1);
#line 4 "condition_13.cg.re"
goto yyc_r1;
-#line 46 "<stdout>"
+#line 44 "<stdout>"
yy10:
++YYCURSOR;
YYSETCONDITION(yycr2);
#line 6 "condition_13.cg.re"
goto yyc_r2;
-#line 52 "<stdout>"
+#line 50 "<stdout>"
yy12:
++YYCURSOR;
YYSETCONDITION(yycr2);
#line 7 "condition_13.cg.re"
goto yyc_r2;
-#line 58 "<stdout>"
+#line 56 "<stdout>"
/* *********************************** */
yyc_r2:
if(YYLIMIT == YYCURSOR) YYFILL(1);
YYSETCONDITION(yycr1);
#line 5 "condition_13.cg.re"
goto yyc_r1;
-#line 76 "<stdout>"
+#line 74 "<stdout>"
yy19:
++YYCURSOR;
YYSETCONDITION(yycr1);
#line 4 "condition_13.cg.re"
goto yyc_r1;
-#line 82 "<stdout>"
+#line 80 "<stdout>"
yy21:
++YYCURSOR;
- YYSETCONDITION(yyc);
#line 7 "condition_13.cg.re"
- goto yyc_;
-#line 88 "<stdout>"
+ goto yyc_r2;
+#line 85 "<stdout>"
}
#line 9 "condition_13.cg.re"
class Token
{
public:
- const Str text;
- const Str* newcond;
- const uint line;
- const bool autogen;
- const bool condchange;
+ const Str text;
+ const std::string newcond;
+ const uint line;
+ const bool autogen;
public:
Token(const SubStr&, uint);
- Token(const Token*, uint, Str*, bool);
+ Token(const Token*, uint, const Str*);
Token(const Token& oth);
~Token();
};
inline Token::Token(const SubStr& t, uint l)
: text(t)
- , newcond(NULL)
+ , newcond()
, line(l)
, autogen(false)
- , condchange(false)
{
;
}
-inline Token::Token(const Token* t, uint l, Str *c, bool chg)
+inline Token::Token(const Token* t, uint l, const Str *c)
: text(t ? t->text.to_string().c_str() : "")
- , newcond(c)
+ , newcond(c ? c->to_string() : "")
, line(t ? t->line : l)
, autogen(t == NULL)
- , condchange(chg)
{
;
}
inline Token::Token(const Token& oth)
: text(oth.text.to_string().c_str())
- , newcond(oth.newcond ? new Str(*oth.newcond) : NULL)
+ , newcond(oth.newcond)
, line(oth.line)
, autogen(oth.autogen)
- , condchange(oth.autogen)
{
;
}
inline Token::~Token()
{
- delete newcond;
}
} // end namespace re2c