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