1 #ifndef CLASSIC_Token_HH
2 #define CLASSIC_Token_HH 1
67 Token(
const std::string &
file,
int line,
const std::string &lex,
72 Token(
const std::string &
file,
int line,
const std::string &lex,
int value);
80 bool isDel(
char del)
const;
84 bool isDel(
const char *del)
const;
108 bool isKey(
const char *key)
const;
131 const std::string &
getLex()
const;
137 const std::string &
getFile()
const;
145 void invalid(
const char *)
const;
std::ostream & operator<<(std::ostream &, const Token &)
constexpr double c
The velocity of light in m/s.
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.