title: ANTLR: "missing attribute access on rule scope" problem
body: <p>I am trying to build an ANTLR grammar that parses tagged sentences such as:</p>
  
  <pre><code>DT The NP cat VB ate DT a NP rat
  </code></pre>
  
  <p>and have the grammar:</p>
  
  <pre><code>fragment TOKEN  :   (('A'..'Z') | ('a'..'z'))+;
  fragment WS :   (' ' | '\t')+;
  WSX :   WS;
  DTTOK   :   ('DT' WS TOKEN);
  NPTOK   :   ('NP' WS TOKEN);
  nounPhrase:  (DTTOK WSX NPTOK);
  chunker : nounPhrase {System.out.println("chunk found "+"("+$nounPhrase+")");};
  </code></pre>
  
  <p>The grammar generator generates the "<code>missing attribute access on rule scope: nounPhrase</code>" in the last line.</p>
  
  <p>[I am still new to ANTLR and although some grammars work it's still trial and error. I also frequently get an "OutOfMemory" error when running grammars as small as this - any help welcome.]</p>
  
  <p>I am using ANTLRWorks 1.3 to generate the code and am running under Java 1.6.</p>