retagged by
8,910 views

1 Answer

Best answer
17 votes
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

Related questions

2 votes
2 votes
2 answers
1
Shashank Chandekar asked Nov 3, 2016
4,266 views
Consider the following context-free grammarS → SS + | SS*| a for the string aa + a*. Is the grammar ambiguous ?
3 votes
3 votes
2 answers
3
vivekpinto07 asked Jun 24, 2016
3,979 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 ...
2 votes
2 votes
0 answers
4
h4kr asked Feb 2, 2023
465 views
Can DCFL be ambiguous?