Hi All,

I have a tree grammar, and am trying to just print out some information from
the tree.  This works fine for matching tokens, but not when matching the
rules.  I'm hoping someone can help explain why this is giving me a
NullPointerException and how to correct it:

Tree Grammar:

// the $i.text causes the NullPointerException, when I $i.text, it works
fine
interfaceDeclaration:  ^(i=interfaceType ID) { System.out.println($i.text +
": " + $ID.text); };

interfaceType:
   PROVIDES
 | REQUIRES;

Corresponding Parser Grammar:

interfaceDeclaration:   interfaceType ID -> ^(interfaceType ID);
interfaceType:
   'provides' -> PROVIDES
 | 'requires' -> REQUIRES;

Thanks very much,
Bill

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