[Haskell-cafe] Parsec to parse tree structures?
Stephen Tetley
stephen.tetley at gmail.com
Sun Mar 14 12:23:28 EDT 2010
On 14 March 2010 16:03, david fries <djf at gmx.ch> wrote:
[SNIP]
> Oddly enough, our customer never bothered to write a parser of their
> own. I wonder why.
Hi David
If the binary structure was previously used only with C programs its
quite common just to use casting to unpack the data into a struct -
though your example seems to suggest this wasn't being done as the
format had both big and little endian tables.
In Haskell or other modern functional languages like SML, parse trees
are generally represented as algebraic types - so there are no
pointers. If you're familiar with ANTLR from the OO world, its rather
like working with the tree definition automatically as opposed to
generating classes from the data description language.
Best wishes
Stephen
More information about the Haskell-Cafe
mailing list