| 1 | #!/usr/bin/env python | 
| 2 | """ | 
| 3 | arith_ast.py | 
| 4 | """ | 
| 5 | |
| 6 | import os | 
| 7 | import sys | 
| 8 | |
| 9 | from asdl import asdl_ as asdl | 
| 10 | from asdl import py_meta | 
| 11 | |
| 12 | this_dir = os.path.dirname(os.path.abspath(sys.argv[0])) | 
| 13 | schema_path = os.path.join(this_dir, 'arith.asdl') | 
| 14 | |
| 15 | with open(schema_path) as f: | 
| 16 | module = asdl.parse(f) | 
| 17 | type_lookup = asdl.ResolveTypes(module) | 
| 18 | root = sys.modules[__name__] | 
| 19 | py_meta.MakeTypes(module, root, type_lookup) |