help-bison
[Top][All Lists]
Advanced

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

Re: Non-greedy wildcard possible? (Long)


From: Frank Heckenbach
Subject: Re: Non-greedy wildcard possible? (Long)
Date: Thu, 27 May 2004 00:54:09 +0200
User-agent: semail 20040101

Hans Aberg wrote:

> >> but you say here you have found an LL(1) way to do it. What kind of
> >> tweak would you need in the LARL(1) parser?
> >
> >(1) Only ask for one token of lookahead before deciding what to do (so
> >you don't risk asking for a token that "belongs" to a different
> >context/production) and (2) make the lexer return the first occurrence
> >of a legal token (as defined by the lookahead set).
> 
> As I said above, the Bison parser may not look at a new token at all, so
> (1) does not work directly.
> 
> But the funny thing is that a similar problem has been discussed before in
> this or the Bug-Bison list: A Frank Heckenbach <address@hidden> is
> implementing a Pascal compiler where one can throw in debugging commands at
> will. This sounds like it is similar to your problem.

I've thought about it, but I don't think it's quite similar. In
particular, I don't use it for lexer tie-ins, which would be
especially problematic with GLR (as I said in other mails in this
thread).

> I was able to work out a description how to implement this feature, though
> I will have to strain my mind to remember it (see below). The real problem
> is finding someone willing to do implement that as a feature in Bison. If
> it is right, perhaps you and Frank Heckenbach can do it?

As far as I'm concerned, at least not short time. I agree that your
solution is the cleaner one, but my current way also works with some
tricks (kind of abusing the location feature, which isn't so bad
given that I'm using locations for their real purpose as well, so
I'm just adding a bit of code to a place where it doesn't strictly
belong, but I don't have to make up a new mechanism).

When I find some time to dive deeper into the Bison internals, I
guess I'll first have to deal with GLR and locations where there
seem to be some real issues.

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)




reply via email to

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