title: ANTLR4 using HIDDEN channel causes errors while using skip does not
body: <p>In my grammar I use:</p>
  
  <pre><code>WS: [ \t\r\n]+ -&gt; skip;
  </code></pre>
  
  <p>when I change this to use HIDDEN channel:</p>
  
  <pre><code>WS: [ \t\r\n]+ -&gt; channel(HIDDEN);
  </code></pre>
  
  <p>I receive errors (extraneous input ' '...) I did not receive while using 'skip'.
  I thought, that skipping and sending to a channel does not differ if it comes to a content passed to a parser. </p>
  
  <p>Below you can find a code excerpt in which the parser is executed:</p>
  
  <pre><code>    CharStream charStream = new ANTLRInputStream(formulaString);
      FormulaLexer lexer = new FormulaLexer(charStream);
      BufferedTokenStream tokens = new BufferedTokenStream(lexer);
      FormulaParser parser = new FormulaParser(tokens);
      ParseTree tree = parser.startRule();
  
      StartRuleVisitor startRuleVisitor = new StartRuleVisitor();
      startRuleVisitor.visit(tree);
  
      VariableVisitor variableVisitor = new VariableVisitor(tokens);
      variableVisitor.visit(tree);
  </code></pre>
  
  <p>And a grammar itself:</p>
  
  <pre><code>grammar Formula;
  
  
  startRule
     : variable RELATION_OPERATOR integer
     ;
  
  integer
     : DIGIT+
     ;
  
  identifier
     : (LETTER | DIGIT) ( DIGIT | LETTER | '_' | '.')+
     ;
  
  tableId
     : 'T_' (identifier | WILDCARD)
     ;
  
  rowId
     : 'R_' (identifier | WILDCARD)
     ;
  
  columnId
     : 'C_' (identifier | WILDCARD)
     ;
  
  sheetId
     : 'S_' (identifier | WILDCARD)
     ;
  
  variable
     : L_CURLY_BRACKET cellIdComponent (COMMA cellIdComponent)+ R_CURLY_BRACKET
     ;
  
  cellIdComponent
     : tableId | rowId | columnId | sheetId
     ;
  
  COMMA
     : ','
     ;
  
  RELATION_OPERATOR
     : EQ
     ;
  
  WILDCARD
     : 'NNN'
     ;
  
  L_CURLY_BRACKET
     : '{'
     ;
  
  R_CURLY_BRACKET
     : '}'
     ;
  
  
  LETTER
     : ('a' .. 'z') | ('A' .. 'Z')
     ;
  
  DIGIT
     : ('0' .. '9')
     ;
  
  
  EQ
     : '='
     | 'EQ' | 'eq'
     ;
  
  
  WS
     : [ \t\r\n]+ -&gt; channel(HIDDEN)
     ;
  </code></pre>
  
  <p>String I try to parse:</p>
  
  <pre><code>{T_C 00.01, R_010,   C_010} = 1
  </code></pre>
  
  <p>Output I get with channel(HIDDEN) used:</p>
  
  <pre><code>line 1:4 extraneous input ' ' expecting {'_', '.', LETTER, DIGIT}
  line 1:11 extraneous input ' ' expecting {'T_', 'R_', 'C_', 'S_'}
  line 1:18 extraneous input '   ' expecting {'T_', 'R_', 'C_', 'S_'}
  line 1:27 extraneous input ' ' expecting RELATION_OPERATOR
  line 1:29 extraneous input ' ' expecting DIGIT
  </code></pre>
  
  <p>But if I change channel(HIDDEN) to 'skip' there are no errors.</p>
  
  <p>What is more, I have observed that for more complex grammar than this i get 'no viable alternative at input...' if I use channel(HIDDEN) and once again the error disappear for the 'skip'.</p>
  
  <p>Do you know what may be the cause of it?</p>