v2.5.0-test
Pre-release
Pre-release
Full Changelog: v2.4.0...v2.5.0
Add GLR parser generator
Adding %glr;
directive will switch the parser generation to GLR parser.
With this directive, any Shift/Reduce, Reduce/Reduce conflicts will not be treated as errors.
Resolving Ambiguities
You can resolve the ambiguties through the reduce action.
Simply, returning Result::Err(Error)
from the reduce action will revoke current path.
Note on GLR Parser
- Still in development, not have been tested enough (patches are welcome!).
- Since there are multiple paths, the reduce action can be called multiple times, even if the result will be thrown away in the future.
- Every
RuleType
andTerm
must implementClone
trait.
- Every
- User must be aware of the point where shift/reduce or reduce/reduce conflicts occur.
Every time the parser diverges, the calculation cost will increase.
Add lookahead
predefined variable in reduce action
You can refer via lookahead
variable in the reduce action, which token caused the reduce action.