Skip to main content

Command Palette

Search for a command to run...

Parsers Practice Problems

Updated
1 min read
A

I am a Student, who finds beauty in simple things. I like to teach sometimes.

LR(0) Parsers

S → A  
A → aA | b
S → A B  
A → a | ε  
B → b | ε
S → aS | b

SLR Parsers

S → A c  
A → b A | d
S → L = R  
L → id  
R → id
S → E $  
E → E + T | T  
T → T * F | F  
F → id

CLR Parsers

S → A a  
A → b A | c
S → A d  
A → b A | c
S → L = R | R  
L → id  
R → L

LALR Parsers

S → A a | b A c  
A → d
S → A B  
A → a  
B → b | c
S → id = E  
E → E + T | T  
T → id

More from this blog

Aman Pathak

58 posts

Things I would speak if the person in front of me is me