123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- #ifndef TOKENTYPE_H
- #define TOKENTYPE_H
- #include <iostream>
- #include <string>
- 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
|