[antlr-interest] __Test__ Class

Klaus Martinschitz klausmartinschitz at gmail.com
Sat Jul 17 03:48:36 PDT 2010


  Hi,

does anyone know why the __Test__ class which is produced by ANTLRWorks 
does not have the correct package information for Java language and why 
the wrong Parser Constructor is called?
The port number shouldn't be there. It's no problem to add package 
information and delete port number after recompile but it is not 
necessary I think....

The code generated by ANTLRWorks for the __Test__ class looks liket this.

import java.io.*;
import org.antlr.runtime.*;
import org.antlr.runtime.debug.DebugEventSocketProxy;
import at.netcrystals.cif_1_1.parser.*;

public class __Test__ {

     public static void main(String args[]) throws Exception {
         CIF1_1Lexer lex = new CIF1_1Lexer(new 
ANTLRFileStream("MyInputFile.cif", "UTF8"));
         CommonTokenStream tokens = new CommonTokenStream(lex);

         CIF1_1Parser g = new CIF1_1Parser(tokens, *49100*, null);
         try {
             g.parse();
         } catch (RecognitionException e) {
             e.printStackTrace();
         }
     }
}

Thanks,
Klaus


More information about the antlr-interest mailing list