[Haskell-beginners] parser error coordinates transformation from preprocessed to original text

Stephen Tetley stephen.tetley at gmail.com
Thu Oct 20 22:22:11 CEST 2011


On 20 October 2011 12:49, Radoslav Dorcik <radoslav.dorcik at gmail.com> wrote:

> One more question:
> Do you know If there is a lexing technology which can inter work with Parsec
> based Parser ?
> With inter work I mean that line number information is preserved across
> lexing/parsing.

Yes, you can use Alex lexers with Parsec for instance. The pattern to
do this covered in section 2.11 "Advanced: Separate scanners" of the
Parsec manual. For a full scanner this unfortunately leads to quite a
bit of boilerplate so usually I use Parsec's own tokenizing code via
Token module.

http://research.microsoft.com/en-us/um/people/daan/download/parsec/parsec.pdf



More information about the Beginners mailing list