tree v text parsing (was Re: [antlr-interest] Article against
TreeWalkers)
Terence Parr
parrt at cs.usfca.edu
Fri Mar 10 10:01:32 PST 2006
On Mar 10, 2006, at 9:46 AM, Gregg Reynolds wrote:
> Andrew Bell wrote:
[snip]
Very well put. recognition is recognition.
> So I guess I must quibble with Terence on one point: I don't see the
> need for 1d or 2d etc. to enter into it. All parsing is the same. Or
> more accurately, all grammars map source sequences to target
> sequences,
> regardless of what the elements of those sequences represent.
> Usually
> the target sequences represent the interpretation of a hierarchical
> (2d)
> structural grouping of source elements. You could have an n-
> dimensional
> tree, and still write a grammar for it that doesn't differ
> fundamentally
> from a programming language grammar.
Agreed...I'm "playing to my audience" a bit. Parsing is about a
stream of symbols; how you get the stream is up to you. It's easy to
say that you are taking a 2D structure like a tree and serializing to
a node stream in 1D to help people understand how the tree parsing
works. :)
Ter
More information about the antlr-interest
mailing list