E
Eric Mahurin
[Note: parts of this message were removed to make it a legal post.]
I think your right about the first part, but not about the second
part; Packrat has nothing to do with LL or LALR parsing.
A PEG is a Parsing Expression Grammar. Its distinguishing features
are:
- has the usual repetition (zero or more, one or more) operators,
sequence operators, alternative operators, as well as "and predicates"
and "not predicates"
- grammars are non-ambiguous because alternatives are specified as a
set of ordered choices
- lends itself to recognition by recursive descent, and maps quite
well onto the way human beings perform recognition in their own minds
A Packrat parser is a memoizing recursive-descent parser that
recognizes input based on a PEG. Its distinguishing feature is the
memoization.
At least, that's my understanding of it.
Recursive descent parsing is a form of LL parsing. See here:
http://en.wikipedia.org/wiki/LL_parser
I'd also call packrat parsing a form of LL parsing since recursive descent
is a form of LL parsing and packrat parsing is a form of recursive descent.
Maybe it would be LL(*) with memoization.
Like ANTLR my Grammar project also generates recursive descent parsers,
although mine flattens all methods except where recursion is actually
required. My Grammars are non-ambiguous (first alternative wins) like
packrat parsers.