1,658 views
0 votes
0 votes

This grammar generates binary numbers with a "decimal" point:

  • $S\rightarrow L.L\mid L$
  • $L\rightarrow LB\mid B$
  • $B\rightarrow 0\mid 1$ 

Design an L-attributed SDD to compute $S.val$, the decimal-number value of an input string. For example, the translation of string $101.101$ should be the decimal number $5.625$. Hint: use an inherited attribute $L.side$ that tells which side of the decimal point a bit is on. 

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
3
admin asked Sep 6, 2019
1,831 views
For the SDD of Fig. $5.8$, give annotated parse trees for the following expressions:int a,b,c.float w,x,y,z.