At 01:38 6/05/2009, Martijn Reuvers wrote:
>Is there an (easy) way to skip a subtree in a tree grammar? For
>example in a conditional expression:
[...]
>bool_function_content[Boolean value]
> : {value != null && value.booleanValue()}? => function_content*
> ;
> catch [FailedPredicateException e] {
> BufferedTreeNodeStream commonInput = (BufferedTreeNodeStream)
>input;
> // This is what I had in mind, but how to skip
the
>current subtree?
> }
If you're using the latest (perhaps forthcoming, I've lost track)
version of ANTLR:
bool_function_content[Boolean value]
: { value != null && value.booleanValue() }? =>
function_content*
| .*
;
If you're using an older version:
skip : . | ^(. skip*) ;
bool_function_content[Boolean value]
: { value != null && value.booleanValue() }? =>
function_content*
| skip*
;
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
-~----------~----~----~----~------~----~------~--~---