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
- Match List I with List II (stack and input configurations)List I List II A. Initial configuration of stack and input in LL parsing I. $ | w…
- The precedence of regular-expression operators from lowest to highest is:
- Consider the following statements: A. For every regular language, we can design a Turing machine. B. For every context-free language, we ca…
- The transition function δ in a multi-tape Turing machine (k tapes) is defined as:
- In the pumping lemma for regular languages, writing the string as xyz, what is the minimum length of y?
- The item generated by the production A → ε is: