Question: Consider the grammar below, which generates arithmetic expressions involving operator + and integer or floating - point operands. Floating - point numbers are distinguished by
Consider the grammar below, which generates arithmetic expressions involving operator and integer or floatingpoint operands. Floatingpoint numbers are distinguished by having a decimal point.
E ETT
T num. num num
Focus on the data type of the arithmetic expression, generated by B The data type of an arithmetic expression, involving addition operator of two integer operands becomes an integer expression, whereas data type of an arithmetic expression involving one integer and one floating point operand becomes a floating point expression. For instance, the data type of expression is integer, whereas are floating point expressions.
Consider a SDD which determines the data type of the expression E In this SDD type is the only synthesized attribute, defined for the nonterminals E and T where Etype stores the data type of the expression E Write the complete SDD which computes Etype to determine the data type of the expression E
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
