[antlr-interest] Possible bug in ANTLR 3.0 code generation ?

Manju Shekhar manjus3 at yahoo.com
Wed Aug 1 09:34:43 PDT 2007


 I have a rule defined like so in my grammar file 
  services_r returns [HashMap<String, Service> svcs] 
         @init { $svcs = new HashMap<String, Service>(); }
         :
         ^( SERVICES (s=service_r)+ ) 
         ;
  However the above generates the following snippet of java code: 
  public static class services_r_return extends 
TreeRuleReturnScope { 
         public HashMap<String; 
         public Service> svcs; 
         public StringTemplate st;
         public Object getTemplate() { return st; } 
         public String toString() 
         { return st==null?null:st.toString(); } 
 };
 
 You can see how the "HashMap<String"; line has got truncated & continues erroneously on the next line. Is this a bug or am I missing something? 
 
 Thanks
 Manju

       
---------------------------------
Pinpoint customers who are looking for what you sell. 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070801/678dd92f/attachment.html 


More information about the antlr-interest mailing list