Is there a good resource online with a collection of grammars for some of the major parsing algorithms (LL(1), LR(1), LR(0), LALR(1))? I've found many individual grammars that fall into these families, but I know of no good resource where someone has written up a large set of example grammars.
Does anyone know of such a resource?
Examples from wikipedia
grammar
S -> F
S -> ( S + F )
F -> a
input
( a + a )
parsing steps
S -> "(" S "+" F ")"
-> ( "F" + F )
-> ( "a" + F )
-> ( a + "a" )
grammar
(1) E → E * B
(2) E → E + B
(3) E → B
(4) B → 0
(5) B → 1
input
1 + 1
parsing steps
need to build a parser table and traverse through states.
grammar
S’ -> S S
S -> C C
C -> c C | d
input
cd
parsing steps
large table
grammar
A -> C x A | ε
B -> x C y | x C
C -> x B x | z
input
xxzxx
parsing steps
traverse large parser table
You may also want to have a look at