[antlr-interest] Help! Predicate failed messages
chain one
chainone at gmail.com
Wed Dec 3 01:49:50 PST 2008
And there are a lot of error tag in the final printed tree like this:
(TYPE_DECL <error: temperature>
Is it caused by the failure of the predicate?
2008/12/3 chain one <chainone at gmail.com>
> procedure_id
> : { isFirst }? id=IDENT { addId($id.getText(),PROCEDURE_IDENT); }
> | nid=PROCEDURE_IDENT { $nid.setType(IDENT);} ->
> ^(PROCEDURE_ID[] PROCEDURE_IDENT)
> ;
> In the first pass, isFirst is true, and in the second pass, isFirst is set
> to be false.
> When running the generated Java code, it seems every time
> the predicate fails, there will be an error message coming out like this:
>
> line 43:41 rule named_types failed predicate: { isFirst }?
>
> Could it be ignored? or there is something wrong with my grammar file?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20081203/e7ec5fc9/attachment.html
More information about the antlr-interest
mailing list