Question 56
If a dependency graph for attribute evaluation in a parse tree contains a DIRECTED CYCLE, what does it signify?
A directed cycle in an attribute dependency graph indicates circular dependencies, making evaluation impossible.
If a dependency graph for attribute evaluation in a parse tree contains a DIRECTED CYCLE, what does it signify?
A directed cycle in an attribute dependency graph indicates circular dependencies, making evaluation impossible.
Which phase of the compiler generates Three-Address Code (TAC)?
The Intermediate Code Generator translates validated parse trees / abstract syntax trees into machine-independent intermediate representations such as Three-Address Code (TAC).
What is the minimum number of Three-Address Code (TAC) instructions required to evaluate x = a + b + c + d?
t1 = a + b, 2. t2 = t1 + c, 3. x = t2 + d. Total = 3 TAC instructions.
Which intermediate representation is designed to be independent of a specific source language and target machine architecture?
A machine-independent IR such as TAC is designed to decouple source-language analysis from target-specific code generation. Assembly, object code, and machine code are target-dependent.
In syntax-directed translation, an abstract syntax tree (AST) differs from a parse tree because:
Abstract Syntax Trees condense parse trees by discarding syntactic sugar (parentheses, semicolons) and retaining only essential operators and operands.