450 views
1 votes
1 votes

Consider the below given grammar:
A→AA+
A→a
Consider the below given statements:
S1: The grammar is not LL(1).
S2: The grammar is CLR(1) but not LALR(1).
S3: The grammar is ambiguous.
S4: The grammar is LALR(1) as well as CLR(1).
Choose the correct option:( Marks: 0.00 )

  1.   Only S3 is correct.
  2.    Only S1 is correct.
  3.    Only S1 and S4 are correct.
    Explanation:
    As LALR(1) table has no conflict, hence the given grammar is LALR(1). mber of states in LALR(1) is 5.
  4.   Only S1 and S2 are correct.

Answer given is option (3).

But I cant understand why S3 is incorrect.

1 Answer

0 votes
0 votes
here for the grammar

A--->AA+

A--->a only one parse tree possible that's why it is not ambiguous  grammar.

but by LR(1) it is LALR(1) and CLR(1).

Related questions

0 votes
0 votes
0 answers
1
eyeamgj asked Nov 19, 2018
262 views
0 votes
0 votes
1 answer
2
neelesh123 asked Sep 16, 2022
310 views
0 votes
0 votes
0 answers
4
Na462 asked Jan 12, 2019
663 views
A Grammer is said to be in 4-Standard form if all productions of the grammer are of type A → BCDE|a. If a grammer is in 4-Standard form how many steps in derivation of ...