[antlr-interest] I get a note when i compile my grammer

Austin Hastings Austin_Hastings at Yahoo.com
Wed Nov 14 16:28:54 PST 2007


Atif,

Your [unchecked] warnings are coming because you are not using generic 
signatures on your collections. You need to declare the type signature 
you will be using for the ArrayLists, using something like "new 
ArrayList<String>();".

Your [serial] warning is complaining because you have not provided a 
unique ID method for a class that extends a serializable parent class. 
Serialization wants each class to have its own unique id.

None of these are caused by or related to ANTLR. You can find answers to 
these on the java tutorials pages on sun.com. Try googling for 
+site:sun.com +java and either serial or unchecked.

=Austin


atif azad wrote:
> Dear All
>
> When I compile my grammer and then use the command
>
> Javac *.java to compile the java classes I get the following message
>
>
> javac  *.java
>
> Note: Sparc2Parser.java uses unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
>
> Then I run with Xlink option to get the following details
>
> javac -Xlint *.java
>
> Sparc2Parser.java:49: warning: [unchecked] unchecked call to put(K,V) 
> as a member of the raw type java.util.HashMap
>        super.put(attrName, value);
>                 ^
> Sparc2Parser.java:53: warning: [unchecked] unchecked call to put(K,V) 
> as a member of the raw type java.util.HashMap
>        super.put(attrName, new Integer(value));
>                 ^
> Sparc2Parser.java:47: warning: [serial] serializable class 
> Sparc2Parser.STAttrMap has no definition of serialVersionUID
>    public static class STAttrMap extends HashMap {
>                  ^
> Sparc2Parser.java:77: warning: [unchecked] unchecked call to push(E) 
> as a member of the raw type java.util.Stack
>        program_stack.push(new program_scope());
>
>
>
>
> I think this is my portion of the grammer which causes this
>
>
> grammar Sparc2;
> options {
>
> output=template;
>
> }
>
> @header {
> import org.antlr.stringtemplate.*;
> }
>
> program
>
> scope {
>  List globals;
>  List functions;
> }
> @init {
>  $program::globals = new ArrayList();
>  $program::functions = new ArrayList();
> }
>    : instructions+
>
>
> -> program(globals={$program::globals},functions={$program::functions})
>    ;
>
>
>
> Can any body please help in this regard how to remove this.
>
> Kind Regards
>
> Azad , Atif
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's 
> FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>



More information about the antlr-interest mailing list