Part of campaign to remove 'stream_lc.h'.
for(CondList::const_iterator it = clist->begin(); it != clist->end(); ++it)
{
//Str *condcpy = newcond ? new Str(*newcond) : newcond;
- Token *token = new Token(code, sourceFileInfo, newcond);//condcpy);
+ Token *token = new Token(code, sourceFileInfo.fname, sourceFileInfo.ln->get_line (), newcond);//condcpy);
RuleOp *rule = new RuleOp(expr, look, token, accept++, ins_access);
RegExpMap::iterator itRE = specMap.find(*it);
{
assert((yyvsp[(7) - (7)].str));
context_check(NULL);
- Token *token = new Token(NULL, sourceFileInfo, (yyvsp[(7) - (7)].str));
+ Token *token = new Token(NULL, sourceFileInfo.fname, sourceFileInfo.ln->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++, RegExp::PRIVATE));
}
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token(NULL, sourceFileInfo, (yyvsp[(3) - (3)].str));
+ Token *token = new Token(NULL, sourceFileInfo.fname, sourceFileInfo.ln->get_line (), (yyvsp[(3) - (3)].str));
delete (yyvsp[(3) - (3)].str);
(yyval.regexp) = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++, RegExp::SHARED);
}
for(CondList::const_iterator it = clist->begin(); it != clist->end(); ++it)
{
//Str *condcpy = newcond ? new Str(*newcond) : newcond;
- Token *token = new Token(code, sourceFileInfo, newcond);//condcpy);
+ Token *token = new Token(code, sourceFileInfo.fname, sourceFileInfo.ln->get_line (), newcond);//condcpy);
RuleOp *rule = new RuleOp(expr, look, token, accept++, ins_access);
RegExpMap::iterator itRE = specMap.find(*it);
{
assert($7);
context_check(NULL);
- Token *token = new Token(NULL, sourceFileInfo, $7);
+ Token *token = new Token(NULL, sourceFileInfo.fname, sourceFileInfo.ln->get_line (), $7);
delete $7;
specStar.push_back(new RuleOp($4, $5, token, accept++, RegExp::PRIVATE));
}
{
in->fatal("code to handle illegal condition already defined");
}
- Token *token = new Token(NULL, sourceFileInfo, $3);
+ Token *token = new Token(NULL, sourceFileInfo.fname, sourceFileInfo.ln->get_line (), $3);
delete $3;
$$ = specNone = new RuleOp(new NullOp(), new NullOp(), token, accept++, RegExp::SHARED);
}
#define _token_h
#include "substr.h"
-#include "stream_lc.h"
namespace re2c
{
const bool autogen;
public:
- Token(const SubStr&, const file_info&);
Token(const SubStr&, const std::string&, uint);
- Token(const Token*, const file_info&, const Str*);
Token(const Token*, const std::string&, uint, const Str*);
Token(const Token& oth);
~Token();
};
-inline Token::Token(const SubStr& t, const file_info& fi)
- : text(t)
- , newcond()
- , source(fi.fname)
- , line(fi.ln->get_line())
- , autogen(false)
-{
- ;
-}
-
inline Token::Token(const SubStr& t, const std::string& s, uint l)
: text(t)
, newcond()
;
}
-inline Token::Token(const Token* t, const file_info& fi, const Str *c)
- : text(t ? t->text.to_string().c_str() : "")
- , newcond(c ? c->to_string() : "")
- , source(t ? t->source : fi.fname)
- , line(t ? t->line : fi.ln->get_line())
- , autogen(t == NULL)
-{
- ;
-}
-
inline Token::Token(const Token* t, const std::string& s, uint l, const Str *c)
: text(t ? t->text.to_string().c_str() : "")
, newcond(c ? c->to_string() : "")
- , source(s)
- , line(l)
+ , source(t ? t->source : s)
+ , line(t ? t->line : l)
, autogen(t == NULL)
{
;