help-bison
[Top][All Lists]
Advanced

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

Re: Finding out when a token is consumed


From: Hans Aberg
Subject: Re: Finding out when a token is consumed
Date: Sat, 10 May 2003 19:43:18 +0200

At 14:37 +0200 2003/05/10, Frank Heckenbach wrote:
>(BTW, did you see the
>attachments, or does the mailing list cut them off or something?),

Attachment comes through, as they must or else people cannot submit patches.

>> If the needed
>> lookahead increase, LALR(1)/LR(1) and such will leave you out in the cold.
>
>Indeed, if the original grammar is LALR(1) (and it definitely needs
>the one token look-ahead in various places), it would seem logical
>that with the directives thrown in it will require a look-ahead of
>two tokens.

>From this, it looks as though you have an original language, and then
somebody has required it to be modified by admitting ad hoc directive to be
inserted. Probably a good way to screw up a language. :-)

If there is a LR(2) parser on the market, you might try to see what happens
when running your grammar through that. Also LR(n) grammars can be
rewritten as LR(1), even though it is said to not be very usable for
practical use.

Perhaps you should check with those that designed the language you are
trying to implement if they know what they do. -- Are you the first fellow
in the world trying to implement it? If you, others implementors should
know how to handle the problem. If you are the first fellow in the world
trying to implement it, it is a good question why it was the language was
designed without giving consideration to the computer tools available,
which are known to be limited, but sufficient for most practical uses.

>> Can directives be followed in sequence without any other tokens?
>
>Yes, but it would be easy to collapse them into a single one at lex
>time, so that's not really a problem.

I can't come up with any better suggestions than what has already been
said, given the limited context background. You might wait to see if
somebody else wakes up and giver further inputs.

  Hans Aberg






reply via email to

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