[Haskell-cafe] Error recovery in Happy

Stephen Tetley stephen.tetley at gmail.com
Tue Mar 8 17:12:00 CET 2011


By the way - my last answer was for the second part of the question.

For error handling - Doaitse Swierstra's UU-Parsing is a combinator
parsing library with some flexibility for error recovery. For an LR
parser like Happy adding extra error handling cases to the productions
in your grammar is the main tool you have.

On 8 March 2011 15:54, Stephen Tetley <stephen.tetley at gmail.com> wrote:
> I'd join comments in with tokens so each token has a comment -
> possibly the empty string, then the parser can decide what to do with
> the comment part of token - e.g retaining it for functions, ignoring
> it for everything else.
>
> You may have to write a two-pass lexer to do this.
>



More information about the Haskell-Cafe mailing list