edited by
1,274 views
0 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}

1 Answer

Position:
Show:

Related questions

1 1 vote
0 0 answers
1.2k
1.2k views
ahmed65956 asked Sep 27, 2023
1,230 views
Give the translation scheme that converts infix to postfix form for the following grammar. Also generate the annotated parse tree for input string 2+6+1E- E+TE->TT->0|1|2...
0 0 votes
2 2 answers
1.1k
1.1k views
Priyansh Singh asked Nov 30, 2018
1,082 views
Select the correct one from the below given options.1. The parser’s output is abstract syntax tree, which represents the grammatical structure of the parse input. 2. Pars...
0 0 votes
0 0 answers
460
460 views
Ebrahim asked Oct 17, 2024
460 views
Q4. Check the ambiguity for the string id[id]in the given grammar:E → E+T | TT → id | id[ ] | id[X]X → E , E | E Please answer like example in this page link https://ww...