: RegExp::SHARED;
for(CondList::const_iterator it = clist->begin(); it != clist->end(); ++it)
{
- Token *token = new Token(code, in->get_fname (), in->get_cline (), newcond);//condcpy);
- RuleOp *rule = new RuleOp(expr, look, token, rank_counter.next (), ins_access);
+ Token *token = new Token(code, in->get_fname (), in->get_cline ());
+ RuleOp *rule = new RuleOp(expr, look, token, rank_counter.next (), ins_access, newcond);
RegExpMap::iterator itRE = specMap.find(*it);
{
in->fatal("condition or '<*>' required when using -c switch");
}
- $$ = new RuleOp($1, $2, $3, rank_counter.next (), RegExp::SHARED);
+ $$ = new RuleOp($1, $2, $3, rank_counter.next (), RegExp::SHARED, NULL);
spec = spec? mkAlt(spec, $$) : $$;
}
| STAR CODE /* default rule */
| '<' STAR '>' expr look newcond CODE
{
context_check(NULL);
- Token *token = new Token($7, $7->source, $7->line, $6);
+ Token *token = new Token($7, $7->source, $7->line);
delete $7;
+ specStar.push_back(new RuleOp($4, $5, token, rank_counter.next (), RegExp::PRIVATE, $6));
delete $6;
- specStar.push_back(new RuleOp($4, $5, token, rank_counter.next (), RegExp::PRIVATE));
}
| '<' STAR '>' expr look ':' newcond
{
assert($7);
context_check(NULL);
- Token *token = new Token(NULL, in->get_fname (), in->get_cline (), $7);
+ Token *token = new Token(NULL, in->get_fname (), in->get_cline ());
+ specStar.push_back(new RuleOp($4, $5, token, rank_counter.next (), RegExp::PRIVATE, $7));
delete $7;
- specStar.push_back(new RuleOp($4, $5, token, rank_counter.next (), RegExp::PRIVATE));
}
| '<' STAR '>' look newcond CODE
{
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token($3, $3->source, $3->line, $2);
- delete $2;
+ Token *token = new Token($3, $3->source, $3->line);
delete $3;
- $$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, rank_counter.next (), RegExp::SHARED);
+ $$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, rank_counter.next (), RegExp::SHARED, $2);
+ delete $2;
}
| NOCOND ':' newcond
{
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token(NULL, in->get_fname (), in->get_cline (), $3);
+ Token *token = new Token(NULL, in->get_fname (), in->get_cline ());
+ $$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, rank_counter.next (), RegExp::SHARED, $3);
delete $3;
- $$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, rank_counter.next (), RegExp::SHARED);
}
| SETUP STAR '>' CODE
{
itRuleDefault = ruleDefaultMap.find(it->first);
if (itRuleDefault != ruleDefaultMap.end())
{
- RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), itRuleDefault->second, rank_counter.next (), RegExp::SHARED);
+ 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;
}
else
itRuleDefault = ruleDefaultMap.find("*");
if (itRuleDefault != ruleDefaultMap.end())
{
- RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), itRuleDefault->second, rank_counter.next (), RegExp::SHARED);
+ 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;
}
}
{
if (ruleDefault != NULL && parseMode != Scanner::Reuse)
{
- RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), ruleDefault, rank_counter.next (), RegExp::SHARED);
+ RuleOp * def = new RuleOp(in->mkDefault(), new NullOp(), ruleDefault, rank_counter.next (), RegExp::SHARED, NULL);
spec = spec ? mkAlt(def, spec) : def;
}
if (spec || !dfa_map.empty())
{
public:
const std::string text;
- const std::string newcond;
const std::string source;
uint32_t line;
const bool autogen;
Token (const char *, uint32_t, const std::string &, uint32_t);
- Token (const Token *, const std::string &, uint32_t, const std::string *);
+ Token (const Token *, const std::string &, uint32_t);
FORBID_COPY (Token);
};
inline Token::Token (const char * t, uint32_t t_len, const std::string & s, uint32_t l)
: text (t, t_len)
- , newcond ()
, source (s)
, line (l)
, autogen (false)
{}
-inline Token::Token (const Token * t, const std::string & s, uint32_t l, const std::string * c)
+inline Token::Token (const Token * t, const std::string & s, uint32_t l)
: text (t ? t->text : "")
- , newcond (c ? * c : "")
, source (t ? t->source : s)
, line (t ? t->line : l)
, autogen (t == NULL)
inline Token::Token (const Token & t)
: text (t.text)
- , newcond (t.newcond)
, source (t.source)
, line (t.line)
, autogen (t.autogen)