Files
Construction-of-Compilers/Project-02/main.py
Jan-Niclas Loosen fe33668b5f Init next project
2025-11-11 14:40:50 +01:00

19 lines
534 B
Python

# This is a sample Python script for testing your TRIPLA parser.
# In PyCharm press Umschalt+F10 to execute it.
import triplayacc as yacc
import triplalex as lex
def test_parser(name):
source = "\n".join(open(name).readlines())
ast = yacc.parser.parse(source) # ,debug=True)
print("AST:")
print(ast)
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
test_parser('whileprograms/complex.while')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/