[antlr-interest] "An Introduction to ANTLR" presentation slides
Loring Craymer
lgcraymer at yahoo.com
Fri Feb 29 14:50:09 PST 2008
Nope--tree walkers recognize token streams that represent trees. This got formalized in ANTLR 3 with the introduction of "UP" and "DOWN" tokens to support LL(*) tree parsing. Ter came up with this approach after I pointed out that ANTLR 2 tree walkers were restricted to predicated LL(1) processing; I consider it to be one of the significant advances in ANTLR 3.
--Loring
----- Original Message ----
> From: Andy Tripp <antlr at jazillian.com>
> To: Loring Craymer <lgcraymer at yahoo.com>
> Cc: Gerald B. Rosenberg <gbr at newtechlaw.com>; antlr-interest <antlr-interest at antlr.org>
> Sent: Friday, February 29, 2008 2:27:28 PM
> Subject: Re: [antlr-interest] "An Introduction to ANTLR" presentation slides
>
> Loring Craymer wrote:
> > Anything that can be described by a formal grammar is a language;
> Hmmm...an AST is something that can be described by a formal grammar.
> That's what a treewalker grammar does.
> So I would think Terrence disagrees with that statement.
> > formal grammars specify syntax. From the Wikipedia definition of Grammar:
> > "
> > In formal language theory, a branch of mathematics used in both computer
> science and linguistics, a grammar is a precise description of a language – that
> is, of a set of strings over some alphabet.
> >
> By saying "a set of strings over some alphabet", they're clearly using
> "grammar" here to mean only lexer and parser grammars.
>
> They also say it's a description of "a language", whereas I think
> Terrence defines grammar more generally, so that a treewalker's
> input spec can also be called a "grammar", even though it's certainly
> not describing "a language" or "a set of strings" at all. It's
> describing an AST.
>
> > Lexer grammars specify the (character) syntax through which legal symbols are
> formed; parser and tree grammars recognize sequences of tokens.
> >
> A treewalker recognize an AST, not a token stream, right?
>
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
More information about the antlr-interest
mailing list