Skip to content

v2.5.0-test

Pre-release
Pre-release
Compare
Choose a tag to compare
@ehwan ehwan released this 24 Aug 11:05
· 45 commits to main since this 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 and Term must implement Clone trait.
  • 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.