#ifndef TOKENTYPE_H #define TOKENTYPE_H #include #include using namespace std; class TokenTypeClass { public: TokenTypeClass(string name, int level); TokenTypeClass(string name); TokenTypeClass(const TokenTypeClass& orig); virtual ~TokenTypeClass(); string getName() const; int getLevel() const; private: string typeName; int level; }; typedef const TokenTypeClass* const TokenType; std::ostream& operator<<(std::ostream& os, TokenType& c); namespace Tokens { extern TokenType FLOAT; extern TokenType TRUE; extern TokenType FALSE; extern TokenType TNULL; extern TokenType TEXT; extern TokenType LABEL; extern TokenType VAR; extern TokenType GLOBAL; extern TokenType INC; extern TokenType DEC; extern TokenType INVERT; extern TokenType BIT_INVERT; extern TokenType MUL; extern TokenType DIV; extern TokenType MOD; extern TokenType ADD; extern TokenType SUB; extern TokenType LEFT_SHIFT; extern TokenType RIGHT_SHIFT; extern TokenType LESS; extern TokenType LESS_EQUAL; extern TokenType GREATER; extern TokenType GREATER_EQUAL; extern TokenType EQUAL; extern TokenType NOT_EQUAL; extern TokenType BIT_AND; extern TokenType BIT_XOR; extern TokenType BIT_OR; extern TokenType AND; extern TokenType OR; extern TokenType SET; extern TokenType ADD_SET; extern TokenType SUB_SET; extern TokenType MUL_SET; extern TokenType DIV_SET; extern TokenType MOD_SET; extern TokenType LEFT_SHIFT_SET; extern TokenType RIGHT_SHIFT_SET; extern TokenType BIT_AND_SET; extern TokenType BIT_XOR_SET; extern TokenType BIT_OR_SET; extern TokenType COMMA; extern TokenType OPEN_BRACKET; extern TokenType CLOSE_BRACKET; extern TokenType OPEN_SQUARE_BRACKET; extern TokenType CLOSE_SQUARE_BRACKET; extern TokenType OPEN_CURVED_BRACKET; extern TokenType CLOSE_CURVED_BRACKET; extern TokenType SEMICOLON; extern TokenType IF; extern TokenType ELSE_IF; extern TokenType ELSE; extern TokenType FOR; extern TokenType WHILE; extern TokenType FUNCTION; extern TokenType BREAK; extern TokenType CONTINUE; extern TokenType RETURN; extern TokenType TRY; extern TokenType CATCH; extern TokenType END_OF_FILE; }; #endif