Question 61
Which of the following is an example of implicit type conversion performed by a compiler's semantic type checker?
Type coercion is automatic/implicit type conversion performed by the semantic analyzer according to language rules.
Which of the following is an example of implicit type conversion performed by a compiler's semantic type checker?
Type coercion is automatic/implicit type conversion performed by the semantic analyzer according to language rules.
In the context of type systems, what is a characteristic of a strongly typed language?
Strong typing means the language enforces its type rules so that incompatible operations are not silently treated as valid. It does not require every strongly typed language to use only compile-time checking.
In three-address code, how is a conditional branch typically represented?
Conditional statements in TAC take the form if x relop y goto L where relop is a relational operator (=, <, >=, etc.).
In a simplified three-address-code model where an indexed store counts as one instruction, how many instructions represent a[i] = b when each integer occupies 4 bytes?
The simplified representation first computes the byte offset with t1 = i * 4 and then performs the indexed store a[t1] = b, giving two three-address-code instructions.
In a Syntax Tree for expression a + b * c, which node represents the root of the tree?
Because * has higher precedence, b * c forms a sub-tree evaluated first. Addition + sits at the top root combining a with (b * c).