Sapan Bhatia | 64c7251 | 2017-06-23 02:32:45 -0700 | [diff] [blame] | 1 | from plyxproto.logicparser import * |
| 2 | import ply.lex as lex |
| 3 | import ply.yacc as yacc |
| 4 | |
| 5 | test_1 = "true" |
| 6 | test_2 = "a | b" |
| 7 | test_3 = "exists a: x=y" |
| 8 | test_4 = "forall a: exists b: x.b=y.b" |
| 9 | test_5 = "forall a: {{ a.endswith('good') }} " |
| 10 | |
| 11 | DEBUG = 0 |
| 12 | |
| 13 | lexer = lex.lex(module=FOLLexer(), debug=DEBUG)#, optimize=1) |
| 14 | parser = yacc.yacc(module=FOLParser(), start='goal', debug=DEBUG) |
| 15 | |
| 16 | for x,v in globals().items(): |
| 17 | if x.startswith('test_'): |
| 18 | print parser.parse(v, lexer = lexer, debug=DEBUG) |