title: ANTLR - number surrounded by single quotes
body: <p>I want ANTLR to recognize '10' (including the single quotes) but it just gives
  me the error: missing ''' at '10'</p>
  
  <p>Here is what I have for <code>Test.g4</code>:</p>
  
  <pre><code>grammar Test;
  
  rules : number;
  number : QUOTE NUM QUOTE;
  
  NUM : [0-9]+;
  QUOTE : '\'';
  WS : [' '\t\r\n]+ -&gt; skip ;
  </code></pre>
  
  <p>Then the driver file looks like:</p>
  
  <pre><code>public class TestStuff{
      public static void main(String [] args){
      CharStream input = new ANTLRInputStream(" '10' ");
      TestLexer lexer = new TestLexer(input);
      CommonTokenStream tokens = new CommonTokenStream ( lexer );
      TestParser parser = new TestParser(tokens);
      parser.rules();
      }
  }
  </code></pre>
  
  <p>I've tried every variation I can think of and all I get is: <code>missing QUOTE at '10'</code></p>
  
  <p>I'm using version 4.1, if it matters.</p>