Grammax doesn’t require any external libraries or dependencies. All generation is done ahead-of-time. After generating the parsing classes you can just copy them into your project.
Also, as other good parser generation tools, grammax uses itself to read the input grammar.
- No runtime dependencies, only pure Java code is generated.
- Parsing is done using a push-down automation without recursion.
- Grammax uses an explicit API for accepting the token stream. It allows you to easily use the tool with any (including your own) lexer. You can pause and resume parsing at any point. Parsing multiple token streams simultaneously is also possible.
- Grammax supports simple lr and canonical lr parsing algorithms.
- Automatic warnings about possible right-recursion cycles that cause a lot of parsing stack memory consumption.
- Types can be assigned to terminals and non-terminals. The corresponding expressions are casted automatically.
%topstatement allows inserting
importautomatically. Therefore grammax can be used in an automated pipeline.