Recent questions tagged grammar

0 0 votes
1 1 answer
649
649 views
1 1 vote
1 1 answer
465
465 views
Show that the grammars $S \rightarrow aSb|bSa|SS|a$and $S \rightarrow aSb|bSa|a$are not equivalent.
1 1 vote
1 answers 1 answer
571
571 views
Show that the grammar $G$ =({$S$}, {$a, b$}$, S, P$), with productions $S \rightarrow SS|SSS|aSb|bSa|λ$ ,is equivalent to the grammar ...
1 1 vote
1 1 answer
1.1k
1.1k views
Are the two grammars with respective productions $S \rightarrow aSb|ab|λ$,and $S \rightarrow aAb|ab$, $A \rightarrow aAb|λ$,equivalent? A...
0 0 votes
0 0 answers
454
454 views
Find grammars for the following languages on Σ = {a}.(a) L = {w : |w| mod 3 = 0}.(b) L = {w : |w| mod 3 0}.(c) L = {w : |w| mod 3 ≠ |w| mod 2}.(d) L = {w : |w| mod 3 ≥ |...
1 1 vote
1 1 answer
671
671 views
Let $Σ$ = {$a, b$}. For each of the following languages, find a grammar that generates it.(a) $L_1$ = {$a^nb^m : n ≥ 0, m n$}.(b) $L_2$ = {$a^nb^{2n} : n ≥ 0$}.(c) $L_3$...
1 1 vote
1 1 answer
1.3k
1.3k views
What language does the grammar with these productions generate?$S \rightarrow Aa$ ,$A \rightarrow B$ ,$B \rightarrow Aa$ .
0 0 votes
2 2 answers
668
668 views
Give a simple description of the language generated by the grammar with productions$S \rightarrow aA,$$A \rightarrow bS,$$S \rightarrow λ.$
0 0 votes
0 0 answers
652
652 views
Find grammars for $Σ$ = {$a, b$} that generate the sets of(a) all strings with exactly one $a$.(b) all strings with at least one $a$.(c) all strings with no more than thr...
32 32 votes
5 answers 5 answers
26.5k
26.5k views
Consider the augmented grammar given below:$S’ \rightarrow S$$S \rightarrow \langle L \rangle \mid id$$L \rightarrow L, S \mid S$Let $I_0 = \text{CLOSURE} (\{[S’ \rightar...
0 0 votes
1 1 answer
5.0k
5.0k views
consider the grammar G: S->A|B A->a|c B->b|c where {S,A,B} are non-terminals,{a,b,c} are terminals.Does LR(1) can parse all strings that are generated by gr...
0 0 votes
1 1 answer
1.1k
1.1k views
0 0 votes
1 1 answer
924
924 views
0 0 votes
1 answers 1 answer
739
739 views
Consider the language defined as L = { $a^pb^qa^r$ | p = q or q = r} .L complement isRegularCFL but not regularCSL but not CSLDCFL
0 0 votes
0 0 answers
1.4k
1.4k views
Let L be the language of all strings on [0,1] ending with 1.Let X be the language generated by the grammar G.$S \rightarrow 0S/1A/ \epsilon $$A \rightarrow 1S/0A$Then $L ...
0 0 votes
1 1 answer
1.0k
1.0k views
0 0 votes
1 1 answer
1.3k
1.3k views
Consider the following languages:$L_1 = \{ a^{n+m} b^n a^m \mid n, m \geq 0 \}$$L_2 = \{ a^{n+m} b^{n+m} a^{n+m} \mid n, m \geq 0\}$Which of the following is correct ?$Co...
0 0 votes
1 1 answer
1.3k
1.3k views
The grammar $S \rightarrow (S) \mid SS \mid \epsilon$ is not suitable for predictive parsing because the grammar isRight recursiveLeft recursiveAmbiguousAn operator gramm...
0 0 votes
1 1 answer
1.2k
1.2k views
Consider the following statements.S1: An unambiguous left recursive grammar must be CLR(1).S2: A DCFG may or may not be LL(1).Select the correct option:1.Both S1 and S2 a...
1 1 vote
1 1 answer
1.5k
1.5k views
Grammar. S → Aa | B A → Ac | Aad | bd | epsilon . .
1 1 vote
1 1 answer
2.4k
2.4k views
Consider the following grammar G shown Below :S → abS | ScS | d | cThe number of terminals in follow set of non-terminal S is ___________________ Is “$” symbol considered...
0 0 votes
1 1 answer
1.0k
1.0k views
consider following grammerS → aSb / aSbb / aSbbb / …..is language generated by above grammer is DCFL?
0 0 votes
2 answers 2 answers
647
647 views
i thought that it is the language where both start and end symbols are same and i got 65 but the ans is 29
0 0 votes
1 1 answer
1.1k
1.1k views
0 0 votes
1 1 answer
1.2k
1.2k views
G1: S-→ aSa| bSb|eG2:S → aaS|bbS| ethe shortest length strings which does not belongs to L(g1) but belongs to L(G2) is
1 1 vote
0 0 answers
1.0k
1.0k views
An $\epsilon$ free LL(1) grammar is also a SLR(1) and hence LALR(1) and LR(1) too.Is this statement true ?
0 0 votes
0 0 answers
910
910 views
I know that for a recursively enumerable language there exists an unrestricted grammar and we have formally defined unrestricted grammar. I want to know whether for every...
0 0 votes
0 0 answers
416
416 views
Operator precedence parser even parses ambiguous grammars that are in form of operator grammars. I am inquiring about the nature of the ambiguous grammar. Could the langu...
0 0 votes
0 0 answers
1.2k
1.2k views
Which of the following problem is undecidable?A) membership problem for CFLB) membership problem for regular languageC)membership problem for cslD)membership problem for ...
0 0 votes
0 0 answers
418
418 views
A language L is a subset of Pascal with the following constructs:a). Expressions involving the operators ‘+’ and ‘<‘ onlyb). Assignment statementsc). ‘while’ statements a...