[Haskell-beginners] tokenizing a string and parsing the string

Erik de Castro Lopo mle+hs at mega-nerd.com
Wed Oct 12 10:39:10 CEST 2011


Stephen Tetley wrote:

> In combinator parsing with say Parsec, you don't tokenize the input
> the parsing - this is an instance of so called "scannerless" parsing
> (slight exaggeration for sake of simplicity).
> 
> If you needed to tokenize then parse, this is the model followed by
> Alex and Happy.

It is actually possible to use alex to split the input into tokens and
then use Parsec to parse the stream of tokens. Token parsers tend
to run a bit faster than Char parsers.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/



More information about the Beginners mailing list