Re: Top-down deterministic parser?

Alexander Morou <>
Sat, 11 Jul 2009 18:25:40 -0700 (PDT)

          From comp.compilers

Related articles
Top-down deterministic parser? (Alexander Morou) (2009-05-11)
Re: Top-down deterministic parser? [09-05-060] (Alexander Morou) (2009-07-06)
Re: Top-down deterministic parser? [09-05-060] (Curator1) (2009-07-08)
Re: Top-down deterministic parser? (Alexander Morou) (2009-07-11)
RE: Top-down deterministic parser? (Quinn Tyler Jackson) (2009-07-12)
Re: Top-down deterministic parser? (Alexander Morou) (2009-07-13)
| List of all articles for this month |

From: Alexander Morou <>
Newsgroups: comp.compilers
Date: Sat, 11 Jul 2009 18:25:40 -0700 (PDT)
Organization: Compilers Central
References: 09-07-007 09-07-012
Keywords: LL(1)
Posted-Date: 12 Jul 2009 04:41:12 EDT

On Jul 8, 10:56 am, Curator1 <> 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.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.