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!

6 thoughts on “MetaSL Parser uses C++ exceptions for program flow

    1. Chris Johnson

      yes I know about the antler library within a library. Are you saying antler originated from java? And that what we have is a poor port to c++?

      Like

  1. CompilerConstructor

    LL(1) is a subclass of context free grammars that can be especially parsed using recursive descent parsers. The 1 denotes the look-ahead size. ANTLR can parse LL(*), which means “endless look-ahead” by using back-tracking. And one way on implementing back-tracking are exceptions …

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s