Home » Compiler Design » Compiler design miscellaneous » Question

Compiler design miscellaneous

  1. Which of the following statements are true?
    1. There exist parsing algorithms for some programming languages whose complexities ar less than θ (n3).
    2. A programming language which allows recursive can be implemented with static storage allocation.
    3. No L-attributed definition can be evaluated in the framework of bottom-up parsing.
    4. Code improving transformations can be performed at both source language and intermediate code level.
    1. 1 and 2
    2. 1 and 4
    3. 3 and 4
    4. 1, 3 and 4
Correct Option: B

The time bounds for the parser are the same as those of the recognizer, while the space bound goes up to n 3 in general in order to store the parse trees. In fact it would probably be most efficient to implementthe algorithm to do just a look-ahead of 1. To implement the full look-ahead for any k would be more costly inprogramming effort and less efficient overall since so few programming languages need the extra lookahead. Improving transformations are performed on a target-specific representation of the program. for both existing and proposed architectures, to gather trace information for code improvements are often applied to a high-level intermediate language though it can be applied to the source level also but it can impact the effectiveness of code improvements
I. Statement is true since there are some parsers which take O(n log2n) time for parsing.
II. Completely false, since there is no use of stack which is required for recursion.
III. False
IV. True since both types of optimizations are applied



Your comments will be displayed only after manual approval.