cleanup, add example output
[sv2nmigen.git] / svparse.py
1 import sys
2
3 import lexor
4 import parse_sv
5 import absyn
6
7 from ply import *
8 import os 
9
10 if __name__ == '__main__':
11     fname = sys.argv[1]
12     outputfn = os.path.splitext(fname)[0]+'.py'
13     print(outputfn)
14     with open(fname) as f:
15         data = f.read()
16         parse_sv.absyn = absyn.Absyn(outputfn)
17         yacc.parse(data, debug=parse_sv.yacc2_debug)
18         print("No Error")
19         parse_sv.absyn.appendComments(data)