[Haskell-cafe] looking for alex+happy examples that uses location annotated tokens and location information in err msgs

Ömer Sinan Ağacan omeragacan at gmail.com
Sun Mar 9 16:45:26 UTC 2014


Ha! I finally managed to use any kinds of tokens in Happy parsers ...
Will post the code soon.

---
Ömer Sinan Ağacan
http://osa1.net


2014-03-09 13:44 GMT+02:00 Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk>:
> On 09/03/14 11:15, Ömer Sinan Ağacan wrote:
>> I think GHC uses alex+happy in very different way than explained in
>> the docs.. For example it doesn't use "posn", "monadUserState" etc.
>> wrappers as explained in alex documentations. I also can't figure out
>> how does it keep track of token locations.. I guess It's just too
>> complicated for me to understand without spending several hours.
>>
>> ---
>> Ömer Sinan Ağacan
>> http://osa1.net
>
> It doesn't use the wrappers provided, it instead uses its own data
> structures to do what the wrappers let you do and more. You can look for
> the data types defined in those modules to try and shed some light on
> how it's all done. I did mention it's not the most lightweight example ;)
>
> --
> Mateusz K.


More information about the Haskell-Cafe mailing list