switch (c) {
case Token::ANGLE_BRACKET_OPEN:
case Token::ANGLE_BRACKET_CLOSE:
- case Token::CHEVRON_OPEN:
- case Token::CHEVRON_CLOSE:
case Token::COLON:
case Token::COMMA:
case Token::BRACKET_OPEN:
case Token::BRACKET_CLOSE:
case Token::PARENTHESIS_OPEN:
case Token::PARENTHESIS_CLOSE:
+ case Token::COMMAND:
+ case Token::REGISTER:
return Token ((Token::Type) c);
+ case '<': {
+ std::istream::char_type c2;
+ in.get(c2);
+ if (c2 == '<') {
+ return Token(Token::SCRIPT_BEGIN);
+ } else {
+ in.putback(c2);
+ return Token(Token::CHEVRON_OPEN);
+ }
+ }
+ case '>': {
+ std::istream::char_type c2;
+ in.get(c2);
+ if (c2 == '>') {
+ return Token(Token::SCRIPT_END);
+ } else {
+ in.putback(c2);
+ return Token(Token::CHEVRON_CLOSE);
+ }
+ }
case '+': case '-':
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
KEYWORD_TRUE = 't',
IDENTIFIER = 'x',
TYPE_NAME = 'n',
- COMMENT = 'c'
+ COMMENT = 'c',
+ COMMAND = '$',
+ REGISTER = '%',
+ SCRIPT_BEGIN = 's',
+ SCRIPT_END = 'S',
};
Token() : type(UNKNOWN), number(0) { }
return "COLON";
case Tokenizer::Token::COMMA:
return "COMMA";
+ case Tokenizer::Token::COMMAND:
+ return "COMMAND";
case Tokenizer::Token::BRACKET_OPEN:
return "BRACKET_OPEN";
case Tokenizer::Token::BRACKET_CLOSE:
return "PARENTHESIS_CLOSE";
case Tokenizer::Token::NUMBER:
return "NUMBER";
+ case Tokenizer::Token::REGISTER:
+ return "REGISTER";
+ case Tokenizer::Token::SCRIPT_BEGIN:
+ return "SCRIPT_BEGIN";
+ case Tokenizer::Token::SCRIPT_END:
+ return "SCRIPT_END";
case Tokenizer::Token::STRING:
return "STRING";
case Tokenizer::Token::KEYWORD_EXPORT: