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

Matt Benson gudnabrsam at yahoo.com
Wed Feb 27 13:22:39 PST 2008


--- Terence Parr <parrt at cs.usfca.edu> wrote:

> 
> 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
>     | ...
>     ;
> 

Wait--is that example literal?  In rule a, how could
next token X predict Y?  I -had- thought I understood
the syntactic predicate.  :(

-Matt

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



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



More information about the antlr-interest mailing list