lark icon indicating copy to clipboard operation
lark copied to clipboard

ABNF grammar support V2

Open t-higuchi opened this issue 4 years ago • 0 comments
trafficstars

This PR implements feature request #318 in different approach from PR #1017.

Now it parses ABNF grammar and convert it to EBNF parse-tree. %import is implemented for convenience, and %terminal to control parse-tree construction. These directives are non-standard extension to ABNF.

The first commit refactors GrammarBuilder into syntax independent GrammarLoaderBase and the rest so that we can share/reuse code to implement %import for EBNF and ABNF (and other grammars).

Second commit is a plugin loader. It loads GrammarLoader instance as a plugin from lark/syntax/*.py. These commits implements PR #1019 in different approach.

t-higuchi avatar Oct 19 '21 14:10 t-higuchi