struct Token {
enum Type {
- UNKNOWN,
+ UNKNOWN = 0,
ANGLE_BRACKET_OPEN = '{',
ANGLE_BRACKET_CLOSE = '}',
CHEVRON_OPEN = '<',
BRACKET_CLOSE = ']',
PARENTHESIS_OPEN = '(',
PARENTHESIS_CLOSE = ')',
- NUMBER,
- STRING,
- KEYWORD_EXPORT,
- KEYWORD_FALSE,
- KEYWORD_INCLUDE,
- KEYWORD_TRUE,
- IDENTIFIER,
- TYPE_NAME,
+ NUMBER = '0',
+ STRING = '"',
+ KEYWORD_EXPORT = 'e',
+ KEYWORD_FALSE = 'f',
+ KEYWORD_INCLUDE = 'i',
+ KEYWORD_TRUE = 't',
+ IDENTIFIER = 'x',
+ TYPE_NAME = 'n',
};
Token() : type(UNKNOWN), number(0) { }
bool HasMore();
Token GetNext();
+ const Token &Peek();
void Putback(const Token &);
private: