edited by
2,641 views
1 votes
1 votes

​​​Consider the following two sets:

Set $\text{X}$Set $\text{Y}$
P. Lexical Analyzer1. Abstract Syntax Tree
Q. Syntax Analyzer2. Token
R. Intermediate Code Generator3. Parse Tree
S. Code Optimizer4. Constant Folding


Which one of the following options is the CORRECT match from Set $\boldsymbol{X}$ to Set $\boldsymbol{Y}$?

  1. $\mathrm{P}-4 ; \mathrm{Q}-1 ; \mathrm{R}-3 ; \mathrm{S}-2$
  2. $\mathrm{P}-2 ; \mathrm{Q}-3 ; \mathrm{R}-1 ; \mathrm{S}-4$
  3. $\mathrm{P}-2 ; \mathrm{Q}-1 ; \mathrm{R}-3 ; \mathrm{S}-4$
  4. $\mathrm{P}-4 ; \mathrm{Q}-3 ; \mathrm{R}-2 ; \mathrm{S}-1$
edited by

3 Answers

0 votes
0 votes
  •  Lexical analysis $\rightarrow$ tokens
  • Syntax analysis $\rightarrow$ parse tree
  • ICG $\rightarrow$ abstract syntax tree
  • code optimization $\rightarrow$ constant folding (it is one of the code optimization methods)

Option $(B)$ is correct.

0 votes
0 votes
Lexical analyzer output = stream of tokens

Syntax analyzer takes stream of tokens as input and produce parse tree

ICG output is abstract syntax tree

Code optimizer - constant folding.
Answer:

Related questions

10.0k
views
5 answers
39 votes
Madhav asked Feb 14, 2017
9,995 views
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:$$\begin{array}{|l|l|}\hline \text{P. Syntax t...
5.1k
views
1 answers
22 votes
Akash Kanase asked Feb 12, 2016
5,147 views
Match the following:$$\begin{array}{ll|ll}\hline \text{(P)} & \text{Lexical analysis} & \text{(i)} & \text{Leftmost derivation} \\\hline \text{(Q)} & \text{Top down pars...
7.1k
views
3 answers
34 votes
go_editor asked Feb 12, 2015
7,094 views
Match the following:$$\begin{array}{ll|ll}\hline \text{P.} & \text{Lexical analysis} & \text{1.} & \text{Graph coloring} \\\hline \text{Q.} & \text{Parsing} & \text{2.}&...
14.5k
views
3 answers
29 votes
makhdoom ghaya asked Nov 19, 2016
14,523 views
Match the pairs in the following questions:$$\begin{array}{ll|ll} (a) & \text{Lexical analysis} & (p) & \text{DAG's} \\\hline (b) & \text{Code optimization} & (q) & \tex...