1.

Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X1,X2,X3,X4,X5 and X6 be the place holders for the non-terminals D, T, L or L1 in the following table: Production ruleSemantic actionD→TLX1.type=X2.typeT→intT.type = intT→FloatT.type = floatL→L1.idX3.type=X4.type add Type (id.entry, X5. type)L→idadd Type (id. entry, X6. type)Which one of the following are the appropriate choices for X1,X2,X3 and X4?

Answer»

Consider the following grammar and the semantic actions to support the inherited type declaration attributes. Let X1,X2,X3,X4,X5 and X6 be the place holders for the non-terminals D, T, L or L1 in the following table:





























Production ruleSemantic action
DTLX1.type=X2.type
TintT.type = int
TFloatT.type = float
LL1.idX3.type=X4.type add Type (id.entry, X5. type)
Lidadd Type (id. entry, X6. type)



Which one of the following are the appropriate choices for X1,X2,X3 and X4?


Discussion

No Comment Found