title: Can SLR grammar have empty productions?
body: <p>I've wrote following grammar:</p>
  
  <pre><code>S-&gt;S ( S ) S
  S-&gt;e
  </code></pre>
  
  <p>e stands for "empty string"</p>
  
  <p>So the language this grammar recognizes includes all strings with matching left and right parenthesis, like (), (()), (()()), etc.</p>
  
  <p>And this grammar is not SLR,  here is how I construct SLR parse table:</p>
  
  <ol>
  <li><p>Augment this grammar:</p>
  
  <p>S1->S
  S->S(S)S
  S->e</p></li>
  <li><p>Then construct LR(0) automaton for it:</p>
  
  <p>I0: 
  S1->.S
  S->.S(S)S
  S->.e</p>
  
  <p>I1: 
  S1->S.
  S->S.(S)S</p></li>
  </ol>
  
  <p>...</p>
  
  <p>Please note that for I0, there is no shift or reduce action for input symbol '(', which is the first token of any string this grammar generates.</p>
  
  <p>So SLR parse table will generate error since on state I0, it doesn't know what to do when parsing string: (()).</p>
  
  <p>My question is:</p>
  
  <p>What is the culprit that makes this grammar NOT SLR? Is it the empty string production? That is:
  S->e. ?</p>
  
  <p>And in a general sense, can SLR grammar have empty productions? like, S->e in this example.
  Thanks.</p>