Hi,

I have a rewrite rule like this:

rule: FOO (BAR baz)? BAM -> ^(FOO (^BAR baz BAM)? BAM);

For more generality, I'd like to include the BAM twice in the tree.
Believe me, that actually makes sense when the names are not BAM and
BAZ ;-)

The problem is that ANTLR generates this code:

if ( stream_BAR.hasNext()||stream_baz.hasNext()||stream_BAM.hasNext() ) {
  // construct optional tree part, causes EmptyRewriteStream exception
if BAR doesn't exist
}

Is there any particular reason why that is a disjunction and not a
conjunction? I.e., for the tree construction part not to cause errors,
you need all of the nodes present, not one of them.

Thanks,
Martin

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