All mock tests are FREE till 31 December — register to save your progress
Unit 8 · Theory of Computation and Compilers Paper 2 CS · December 2022 Shift 1

Which of the following statements are correct?
A. Syntax-directed translation can be applied in type checking.
B. Syntax-directed translation can be used in 3-address code generation.
C. Syntax-directed translation can be used in the construction of syntax trees.
D. Syntax-directed translation can be used to recognise valid tokens.
Choose the most appropriate answer from the options given below:

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: A. A, B and C

Explanation

SDTs attach semantic actions to grammar productions (type checking, IR generation, AST construction). Recognising tokens is the lexer's job.

More Theory of Computation and Compilers questions