Open mingodad opened 1 year ago
Oh hey these are really cool 😀
Trying to convert this grammar to use in https://mingodad.github.io/parsertl-playground/playground/ I've noticed that probably there is a mistake in this rule:
prefix
:
| ('+' | '-' | '!' | '^' | '*' | '&' ) expression
;
Probably this is what you want/mean:
prefix
: ('+' | '-' | '!' | '^' | '*' | '&' ) expression //remove the |
;
You do not seem to want prefix
to have an empty
alternative, do you ?
Also you have a duplicated production here:
stringDecl
: IDENT '=' string_ eos
| IDENT '=' compoundString eos
| IDENT '=' compoundString eos // identical the above
;
Probably you want this:
stringDecl
: IDENT '=' string_ eos
| IDENT '=' compoundString eos
;
Oh nice catch. Probably a merge conflict that got messy.
Also I edited https://github.com/Fault-lang/Fault/issues/27#issuecomment-1761150545 changed my mistake:
-You do seem to want prefix to have an empty alternative, do you ?
+You do not seem to want prefix to have an empty alternative, do you ?
I've just added Fault-lang
grammar to https://mingodad.github.io/parsertl-playground/playground/ (select Fault-lang parser (partailly working)
from Examples
then click Parse
to see a parser tree for the content in Input source
).
Also you can test your grammar on http://lab.antlr.org/ .
Using some online tools like https://www.bottlecaps.de/rr/ui and https://www.bottlecaps.de/convert/ we can have a nice navigable railroad diagram.
Copy and paste the
EBNF
shown bellow on https://www.bottlecaps.de/rr/ui on the tabEdit Grammar
the click on the tabView Diagram
to see/download a navigable railroad diagram.