By mswatcher
via explodingcoder.com
Published: Nov 16 2008 / 04:10
Some months ago I came across an anomaly in both Visual Studio 2005 and 2008 when handling exceptions in a .NET project and it threw me through a loop. I'm a fan of the ANTLR parser generator and so I was working on a project that parses some user input text. As a feature, if the parser doesn't like the input, I expect that it will throw an exception which I would catch from my code. This worked in all but one particular test case. If I provided input for which the lexer has no rules for, such as giving it a string with a semicolon when there's no rules recognizing that character, it throws a NoViableAltException to let you know it didn't know what to do with that character.
Add your comment