needs refactoring

This commit is contained in:
Jan-Niclas Loosen
2025-11-20 15:33:16 +01:00
parent eb362896fd
commit 346c3c8ffd
4 changed files with 125 additions and 50 deletions

18
Project-02/test.py Normal file
View File

@@ -0,0 +1,18 @@
# 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('triplaprograms/complex.tripla')
# See PyCharm help at https://www.jetbrains.com/help/pycharm/