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

Terence Parr parrt at cs.usfca.edu
Thu Feb 28 10:07:03 PST 2008


On Feb 28, 2008, at 9:41 AM, Matt Benson wrote:

>
> --- Andy Tripp <antlr at jazillian.com> wrote:
>
>> Terence Parr wrote:
>>>
>>> A syn pred simply specifies the sytnactic context
>> that must be true
>>> for the parser (or lexer or tree parser) to pass.
>>
>> Ah, OK. So my slide is wrong.
>>
>> I guess I tend to wrongly equate "syntax" with a
>> lexer and "semantics"
>> with a parser.
>>
>> So a syntactic predicate can apply to lexer, parser,
>> or treewalker.
>> And I guess a syntactic predicate is a specific kind
>> of semantic
>> predicate. Whereas a sem pred is
>> any boolean expression that must be true to match, a
>> syn pred is one
>> that simply says
>> "look ahead and see if we'll match X".
>
> I don't think it's correct to say that a syntactic
> predicate is a type of semantic predicate.  I think
> the nomenclature here directly reflects the difference
> between syntax and semantics:  respectively, the
> legality of the communication medium vs. the
> sensicality (?) of the content.
>
> Opinions?  Yea/nay?
>
> -Matt

Syn preds are actually impl. as sem preds as Andy says.  The diff is  
as you say syntax vs semantics (at least by intention)

Ter


More information about the antlr-interest mailing list