[antlr-interest] Syntactic predicates elude me

Raphael Reitzig r_reitzi at cs.uni-kl.de
Sun Jun 29 07:40:06 PDT 2008


For backtracking is done through implicitly placed predicates for all
rules, no. 

However, I found the debug mode to be satisfying. It is not as responsive
as the interpreteter, for you have to generate and compile code, but it can
show you the produced AST as well as the parse tree. 

I understand your feeling, I had the same ;) Though I spent only days, not
weeks, confusing a bunch of fellow students as well :D

Raphael 

On Sun, 29 Jun 2008 11:31:24 +0100, "Artemus Ward"
<coddbotherer at googlemail.com> wrote:
> 2008/6/28 Raphael Reitzig <r_reitzi at cs.uni-kl.de>:
>> Hi!
>>
>> I had a similar problem. ANTLRWorks' interpreter cannot evaluate
>> predicates. Try debugging it. The Debugger actually works with the
> created
>> and compiled classes and thus is able to work with predicates.
> 
> Hell.  I have wasted two weeks because I felt it was arrogant to think
> the problem wasn't just my own lack of understanding. I am not happy.
> What about backtracking?  Does ANTLRWorks support that?
> 
> Art
> 
>> On Sat, 28 Jun 2008 21:43:30 +0100, "Artemus Ward"
>> <coddbotherer at googlemail.com> wrote:
>>> I am a newbie and for a couple of weeks I've been banging my head on
>>> something simple that I'm just not getting.
>>>
>>> I just cannot figure out how to write a syntactic predicate.  I'm
>>> testing in ANTLRWorks and I always get an error reported like:
>>> FailedPredicateException(rulename,{synpredN}?).
>>>
>>> What puzzles me is that the predicate that is reported is always the
>>> one I expected would succeed based on the input I provide.  If I
>>> provide an input that should match (say) the third predicate it will
>>> report the third predicate as the error.
>>>
>>> I'm using ANTLR 3.0.1 and ANTLRWorks 1.1.7.
>>>
>>> Art
>>
>>



More information about the antlr-interest mailing list