
20 Feb
2013
20 Feb
'13
2:27 a.m.
* Martin Drautzburg
I do know for sure, that it is possible to parse "(1+2)+3" (ghci does it just fine). But I seem to be missing a trick.
Can anyone shed some light on this?
The trick in this case is that ghci doesn't use a recursive descent parser — it uses an LR parser (generated by Happy). Another workaround is to use memoization of some sort — see e.g. GLL ("Generalized LL") parsing. Roman