Introduction - If you have any usage issues, please Google them yourself
LR parser design
Given that statement, The Extension of the grammar G [S ] as follows:
(0) S -> S (1) S-> v I: T (2) I-> I, i (3) I-> i (4) T-> r
One representative of terminator v var, r representative of real.
Living patterns of its identification Specification prefix DFA and LR (0) analysis as follows:
Input
GOTO table table status ACTION
v i,: r# S I T
0 S2 1
1 acc
2 S4 3
3 S6 S5
4 r3 r3 r3 r3 r3 r3
5 S9 8
6 S7
7 r2 r2 r2 r2 r2 r2
8 r1 r1 r1 r1 r1 r1
9 r4 r4 r4 r4 r4 r4
Programming LR parser article law, and set the input sentence is the grammar:
var i, i, i: real
Given output