Add documentation to AST constructors
Many of the AST constructors do not currently have doxygen comments to provide documentation. Adding these is a straightforward, tedious task, and very helpful task. I.e. https://github.com/cleishm/libcypher-parser/blob/v0.1.0/src/lib/cypher-parser.h#L524-L899
Add accessor methods for AST nodes
Many of the AST nodes do not currently have functions exposed for accessing their attributes (e.g. like the
CYPHER_AST_COLLECTION node does). This is also a very easy task, although a little tedious.
What good is a full AST, containing all the information needed to render out (including comment nodes), if there isn't an easy way to create a pretty rendering?
Semantic checking of ASTs
To provide much more interesting linting of cypher statements, it is necessary to add a complete semantic checking feature, which would take a parsed AST and evaluate a variety of semantic rules against it, including type checking.
Add tests for parsing
There are very few automated tests covering parsing of the Cypher grammar, and adding more would be a wonderful contribution. See https://github.com/cleishm/libcypher-parser/blob/v0.1.0/tests/check_command.c as an example, although it may be helpful to assert on an AST rendering to a memstream, instead of checking each node separately.
leg is a great tool, but has many shortcomings that had to be worked around. There are many improvements that could be made to leg, which would simplify the libcypher-parser implementation and provide performance advantages. These include:
- Handling of exceptional conditions (e.g. failures in malloc/realloc or in rules - libcypher-parser currently replaces the use of malloc/realloc/etc in leg output to use longjmp's when failures occur).
- Adding parameterized rules.
- Supporting per-rule types for
- Adding memoization (packrat parsing).
- Collection of results within repeating rules.
- Built-in tracking of input ranges and rows/columns of input.
- Built-in error handling and recovery, including labeling of rules (ref: http://arxiv.org/pdf/1405.6646v1.pdf, http://arxiv.org/pdf/1405.6646.pdf).
- Addition of cut point operators (ref: http://ialab.cs.tsukuba.ac.jp/~mizusima/publications/paste513-mizushima.pdf, http://ceur-ws.org/Vol-1269/paper232.pdf).