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());
bool isEOF() const
Test for end of file.
bool isInteger() const
Test for integer.
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
const std::string & getLex() const
Return the lexeme.
Type getType() const
Return the token type.
std::string getWord() const
Return word value.
bool isReal() const
Test for real number.
Representation of a single input token.
bool isError() const
Test for error.
Type
Possible token types.
bool isDel() const
Test for any delimiter.
bool isKey(const char *key) const
Test for keyword.
double getReal() const
Return real value.
const Token & operator=(const Token &)
const std::string & getFile() const
Return the token's file name.
int getLine() const
Return the token's line number.
int getInteger() const
Return integer value.
bool isString() const
Test for string.
void invalid(const char *) const
std::string getString() const
Return string value.
bool isWord() const
Test for word.
bool getBool() const
Return boolean value.