23 lines
578 B
Python
23 lines
578 B
Python
from antlr4 import InputStream
|
|
from antlr4 import CommonTokenStream
|
|
|
|
# include to use the generated lexer and parser
|
|
from Exercice6Lexer import Exercice6Lexer
|
|
from Exercice6Parser import Exercice6Parser
|
|
|
|
import sys
|
|
|
|
|
|
def main():
|
|
input_stream = InputStream(sys.stdin.read())
|
|
lexer = Exercice6Lexer(input_stream)
|
|
stream = CommonTokenStream(lexer)
|
|
parser = Exercice6Parser(stream)
|
|
parser.full_expr() # We want to recognize full_expr in grammar Exercice6
|
|
print("Finished")
|
|
|
|
|
|
# warns pb if py file is included in others
|
|
if __name__ == '__main__':
|
|
main()
|