[antlr-interest] "An Introduction to ANTLR" presentation slides

Terence Parr parrt at cs.usfca.edu
Wed Feb 27 12:49:56 PST 2008


On Feb 27, 2008, at 12:45 PM, Andy Tripp wrote:

> Hi Matt,
>
> Thanks. Yea, I was very hesitant to put that sentence in, as I  
> wasn't sure it was
> correct. I'd appreciate it if anyone could clarify this for me.

hi gang. A semantic predicate is a boolean expression that must be  
true for the parse to pass over it; any kind of recognizer.  A gated  
sem pred is one that forces alts to be turned on or off at run time.

A syn pred simply specifies the sytnactic context that must be true  
for the parser (or lexer or tree parser) to pass.  I.e., if you see X,  
then Y will match:

a : (X)=> Y
    | ...
    ;

preds order the alts. first one that matches wins.

Ter
>
>
> Andy
>
> Matt Benson wrote:
>>
>> “Syntactic Predicate" is just some "Symantic
>> Predicate" that happens to be in a lexer
>> rule rather than a parser rule.
>>
>>
>



More information about the antlr-interest mailing list