Sean McLaughlin | 17 May 03:21

alex + happy parser problem

Hi,

  To learn alex and happy, I'm trying to write a parser for a simple
expression language.
When I wrote my own lexer and just used happy, it was fine.
When I used the basic wrapper of alex it was also fine.  However, when
I use the posn wrapper
to get position information, I get a strange exception when the parse
error occurs at the end
of the input.

For example, parsing "1 + " yields "Internal Happy error" rather than
something like
"Parse error at line 1, column 5"

The lexer and parser are attached.  Can anyone see what I'm doing wrong?
calling

parse "1+"

yields a "Internal Happy error"
instead of a parse error as I would expect.

Thanks,

Sean

------------------
-- Lexer
------------------
(Continue reading)


Gmane