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: Vincent Zweije
Subject: RE: Non-greedy wildcard possible? (Long)
Date: Fri, 28 May 2004 10:32:36 +0200

Frank Heckenbach wrote:

> Hans Aberg <address@hidden>:
>
> > LALR(1) may export some actions before detecting the error. Both
> > algorithms will though neither gulp up extra tokens.
>
> Are you sure? 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. 

Different things.

Hans' remark is about error detection in LALR as opposed to LR,
without an error recovery mechanism.

The section from the manual is about the error recovery mechanism,
which can be implemented for either LALR or LR.

Ciao.                                                     Vincent.




reply via email to

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