OPM/opm-parser — pull request #234 by andlaus (2014-06-05 08:58:51+00:00)
Title: make Deck::hasKeyword() throw if the used parser doesn't know about the queried keyword

the problem is that the commonly used pattern

```
if (deck->hasKeyword("FOO"))
auto kw = deck->getKeyword("FOO");
```

will succeed even if FOO is completely undefined (e.g. because it
contains a typo).

this lead to the discovery of a few bugs in opm-core and opm-autodiff as well as to the discovery that the ROCKTAB definition was missing in opm-parser.

This patch is more a RFC than a "real" PR because the parser needs to be passed to the deck via a raw pointer and the user needs to make sure that the parser object lives at least as long as the deck. std::shared_ptr cannot be used here as creating one in the parse*() methods would lead to the immediate deletion of the parser as soon as the pointer goes out of scope. One way to solve this is to add a static method Parser::create() which returns a shared pointer, but that would lead to cyclic dependencies (the parser object pointing to itself via a shared_ptr) and thus to resource leaks. That said, I'd like to have such a functionality because it uncovers quite a few non-trivial bugs...