title: Yacc/Bison grammar for sequence of statements
body: <p>I'm trying to parse a sequence of statements, with the following rule: statements must be separated by at least one newline, and the sequence may be padded with at least zero newlines. For example, </p>
  
  <pre><code>\n
  stmt\n
  stmt\n
  \n
  stmt
  </code></pre>
  
  <p>So far I've come up with this Yacc grammar,</p>
  
  <pre><code>stmt_list:
      %empty
  |   stmt_list stmt seps
  ;
  
  seps:
      sep
  | seps sep
  ;
  </code></pre>
  
  <p>but it doesn't match my example since my grammar expects a newline at the end.
  Is there are standard way of parsing this? Thanks.</p>