jorts/jortsc/main.py
Luna 7ce0565de7 add basics of a handwritten parser
hell yeah i'm going down that path

lark made confusing stuff, i'll probably get more confused with a
handwritten one, but oh well, such is life
2019-03-10 01:55:12 -03:00

27 lines
451 B
Python

#!/usr/bin/python3
import sys
import pprint
import logging
from jortsc.parser.lexer import lex_jorts
from jortsc.parser.syntatic import syntatic
logging.basicConfig(level=logging.DEBUG)
def main():
"""main entry point"""
try:
in_data = sys.stdin.read()
except EOFError:
pass
tokens = lex_jorts(in_data)
pprint.pprint(tokens)
tree = syntatic(tokens)
print(tree)
if __name__ == '__main__':
main()