Implementing exactly Haskell's rule for indentation is incredibly hard.
In fact, no known Haskell compiler gets it right.
But if you make a slightly simpler one, it's easy. The simple one is
the one based only on indentation.
There are different ways you can do this.
For instance, you can
Bas van Gijzel wrote:
Hello everyone,
I'm doing a bachelor project focused on comparing parsers. One of the
parser libraries I'm using is Parsec (2) and I'm going to implement a
very small subset of haskell with it, with as most important feature
the off-side rule (indentation based parsing)
Hey,
Thanks for the help thusfar. These are interesting suggestions, and I think
the occam-pi compiler would help a bit as example. I'll force myself to
learn some more about the state monad, but I haven't found really good
examples except in Real World Haskell until now so I hope I'll manage.
As Lennart said, the complete offside rule as found in Haskell is
almost impossible to get right. This is mainly due to the way in which
it is formulated: in terms of error correction. This makes it very
difficult to build a parser for such rules which have error correction
built into
2009/4/28 Bas van Gijzel neneko...@gmail.com
I'm doing a bachelor project focused on comparing parsers. One of the
parser libraries I'm using is Parsec (2) and I'm going to implement a very
small subset of haskell with it, with as most important feature the off-side
rule (indentation based
Hello everyone,
I'm doing a bachelor project focused on comparing parsers. One of the parser
libraries I'm using is Parsec (2) and I'm going to implement a very small
subset of haskell with it, with as most important feature the off-side rule
(indentation based parsing) used in function
On Mon, Apr 27, 2009 at 2:41 PM, Bas van Gijzel neneko...@gmail.com wrote:
Hello everyone,
I'm doing a bachelor project focused on comparing parsers. One of the parser
libraries I'm using is Parsec (2) and I'm going to implement a very small
subset of haskell with it, with as most important
I don't have experience solving this problem, but I've read a few
horror stories from people who had state affect the results of parsing
in Parsec.
Haskell's layout rules replace indentation levels with braces and
semicolons; you could run an initial tokenizing parser that builds
tokens including