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

Andy Tripp antlr at jazillian.com
Fri Feb 29 14:27:28 PST 2008


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?


More information about the antlr-interest mailing list