L → E n E → E1 + T | T T → T1 * F | F F → (E) | digit
Production | Semantic Rule |
---|---|
L → E n | L.val = E.val |
E → E1 + T | E.val = E1.val + T.val |
E → T | E.val = T.val |
T → T1 * F | T.val = T1.val * F.val |
T → F | T.val = F.val |
F → (E) | F.val = E.val |
F → digit | F.val = digit.lexval |
A → B A.s = B.i B.i = A.s + 1
Production | Semantic Rule |
---|---|
T → FT' | T'.inh = F.val |
T'.val = T'.syn | |
T' → *FT'1 | T'1.inh = T'.inh × F.val |
T'.syn = T'1.syn | |
T' → ε | T'.syn = T'.inh |
F → digit | T.val = digit.lexval |