You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the sql output of the lemon parser generator with the query shown bellow give us an EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams.
lemon -S zephir.lemon
select name || ' ::=' || group_concat(
case when hasOr == 1 then ' (' || trim(rtxt) || ')'
else
case when length(rtxt) == 0 then ' /* empty */' else rtxt end
end, '
|')
from (
select lhs, name, substr(txt, instr(txt, tbl.sep) + length(tbl.sep)) rtxt, (instr(txt, '|') > 0) hasOr
from rule left join symbol on lhs=id, (select '::=' as sep) tbl
) as t
group by lhs;
We can see a railroad diagram for the grammar in parser/zephir.lemon with tokens manually added from parser/scanner.re, copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui in the tab Edit Grammar then switching to the tab View Diagram.
Using the
sql
output of thelemon
parser generator with the query shown bellow give us an EBNF understood by https://www.bottlecaps.de/rr/ui to generate railroad diagrams.We can see a railroad diagram for the grammar in
parser/zephir.lemon
withtokens
manually added fromparser/scanner.re
, copy and paste the EBNF shown bellow on https://www.bottlecaps.de/rr/ui in the tab Edit Grammar then switching to the tab View Diagram.The text was updated successfully, but these errors were encountered: