[antlr-interest] TreeParser development: How to build an effective "dont care" rule?

luciano mantuaneli mantu_lists at yahoo.com.br
Mon Sep 18 13:58:08 PDT 2006


  Indeed, you're right, Bryan! After read your post, I checked my grammar with more attention and i faound an optional value that i treated in a wrong way.
  Thank you very much!

Bryan Ewbank <ewbank at gmail.com> escreveu:
  The rule looks correct; however, I suspect that you have problems
where the rule is used. There must be a rule somewhere else that has
one too many "dontCare" matches in its production.

Perhaps something like a declaration that has an optional initial value?

To help you debug, use the "-trace" option and discover the rule being
processed when the error is detected.

- Bryan

On 9/15/06, luciano mantuaneli wrote:
> Hi!
> I'm developing a TreeParser, and I wish to know how to create an rule that
> do nothing on matching any token.
> I tried to do this with this rule:
>
> dontCare:
> .
> ;
>
> But, this rule doesn't seems to work properly. Depending on how my
> TreeParser grammar is written, I get the following error message:
>
> : Mismatched Token: expecting any AST node
>
> My questions:
> 1)My dontCare rule is proper for the task mentioned above?
> 2)Do you know how this error message is related with my dontCare rule?

    
---------------------------------
  

 		
---------------------------------
 Novidade no Yahoo! Mail: receba alertas de novas mensagens no seu celular. Registre seu aparelho agora!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20060918/15bba4ab/attachment.html 


More information about the antlr-interest mailing list