17eed69bd5
2008/02/13 08:56:22 jcn 1.1.2.1: Import src2xml and doc/layout from GIT.
23 lines
450 B
Python
23 lines
450 B
Python
#!/usr/bin/env python
|
|
|
|
import sys
|
|
import expression
|
|
|
|
def run (exp):
|
|
tokens = exp.split()
|
|
expparser = expression.ExpParser(tokens)
|
|
expparser.build()
|
|
expparser.dumpTree()
|
|
|
|
def main ():
|
|
run("6 + 34")
|
|
run("6 + 34 - 10")
|
|
run("6 + 34 - 10 + 200")
|
|
run("6 + 34 - 10 * 200")
|
|
run("6 + 34 - 10 * 200 + 18")
|
|
run("6 + 34 - 10 * 200 + 18 / 2")
|
|
|
|
run("6 * ( ( 10 + 2 ) - 10 ) * 33")
|
|
|
|
if __name__ == '__main__':
|
|
main()
|