jcoglan / canopy

A parser compiler for Java, JavaScript, Python, Ruby
http://canopy.jcoglan.com
Mozilla Public License 2.0
418 stars 54 forks source link

Suport composing/importing grammars #50

Open byteit101 opened 3 years ago

byteit101 commented 3 years ago

One of the advantages of PEG-based grammars is that they are composable. It would be very nice if canopy supports either composing or importing grammars.

I have a start of this implementation at https://github.com/byteit101/canopy/tree/multi_grammar but I wasn't sure how to expose actions for Java (multiple interfaces?), but otherwise it should "work". Importing should also be doable, but I haven't implemented that yet.