[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Tokenizing and Parsec

Subject: Re: [Haskell-cafe] Tokenizing and Parsec
From: Uwe Hollerbach
Date: Mon, 11 Jan 2010 19:20:51 -0800
Hi, Günther, you could write functions that pattern-match on various
sequences of tokens in a list, you could for example have a look at
the file Evaluator.hs in my scheme interpreter haskeem, or you could
build up more-complex data structures entirely within parsec, and for
this I would point you at the file Parser.hs in my accounting program
umm; both are on hackage. Undoubtedly there are many more and probably
better examples, but I think these are at least a start...

regards, Uwe

On 1/11/10, Günther Schmidt <[email protected]> wrote:
> Hi all,
>
> I've used Parsec to "tokenize" data from a text file. It was actually
> quite easy, everything is correctly identified.
>
> So now I have a list/stream of self defined "Tokens" and now I'm stuck.
> Because now I need to write my own parsec-token-parsers to parse this
> token stream in a context-sensitive way.
>
> Uhm, how do I that then?
>
> Günther
>
> a Token is something like:
>
> data Token = ZE String
>             | OPS
>             | OPSShort String
>             | OPSLong String
>             | Other String
>             | ZECd String
>               deriving Show
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

<Prev in Thread] Current Thread [Next in Thread>