[antlr-interest] @SuppressWarnings("all")

Terence Parr parrt at cs.usfca.edu
Tue Sep 19 17:30:47 PDT 2006


On Sep 19, 2006, at 11:43 AM, Greg Clemenson wrote:

> Ter,
>
> Thank you for your reply to my question.  I was not quite able to  
> make things work by creating a GregJava.stg.

I think you would need to make sure that GregJava.stg was in a  
directory with the same root name underneath the templates directory,  
mimicking the Java target.

>   However, I did get this approach to work via just editing  
> Java.stg and rebuilding Antlr.

Note there is no point in rebuilding ANTLR as it dynamically loads  
those templates.. :)

>   This change is OK for me since i am exclusively doing Java 5  
> development.  The part of Java.stg changed now reads like this:
>
> <@imports>
> import org.antlr.runtime.*;
> <if(TREE_PARSER)>
> import org.antlr.runtime.tree.*;
> <endif>
> import java.util.Stack;
> import java.util.List;
> import java.util.ArrayList;
> <if(backtracking)>
> import java.util.Map;
> import java.util.HashMap;
> <endif>
> @SuppressWarnings({"unused", "cast"})
> <@end>
>
> I suppressed a more specific set of warnings, namely "unused" and  
> "cast".

Hooray.

Ter


More information about the antlr-interest mailing list