I've written my own recursive descent parser, rather than using the parser generator, as I was having trouble understanding how to roll good error recovery into the generated parser, and also so that I could tweak the performance of the parser.
It works very well, except that when I try to report an error that is due to early termination of the parsed text, the error doesn't show up in the editor view (no wavy lines). I know that the parser generator's error identification was able to identify errors due to early termination of the text and obviously reported them (I saw the wavy lines).
What I've been doing is:
formula.SyntaxErrors.Add(new SyntaxError(lexicalParser.LookAheadToken.TextRange, "..."))
but this works beautifully everywhere EXCEPT on the "EndDocument" token.
Is there a different way I need to report errors when they are identified only at the EndDocument token?
Thanks,
It works very well, except that when I try to report an error that is due to early termination of the parsed text, the error doesn't show up in the editor view (no wavy lines). I know that the parser generator's error identification was able to identify errors due to early termination of the text and obviously reported them (I saw the wavy lines).
What I've been doing is:
formula.SyntaxErrors.Add(new SyntaxError(lexicalParser.LookAheadToken.TextRange, "..."))
but this works beautifully everywhere EXCEPT on the "EndDocument" token.
Is there a different way I need to report errors when they are identified only at the EndDocument token?
Thanks,
Kelly Leahy Software Architect Milliman, USA