diff options
author | Benedikt Böhm <bb@xnull.de> | 2009-06-29 08:57:13 +0200 |
---|---|---|
committer | Benedikt Böhm <bb@xnull.de> | 2009-06-29 08:57:13 +0200 |
commit | 17fab2bc59945045a8df39ece8c845d1565245da (patch) | |
tree | 96c679139d26a9140c43dade3a524008adab722b /src/__init__.py | |
parent | 66ae0bea2be78152e8f85f5334b7978a3e621c61 (diff) | |
parent | a4f2a248273064ec464e7d376f8f5778ac808bd6 (diff) | |
download | swppy-17fab2bc59945045a8df39ece8c845d1565245da.tar.gz swppy-17fab2bc59945045a8df39ece8c845d1565245da.tar.xz swppy-17fab2bc59945045a8df39ece8c845d1565245da.zip |
Merge branch 'master' of git@git.animux.de:swppy
Conflicts:
src/front/__init__.py
Diffstat (limited to 'src/__init__.py')
-rw-r--r-- | src/__init__.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..747efde --- /dev/null +++ b/src/__init__.py @@ -0,0 +1,38 @@ +from front.lexer import Lexer +from front.parser import Parser +#from front.symbols import SymbolTable + +def main(): + source = '''fun fib[a] + if a < 2 + @1 + end + @( fib[a-1] + fib[a-2] ) +end + +# main function +fun main[] + sum = 0 + i = 0 + while (i < 10) + sum = sum + fib[i] + i = i + 1 + end + @sum +end''' + + #symbols = SymbolTable() + #lex = Lexer(source) + + # testing + #while True: + # token = lex.scan() + # print token.__repr__() + # if not token: + # break + + parse = Parser(Lexer(source)) + print parse.parse() + +if __name__ == "__main__": + main() |