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 and ) to parse a string with n tokens?
GATE CSE · Compiler Design
Master topic for Parsing. Includes Syntax Analysis, Top-Down Parsing, Bottom-Up Parsing, Error Detection & Recovery.
143 questions · 20 PYQs · 0 AI practice · GATE CSE 2027
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 and ) to parse a string with n tokens?
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. is the empty string, S\rightarrow aAbB|bAaB|\varepsilonA\rightarrow SB\rightarrow S$ The FIRST and FOLLOW sets for the non-terminals A and B are

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. is the empty string, S\rightarrow aAbB|bAaB|\varepsilonA\rightarrow SB\rightarrow S$ The appropriate entries for E1, E2, and E3 are

Consider two binary operators ' 'and ' ' with the precedence of operator being lower than that of the operator . Operator is right associative while operator is left associative. Which one of the following represents the parse tree for expression (7 3 4 3 2)?

Which of the following sentences can be generated by
Which variable does not drive a terminal string in grammar? S -> AB A -> a B -> b B -> C
The grammar S aSa|bS|c is
Which of the following statements are TRUE? I There exist parsing algorithms for some programming languages whose complexities are less than . 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.
Which of the following describes a handle (as applicable to LR-parsing) appropriately?
Consider the grammar Which of the following sentences can be derived by this grammar?
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if
Match the following:

Consider the CFG with {S, A,B} as the non-terminal alphabet, {a,b} as the terminal alphabet, S as the start symbol and the following set of production rules: S aB S bA B b A a B bS A aS B aBB S bAA Which of the following strings is generated by the grammar?
Consider the grammar given below: Consider the following strings. i. xxyyx ii. xxyyxy iii. xyxy iv. yxxy v. yxx vi. xyx Which of the above strings are generated by the grammar ?
Consider the following grammars. Names representing terminals have been specified in capital letters.
\begin{array}{llll}\hline \text{$G1$ :} & \text{stmnt} & \text{\rightarrow$} & \text{WHILE (expr) stmnt} \\ \text{} & \text{stmnt} & \text{\rightarrow$} & \text{OTHER} \\ \text{} & \text{expr} & \text{\rightarrow$} & \text{ID} \\ \hline \text{ $G2$ :} & \text{stmnt} & \text{\rightarrow$} & \text{WHILE (expr) stmnt} \\ \text{} & \text{stmnt} & \text{\rightarrow$} & \text{OTHER} \\ \text{} & \text{expr} & \text{\rightarrow$} & \text{expr $+$ expr} \\ \text{} & \text{expr} & \text{\rightarrow$} & \text{expr $*$ expr} \\ \text{} & \text{expr} & \text{\rightarrow$} & \text{ID} \\ \hline \end{array}Which one of the following statements is true?
Consider the grammar with non-terminals N={ }, terminals T={a,b,i,t,e}, with S as the start symbol, and the following set of rules: The grammar is NOT LL(1) because:
Consider an ambiguous grammar G and its disambiguated version D. Let the language recognized by the two grammars be denoted by L(G) and L(D) respectively. Which one of the following is true?
Consider the CFG with {S, A,B} as the non-terminal alphabet, {a,b} as the terminal alphabet, S as the start symbol and the following set of production rules: S aB S bA B b A a B bS A aS B aBB S bAA For the string "aabbab", how many derivation trees are there?
Consider the following grammar. S S * E S E E F + E E F F F id Consider the following LR(0) items corresponding to the grammar above. (i) S S * .E (ii) E F. + E (iii) E F + .E Given the items above, which two of them will appear in the same set in the canonical sets-of-items for the grammar?
The grammar S AC|CB C aCb| A aA|a B Bb|b generates the language , what is the length of the derivation (number of steps starting from S) to generate the string with ?
Want unlimited AI-generated Parsing questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →