title: ANTLR lexer error: no viable alternative at character '\n'
body: <p>I am writing an ANTLR parser that attempts to recognize GDB backtrace output from a given input string.</p>
  
  <p>I'm ignoring new lines with the following lexer grammar:</p>
  
  <pre><code>RETURN : ('\r' | '\n' | '\r\n') { skip(); };
  </code></pre>
  
  <p>However, when I run the parser against some input, ANTLR gives the following lexer error:</p>
  
  <pre><code>line 20:21 no viable alternative at character '\n'
  line 23:14 no viable alternative at character '\n'
  line 30:21 no viable alternative at character '\n'
  line 33:31 no viable alternative at character '\n'
  </code></pre>
  
  <p>I am not sure why this would ever happen, since I have already specified '\n' in the lexer.</p>
  
  <p>Does anybody has any ideas? Thanks.</p>