[antlr-interest] Protected values and returning values

johnclarke72 johnclarke at hotmail.com
Wed Jun 19 14:50:42 PDT 2002


In my grammar I define a rule called STARTTAGS.  This is defined as :

STARTTAG 
{
    Hashtable tagAttributes = null;
}
  : "<"! TEXTDATA (WS (tagAttributes = ATTRIBUTES)?)?
  ">"!;

The definition for ATTRIBUTES is :

// Definition for Attributes
protected ATTRIBUTES returns [Hashtable a = new Hashtable()]
: ( ATTRIBUTE[a] (WS ATTRIBUTE[a])* )
;

In my parser I can get access to the name of the tag (defined by 
TEXTDATA).  But how can I can get access to the attributes listed in 
tagAttributes ?

I would be grateful for all help offered regarding this.

Thanks

John


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list