Here an example:

void UnaryExpr() #UnaryExpr(cond) :
{boolean cond=false;}
{
  (<Minus>
              {cond=true; jjtThis.processToken(token);}
             #Minus(true) | <Plus>
              {cond=true; jjtThis.processToken(token);}
             #Plus(true))* UnionExpr()
}

The "boolean cond=false" statement I know how to generate it by modifying
the action-exprProduction template.

But for the other ones (cond=true;), it's more complicated.

Lionel



                                                                                       
                                       
                      Scott Boag@LOTUS                                                 
                                       
                                               To:      Lionel 
Villard/Watson/IBM@IBMUS                                       
                      02/05/2003 06:17         cc:      "xalan-dev " 
<[EMAIL PROTECTED]>                               
                      PM                       Subject: Re: user actions(Document 
link: Lionel Villard)                       
                                                                                       
                                       



Lionel, can you give a concrete example of what you want to do?

There are ways to have a derived stylesheet to add actions.

-scott

Lionel Villard/Watson/IBM wrote on 02/05/2003 06:09:50 PM:

> I want to put user actions for some grammar units, but I don't know
> how to do it properly. Apparently it's not possible to do it during
> the transformation of the grammar into the jjtree format, I mean not
> possible *easily*. An alternative is to use a patch to apply on
> xpath-grammar.jjt. What do you think?
>
> Lionel


Reply via email to