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