GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
73 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 (1k points)   | 73 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.3k 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 Feb 2017
  1. Arjun

    5224 Points

  2. Bikram

    4230 Points

  3. Habibkhan

    3748 Points

  4. Aboveallplayer

    2986 Points

  5. Debashish Deka

    2356 Points

  6. sriv_shubham

    2298 Points

  7. Smriti012

    2142 Points

  8. Arnabi

    2008 Points

  9. sh!va

    1654 Points

  10. mcjoshi

    1628 Points

Monthly Topper: Rs. 500 gift card

20,832 questions
25,989 answers
59,623 comments
22,046 users