Clinton
Clinton

Reputation: 23135

Generating "expected" style error messages from Happy

As Happy generates a state machine and runs through it upon parsing, I presume when hitting a parse error it will be able to tell what tokens it was expecting.

Is there anyway to get this information as part of printing the error? Currently I'm just printing out the location in the source of the failing token and what sort of token is failing, but it would be good to tell the user what sort of token is expected.

Can I get this sort of information and feed it into my error handling function, and if so how?

Upvotes: 0

Views: 162

Answers (0)

Related Questions