Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged grammar
4
votes
3
answers
361
Which of the following is true for the left recursive grammar
ShiveshRoy
6.3k
views
ShiveshRoy
asked
May 13, 2016
Compiler Design
compiler-design
parsing
grammar
test-series
+
–
10
votes
2
answers
362
How to Eliminate Indirect Left recursion from this grammar?
$\textbf{Eliminating indirect left-recursion}$ Indirect left-recursion $S\rightarrow Aa|b$ $A\rightarrow Ac| Sd |\in$
$\textbf{Eliminating indirect left-recursion}$Indirect left-recursion$S\rightarrow Aa|b$$A\rightarrow Ac| Sd |\in$
ShiveshRoy
9.1k
views
ShiveshRoy
asked
May 8, 2016
Compiler Design
grammar
compiler-design
parsing
+
–
8
votes
3
answers
363
ISRO-2013-6
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 cA' \mid adA' \mid bdA', A' \rightarrow A \mid \epsilon$
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...
makhdoom ghaya
6.7k
views
makhdoom ghaya
asked
Apr 25, 2016
Compiler Design
isro2013
parsing
grammar
+
–
17
votes
1
answer
364
GATE CSE 1991 | Question: 10c
Consider the following grammar for arithmetic expressions using binary operators $-$ and $/$ which are not associative $E \rightarrow E -T\mid T$ $T \rightarrow T/F\mid F$ $F \rightarrow (E) \mid id$ ($E$ is the start symbol ... given production rules and adding at most one more production rule. Convert the grammar obtained above into one that is not left recursive.
Consider the following grammar for arithmetic expressions using binary operators $-$ and $/$ which are not associative$E \rightarrow E -T\mid T$$T \rightarrow T/F\mid F$ ...
go_editor
2.7k
views
go_editor
asked
Apr 24, 2016
Compiler Design
gate1991
grammar
compiler-design
normal
descriptive
+
–
14
votes
5
answers
365
GATE CSE 1991 | Question: 10b
Consider the following grammar for arithmetic expressions using binary operators $-$ and $/$ which are not associative $E \rightarrow E -T\mid T$ $T \rightarrow T/F\mid F$ $F \rightarrow (E) \mid id$ ($E$ is the start symbol ... with redundant parentheses. Do this with minimum number of changes to the given production rules and adding at most one more production rule.
Consider the following grammar for arithmetic expressions using binary operators $-$ and $/$ which are not associative$E \rightarrow E -T\mid T$$T \rightarrow T/F\mid F$ ...
go_editor
4.1k
views
go_editor
asked
Apr 24, 2016
Compiler Design
gate1991
grammar
compiler-design
normal
descriptive
+
–
29
votes
4
answers
366
GATE CSE 2007 | Question: 79
Consider the CFG with $\left\{S, A, B\right\}$ as the non-terminal alphabet, $\{a, b\}$ as the terminal alphabet, $S$ as the start symbol and the following set of production rules: $S \rightarrow aB$ $S \rightarrow bA$ $B \rightarrow b$ ... $B \rightarrow aBB$ $S \rightarrow bAA$ For the string $aabbab$, how many derivation trees are there? $1$ $2$ $3$ $4$
Consider the CFG with $\left\{S, A, B\right\}$ as the non-terminal alphabet, $\{a, b\}$ as the terminal alphabet, $S$ as the start symbol and the following set of product...
go_editor
8.4k
views
go_editor
asked
Apr 23, 2016
Compiler Design
gatecse-2007
compiler-design
grammar
normal
+
–
2
votes
2
answers
367
S-->A|B A-->a|epsilon B-->b|epsilon Is this grammar LL(1) ??
Ashwani Kumar 2
2.2k
views
Ashwani Kumar 2
asked
Apr 18, 2016
Compiler Design
compiler-design
grammar
parsing
ll-parser
+
–
6
votes
7
answers
368
Number of conflict
Consider the grammar given below S⟶ SS | a | ∈ The number of inadequate states in the DFA of LR(1) items is (a) 1 (b) 2 (c) 3 (d) 4
Consider the grammar given belowS⟶ SS | a | ∈The number of inadequate states in the DFA of LR(1) items is(a) 1 (b) 2 (c) 3 (d) 4
srestha
7.3k
views
srestha
asked
Apr 16, 2016
Compiler Design
compiler-design
grammar
parsing
lr-parser
+
–
40
votes
1
answer
369
GATE CSE 2016 Set 2 | Question: 46
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example, int a[10] [3]; The grammars use D as the start symbol, and use six ... Which of the grammars correctly generate the declaration mentioned above? Both G1 and G2 Only G1 Only G2 Neither G1 nor G2
A student wrote two context-free grammars G1 and G2 for generating a single C-like array declaration. The dimension of the array is at least one. For example,int a[10] [3...
Akash Kanase
9.0k
views
Akash Kanase
asked
Feb 12, 2016
Compiler Design
gatecse-2016-set2
compiler-design
grammar
normal
+
–
39
votes
4
answers
370
GATE CSE 2016 Set 2 | Question: 45
Which one of the following grammars is free from left recursion? $S \rightarrow AB$ $A \rightarrow Aa \mid b$ $B \rightarrow c$ $S \rightarrow Ab \mid Bb \mid c$ $A \rightarrow Bd \mid \epsilon$ $B \rightarrow e$ $S \rightarrow Aa \mid B$ ... $ B \rightarrow d$ $S \rightarrow Aa \mid Bb \mid c$ $A \rightarrow Bd \mid \epsilon$ $B \rightarrow Ae \mid \epsilon$
Which one of the following grammars is free from left recursion?$S \rightarrow AB$$A \rightarrow Aa \mid b$$B \rightarrow c$$S \rightarrow Ab \mid Bb \mid c$$A \rightarro...
Akash Kanase
9.6k
views
Akash Kanase
asked
Feb 12, 2016
Compiler Design
gatecse-2016-set2
compiler-design
grammar
easy
+
–
2
votes
1
answer
371
When to shift and when to reduce?
In the above grammar, 1. how to determine the precedence of the operator? 2. If there is shift and reduce conflict, in who's favor to resolve? 3. Why are we not reducing E-->E+E, instead we are shifting. But incase of E-->id, we are reducing.
In the above grammar,1. how to determine the precedence of the operator?2. If there is shift and reduce conflict, in who's favor to resolve?3. Why are we not reducing E >...
Purple
653
views
Purple
asked
Jan 27, 2016
Compiler Design
compiler-design
parsing
grammar
test-series
+
–
1
votes
1
answer
372
TestBook Test Series: Compiler Design - Grammar
Sumit1311
2.2k
views
Sumit1311
asked
Jan 21, 2016
Compiler Design
testbook-test-series
compiler-design
grammar
+
–
0
votes
0
answers
373
Give LL(1) parsing table. I/P ="ab*"
Deepaank Satyam Sinh
550
views
Deepaank Satyam Sinh
asked
Jan 18, 2016
Compiler Design
compiler-design
grammar
ll-parser
+
–
4
votes
4
answers
374
TestBook Test Series: Theory Of Computation - Grammar
Number of nodes in the derivation tree when a word of length $2^{k}$ is derived from a grammar in CNF? $2^{k+1} -1$ $3.2^{k+1} - 1$ $2^{k+1} + 1$ $2^{k+1} + 1$
Number of nodes in the derivation tree when a word of length $2^{k}$ is derived from a grammar in CNF?$2^{k+1} -1$$3.2^{k+1} - 1$$2^{k+1} + 1$$2^{k+1} + 1$
Tushar Shinde
2.3k
views
Tushar Shinde
asked
Jan 18, 2016
Theory of Computation
testbook-test-series
theory-of-computation
grammar
+
–
1
votes
1
answer
375
Is the following grammar LL1
In the explanation, it is mentioned as follows Now , my question is how First(B) is a here. Can you please explain it ?
In the explanation, it is mentioned as followsNow , my question is how First(B) is a here. Can you please explain it ?
worst_engineer
552
views
worst_engineer
asked
Jan 4, 2016
Compiler Design
compiler-design
grammar
ll-parser
test-series
+
–
0
votes
1
answer
376
compiler design
I want to know which grammars are used while various phases of compiler . like we use the regular languages for verification of tokens, and this the question why i want to know it . plz verify the question and answer given is B . and plz explain all the grammars used in various phases .
I want to know which grammars are used while various phases of compiler . like we use the regular languages for verification of tokens, and this the question why i want t...
Tendua
750
views
Tendua
asked
Jan 2, 2016
Compiler Design
compiler-design
grammar
test-series
+
–
2
votes
1
answer
377
Slr(1)
S->aAb/aBc/bAd/bBe A->g B->g How many states in slr(1)
S->aAb/aBc/bAd/bBeA->gB->gHow many states in slr(1)
sourabh
637
views
sourabh
asked
Jan 1, 2016
Compiler Design
compiler-design
grammar
parsing
lr-parser
+
–
1
votes
1
answer
378
Question on deciding type of language
Given answer: A Please explain
Given answer: APlease explain
shikharV
427
views
shikharV
asked
Nov 29, 2015
Theory of Computation
theory-of-computation
grammar
+
–
1
votes
1
answer
379
Uniquely derivable strings from grammar
The given answer to the problem is 1 ('a'). But I think that strings 'a+a' & 'a*a' can also be derived from the grammar. Please correct me if I am wrong.
The given answer to the problem is 1 ('a'). But I think that strings 'a+a' & 'a*a' can also be derived from the grammar. Please correct me if I am wrong.
shikharV
434
views
shikharV
asked
Nov 29, 2015
Theory of Computation
theory-of-computation
grammar
+
–
0
votes
1
answer
380
Deciding grammar type
shikharV
478
views
shikharV
asked
Nov 19, 2015
Compiler Design
compiler-design
grammar
test-series
+
–
0
votes
1
answer
381
Deciding grammar
Given answer: D Solution to this problems says that the grammar is same as dangling else problem. Please explain me how.
Given answer: DSolution to this problems says that the grammar is same as dangling else problem. Please explain me how.
shikharV
470
views
shikharV
asked
Nov 19, 2015
Compiler Design
compiler-design
grammar
test-series
+
–
1
votes
1
answer
382
ambigious grammer
how to verify weather given grammer is ambigious or not???
how to verify weather given grammer is ambigious or not???
Hira Thakur
634
views
Hira Thakur
asked
Nov 16, 2015
Compiler Design
compiler-design
grammar
ambiguous-grammar
+
–
1
votes
1
answer
383
Is the grammar S$\rightarrow$ϵ empty?
Is the grammar S$\rightarrow$ϵ empty?
Is the grammar S$\rightarrow$ϵ empty?
monanshi
337
views
monanshi
asked
Oct 25, 2015
Theory of Computation
theory-of-computation
grammar
context-free-language
+
–
1
votes
1
answer
384
the next three questions are based on the following grammar:
E-->E/X | X X--> T-X | X*T | T T--> T + F | F F-->(E) | T my doubt is how can we decide left or right associativity and another doubt was how can we decide precedence of the operator...i got confusion can any one explain plzzz...
E >E/X | XX T-X | X*T | TT T + F | FF >(E) | Tmy doubt is how can we decide left or right associativity and another doubt was how can we decide precedence of the operat...
lohith
561
views
lohith
asked
Oct 6, 2015
Compiler Design
grammar
+
–
2
votes
1
answer
385
Identify the grammar represented by the following production rules
$S \rightarrow C C \\ C \rightarrow c C | d$
$S \rightarrow C C \\ C \rightarrow c C | d$
ram121
1.1k
views
ram121
asked
Feb 2, 2015
Compiler Design
theory-of-computation
grammar
+
–
1
votes
1
answer
386
Recognising type of language
HI, I would like someone to give clarification on how to identify a string is which grammar. I am not able to understand the concept well. So if someone explains ii, it will be highly appreciated. Please give examples. for eg: { a^n } is CFG or not. Thank you.
HI,I would like someone to give clarification on how to identify a string is which grammar. I am not able to understand the concept well. So if someone explains ii, it wi...
KingSAJ
702
views
KingSAJ
asked
Jan 29, 2015
Theory of Computation
grammar
+
–
1
votes
1
answer
387
plz answer...
Hcas Hgnis
325
views
Hcas Hgnis
asked
Dec 7, 2014
Theory of Computation
theory-of-computation
grammar
context-sensitive
+
–
36
votes
2
answers
388
GATE IT 2005 | Question: 83a
Consider the context-free grammar $E \rightarrow E + E$ $E \rightarrow (E * E)$ $E \rightarrow id$ where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\}$, and the set of nonterminals is $\{E\}$. Which of the following terminal strings has more than one parse tree ... $id + (id* (id * id))$ $(id* (id * id)) + id$ $((id * id + id) * id)$
Consider the context-free grammar$E \rightarrow E + E$$E \rightarrow (E * E)$$E \rightarrow id$where $E$ is the starting symbol, the set of terminals is $\{id, (,+,),*\...
Ishrat Jahan
6.5k
views
Ishrat Jahan
asked
Nov 3, 2014
Compiler Design
gateit-2005
compiler-design
grammar
parsing
easy
+
–
33
votes
3
answers
389
GATE IT 2007 | Question: 9
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? $L (D) ⊂ L (G)$ $L (D) ⊃ L (G)$ $L (D) = L (G)$ $L (D)$ is empty
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 o...
Ishrat Jahan
6.7k
views
Ishrat Jahan
asked
Oct 29, 2014
Compiler Design
gateit-2007
compiler-design
grammar
normal
+
–
34
votes
5
answers
390
GATE CSE 1996 | Question: 11
Let $G$ be a context-free grammar where $G=(\{S, A, B, C\}, \{a, b, d\}, P, S)$ with the productions in $P$ given below. $S \rightarrow ABAC$ $A \rightarrow aA \mid \varepsilon$ $B \rightarrow bB \mid \varepsilon$ ... $\varepsilon$ productions and no unit productions. (A unit production is of the form $x \rightarrow y$, and $x$ and $y$ are non terminals).
Let $G$ be a context-free grammar where $G=(\{S, A, B, C\}, \{a, b, d\}, P, S)$ with the productions in $P$ given below.$S \rightarrow ABAC$$A \rightarrow aA \mid \vareps...
Kathleen
7.7k
views
Kathleen
asked
Oct 9, 2014
Compiler Design
gate1996
compiler-design
grammar
normal
descriptive
+
–
Page:
« prev
1
...
8
9
10
11
12
13
14
15
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register