Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove parser main #21

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions src/parser.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/env python
import argparse
import pprint

import grammar
import visitor
import preprocessor
import visitor


class ImperivmParser:
Expand All @@ -21,16 +17,4 @@ def __init__(
def parse(self, program):
program = self.preprocessor.process(program)
tree = self.grammar.parse(program)
return self.visitor.visit(tree)


if __name__ == "__main__":
argparser = argparse.ArgumentParser()
argparser.add_argument("filename", nargs=1)
args = argparser.parse_args()
data = None
with open(args.filename[0], "r") as file:
code = file.read()

ast = ImperivmParser().parse(code)
pprint.pprint(ast)
return self.visitor.visit(tree)
Loading