OILS / opy / _regtest / src / asdl / arith_ast.py View on Github | oilshell.org

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