diff options
Diffstat (limited to 'src/front/__init__.py')
-rw-r--r-- | src/front/__init__.py | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/src/front/__init__.py b/src/front/__init__.py index 63529ef..426a16e 100644 --- a/src/front/__init__.py +++ b/src/front/__init__.py @@ -1,7 +1,33 @@ from front.lexer import Lexer from front.parser import Parser +from front.symbols import SymbolTable def main(): - lex = Lexer() - parse = Parser(lex) - parse.program() + source = '''fun fib[a] + if a < 2 + @1 + @( fib[a-1] + fib[a-2] ) +end + +# main function +fun main[] + sum = 0 + i = 0 + while (i < 10) + sum = sum + fib[i = i + 1] + end + @sum +end''' + + symbols = SymbolTable() + lex = Lexer(source, symbols) + + # testing + while True: + token = lex.scan() + print token.__repr__() + if not token: + break + + # parse = Parser(lex) + # parse.program() |