-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
26 lines (21 loc) · 670 Bytes
/
main.py
File metadata and controls
26 lines (21 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys
import tkinter as tk
from tkinter import ttk
from tkinter import filedialog as fd
from antlr4 import *
from gen.EZgraphLexer import EZgraphLexer
from gen.EZgraphParser import EZgraphParser
from gen.EZgraphInterpreterVisitor import EZgraphInterpreterVisitor
from gen.EZgraphVisitor import EZgraphVisitor
def main(argv):
input = FileStream("input.txt")
lexer = EZgraphLexer(input)
stream = CommonTokenStream(lexer)
parser = EZgraphParser(stream)
tree = parser.s()
output = open("output.py", "w")
Interprete = EZgraphInterpreterVisitor()
Interprete.visit(tree)
output.close()
if __name__ == '__main__':
main(sys.argv)