title: ANTLR 4 how to parse comments
body: <p>I am parsing a SQL like language and I am having trouble parsing comments.
  The idea is to ignore them.</p>
  
  <p>I have these rules:</p>
  
  <pre><code>NEWLINE: '\r'? '\n' -&gt; skip 
  WS  :    [ \t]+ -&gt; skip 
  </code></pre>
  
  <p>How can I ignore:</p>
  
  <ul>
  <li>Everything that is between '--'or '#' and the next '\n'</li>
  <li>Everything between '/<em>' and '</em>/'  (slash + asterisk untill asterix + slash - the asterisk somehow gone).</li>
  </ul>
  
  <p>I tried something like this before the WS and the NEWLINW:</p>
  
  <pre><code>COMMENT1 : ('--'|'#') ~'\n'* -&gt; skip;
  </code></pre>
  
  <p>didn't work - I got: </p>
  
  <pre><code>line 1:115 missing ';' at '&lt;EOF&gt;'
  </code></pre>
  
  <p>probably something because it didn't go with my main rule:
  parse : (statments (';')+)* EOF;</p>
  
  <p>Can anyone help me?</p>
  
  <p>Regards idob</p>