Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Match the following :
    List – I List – II
    P. Lexical analysis 1. Graph coloring
    Q. Parsing 2. DFA minimization
    R. Register allocation 3. Post-order traversal
    S. Expression evaluation 4. Production tree

    1. P-2, Q-3, R-1, S-4
    2. P-2, Q-1, R-4, S-3
    3. P-2, Q-4, R-1, S-3
    4. P-2, Q-3, R-4, S-1
Correct Option: C

Lexical Analyzer uses DFA to recognize the longest possible input sequence that makes up a token. Parser takes input in the form of tokens and usually builds a data structure in the form of parse tree. Here parse tree can be termed as a production tree as parser uses production of the grammar to check whether generated tokens form a meaningful compression. Register allocation can be reduced to K-colouring problem where K is the number of registers available on the target architecture. Post order traversal of expression tree gives postfix notation for a given expression & this post fix notation can be evaluated using stack.



Your comments will be displayed only after manual approval.