summaryrefslogtreecommitdiffstats
path: root/src/front/lexer.py
diff options
context:
space:
mode:
authorBenedikt Böhm <bb@xnull.de>2009-05-19 17:20:48 +0200
committerBenedikt Böhm <bb@xnull.de>2009-05-19 17:20:48 +0200
commitca832cb706d6a2d49d049b0ba827f606331269c7 (patch)
treea8ce06f7f8ac4e130a9bfab06be2081327841076 /src/front/lexer.py
parenta3fb21ae4602f72992bcaceea3f101efdc1affad (diff)
downloadswppy-ca832cb706d6a2d49d049b0ba827f606331269c7.tar.gz
swppy-ca832cb706d6a2d49d049b0ba827f606331269c7.tar.xz
swppy-ca832cb706d6a2d49d049b0ba827f606331269c7.zip
define interfaces
Diffstat (limited to 'src/front/lexer.py')
-rw-r--r--src/front/lexer.py62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/front/lexer.py b/src/front/lexer.py
new file mode 100644
index 0000000..aca7473
--- /dev/null
+++ b/src/front/lexer.py
@@ -0,0 +1,62 @@
+class Lexer:
+ line = 1
+
+ def __init__(self):
+ return
+
+ def reserve(self, word):
+ return
+
+ def scan():
+ return
+
+class Tag:
+ # lexer tokens
+ NUMBER = 1
+ TRUE = 2
+ FALSE = 3
+ IDENT = 4
+ WHILE = 5
+ IF = 6
+ ELSE = 7
+ END = 8
+ LBRAK = 9
+ RBRAK = 10
+ LPAREN = 11
+ RPAREN = 12
+ NEWLINE = 13
+ COMMA = 14
+ FUN = 15
+ ASSIGNMENT = 16
+ RETURN = 17
+ OPERATOR = 18
+
+ # parser tokens
+ BOOL = 19
+ JOIN = 20
+ EQUALITY = 21
+ RELATION = 22
+ EXPRESSION = 23
+ TERM = 24
+ UNARY = 25
+ FACTOR = 26
+ IDENT_LIST = 27
+ EXPRESSION_LIST = 28
+ PROGRAM = 29
+ FUNCTION = 30
+ STATEMENT = 31
+ STATEMENTS = 32
+ IF_STATEMENT = 33
+ WHILE_STATEMENT = 34
+ RETURN_STATEMENT = 35
+ ASSIGN_STATEMENT = 36
+ FUNCTION_CALL = 37
+
+class Token:
+ tag = None
+
+ def __init__(self, tag):
+ return
+
+ def __str__(self):
+ return