LR Parser-Part-I
LR Parser-Part-I
LR parsing is one type of bottom up parsing. It is used to parse the large class of grammars.
"K" is the number of input symbols of the look ahead used to make number of parsing decision.
LR parsing is divided into four parts: LR (0) parsing, SLR(1) parsing, CLR(1) parsing and
LALR(1) parsing.
NOTE that LR(0) Parsing Table Algorithm is not in your Course Syllabus
Fig: Block diagram of LR parser
More Details:-
Construction of LR Parsing Table
NOTE that LR(0) Parsing Table Algorithm is not in your Course Syllabus
Augment Grammar
Example
Given grammar
1. S → AA
2. A → aA | b
1. S`→ S
2. S → AA
3. A → aA | b
More Details
Finally
Step 3: DFA
Step 4: Construction of SLR(1) Parsing Table using Algorithm.