[Top][All Lists]

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

Re: Non-greedy wildcard possible? (Long)

From: Hans Aberg
Subject: Re: Non-greedy wildcard possible? (Long)
Date: Fri, 28 May 2004 20:45:18 +0200

At 00:43 +0200 2004/05/27, Frank Heckenbach wrote:
>> LALR(1) may export some actions before detecting the error. Both
>> algorithms will though neither gulp up extra tokens.
>Are you sure?

Relative LR(1), that is. See, for example, Aho, Sethi, Ullman,
"Compilers...", p. 240.

The manual says:
>: But Bison can force the situation to fit the rule, by discarding part of
>: the semantic context and part of the input.  First it discards states
>: and objects from the stack until it gets back to a state in which the
>: @code{error} token is acceptable.  (This means that the subexpressions
>: already parsed are discarded, back to the last complete @code{stmnts}.)
>: At this point the @code{error} token can be shifted.  Then, if the old
>: look-ahead token is not acceptable to be shifted next, the parser reads
>: tokens and discards them until it finds a token which is acceptable.

This applies once an error has been detected.

  Hans Aberg

reply via email to

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