blob: 40b238da50fb94144bbeb6496415dcc7855a9330 [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 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
17for x,v in globals().items():
18 if x.startswith('test_'):
19 print parser.parse(v, lexer = lexer, debug=DEBUG)