32 file(), line(0),
type(IS_ERROR), lexeme(),
33 d_value(0.0), i_value(0), c_value(0)
38 file(rhs.file), line(rhs.line),
type(rhs.
type), lexeme(rhs.lexeme),
39 d_value(rhs.d_value), i_value(rhs.i_value), c_value(rhs.c_value)
44 file(fil), line(lin),
type(typ), lexeme(1u, value),
45 d_value(0.0), i_value(0), c_value(value)
50 file(fil), line(lin),
type(typ), lexeme(value),
51 d_value(0.0), i_value(0), c_value(0)
56(
const std::string &fil,
int lin,
Type typ,
const std::string &lex):
57 file(fil), line(lin),
type(typ), lexeme(lex),
58 d_value(0.0), i_value(0), c_value(0)
63(
const std::string &fil,
int lin,
const std::string &lex,
double value):
64 file(fil), line(lin),
type(IS_REAL), lexeme(lex),
65 d_value(value), i_value(0), c_value(0)
70(
const std::string &fil,
int lin,
const std::string &lex,
int value):
71 file(fil), line(lin),
type(IS_INTEGER), lexeme(lex),
72 d_value(0.0), i_value(value), c_value(0)
146 }
else if(
lexeme ==
"FALSE") {
232 os <<
"Error token: " << token.
getLex();
248 os <<
'"' << token.
getLex() <<
'"';
257 std::ostringstream os;
258 os <<
"Expected " <<
type <<
" token in line " <<
line <<
" of file \""
260 throw ParseError(
"Token::invalid()", os.str().c_str());
std::ostream & operator<<(std::ostream &os, const Token &token)
boost::function< boost::tuple< double, bool >(arguments_t)> type
Representation of a single input token.
bool isError() const
Test for error.
Type getType() const
Return the token type.
bool isString() const
Test for string.
bool isWord() const
Test for word.
bool isEOF() const
Test for end of file.
const std::string & getLex() const
Return the lexeme.
std::string getWord() const
Return word value.
bool isKey(const char *key) const
Test for keyword.
bool isDel() const
Test for any delimiter.
bool getBool() const
Return boolean value.
int getLine() const
Return the token's line number.
std::string getString() const
Return string value.
void invalid(const char *) const
bool isInteger() const
Test for integer.
double getReal() const
Return real value.
const Token & operator=(const Token &)
Type
Possible token types.
bool isReal() const
Test for real number.
int getInteger() const
Return integer value.
const std::string & getFile() const
Return the token's file name.