Open mingodad opened 8 months ago
I've also just added this project grammar to https://mingodad.github.io/parsertl-playground/playground/ an Yacc/Lex
compatible online editor/tester (select Claro-lang parser
from Examples
then click Parse
to see a parse tree for the content in Input source
).
Notice that I replaced all occurrences of right recursion by left recursion because LALR
parsers work better that way see https://www.gnu.org/software/bison/manual/bison.html#Recursion .
This is super cool! Thanks for sharing this :D. Lately I've actually been strongly considering a future parsing migration from JCup to ANTLR, and I get the feeling that even just having this simplified EBNF with all the production actions stripped out would already make that a lot easier.
Using a script doing a bit of regex search and repace and manually adding the tokens from the lexer we can get an
EBNF
understood by (IPV6) https://www.bottlecaps.de/rr/ui or (IPV4) https://rr.red-dove.com/ui to generate a nice navigable railroad diagram that can help document/develop/debug this project grammar.Follow the instructions shown bellow at the top:
Script using
Lua
string pattern matching: