0

I read one of my notes for Preparing PhD entrance Exam. Uppercase letter is non-terminals and Lowercase letter is terminal.

We have two grammar as like :

G1: S-->bSa | aSb | ba
G2: S-->XYa
    X-->a | Yb
    Y--> c | epsilon

My note's wrote:

G1 is not LL(1) Grammar but G2 is LL(1) Grammar.I know some about LL(1) but I think this example is not obvious to me. anyone could simplicit it for me? thanks.

user3661613
  • 107
  • 1
  • 9
  • 1
    You need to look more closely at the documentation for that online tool. Here's the grammar: http://smlweb.cpsc.ucalgary.ca/vital-stats.php?grammar=S+-%3E+b+S+a%0D%0A+++|+a+S+b%0D%0A+++|+b+a. (Spaces matter.) – rici Feb 11 '16 at 19:22
  • @rici Okey. I get it. thanks. Is It possible to make it clearer for me without tools? – user3661613 Feb 11 '16 at 19:24
  • @rici your grammar has wrong syntax too, Error, line 2, syntax error found at EOF The grammar is ill-formed! – user3661613 Feb 11 '16 at 19:29
  • That wasn't me. It was stack overflow's html converter, which helpfully deleted the `.` at the end of the URL. You could add the `.` back yourself, or try this: http://smlweb.cpsc.ucalgary.ca/vital-stats.php?grammar=S+-%3E+b+S+a%0D%0A+++|+a+S+b%0D%0A+++|+b+a.# – rici Feb 11 '16 at 19:31
  • Thanks @rici So my last question is How I can use Symbol Epsilon in that tools? – user3661613 Feb 11 '16 at 19:34
  • I have no idea. Probably, just put nothing. (eg. `List -> | List x.` ) – rici Feb 11 '16 at 19:41

0 Answers0