grammatica-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Grammatica-users] Lookahead feature?


From: Matti Katila
Subject: Re: [Grammatica-users] Lookahead feature?
Date: Fri, 16 Sep 2005 08:52:23 +0300 (EEST)

On Thu, 15 Sep 2005, Per Cederberg wrote:

> I like the idea of LL(*) grammars. Might be a nice project
> for a new and improved version of Grammatica. Especially
> since the ANTLR source code can be studied for good ideas
> and (probably) a quality implementation.

At least the source code it flushes out is not very clear.

And btw. I think sensitive parser handles the following grammar well.

Goal = a+ (A | B);
A    = b ;
B    = c ;

Just is it very slow thanks for the guessing structure it creates while
(actually before) parsing. It can be made faster by reusing thrown away
guessing structure partitions which should need a lot less object
creation (that's usually the bottleneck with java), and it currently has
no error escaping, i.e., if the grammar doesn't fit for given character
stream it just gives you start node null and thus doesn't help much for
the user.

Well, I might be wrong but doesn't LL(*) mean that

op1 = '<<<'
op2 = '<<'

Start = op2 | op1;

Should give op1 for given input '<<<' intstead of op2 and error message
for a last '<' token?


   -Matti





reply via email to

[Prev in Thread] Current Thread [Next in Thread]