title: ANTLR: Use First Token of next statement to terminate the preceeing one
body: <p>I am having some issues to related to statement termination for an SQL grammar. Currently it supports statement termination through semicolon ';' token. Making this as optional makes the grammar go out of memory. I want to know whether I can match the first token of next statement as a terminator for previous one without consuming it.  Here is a snippet of my parser grammar.</p>
  
  <pre><code>unit_statement
  : statement SEMICOLON!
  ;
  
   statement
  options{
  backtrack=true;
  }
  :   
       declare_statement
  |    assignment_statement
  |    sql_statement
  ;
  </code></pre>
  
  <p>Here the sql_statement rule must end with a semicolon but declare_statement should not. I am using ANTLR 3</p>