Hello.

I am trying to make a not too complicated translator using ANTLR, the
aproach I'm taking makes use of Multimaps in the grammar file.
However I'm having some trouble initializing them, here's how I do it:

grammar FSM;

options {output=template;}

@header {
import org.antlr.stringtemplate.*;
import org.antlr.misc.MultiMap;

}
model
scope{
   Multimap <Integer, String> CMap;
   Multimap <Integer, String> UMap;
}

@init {
  $model::UMap = HashMultimap.create();
  $model::CMap = HashMultimap.create();

}

 : RULES
  -> RewriteRule
;

...

When I try to debug that in ANTLWorks, or try to build project in NetBeans I
get the following error:

error(104):  cannot find an attribute name in attribute declaration
java.lang.StringIndexOutOfBoundsException: String index out of range: -1

Which seems to be a problem with the angled brackets or something. Because
If I comment out /*Multimap <Integer, String> CMap*/ the error goes away.
What would be a correct way to initialize a Multimap visible to that scope?

For your time, thank you.

 - APJ

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to