Can I tell Happy to always ignore a certain special token? I would like for it to always ignore the Empty token and I'd rather not filter the tokens before sending them to Happy, if I can help it.
Can I tell Happy to always ignore a certain special token? I would like for it to always ignore the Empty token and I'd rather not filter the tokens before sending them to Happy, if I can help it.
I think the simplest solution will be to just ignore it in your implementation of binding between lexer and parser
I mean, this is normally lexer's work, e.g. in case of comments
I am using Empty tokens in the lexer as markers for delimiting errors. I ended up doing it in such a way that I remove Empty tokens while reporting errors after the lexer is done. It sounds a big contrived, probably is, but the final solution doesn't look as bad as it sounds.
Can I tell Happy to always ignore a certain special token? I would like for it to always ignore the
Empty
token and I'd rather not filter the tokens before sending them to Happy, if I can help it.Pedro Minicz said:
I think the simplest solution will be to just ignore it in your implementation of binding between lexer and parser
I mean, this is normally lexer's work, e.g. in case of comments
I am using
Empty
tokens in the lexer as markers for delimiting errors. I ended up doing it in such a way that I removeEmpty
tokens while reporting errors after the lexer is done. It sounds a big contrived, probably is, but the final solution doesn't look as bad as it sounds.I simplified it and now I don't need
Empty
tokens anymore :smiley: