search
Log In

Recent questions tagged ambiguous

0 votes
1 answer
1
0 votes
0 answers
3
Consider the following CFG $G:$ $S \rightarrow SS \mid T$ $T \rightarrow aT b \mid ab$ Describe $L(G)$ and show that $G$ is ambiguous. Give an unambiguous grammar $H$ where $L(H) = L(G)$ and sketch a proof that $H$ is unambiguous.
asked Oct 12, 2019 in Theory of Computation Lakshman Patel RJIT 74 views
0 votes
0 answers
4
The following is an ambiguous grammar for expressions with $n$ binary, infix operators, at $n$ different levels of precedence: $E\rightarrow E\theta_{1}E\mid E\theta_{2}E\mid \cdot\cdot\cdot E\theta_{n}E\mid(E)\mid id$ ... of the tables for the two (ambiguous and unambiguous) grammars compare? What does that comparison tell you about the use of ambiguous expression grammars?
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 114 views
0 votes
0 answers
5
The following grammar is proposed to remove the "danglingelse ambiguity" discussed in Section $4.3.2$: $stmt\rightarrow if\: expr\: then\: stmt\mid matchedstmt$ $matchedstmt \rightarrow if \:expr \:then \:matchedstmt\: else\: stmt\mid other$ Show that this grammar is still ambiguous.
asked Aug 20, 2019 in Compiler Design Lakshman Patel RJIT 113 views
1 vote
0 answers
6
Repeat Question $4.2.1$ for each of the following grammars and strings: $S\rightarrow 0S1\mid 01$ with string $000111$. $S\rightarrow +SS\mid \ast SS\mid a$ with string $+\ast aaa$. $S\rightarrow S(S)S\mid \epsilon$ with string $(()())$ ... $bterm\:\rightarrow\:bterm\:and\:bfactor\mid bfactor$ $bfactor\:\rightarrow\:not\:bfactor\mid (bexpr)\mid true\mid false$
asked Aug 17, 2019 in Compiler Design Lakshman Patel RJIT 84 views
0 votes
1 answer
7
Consider the context-free grammar:$S\rightarrow SS + \mid SS {\ast} \mid a$and the string $aa + a{\ast}$. Give a leftmost derivation for the string. Give a rightmost derivation for the string. Give a parse tree for the string. Is the grammar ambiguous or unambiguous? Justify your answer. Describe the language generated by this grammar.
asked Aug 7, 2019 in Compiler Design Lakshman Patel RJIT 622 views
1 vote
2 answers
8
Which of the grammars are ambiguous? $S\rightarrow 0S1 \mid 01$ $S\rightarrow +SS \mid -SS \mid a$ $S\rightarrow S(S)S \mid \epsilon$ $S\rightarrow aSbS \mid bSaS \mid \epsilon$ $S\rightarrow a \mid S+S \mid SS \mid S^{\ast} \mid (S)$
asked Jul 26, 2019 in Compiler Design Lakshman Patel RJIT 298 views
2 votes
0 answers
9
0 votes
1 answer
10
0 votes
0 answers
11
0 votes
0 answers
12
0 votes
0 answers
21
Why is Regular grammar obtained from DFA always unambiguous? Why Regular grammar obtained from NFA may or may not be ambiguous?
asked Dec 7, 2018 in Theory of Computation OneZero 127 views
0 votes
1 answer
22
Consider the following grammar which of the following is/are ambiguous? (i) S → y | SxS (ii) S → E | ExS and E → y (iii) S → Sxy | y
asked Sep 11, 2018 in Theory of Computation goluabhinan 119 views
0 votes
0 answers
23
Which of the following statements is/are TRUE ? (i) The grammar S → SS | a is ambiguous (where S is the start symbol). (ii) The grammar S → 0S1 | 01S | e is ambiguous (the special symbol e represents the empty string and S is the start symbol). (iii) The grammar (where S is the ... (iii) are TRUE (D) All of (i), (ii) and (iii) are TRUE Sure shot (i) and (ii) are true i want third one in brief
asked Jun 19, 2018 in Compiler Design Nikhil Patil 406 views
0 votes
0 answers
24
Hi mates, Show that it is ambiguous grammar TIA S->aAB/bBA A->bS/a B->aS/b
asked Nov 24, 2017 in Compiler Design Sahil1994 102 views
1 vote
1 answer
25
Which of the following statements is/are TRUE? The grammar $S \rightarrow SS \mid a$ is ambiguous. (Where $S$ is the start symbol) The grammar $S \rightarrow 0S1 \mid 01S \mid \epsilon$ is ambiguous. (The special symbol $\epsilon$ represents the empty string) (Where $S$ is the start symbol) The ... are TRUE. Only (a) and (c) are TRUE. Only (b) and (c) are TRUE. All of (a), (b) and (c) are TRUE.
asked Nov 5, 2017 in Theory of Computation Arjun 1.8k views
0 votes
0 answers
26
Ques. S --> Aa/bAc/dc A --> d Isn't this grammar Ambiguous? If First(S) has more than one production giving the same first value, isn't it ambiguous?
asked Aug 22, 2017 in Compiler Design Warlock lord 209 views
2 votes
1 answer
27
As given that 1st is not regular and 2nd is regular as 1st not form AP but 2nd form.but if in 2nd we fix value of m and n same then it will work as 1st(not regular) so 2nd also should not be regular.as i know if we fix m or n value as any constant it will be AP but what if same???
asked Aug 8, 2017 in Theory of Computation learner_geek 266 views
0 votes
1 answer
29
Consider the following statements : i) An ambiguous grammar can not generate DCFL. ii) An unambiguous grammar will always generate deterministic context free language. iii) Any non-empty language admits an ambiguous grammar. iv) All regular grammars are unambiguous. Which of the above is/are TRUE? i) and iv) only ii) and iii) only iii) only ii) and iv) only
asked Jan 29, 2017 in Theory of Computation vnc 134 views
0 votes
0 answers
30
By seeing a grammar I can say it is ambiguous or not. But How can I say it is inherently ambiguous or not.?
asked Jan 22, 2017 in Theory of Computation Lucky sunda 205 views
...