On 8/7/2012 3:06 AM, Jonathan M Davis wrote:
It's easier to see where in the range of tokens the errors occur. A delegate is disconnected from the point where the range is being consumed, whereas if tokens are used for errors, then the function consuming the range can see exactly where in the range of tokens the error is (and potentially handle it differently based on that information).
The delegate has a context pointer giving it a reference to whatever context the code calling the Lexer needs.