blob: 8035f8597c785b388616f87f3de9306285a1752b [file] [log] [blame]
Sapan Bhatia64c72512017-06-23 02:32:45 -07001from plyxproto.logicparser import *
2import ply.lex as lex
3import ply.yacc as yacc
Sapan Bhatiad70c3782017-06-28 22:47:22 -07004import pdb
Sapan Bhatia64c72512017-06-23 02:32:45 -07005
Sapan Bhatiad70c3782017-06-28 22:47:22 -07006test_1 = "<true>"
7test_2 = "<a | b>"
8test_3 = "<exists a: x=y>"
9test_4 = "<forall a: exists b: x.b=y.b>"
10test_5 = "<forall a: {{ a.endswith('good') }}>"
Sapan Bhatia99669732017-07-25 19:19:14 -040011test_6 = "< *doit(foo) >"
Sapan Bhatia64c72512017-06-23 02:32:45 -070012
13DEBUG = 0
14
Sapan Bhatiad70c3782017-06-28 22:47:22 -070015lexer = lex.lex(module=FOLLexer(), debug=DEBUG)
Sapan Bhatia64c72512017-06-23 02:32:45 -070016parser = yacc.yacc(module=FOLParser(), start='goal', debug=DEBUG)
17
18for x,v in globals().items():
19 if x.startswith('test_'):
20 print parser.parse(v, lexer = lexer, debug=DEBUG)