GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
87 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)   | 87 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.5k 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 Apr 2017
  1. akash.dinkar12

    3752 Points

  2. Divya Bharti

    2618 Points

  3. Deepthi_ts

    2162 Points

  4. rude

    1966 Points

  5. Tesla!

    1768 Points

  6. Sanjay Sharma

    1646 Points

  7. Debashish Deka

    1614 Points

  8. Shubham Sharma 2

    1610 Points

  9. Prashant.

    1554 Points

  10. Kapil

    1528 Points

Monthly Topper: Rs. 500 gift card

22,100 questions
28,082 answers
63,368 comments
24,203 users