
19 Mar
2010
19 Mar
'10
3:20 p.m.
On 03/19/10 14:24, Derek Thurn wrote:
Ah, I see. The problem is that the primitiveType parser succeeds. Is there then no generic way to use lookahead in Parsec to make choices of this nature? I appreciate that it might be possible to refactor my grammar to never require examining the next token to make a parsing decision about the current token, but I've already got an LALR(1) grammar that I'm pretty happy with...
Well, you could learn to make something in Parsec that matches your grammar, or you could use a LALR(1) parsing library. Like "Happy". (Well, Happy is actually a sort of preprocessor for Haskell. But still, doesn't using the most-fitting tool for the job seem to make sense?) -Isaac