jorts/jortsc/main.py

28 lines
451 B
Python
Raw Normal View History

2019-03-08 21:50:58 +00:00
#!/usr/bin/python3
import sys
2019-03-09 03:02:13 +00:00
import pprint
2019-03-09 21:58:28 +00:00
import logging
2019-03-09 03:02:13 +00:00
from jortsc.parser.lexer import lex_jorts
from jortsc.parser.syntatic import syntatic
2019-03-09 21:58:28 +00:00
logging.basicConfig(level=logging.DEBUG)
2019-03-08 21:50:58 +00:00
def main():
"""main entry point"""
try:
in_data = sys.stdin.read()
except EOFError:
pass
2019-03-09 03:02:13 +00:00
tokens = lex_jorts(in_data)
pprint.pprint(tokens)
2019-03-08 21:50:58 +00:00
tree = syntatic(tokens)
2019-03-09 21:58:28 +00:00
print(tree)
2019-03-08 21:50:58 +00:00
if __name__ == '__main__':
main()