LRToy
This LR Toy allows you to enter a grammar (BNF), view some of its properties, and obtain LR(0), SLR and LR(1) parsing tables for it.
The examples below illustrate the supported BNF notation.
gr0
E -> "succ" E E -> "if" E "then" E E -> "id"
LR(0)
SLR
LR(1)
gr1
S -> "(" L ")" S -> "x" L -> S L -> L "," S
LR(0)
SLR
LR(1)
gr2
E -> T "+" E E -> T T -> "x"
LR(0)
SLR
LR(1)
gr3
S -> S ";" S S -> "id" ":=" E S -> "print" "(" L ")" E -> "id" E -> "num" E -> E "+" E E -> "(" S "," E ")" L -> E L -> L "," E
LR(0)
SLR
LR(1)
gr5
cmd -> "cp" files dir files -> file files -> files file file -> "path" dir -> "path"
LR(0)
SLR
LR(1)
gr6
E -> "fn" "id" "->" E E -> E "+" E E -> "(" E ")" E -> "id" E -> "int"
LR(0)
SLR
LR(1)
your_own_grammar
LR(0)
SLR
LR(1)
Thomas Hallgren