The goal of this package is to provide reliable tooling for the Souffle programming language.
This package uses Lark for its parsers.
There are currently two parsers, one for Souffle, and another for the intermediate RAM language used in its compiler. Both parsers have a wrapper which invokes the preprocessor. This simplifies parsing, as we don't need to handle macros/extra source files. The RAM parser wrapper also runs the compiler to generate the RAM program.
The Souffle grammar is mostly complete, but occasionally stumbles when parsing transformed Datalog from the compiler.
The RAM grammar is incomplete, lacking parsing for more advanced language features e.g. subsumption.
Currently the most interesting visitor is PyPlanVisitor
, which generates a succinct "plan" in (non-functional) Python representing the RAM program generated by the compiler. This is a great aid for hand-tuning Souffle programs.