Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it :
    (P) Syntax tree (i) Code generator
    (Q) Character stream (ii) Syntax analyzer
    (R) Intermediate (iii) Semantic analyzer representation
    (S) Token stream (iv) Lexical analyzer
    1. P → (ii), Q → (iii), R → (iv), S → (i)
    2. P → (ii), Q → (i), R → (iii), S → (iv)
    3. P → (iii), Q → (iv), R → (i), S → (ii)
    4. P → (i), Q → (iv), R → (ii), S → (iii)
Correct Option: C

According to the complier phase. Shown in figure below. The lexical analysis Phase Processes the character strem and generates tokens stream, these tokens are processed by syntex analysis analyzer and generate the syntex tree. these syntex tree is processed by the semantic analyzer, and generate the intermediate representation such as (3-Address code) is used for code generation process.



Your comments will be displayed only after manual approval.