Match List I with List II according to the input to the compiler phase that processes it:
| List I | List II |
|---|---|
| (a) Syntax tree | (I) Code generator |
| (b) Intermediate representation | (II) Semantic analyzer |
| (c) Token stream | (III) Lexical analyzer |
| (d) Character stream | (IV) Syntax analyzer |
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: B. (a)-(II), (b)-(I), (c)-(IV), (d)-(III)
Explanation
The semantic analyser takes the syntax tree (II), the code generator takes the intermediate representation (I), the syntax analyser takes the token stream (IV), and the lexical analyser takes the character stream (III).More Theory of Computation and Compilers questions
- Arrange the following phases of a compiler in their order of execution (start to end): (a) Target code generation (b) Syntax analysis (c) C…
- Consider a finite automaton F1 with three states C (start), S and E (final), in which there are transitions in both directions between ever…
- The maximum yield length of the following CNF CFG is S → AB A → CD B → e C → a D → b
- Consider the language L = {w ∈ {a, b, c}* : nₐ(w) + n_b(w) = n_c(w)}. L is
- Consider the following statements: A. A context-free language is generated by an LR(0) grammar if and only if it is accepted by a determini…
- Which phase of the compiler checks the grammar of the program?