This commit is contained in:
NikolajDanger
2022-06-08 13:30:17 +02:00
parent 912c46ab7c
commit 935c90f645
3 changed files with 8 additions and 17 deletions

22
main.py
View File

@@ -2,23 +2,13 @@ from lexer import Lexer
from parser import Parser
text_input = """
VOCA FORS
DESIGNA correct UT FORTIS_NUMERUS I C
DESIGNA gvess UT NULLUS
DUM FALSITAS FACE {
DESIGNA gvess UT AUDI_NUMERUS
SI gvess MINUS correct TUNC {
DICE "Too low!"
} ALUID SI gvess PLUS correct TUNC {
DICE "Too high!"
} ALUID {
ERUMPE
}
DEFINI invoca i UT {
REDI i
}
DICE "You guessed correctly!"
DESIGNA invoca UT I
DICE (INVOCA invoca invoca)
"""
lexer = Lexer().get_lexer()
@@ -28,7 +18,7 @@ parser = pg.get_parser()
tokens = lexer.lex(text_input)
#for token in tokens:
# print(token)
# print(token)
x = parser.parse(tokens)
#print(x)