retagged by
10,839 views

1 Answer

Best answer
17 17 votes
if a grammar is regular then it will be Context free also [as per chomsky hierarchy] it may be or may be not ambiguous depending on grammar.

as
S->bS|aX
X->bS|aY
Y->aY|bY|^
is regular having regular expression (a+b)*aa(a+b)* and unambiguous

but grammar
S->aS|bS|aX
X->aY
Y->aY|bY|^
is also regular having regular expression (a+b)*aa(a+b)* and ambiguous.[check aaa]

But it is sure any ambiguous regular grammar can be converted into unambiguous regular grammar.
selected by
Position:
Show:

Related questions

2 2 votes
2 2 answers
4.7k
4.7k views
Shashank Chandekar asked Nov 3, 2016
4,707 views
Consider the following context-free grammarS → SS + | SS*| a for the string aa + a*. Is the grammar ambiguous ?
3 3 votes
1 answers 1 answer
1.7k
1.7k views
3 3 votes
2 answers 2 answers
4.9k
4.9k views
vivekpinto07 asked Jun 24, 2016
4,913 views
An ambiguous grammar is one that producesmore than one left most derivation for the same sentence.more than one right most derivation for the same sentence.more than one ...
0 0 votes
0 0 answers
941
941 views
h4kr asked Feb 2, 2023
941 views
Can DCFL be ambiguous?