✨
This commit is contained in:
31
main.py
Normal file
31
main.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from lexer import Lexer
|
||||
from parser import Parser
|
||||
|
||||
text_input = """
|
||||
VOCA FORS
|
||||
|
||||
DESIGNA correct UT FORTIS_NUMERUS I C
|
||||
DESIGNA guess UT NULLUS
|
||||
|
||||
DUM FALSITAS FACE {
|
||||
DESIGNA guess UT AUDI_NUMERUS
|
||||
SI guess MINUS correct TUNC {
|
||||
DICE "Too low!"
|
||||
} ALUID SI guess PLUS correct TUNC {
|
||||
DICE "Too high!"
|
||||
} ALUID {
|
||||
ERUMPE
|
||||
}
|
||||
}
|
||||
|
||||
DICE "You guessed correctly!"
|
||||
"""
|
||||
|
||||
lexer = Lexer().get_lexer()
|
||||
pg = Parser()
|
||||
pg.parse()
|
||||
parser = pg.get_parser()
|
||||
|
||||
tokens = lexer.lex(text_input)
|
||||
|
||||
print(parser.parse(tokens))
|
||||
Reference in New Issue
Block a user