Question: Consider the following attribute grammar. Draw an annotated parse tree for the input: int a, b, c; string s; S D S.st = D.st S
Consider the following attribute grammar. Draw an annotated parse tree for the input:
int a, b, c; string s;
S D
- S.st = D.st
S S D
- S1.st = S2.st || D.st
D T L ;
- D.st = T.type || L.st
T int
- T.type = int
T string
- T.type = string
L id
- L.st = id.name
L L , id
- L1.st = L2.st , id.name
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
