Skip to content
Lex, Parse and build an AST for a DSL that can be used to search objects in Inventory
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
parsley
.gitignore
Makefile
README.mkd
django_compile.py
invfilter.py
invlex.py
invparse.py
parser_tests.py
utils.py

README.mkd

Requirements:

ply

When you build the parser there are some errors:

WARNING: shift/reduce conflict for AND in state 21 resolved as shift
WARNING: shift/reduce conflict for OR in state 21 resolved as shift
WARNING: shift/reduce conflict for NOT in state 21 resolved as shift
WARNING: shift/reduce conflict for LPAREN in state 21 resolved as shift
WARNING: shift/reduce conflict for DIRECTIVE in state 21 resolved as shift
WARNING: shift/reduce conflict for TEXT in state 21 resolved as shift
WARNING: shift/reduce conflict for RE in state 21 resolved as shift

These are OK. The parser doesn't know whether to reduce an expression OR expression and decides to shift's the OR statement onto the stack. This is what we want because a space between two terms implies and AND and an OR is always the last thing you should do.

Something went wrong with that request. Please try again.