Match the LIST-I with LIST-II Choose the correct answer from the options given below:LIST-I LIST-II A. Conflict Resolution I. Three - Address Code B. Common Subsequence II. Precedence C. Quadruples III. Syntax Directed Translations D. L-Attributed definitions IV. Direct Acyclic Graph (DAG)
A-II, B-IV, C-I, D-III
Each item in the first list is a technique or construct from parsing, optimisation or intermediate-code generation, matched with the tool used for it.
A. Conflict Resolution — shift/reduce conflicts in an ambiguous grammar (e.g. E → E + E | E * E) are resolved in YACC/LR parsers by declaring operator precedence and associativity. A → II.
B. Common Subsequence — repeated (common) subexpressions in a basic block are detected by building a directed acyclic graph, where a shared node represents the common part and is computed once. B → IV.
C. Quadruples — a record with fields op, arg1, arg2, result; it is one of the standard representations of three-address code (with triples and indirect triples). C → I.
D. L-Attributed definitions — a class of syntax-directed definitions whose inherited attributes depend only on the parent and left siblings, so they can be implemented as syntax-directed translation schemes during a left-to-right parse. D → III.
The code A-II, B-III, C-I, D-IV swaps the DAG and translation pairs; A-III, B-II, C-IV, D-I and A-IV,B-I, C-II, D-III misplace precedence and three-address code.
A-II, B-IV, C-I, D-III option is correct.
Which of the following is not an intermediate code form ?