[antlr-interest] += Output Option clarification

bryce.alcock at sungard.com bryce.alcock at sungard.com
Wed Apr 4 07:01:52 PDT 2007


condExpr returns a java.lang.Integer.

In Reality, it either returns:
TRUE or FALSE
where TRUE is 'new java.lang.Integer(1);'
and FALSE is 'new java.lang.Integer(0);'

There may be a better way to do this:
Here is a summary of this portion of the system...

The basic problem is a conditional 
expression.  These conditionals (i.e. condExpr) can be 
chained together with the 'AND' key word, in which case
all condExpr must return TRUE.
These chained condExpr(s) are called a compoundExpr.
The code you are looking at 
evaluates the return of each condExpr,
and if any fail it records a failure.

SAMPLE GRAMMAR
(e.g.  (NAV+0.10*NAV>DELTA_NAV) AND (ACTION_DATE>TODAY-30)   )

I can't change the current language grammar 
because of a requirement for backwards 
compatibility.

Bryce





On Apr 3, 2007, at 9:57 AM, bryce.alcock at sungard.com wrote:

>
> I get the following error in my TreeWalker Grammar file:
>
> error(134): ExprWalker.g:43:14: rule '+=' list labels are not 
> allowed w/o output option: lids

Hi. I decided that += only makes sense to track templates or ASTs. 
If the rule returns ints, for example, should I make an int list or 
text of rule?  As it's ambig, i decided to only have it make sense 
for output option.

Ter

>
> I noticed the release notes state the following:

> Here is what i am trying to do:
>
> compoundExpr returns [int value] :
>         ^(COMPOUND (lids+=condExpr)+ )
>         {
>                              ..........
>                 };

what does condExpr return?


Ter



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070404/513a0331/attachment.html 


More information about the antlr-interest mailing list