in Compiler Design edited by
305 views
0 votes
0 votes

Given the following statement: 6 * (8-3)
Make the Annotated Parse Tree based on the translation scheme below.

S → B {A.i = B.val} A {S.val = A.s}
A → - B {A1.i = A.i - B.val} A1 {A.s = A1.s}
A → e {A.s = A.i}
B → D {C.i = D.val} C {B.val = C.s}
C → * D {C1.i = C.i * D.val} C1 {C.s = C1.s}
C → e {C.s = C.i}
D → ( S ) {D.val = S.val}
D → num {D.val = num.val}

in Compiler Design edited by
by
305 views

1 Answer

0 votes
0 votes
Ig we get 6 levels of nodes in the parseTree, and soln=30 (?)

Related questions