title: Ignoring whitespace (in certain parts) in Antlr4
body: <p>I am not so familiar with antlr. I am using version 4 and I have a grammar where whitespace is not important in some parts (but it might be in others, or rather its luck).</p>
  
  <p>So say we have the following grammar</p>
  
  <pre><code>grammar Foo;
  program : A* ;
  A  : ID '@' ID '(' IDList ')' ';' ;
  ID : [a-zA-Z]+ ;
  IDList : ID (',' IDList)* ;
  WS : [ \t\r\n]+ -&gt; skip ;
  </code></pre>
  
  <p>and a test input</p>
  
  <pre><code>foo@bar(X,Y);
  foo@baz  ( z,Z) ;
  </code></pre>
  
  <p>The first line is parsed correctly whereas the second one is not.
  I don't want to polute my rules with the places where whitespace is not relevant, since my actual grammar is more complicated than the toy example. In case it's not clear the part ID'@'ID should not have a whitespace. Whitespace in any other position shouldn't matter at all.</p>