[antlr-interest] Question about building code generation target

Rick Mann rmann at latencyzero.com
Fri Jan 16 13:37:21 PST 2009


Hi. I'm trying to follow the instructions for building a code  
generation target here:

http://www.antlr.org/wiki/display/ANTLR3/How+to+build+an+ANTLR+code+generation+target

Mostly to experiment with ANTLR from a different perspective, and  
maybe to do something useful. However, one step isn't very clear:

"I recommend building the ANTLR tool 'in place'. Do not create a jar  
or compile/copy to a build directory. When you run it with 'java -cp  
path-to-src-dir ...' it will use the original *.stg file, which you'll  
edit a lot - so rebuilding the tool would be quite a PITA."

I'm not really sure what that means. I built ANTLR with "ant build",  
and when I try running as the step suggests, well, I can't get the  
classpath right, and I'm not sure how that ties into the .stg files.

$ java -cp build/classes:build/rtclasses/:lib/stringtemplate-3.2.jar  
org.antlr.Tool
Exception in thread "main" java.lang.NoClassDefFoundError: antlr/ 
TokenStream
	at org.antlr.tool.ErrorManager.setLocale(Unknown Source)
	at org.antlr.tool.ErrorManager.<clinit>(Unknown Source)
	at org.antlr.Tool.main(Unknown Source)

Would someone please clarify? Thanks!


-- 
Rick



More information about the antlr-interest mailing list