-
Notifications
You must be signed in to change notification settings - Fork 20
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
Grammar railroad diagram #134
Comments
That's very cool --- did you generate the yacc-compatible input from the Lemon grammar automatically or by hand? I find railroad diagrams impressively easy to read, although this one is a obfuscated a bit by the way the parser uses a lot of subrules for things like lists. One of the (many) things on my to-do list, actually, is to rewrite the parser completely, hopefully with something smaller. I've recently had good results with a packrat parser for a BASIC interpreter. See https://github.com/davidgiven/comal65/blob/master/src/_parser.s. The tricky part would be memoisation, but careful design of the parser should avoid most of that... |
I've generated with this extended lemon that has an option to output naked yacc grammar:
That parser in a kind of assembler doesn't seem funny to maintain . |
I've just added this "src/cowfe/parser.y" to https://mingodad.github.io/parsertl-playground/playground/ an
Yacc/Lex
compatible online editor/tester (select "Cowgol parser" from "Examples" then click "Parse" to see a parser tree for the content in "Input source").The playground also generates an EBNF understood by https://www.bottlecaps.de/rr/ui to generate a nice navigable railroad diagram.
The text was updated successfully, but these errors were encountered: