title: Parsing ambiguous input with Antlr
body: <p>I have been trying for a few days to parse some text that consists of text and numbers (I've called it a sentence in my grammar). </p>
  
  <pre><code>    sentence options {
            greedy=false;
       } 
           : (ANY_WORD | INT)+;
  </code></pre>
  
  <p>I have a rule that needs to parse a sentence that finishes with an INT</p>
  
  <pre><code>    sentence_with_int 
          : sentence INT;
  </code></pre>
  
  <p>So if I had some input that was " the  number of size 14 shoes bought was 3 " then sentence_with_int would be matched not just sentence. I'm sure there is a better way to do this but I'm just learning the tool. </p>
  
  <p>Thanks, Richard </p>