0
$\begingroup$

Consider the augmented grammar G is:

S` -> S
S -> a
S -> (T)
T -> T,S
T -> S

I have tried to construct parse table. But, when I read '(' nonterminal Symbol (item 3), there is no action table elements either 'shift' or 'reduce'.

I3:
S -> (.T)
T -> .T,S
T -> .S

so I can't construe '(a,(a,a))' in this Parse table. then is it ambiguous grammar? or I wrong the answer?

$\endgroup$
  • 1
    $\begingroup$ Are you sure you aren't missing items in I3? There is a dot before S in one of the production. $\endgroup$ – AProgrammer Dec 8 '15 at 5:52
-2
$\begingroup$

I3 productions are: S->(.T) T->.T,S T->.S here you need to add closure of S S->.a S->.(T)

$\endgroup$
  • 5
    $\begingroup$ This looks a bit thin. Can you elaborate, in particular w.r.t. "why"? $\endgroup$ – Raphael Dec 8 '15 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.