Parsing and Syntax directed translation (original) (raw)
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. [Tex]\\epsilon[/Tex] is the empty string, $ indicates end of input, and, | separates alternate right hand sides of productions.


Consider the date same as above question. The appropriate entries for E1, E2, and E3 are

Consider the following two sets of LR(1) items of an LR(1) grammar.
X -> c.X, c/d
X -> .cX, c/d
X -> .d, c/d
X -> c.X, $
X -> .cX, $
X -> .d, $
Which of the following statements related to merging of the two sets in the corresponding LALR parser is/are FALSE?
- Cannot be merged since look aheads are different.
- Can be merged but will result in S-R conflict.
- Can be merged but will result in R-R conflict.
- Cannot be merged since goto on c will lead to two different sets.
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e., of type A -> є and A -> a) to parse a string with n tokens?
The grammar S → aSa | bS | c is
Match all items in Group 1 with correct options from those given in Group 2.
**Group 1 Group 2
**P. Regular expression 1. Syntax analysis
**Q. Pushdown automata 2. Code generation
**R. Dataflow analysis 3. Lexical analysis
**S. Register allocation 4. Code optimization
Which of the following statements are TRUE?
I. There exist parsing algorithms for some programming languages
whose complexities are less than O(n3).
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.
A CFG G is given with the following productions where S is the start symbol, A is a non-terminal and a and b are terminals.
S→aS∣A
A→aAb∣bAa∣ϵ
For the correct answer in Q75, how many steps are required to derive the string and how many parse trees are there?
Consider the following parse tree for the expression a#b$c$d#e#f, involving two binary operators $ and #.

Which one of the following is correct for the given parse tree?
- $ has higher precedence and is left associative; # is right associative
- # has higher precedence and is left associative; $ is right associative
- $ has higher precedence and is left associative; # is left associative
- # has higher precedence and is right associative; $ is left associative
Which phase of compiler generates stream of atoms?
There are 85 questions to complete.
Take a part in the ongoing discussion