[antlr-interest] Running antlr Tool V3.0 from ant (in netbeans)

Terence Parr parrt at cs.usfca.edu
Sat Jun 4 13:59:45 PDT 2005


On Jun 4, 2005, at 1:55 PM, Matthew Ford wrote:

> hi all,
>
> This is the target I am trying to run
>
>     <target name="-pre-compile" description="antlrGeneration">
>       <echo message="Generating Antlr files"/>
>     <java classname="org.antlr.Tool"
>         fork="yes" dir="C:\antlr-3.0ea1\outputs\list"
>         classpath="${javac.classpath}">
>         <arg value="C:\antlr-3.0ea1\outputs\list\list.g"/>
>     </java>
>    </target>
> where javac.classpath contains the V3.0 antlr libs jars
> The the error is shown below
> any suggestions??
> matthew

Hi Matthew,

Seems that I messed up an error message template.  The  
CANNOT_WRITE_FILE message indicates that ANTLR couldn't write  
something...must be permissions issue where you are writing output or  
the files themselves are protected...

Sorry about that...  BTW, Matthew, you'll note the improved error  
message from StringTemplate, which is handling the error messages.   
It gives you the context (which template(s)) of the error now. :)

Ter

>
> Generating Antlr files
> ANTLR Parser Generator   Early Access Version 3.0ea1 (June 1, 2005)
> 1989-2005
> internal error: C:\antlr-3.0ea1\outputs\list\list.g :
> java.util.NoSuchElementException: no such attribute: stackTrace in  
> template
> context [CANNOT_WRITE_FILE]
> org.antlr.stringtemplate.StringTemplate.rawSetAttribute 
> (StringTemplate.java:
> 620)
> org.antlr.stringtemplate.StringTemplate.setAttribute 
> (StringTemplate.java:518
> )
> org.antlr.tool.ToolMessage.toString(ToolMessage.java:71)
> java.lang.String.valueOf(String.java:2577)
> java.io.PrintStream.print(PrintStream.java:616)
> java.io.PrintStream.println(PrintStream.java:753)
> org.antlr.tool.ErrorManager$1.error(ErrorManager.java:199)
> org.antlr.tool.ErrorManager.error(ErrorManager.java:371)
> org.antlr.codegen.CodeGenerator.genRecognizer(CodeGenerator.java:308)
> org.antlr.Tool.processGrammar(Tool.java:233)
> org.antlr.Tool.process(Tool.java:173)
> org.antlr.Tool.main(Tool.java:65)
>
>



More information about the antlr-interest mailing list