Question: 3. A syntax directed definition for deriving the decimal value of a binary number is: Productions S L.R S L LLIB L B R

3. A syntax directed definition for deriving the decimal value of a binary number is: Productions S L.R S L LLIB L B R R B R B B 0 B 1 Semantic Rules L.pos = 0; R.pos = -1; S.val =L.val + R.val L.pos 0; S.val L.val; = Li-pos L.pos +1; B.pos L.pos; L.val = L.val + B.val; L.pos; L.val = B.val; B.pos = - R.pos R.pos 1; B.pos = R.pos; L.val = L.val + B.val; = B.pos R.pos; L.val = B.val; B.val = 0; B.val=1*2B.pos a) Draw an annotated parse tree for the sentence: 101.101 [6 points] b) Draw the dependency graph for the parse tree of (a). [4 points]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
