Semantic Analysis & Type Checking

Answer & solution
Official answer: 2.374 to 2.376
Our answer: 2.375
Step through it (19 steps)
The I rules interpret the left substring as a binary integer: I(10)=2*1+0=2. Evaluate the fractional suffix from right to left: F(1)=1/2, F(11)=(1+1/2)/2=3/4, and F(011)=(0+3/4)/2=3/8. Thus N.val=2+3/8=2.375, within the official interval 2.374 to 2.376.
Teaching detail. The separator # plays the role of a binary radix point in these semantic rules, not a multiplication or concatenation operator on numbers. The left-recursive integer production multiplies the accumulated prefix by two before appending the next bit. The right-recursive fractional production halves the sum of the current bit and the suffix fraction, placing successive bits at weights 1/2,1/4,1/8. Directly, 10#011 represents 2+0/2+1/4+1/8. This corroborates the synthesized-attribute evaluation and yields an exact terminating decimal.