GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
80 views
Consider the grammar given below. It is

E -> T+E | T

T -> a

a. SLR(1) but not LL(1)

b. Not an operator grammar

c. Ambiguous

d. None of these
asked in Compiler Design by Active (1.1k points)   | 80 views

2 Answers

+1 vote
Best answer

Answered by gabber:

For LL(1) :

First(T+E) ⋂⋂ First(T) = PHI

 {a }  ⋂⋂ {a} != PHI 

SO not LL(1).

 

 

 

 

answered by Veteran (13.4k points)  
0 votes
Is it a ? Its not LL 1 as first of E one will have conflict of two production s.To chk SLR1 we can construct canonical collections and then chk.
answered by Junior (607 points)  
I dont have the answer. And don't have any idea how to proceed in these questions.

For LL(1) :

First(T+E) $\bigcap_{}^{}$ First(T) = PHI

 {a }  $\bigcap_{}^{}$ {a} != PHI 

SO not LL(1).

 

 



Top Users Mar 2017
  1. rude

    4768 Points

  2. sh!va

    3054 Points

  3. Rahul Jain25

    2920 Points

  4. Kapil

    2728 Points

  5. Debashish Deka

    2602 Points

  6. 2018

    1574 Points

  7. Vignesh Sekar

    1422 Points

  8. Akriti sood

    1378 Points

  9. Bikram

    1342 Points

  10. Sanjay Sharma

    1126 Points

Monthly Topper: Rs. 500 gift card

21,517 questions
26,844 answers
61,157 comments
23,181 users