[antlr-interest] Skip (but consume) some part of a rule in a TreeParser

Joan Pujol joanpujol at gmail.com
Wed Dec 15 11:51:18 PST 2004


Hi,

I have a treeparser that does the the second pass of my semantic
checks (I'm not constructing the AST, then I have builAST=false).

My question is:

If in some part of a rule I detect an error and I don't want to parse
the rest of the rule how can I skip it?
If I do a return I skip the rule, but then the ASTs of the rule wans't consumed.

Here is the example:

I have a rule for object acces:

#(OBJECTACCES expression expression) 
In a call to object.attribute object1 is the first expression and
attribute is the second expression.
If for example the object isn't declared I don't want to parse the
second expression, but I want to consume it.


A lot of thanks in advance,

-- 
Joan Jesús Pujol Espinar


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

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





More information about the antlr-interest mailing list