|Top-down deterministic parser? email@example.com (Alexander Morou) (2009-05-11)|
|Re: Top-down deterministic parser? [09-05-060] firstname.lastname@example.org (Alexander Morou) (2009-07-06)|
|Re: Top-down deterministic parser? [09-05-060] email@example.com (Curator1) (2009-07-08)|
|Re: Top-down deterministic parser? firstname.lastname@example.org (Alexander Morou) (2009-07-11)|
|RE: Top-down deterministic parser? email@example.com (Quinn Tyler Jackson) (2009-07-12)|
|Re: Top-down deterministic parser? firstname.lastname@example.org (Alexander Morou) (2009-07-13)|
|From:||Alexander Morou <email@example.com>|
|Date:||Sat, 11 Jul 2009 18:25:40 -0700 (PDT)|
|Posted-Date:||12 Jul 2009 04:41:12 EDT|
On Jul 8, 10:56 am, Curator1 <rsilv...@gmail.com> wrote:
> Before you reinvent the wheel, swing bywww.antlr.organd check out
> the excellent LL(*) construct there.
I'm looking for an example of a top-down left most derivative parser,
which has an unlimited look-ahead capacity, doesn't generate tons
of spaghetti look-ahead logic, and determines the logic inside the
resultant parser at parse-time.
From what I can tell, ANTLR encodes the look-ahead logic directly
within the recursive methods which parse the individual productions.
The code is quite hard to follow unless you're familiar with the
program, it also appears to encode follow logic via a stack (?), and
I'm guessing that this would cause quite ugly and very large code
if you didn't know what you were doing.
Presently the program I'm writing encodes the DFA of a rule as
mentioned before, I'm also encoding a generalized first DFA
which utilizes the rule DFA as a source, which will finally
be merged to declare the Follow DFA. Each subsequent phase
introduces non-determinism, so the solution is to determinize it.
I'll know more about whether this is sufficient once I'm there, but
in the mean time it probably wouldn't hurt to look at other
implementations, which deduce logic at the parser's run-time.
Return to the
Search the comp.compilers archives again.