[antlr-interest] reference tokens{} in other files

Michael LeBlanc Mike at LeBlanc-Engineering.com
Fri Nov 2 02:49:42 PDT 2007


On Nov 1, 2007, at 5:51 PM, John Ridgway wrote:

> I haven't tried it, but shouldn't
>   import static fooParser.*;
> work?

$ javac -Xlint:unchecked -cp .:/Applications/.../antlrworks.jar  
Test.java
Test.java:6: package fooParser does not exist
import fooParser.*;
^
Test.java:22: cannot find symbol
symbol  : variable DUMMY
location: class Test
             case DUMMY:
                  ^

$ ls -l fooParser*
-rw-r--r--   1 mike  staff    2804 Nov  1 16:42 fooParser$DFA14.class
...
-rw-r--r--   1 mike  staff   56905 Nov  1 16:42 fooParser.class
-rw-r--r--   1 mike  staff  163463 Nov  1 16:42 fooParser.java

With "import static fooParser.*;", the first error changes to

Test.java:6: cannot find symbol
symbol: class fooParser
import static fooParser.*;
               ^



More information about the antlr-interest mailing list