Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create railroad diagrams #8

Open
cdiggins opened this issue May 22, 2017 · 4 comments
Open

Create railroad diagrams #8

cdiggins opened this issue May 22, 2017 · 4 comments

Comments

@cdiggins
Copy link
Owner

https://github.com/dundalek/GrammKit

@Hypercubed
Copy link
Contributor

Any thoughts on how to achieve this? Would you go through an intermediate definition?

@cdiggins
Copy link
Owner Author

@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

@cdiggins
Copy link
Owner Author

So I think that grammKit, just needs something like the PEG grammar definitions but cleaned up a bit.

@Hypercubed
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants