in Compiler Design
803 views
1 vote
1 vote
As in Ada, suppose that each expression must have a unique type, but that from a subexpression, by itself, all we can deduce is a set of  possible types. That is, the application of function $E_{1}$ to argument $E_{2}$ , represented by $E\rightarrow E_{l}(E_{2})$, has the associated rule

$E.type=\{t\mid \text{for some $s$ in} \:E_{2}.type,s\rightarrow t\: \text{is in}\: E_{1}.type\}$

Describe an SDD that determines a unique type for each subexpression by using an attribute $type$ to synthesize a set of possible types bottom-up, and, once the unique type of the overall expression is determined, proceeds top-down to determine attribute $unique$ for the type of each subexpression.
in Compiler Design
803 views

Please log in or register to answer this question.

Related questions