blob: eb350d77c7bbfe6fd20f5ccf87b36d52602d69a4 [file] [log] [blame]
Sapan Bhatia64c72512017-06-23 02:32:45 -07001from plyxproto.logicparser import *
2import ply.lex as lex
3import ply.yacc as yacc
4
Sapan Bhatiad70c3782017-06-28 22:47:22 -07005test_1 = "<true>"
6test_2 = "<a | b>"
7test_3 = "<exists a: x=y>"
8test_4 = "<forall a: exists b: x.b=y.b>"
9test_5 = "<forall a: {{ a.endswith('good') }}>"
Sapan Bhatia99669732017-07-25 19:19:14 -040010test_6 = "< *doit(foo) >"
Sapan Bhatia64c72512017-06-23 02:32:45 -070011
12DEBUG = 0
13
Sapan Bhatiad70c3782017-06-28 22:47:22 -070014lexer = lex.lex(module=FOLLexer(), debug=DEBUG)
Sapan Bhatia64c72512017-06-23 02:32:45 -070015parser = yacc.yacc(module=FOLParser(), start='goal', debug=DEBUG)
16
Zack Williamsbe7f36d2018-02-02 11:37:11 -070017for x, v in globals().items():
Sapan Bhatia64c72512017-06-23 02:32:45 -070018 if x.startswith('test_'):
Zack Williamsbe7f36d2018-02-02 11:37:11 -070019 print parser.parse(v, lexer=lexer, debug=DEBUG)