The Gateway to Computer Science Excellence
+1 vote
182 views

Why ε  is not shown in First(S). First(s) does contain ε . And please help me figure out which grammar is this?

According to me it is NOT LL(1) (since it is left factored), NOT LR(0) (Since the Item 0 has a R-R conflict), NOT SLR(1) (The item 0 has a RR conflict since Follow(X) = Follow(Y) = {a,b}

correct me If i'm wrong

in Compiler Design by (113 points)
edited by | 182 views
0

First(s) does contain ε

No, it can not contain it... and it should be LL(1)

0
it will be LL(1) and i dont  think it is left factored
0
It is both LL(1) and LR(1)

I think you are misunderstanding LR(1) with SLR(1)

By LR(1) option mean to be CLR(1)
0
since it is LL(1) it will be LALR(1) and hence it will be CLR(1)
0
@adarsh_1997 are you sure about your statement

Because every LL(1) is not LALR(1)

But every LL(1) is LR(1).

Correct me if I am wrong!
0
and epsilon free (LL(1)) grammar will be slr(1) hence lalr(1) hence clr(1)

key is (epsilon free)
0
@adarsh_1997 can you please explain what do you mean by epsilon free!
0

@Shaik Masthan

Thank you. I looked at it. Since S is never generating EPSILON First(S) can NOT have EPSILON.

And the grammar is LL1. Since it is LL1 it is also LR1.

It is NOT necessary for a LL1 grammar to be LALR1.

 

0

@Hopealways 

It is NOT necessary for a LL(1) grammar to be LALR(1).

Yes 

+1
Yes bro u r right if a grammer is LL(1) it doesnt mean it will be LALR(1) it will CLR(1)
+1

@Shivam Kasat yes bro u r right 

Please log in or register to answer this question.

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,650 questions
56,228 answers
194,225 comments
95,678 users