MetaSL Parser uses C++ exceptions for program flow

Beware to whoever integrates the mental images MetaSL parser into their application. For program logic, the parser makes heavy use of C++ exceptions to handle program flow. So instead of an if statement switching with if/then/else, it throws exceptions:

First-chance exception at 0x000007fefdfaaa7d (KernelBase.dll) in NNNN.exe: Microsoft C++ exception: antlr::MismatchedTokenException at memory location 0x4d69d458..
First-chance exception at 0x000007fefdfaaa7d (KernelBase.dll) in NNNN.exe: Microsoft C++ exception: antlr::NoViableAltException at memory location 0x4d69d270..
First-chance exception at 0x000007fefdfaaa7d (KernelBase.dll) in NNNN.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefdfaaa7d (KernelBase.dll) in NNNN.exe: Microsoft C++ exception: antlr::NoViableAltException at memory location 0x4d69d270..

I know… I know: Terrible!!

So the fallout for us poor souls who have to integrate this garbage is 10’s of thousands of C++ Exceptions, not to mention a terrible performance hit just for our application to use this stuff.  Yuck!

Advertisements