Files
centvrion/main.py
NikolajDanger 05072e5a0a
2022-06-08 16:28:53 +02:00

34 lines
588 B
Python

from centvrion.lexer import Lexer
from centvrion.parser import Parser
text_input = """
VOCA FORS
DESIGNA correct VT FORTIS_NVMERVS I C
DESIGNA gvess VT NVLLVS
DVM FALSITAS FACE {
DESIGNA gvess VT AVDI_NVMERVS
SI gvess MINVS correct TVNC {
DICE "Too low!"
} ALVID SI gvess PLVS correct TVNC {
DICE "Too high!"
} ALVID {
ERVMPE
}
}
DICE "You guessed correctly!"
"""
lexer = Lexer().get_lexer()
parser = Parser()
tokens = lexer.lex(text_input)
#for token in tokens:
# print(token)
program = parser.parse(tokens)
#print(x)
program.eval()