Compiler Design


Q91.

For the grammar below, a partial LL(1) parsing table is also presented along with the grammar. Entries that need to be filled are indicated as E1, E2, and E3. \varepsilon is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.S\rightarrow aAbB|bAaB|\varepsilon A\rightarrow S B\rightarrow S The appropriate entries for E1, E2, and E3 are
GateOverflow

Q92.

Which of the following statements are TRUE? I There exist parsing algorithms for some programming languages whose complexities are less than \theta (n^{3}). II A programming language which allows recursion can be implemented with static storage allocation. III No L-attributed definition can be evaluated in the framework of bottom-up parsing. IV Code improving transformations can be performed at both source language and intermediate code level.
GateOverflow

Q93.

Which variable does not drive a terminal string in grammar? S -> AB A -> a B -> b B -> C
GateOverflow

Q94.

Which of the following sentences can be generated by S -> aS \mid bA A -> d \mid cA
GateOverflow

Q95.

An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
GateOverflow

Q96.

Match the following:
GateOverflow

Q97.

Which of the following describes a handle (as applicable to LR-parsing) appropriately?
GateOverflow

Q98.

The grammar S\rightarrowaSa|bS|c is
GateOverflow

Q99.

Which of the following are true? I. A programming language which does not permit global variables of any kind and has no nesting of procedures/functions, but permits recursion can be implemented with static storage allocation II. Multi-level access link (or display) arrangement is needed to arrange activation records only if the programming language being implemented has nesting of procedures/functions III. Recursion in programming languages cannot be implemented with dynamic storage allocation IV. Nesting procedures/functions and recursion require a dynamic heap allocation scheme and cannot be implemented with a stack-based allocation scheme for activation records V. Programming languages which permit a function to return a function as its result cannot be implemented with a stack-based storage allocation scheme for activation records
GateOverflow

Q100.

For a statement S in a program, in the context of liveness analysis, the following sets are defined: USE(S) : the set of variables used in S IN(S) : the set of variables that are live at the entry of S OUT(S) : the set of variables that are live at the exit of S Consider a basic block that consists of two statements, S1 followed by S2. Which one of the following statements is correct?
GateOverflow