[antlr-interest] What's wrong with org.antlr.Tool.main(String[] args)?

Sameh W. Zaky sameh.wz at gmail.com
Tue May 25 12:12:36 PDT 2010


Hi all,

Using ANTLR v3.2, in the runtime I generate the lexer and parser Java files
using this code:
org.antlr.Tool.main(new String[]{projectPath+"GrammarFile.g"});

The problem is that, after this line of code, no other code gets executed,
for example, in this piece of code:
System.out.println("Before");
org.antlr.Tool.main(new String[]{projectPath+"GrammarFile.g"});
System.out.println("After");

Output: "Before" will be printed, the lexer and parser will be generated,
BUT "After" will NOT be printed..
Using Java Graphical User Interface, whenever I call this line of code in my
application, it indeed creates the lexer and parser but then the application
freezes..

Any idea why this happens? Or how I can avoid it?

-- 
Sameh W. Zaky


More information about the antlr-interest mailing list