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
|
|
|
|
2019-03-09 19:52:34 +00:00
|
|
|
from jortsc.parser.lexer import lex_jorts
|
2019-03-10 04:55:12 +00:00
|
|
|
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
|
|
|
|
2019-03-10 04:55:12 +00:00
|
|
|
tree = syntatic(tokens)
|
2019-03-09 21:58:28 +00:00
|
|
|
print(tree)
|
|
|
|
|
2019-03-10 04:55:12 +00:00
|
|
|
|
2019-03-08 21:50:58 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|