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;
167 #endif // CLASSIC_Token_HH
constexpr double c
The velocity of light in m/s.
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.