edited by
20,572 views
40 40 votes
Match the pairs in the following questions:$$\begin{array}{|ll|ll|} \hline (a) & \text{Lexical analysis} & (p) & \text{DAG's} \\\hline  (b) & \text{Code optimization} & (q) & \text{Syntax trees} \\\hline   (c) & \text{Code generation} & (r)  & \text{Push down automaton} \\\hline (d) & \text{Abelian groups} & (s)  & \text{Finite automaton}  \\\hline \end{array}$$

4 Answers

Best answer
78 78 votes
$$\small \begin{array}{ll|ll} (a) & \text{Lexical analysis} & (s) & \text{Finite automaton (DFA creation for finding tokens)} \\\hline  (b) & \text{Code optimization} & (p) & \text{DAG's (Common subtree minimization)} \\\hline   (c) & \text{Code generation} & (q)  & \text{Syntax trees (one can construct a derivation and }\\&&& \text{from it a parse tree that can be
 used for code generation)}  \\\hline (d) & \text{Abelian groups} & (r)  & \text{ Push down automaton}   \end{array}$$
edited by
3 3 votes
lexical analysis related to regular expression ( finite auotomata)

code optimization related to DAGs

as i know code generation is done on parse tree ( syntax tree + semantic meaning )

hence

A : S

B : P

C: Q

D : R ( dont sure about this option )
2 2 votes

  a) lexical analysis   is related to     Syntax trees

lexical analysis generates tokens Tokens are frequently defined by regular expressions, which are understood by a lexical analyzer generator such as lex..and  regular expressions,are used in  Syntax analysis for genearating..syntax tree.

b)code optimization    is related to      p)DAG's

http://web.cecs.pdx.edu/~harry/compilers/slides/Optimize2.pdf

c)code generation   is related to   Push down automata

from the run of the push-down automaton, one can construct a derivation and from it a parse tree that can be used for code generation

d)abelian group          is related to        s)Finite automata

http://eiche.theoinf.tu-ilmenau.de/kuske/LOGINF/abstractStruengmann.pdf

1 flag:
✌ Edit necessary (0shan)
1 1 vote

Let’s match them one by one:

| (a) Lexical analysis | → (s) Finite automaton |
Lexical analysis uses finite automata for token recognition.

| (b) Code optimization | → (p) DAG’s |
DAG (Directed Acyclic Graph) is used to represent expressions and eliminate common subexpressions during optimization.

| (c) Code generation | → (q) Syntax trees |
Syntax trees are used to generate intermediate or target code.

| (d) Abelian groups | → (r) Push down automaton | ❌ (Incorrect)
Actually, Abelian groups are from Abstract Algebra, not automata. There is no direct relation to compiler design.
But among the given options, none fit perfectly — so (d) is unrelated to compiler concepts.

(a) → (s)
(b) → (p)
(c) → (q)
(d) → (r) (by elimination, though conceptually unrelated)

edited by
Position:
Show:

Related questions

24 24 votes
4 answers 4 answers
11.6k
11.6k views
Misbah Ghaya asked Nov 19, 2016
11,610 views
Match the pairs in the following questions:$$\begin{array}{|ll|ll|}\hline (a) & \text{Pointer data type} & (p) & \text{Type conversion} \\\hline (b) & \text{Activation r...
32 32 votes
2 answers 2 answers
10.4k
10.4k views
Misbah Ghaya asked Nov 19, 2016
10,445 views
The number of rooted binary trees with $n$ nodes is,Equal to the number of ways of multiplying $(n+1)$ matrices.Equal to the number of ways of arranging $n$ out of $2 n$ ...
30 30 votes
3 answers 3 answers
6.3k
6.3k views
Misbah Ghaya asked Nov 19, 2016
6,286 views
Match the pairs in the following questions:$$\begin{array}{|ll|ll|}\hline (a) & \text{Groups} & (p) & \text{Associativity} \\\hline (b) & \text{Semigroups} & (q) & \text...
24 24 votes
3 answers 3 answers
11.8k
11.8k views
Misbah Ghaya asked Nov 19, 2016
11,774 views
Match the pairs in the following questions:$$\begin{array}{|ll|ll|} \hline (a) & \text{A heap construction} & (p) & \ \Omega(n\log_{10}n) \\\hline (b) & \text{Construct...