search
Log In

Recent questions tagged parsing

0 votes
1 answer
1
S1)Stack contains only viable prefixes S2) handle is always on top of the stack options: a) only S1 is true b)only S2 is true c)both S1 and S2 d)neither is true
asked Sep 27, 2016 in Compiler Design Anusha Motamarri 295 views
11 votes
2 answers
2
Consider the folllowing grammar $ S\rightarrow AaS \ |\ b$ $ A\rightarrow c \ |\ d \ |B$ $ B\rightarrow AgC \ |\ AhC \ | \ DgC | \ DhC$ $C\rightarrow c \ |\ d \ | \ D$ $ D\rightarrow eBf$ Which of the following are viable prefix ? $ \left ( 1 \right )Aab$ $ \left ( 2 \right )ca$ $ \left ( 3 \right )cab$ $\left ( 4 \right )AgCS$
asked Sep 20, 2016 in Compiler Design ManojK 1.6k views
1 vote
0 answers
3
Consider the Grammer S -> (S) | SS | () In the goto graph of LR(0) item, the number of inadequate states are (A). 1 (B). 2 (C). 3 (D). 4
asked Aug 17, 2016 in Compiler Design anonymous 337 views
4 votes
2 answers
4
Which of the following is false? The grammar $S \rightarrow a \: Sb \mid bSa \mid SS \mid \in$, where $S$ is the only non-terminal symbol and $\in$ is the null string, is ambiguous SLR is powerful than LALR An LL(1) parser is a top-down parser YACC tool is an LALR(1) parser generator
asked Aug 16, 2016 in Compiler Design jothee 1.1k views
2 votes
1 answer
5
S-> AB / Ɛ A-> AC / 0C B->0S C->1 What is the first (A)..??
asked Aug 13, 2016 in Compiler Design dhairya 509 views
1 vote
2 answers
6
Which of the following statements is false? Top-down parsers are LL parsers where first L stands for left-to-right scan and second L stands for a leftmost derivation (000)* is a regular expression that matches only strings containing an odd number of zeroes, including the empty string ... is, if L is any context-free language, then the language $L^R =\{w^R: w \varepsilon L\}$ is context-free
asked Aug 8, 2016 in Compiler Design jothee 1.1k views
1 vote
2 answers
7
Which one of the following is false? LALR parser is Bottom-Up parser A parsing algorithm which performs a left to right scanning and a right most deviation is RL($1$) LR parser is Bottom-Up parser In LL($1$), the $1$ indicates that there is a one symbol look-ahead
asked Jul 31, 2016 in Compiler Design jothee 1.5k views
1 vote
2 answers
8
Which of the following is true while converting CFG to an LL(1) grammar? Removing left recursion alone Factoring the grammar alone Removing left recursion and factoring the grammar None of the above
asked Jul 10, 2016 in Compiler Design Arjun 1.9k views
2 votes
3 answers
9
Given the following expressions of a grammar $E \rightarrow E * F / F + E / F$ $F \rightarrow F – F / id$ Which of the following is true? $*$ has the higher precedence than + - has the higher precedence than $*$ + and – have same precedence + has the higher precedence than $*$
asked Jul 8, 2016 in Compiler Design jothee 866 views
10 votes
5 answers
10
Recursive descent parsing is an example of Top-down parsers Bottom-up parsers Predictive parsers None of the above
asked Jul 6, 2016 in Compiler Design jothee 7.6k views
5 votes
3 answers
11
A top-down parser generates Rightmost Derivation Rightmost derivation in reverse Leftmost derivation Leftmost derivation in reverse
asked Jul 5, 2016 in Compiler Design habedo007 9.5k views
3 votes
3 answers
12
An ambiguous grammar is one that produces more than one left most derivation for the same sentence. more than one right most derivation for the same sentence. more than one leftmost derivation for the different sentence. i and ii i or ii ii and iii ii or iii
asked Jun 24, 2016 in Unknown Category vivekpinto07 2.2k views
8 votes
2 answers
13
Which statement is true? LALR parser is more powerful and costly as compare to other parsers All CFG's are LP and not all grammars are uniquely defined Every SLR grammar is unambiguous but not every unambiguous grammar is SLR LR(K) is the most general back tracking shift reduce parsing method
asked Jun 17, 2016 in Compiler Design jothee 3.7k views
7 votes
3 answers
14
Which one of the following is a top-down parser? Recursive descent parser Shift left associative parser SLR(k) parser LR(k) parser
asked Jun 17, 2016 in Compiler Design jothee 2.6k views
12 votes
3 answers
15
Which grammar rules violate the requirement of the operator grammar? A, B, C are variables and a, b, c are terminals $A \rightarrow BC$ $A \rightarrow CcBb$ $A \rightarrow BaC$ $A \rightarrow \epsilon$ (a) 1 only (b) 1 and 2 (c) 1 and 3 (d) 1 and 4
asked Jun 17, 2016 in Compiler Design jothee 4.2k views
1 vote
1 answer
16
1 vote
3 answers
17
A shift reduce parser suffers from Shift reduce conflict only Reduce reduce conflict only Both shift reduce conflict and reduce reduce conflict Shift handle and reduce handle conflicts
asked Jun 8, 2016 in Compiler Design makhdoom ghaya 1.8k views
2 votes
1 answer
18
Which of the following suffices to convert an arbitrary $CFG$ to an $LL(1)$ grammar ? Removing left recursion alone Removing the grammar alone Removing left recursion and factoring the grammar None of the above
asked Jun 8, 2016 in Compiler Design makhdoom ghaya 757 views
2 votes
2 answers
19
A grammar $G$ is $LL(1)$ if and only if the following conditions hold for two distinct productions $A \rightarrow \alpha \mid \beta$ I. First $(\alpha) \cap$ First $(\beta) \neq \left\{a\right\}$ where $a$ is some terminal symbol of the grammar. II. First $(\alpha) \cap$ ... $(\alpha) \cap$ Follow $(A) = \phi$ if $\lambda \in$ First $(\beta)$ I and II I and III II and III I, II and III
asked Jun 8, 2016 in Compiler Design makhdoom ghaya 2.2k views
2 votes
1 answer
20
A-->AA+/AA*/a is it eligible to be used by SR parse. If we apply SR parse on this grammar then what will be the order of activation Record in Stack
asked Jun 4, 2016 in Compiler Design shekhar chauhan 401 views
2 votes
1 answer
22
6 votes
2 answers
24
Whether LR(1) grammar is same as that of CLR(1) grammar. If yes then please explain and if not then what is the difference between them?
asked May 14, 2016 in Compiler Design ShiveshRoy 6.7k views
1 vote
1 answer
26
asked Apr 27, 2016 in Compiler Design Sanjay Sharma 167 views
7 votes
3 answers
27
Which of the following productions eliminate left recursion in the productions given below: $S \rightarrow Aa \mid b$ $A \rightarrow Ac \mid Sd \mid \epsilon$ $S \rightarrow Aa \mid b, A \rightarrow bdA', A' \rightarrow A'c \mid A'ba \mid A \mid \epsilon$ ... $S \rightarrow Aa \mid b, A \rightarrow cA' \mid adA' \mid bdA', A' \rightarrow A \mid \epsilon$
asked Apr 25, 2016 in Compiler Design makhdoom ghaya 4.1k views
5 votes
1 answer
28
Shift reduce parsing belongs to a class of Bottom up parsing. Top down parsing. Recursive parsing. Predictive parsing.
asked Apr 25, 2016 in Compiler Design makhdoom ghaya 3.3k views
1 vote
3 answers
29
Which of the following is the most powerful parsing method? LL(I) Canonical LR SLR LALR
asked Apr 25, 2016 in Theory of Computation Sanjay Sharma 757 views
1 vote
2 answers
30
Given the following statements: $S_1$: SLR uses follow information to guide reductions. In case of LR and LALR parsers, the look-aheads are associated with the items and they make use of the left context available to the parser. $S_2$: LR grammar is a large subclass of context ... not correct and $S_2$ is correct. $S_1$ is correct and $S_2$ is not correct. $S_1$ is correct and $S_2$ is correct
asked Apr 25, 2016 in Compiler Design Sanjay Sharma 1.1k views
...