xsawyerx / guacamole

Guacamole is a parser toolkit for Standard Perl. It provides fully static BNF-based parsing capability to a reasonable subset of Perl.
https://metacpan.org/pod/Guacamole
20 stars 8 forks source link

Pluggable grammars #23

Open xsawyerx opened 4 years ago

xsawyerx commented 4 years ago

We can support grammar plugins so people could load additional grammar to parse DSLs.

Examples:

We can document the base lexemes so others can use them. They could create their own lexemes with a prefix for them, like MooseKeywordHasExpr and MooseKeywordHas.

xsawyerx commented 3 years ago

Support from the wonderful #marpa developer community: :heart_eyes:

05:44 | jdurand_ | Re https://colabti.org/irclogger/irclogger_log/marpa?date=2020-06-15#l6
05:45 | jdurand_ | as stated by Jeffrey, I it just a matter of compiling a grammar using variables
05:45 | jdurand_ | https://github.com/jddurand/MarpaX-Languages-M4/blob/master/lib/MarpaX/Languages/M4/Impl/Parser.pm does that for example
05:47 | jdurand_ | when https://github.com/jddurand/perl-MarpaX-ESLIF-URI  is playing with grammar subclass, as it if was a object (the later is  using MarpaX::ESLIF and not Marpa::R2 directly but the principles are  the same)
xsawyerx commented 2 years ago

Preliminary implementation available with documentation of it here: https://github.com/xsawyerx/guacamole/commit/801bcb677f1f5a3a4b22bb4b058192316f77aafb