I don’t think that there any bugs here. The gated predicates work fine for me 
(not that that means there are therefore no bugs ;-), but that it is more 
likely there is a misuse going on somewhere in the grammar).

 

If you think that there is a bug then you should pin it down to a small piece 
of grammar so that it can be investigated. What usually happens is that the 
grammar is so ambiguous that the predicates don’t cover all the possibilities 
and your gate fails… and then what? You might need to put your gate before the 
reference to the rule rather than within the rule.

 

So, can you provide a small example of gated predicates not doing what you 
think that they should?

 

Jim

 

 

 

From: [email protected] 
[mailto:[email protected]] On Behalf Of Naveen Chawla
Sent: Monday, October 19, 2009 12:15 AM
To: David-Sarah Hopwood
Cc: [email protected]
Subject: Re: [antlr-interest] Semantic predicates

 

Yes, I alluded to that in another thread, "How to make a syntactic predicate 
exit a rule completely". I am a beginner in this area, but I think that what 
you said is true of syntactic predicates as well. I think it would make ANTLR 
more powerful, if this feature existed (of not matching a rule if all or the 
only predicate(s) fail in it), but as Jim pointed out, there could be problems 
such as bad development practices. If you do use predicates, it would seem more 
intuitive to work that way.

2009/10/17 David-Sarah Hopwood [email protected]


 

I think we have to interpret this as an ANTLR bug, not the grammar writer
being confused. Conceptually, a gated semantic predicate with a single
alternative has a clear meaning: if the predicate fails then it should be
equivalent to a rule that never matches. It would be very strange for it
to mean anything else.

--
David-Sarah Hopwood  ⚥  http://davidsarah.livejournal.com 
<http://davidsarah.livejournal.com/> 



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
-~----------~----~----~----~------~----~------~--~---

List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

Reply via email to