Make the selection parser exception-proof.
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 20 Jun 2012 03:47:36 +0000 (06:47 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 20 Jun 2012 17:52:55 +0000 (20:52 +0300)
commite51f0c8c22a8da5fde28be6bb3f29a114bb9e4db
tree02fced19cd2617be557da1bbabe4d9612d151fa2
parent016d8bd9c73c58c54793d20bf7100f6293fdae9b
Make the selection parser exception-proof.

The parser now catches and stores any exception that occurs during
parsing, terminates the parser cleanly, and rethrows the exception.

The functions called from the parser are still not exception-safe, and
would require quite some work to make so, because they are code written
originally in C and do a lot of dynamic memory allocation, returning
some of the allocated memory to the caller.  But the generated code
should now work with exceptions.

Fixes #880.

Change-Id: I2d534d106a6fe20d949b3f24b0d7f9980c545fcf
src/gromacs/selection/parser.cpp
src/gromacs/selection/parser.h
src/gromacs/selection/parser.y
src/gromacs/selection/parsetree.cpp
src/gromacs/selection/parsetree.h
src/gromacs/selection/scanner.h
src/gromacs/selection/scanner_internal.cpp
src/gromacs/selection/scanner_internal.h
src/gromacs/selection/selectioncollection.cpp