Open cdiggins opened 7 years ago
Any thoughts on how to achieve this? Would you go through an intermediate definition?
@Hypercubed , sorry I missed your comment. I can generate both AST Schemas and PEG geometry definitions from a Heron grammar. An example output is here https://github.com/cdiggins/heron-language/blob/master/spec.md generated by the tool: https://github.com/cdiggins/heron-language/blob/master/tools/gen-spec.js
So I think that grammKit, just needs something like the PEG grammar definitions but cleaned up a bit.
If I understand correctly the outputs in the heron-language repo are PEG format, while GrammKit takes PEGjs, Ohm, or EBNF. Unless you know a decent way to convert Myna grammar (or PEG) to PEGjs it might be better to process the rules directly into the intermediate format GrammKit uses (basically the output of PEGjs#parse).
This is my attempt so far: https://github.com/Hypercubed/f-flat_node/blob/master/bin/gen-spec.js#L22
It works, but not great... I'm still not sure the correct "translations" of some rules.
https://github.com/dundalek/GrammKit