On Mar 25, 2008, at 16:26 , Paul Keir wrote:
Thankyou. Yes, I'd also noticed that "only end" could result in the "end" part being taken as an identifier. The language I'm parsing actually doesn't have reserved words though; so "end" and "only" are both possible valid identifiers. I should then probably replace my use of say, reserved "only", with string "only"; whiteSpace; for clarity. Still stuck though...



But now you have an ambiguity in your language, which is exactly why the parse is failing: "only end" could be waiting for "end", or for end of file / whatever tokens might follow this clause. In the worst case, the latter might lead to a situation where an unambiguous parse is impossible.

You might want to provide a better description of the full language --- and think about how it would need to be implemented to avoid ambiguity.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university    KF8NH


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to