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

Nev antlr at zavalon.com
Fri Feb 29 13:46:59 PST 2008


Sorry but I have to agree with Terrence.
He put it very elegantly
structure == syntax,
meaning == semantics

the
result = count * 2;

Is valid syntax in a number of languages. It can be stored in a tree
structure. And would still be valid structure or syntax as from above -
structure == syntax.

But it may NOT be semantically correct. It would depend on the type of the
two variables etc.

Antlr does not check the semantics - that is left to actions eg you need to
maintain a symbol table to check the type of the variables.

nev

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Andy Tripp
> Sent: Saturday, 1 March 2008 8:08 AM
> To: Gerald B. Rosenberg
> Cc: antlr-interest
> Subject: Re: [antlr-interest] "An Introduction to ANTLR" presentation
> slides
> 
> Gerald B. Rosenberg wrote:
> >
> > Even if they were represented as the same sub-tree, whether it could
> > be unrolled or further transformed in some other way could be
> > dependent on surrounding syntax.  Or, for that matter, dependent on
> > the internal syntax of the X sub-tree.
> 
> >
> > So, it would be entirely valid for a syntactic predicate to consider
> > the surrounding or internal syntax of a sub-tree in deciding on a
> > "correct" production, even in a treewalker.
> Ah... I see...you're casually referring to AST structure as "syntax" to
> give Terrence something convenient to site
> and show that he's not the only one who uses the word "syntax" that way ;)
> 
> Sorry, that doesn't count ;)
> No retroactive immunity allowed.
> You're just confusing people by referring to AST structure as
> "surrounding syntax" and "internal syntax".
> Better to stick with the tried-and-true "tree structure" nomenclature.
> 
> Andy


More information about the antlr-interest mailing list