Use C++ parser via speedy-antlr-tool #70
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The antlr4 C++ runtime parser is supposedly faster than the Python runtime one.
This PR changes the layout of the repository, and adds the source files of the antlr4 C++ runtime.
Both C++ and Python generated file sources are now outside of the distributed module directories, and are only regenerated by manually triggering the
src/grammar/build.py
script.The C++ parsers are wrapped for Python via
speedy-antlr-tool
and added into the build via a newsetup.py
defining the binary modules.The new parsers do not expose all antlr4 features, e.g., the named context elements are present in the C++ sources and the Python implementation, but the automatic wrapping does not expose them. Fortunately, all use-cases in the mccode-antlr visitors could be changed to use the functional forms like
ctx.params
→ctx.expr()
.The build system is augmented to use CIBuildwheel for Python 3.8-3.13 on Linux (manylinux and musllinux), macOS (Arm and Intel) and Windows.