diff --git a/sources/zweic/Tokens.py b/sources/zweic/Tokens.py new file mode 100755 index 0000000..525369d --- /dev/null +++ b/sources/zweic/Tokens.py @@ -0,0 +1,66 @@ +# (c) 2005 Andreas Jaggi, Michael Karlen +# +# GNU Public License http://opensource.org/licenses/gpl-license.php + +import sys +import Enum + +class Tokens (Enum.Enum): + EOF = "" + BAD = "" + + IDENT = "ident" + NUMBER = "number" + STRING = "string" + + TRUE = "true" + FALSE = "false" + THIS = "this" + NULLTYPE = "Null" + NULLFACTOR = "null" + + READINT = "readInt" + READCHAR = "readChar" + PRINTINT = "printInt" + PRINTCHAR = "printChar" + + VAL = "val" + INT = "Int" + DEF = "def" + SET = "set" + VAR = "var" + CLASS = "class" + NEW = "new" + EXTENDS = "extends" + + SUB = "-" + NOT = "!" + ADD = "+" + MUL = "*" + MOD = "%" + DIV = "/" + EQ = "==" + NE = "!=" + LT = "<" + GT = ">" + LE = "<=" + GE = ">=" + + AND = "and" + OR = "or" + IF = "if" + ELSE = "else" + DO = "do" + WHILE = "while" + + LPAREN = "(" + RPAREN = ")" + LACCOLADE = "{" + RACCOLADE = "}" + EQUALS = "=" + SEMICOLON = ";" + PERIOD = "," + DOT = "." + COLON = ":" + +