edited by
941 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}

edited by

1 Answer

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

Related questions

719
views
0 answers
0 votes
ahmed65956 asked Sep 27, 2023
719 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|3|4|5|6|7|8|9
564
views
1 answers
0 votes
ahmed65956 asked Aug 3, 2023
564 views
Consider the given grammar of syntax directed translation scheme and answer the following: (2 MARKS) ... the semantic rules of the above grammar productionsDraw the annotated parse tree for 7-8-5/2
634
views
2 answers
0 votes
Priyansh Singh asked Nov 30, 2018
634 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 ... leaves while keywords cannot appear as leaves. 4.All of the above are true
624
views
0 answers
0 votes
admin asked Sep 6, 2019
624 views
Modify the SDD of Fig. $5.25$ to include superscripts denoted by operator sup between boxes. If box $B_{2}$ is a superscript of box $B_{1}$, then position the ... $5.26$.