Commit Graph

59 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
f0ae5db131 opm-parser adoption of Deck automatic ownership
Since the Deck* family of classes have changed their interfaces to no
longer use shared_ptr, a lot of code broke. This patch fixes all
problems in tests, other signatures and accesses to now use the new Deck
interfaces.
2016-02-18 13:27:24 +01:00
Jørgen Kvalsvik
4b98943665 Replaces unecessary header includes with fwd decls
Every header is self-contained and includes only what it must to
function, relying on users include what they need in source files,
adopting a pay-what-you-use model (in particular for internal
dependencies).
2016-01-26 13:23:22 +01:00
Jørgen Kvalsvik
04900a4bb6 ParserKeywords.hpp -> ParserKeywordsX.hpp
To reduce compiler stress and be more explicit w.r.t. dependencies, all
files now includes only the keywords they need, instead of the
collection of all files.
2016-01-21 09:25:58 +01:00
Joakim Hove
51e3aa82cc Update include path 2015-10-06 11:30:43 +02:00
Joakim Hove
c1e94f788f ParseMode::PARSE_EXTRA_DATA
Extra elements in the input record are handled with
ParseMode::handleError() with the new error mode PARSE_EXTRA_DATA.
2015-09-28 13:43:22 +02:00
Kjell W. Kongsvik
dc0cc45e89 Allowed parser keywords without items 2015-09-15 16:43:01 +02:00
Atgeirr Flø Rasmussen
3845e1c239 Suppress warnings from boost.
Done by using the disable_warnings.h and reenable_warnings.h headers.
In some cases also a little reordering of includes, to put all boost
includes in the warning-suppressed part.
2015-08-10 13:06:50 +02:00
Joakim Hove
679ef35d0b Updated code to use compiled defaults 2015-06-08 11:29:21 +02:00
Joakim Hove
1161e1098c Rewritten code generation:
With this commit the generation of built in keywords is completely
changed. The most important changes include:

  1) We have autogenerated a class for each keyword in the new
     ParserKeywords { ... } namespace.

  2) The autogenerated classes derive from ParserKeyword, and the
     default constructor will build of a fully initialized
     ParserKeyword instance, i.e. the keyword used to parse the EQUIL
     keyword can be instantiated as simple as:

         ParserKeywords::EQUIL kw;

  3) The generated keywords have built in static constants for keyword
     and item names, and item default values. That way it should be
     possible for the compiler to catch trivial errors like trying to
     access the keyword "PoRO"; also the the access to default values
     means that properties can be initialized without actually
     insantiating a DeckKeyword.

  4) Two new classes Generator/KeywordLoader and
     Generator/KeywordGenerator have been created, with the help of
     these classes the keyword generation code is significantly
     simplified.
2015-06-08 11:29:18 +02:00
Joakim Hove
3e77c88f31 ParserKeyword constructor with one argument works. 2015-06-05 14:26:36 +02:00
Joakim Hove
f793ab09d1 Added basic support for records: in configuration. 2015-02-26 21:54:06 +01:00
Joakim Hove
62e7f2a3aa Moved item management from Keyword to record.
Withe this commit the ParserRecord objects are created as needed by the
ParserKeyword; i.e a parserkeyword can in principle be totally without a
record.
2015-02-26 19:55:06 +01:00
Joakim Hove
875f591a1b Changed ParserKeyword to use vector of records 2015-02-20 00:21:32 +01:00
chflo
3298fe4337 OPM-145: Removed tests for ACTION 2015-01-14 10:14:06 +01:00
Andreas Lauser
ea38a25af4 remove all trailing white space
this is just the result of

```
find -iname "*.[ch]pp" | xargs sed -i "s/ *$//"
find opm/parser/share/keywords -type f |  xargs sed -i "s/ *$//"
```

so if it causes conflicts with other patches, the others should get
priority. The rationale behind this patch is that some people tell
their editor to remove white space which leads to larger than
necessary patches...
2014-12-08 16:34:28 +01:00
Andreas Lauser
ead7e0a8c9 make the parser case-insensitive
i.e., make keywords ALL_UPPERCASE before using them because Eclipse
seems to be case-insensitive (although this is one of its undocumented
features...)
2014-11-07 14:24:12 +01:00
Andreas Lauser
a4f55f5f8d JSON keyword definitions: make the "sections" item mandatory
the empty list can be used which means that the keyword may occur in
any section. (which is useful for e.g. section delimiters.)
2014-10-13 16:06:09 +02:00
Joakim Hove
d6fa1449af Default: Changed size_type: ALL -> SINGLE 2014-09-03 10:37:01 +02:00
Andreas Lauser
fee11596f8 allow underscores in deck names and disallow sharps
underscores are used by a few of the summary specifier keywords
(e.g. BPR_X), but after closer inspection '#' symbols are not.
2014-06-29 14:32:06 +02:00
Andreas Lauser
96904b00f4 allow keywords to match regular expressions as their deck name
the RE used is specified via the "deck_name_regex" in the JSON file of
the respective keyword. A deck name is assumed to match a given parser
internal keyword if the deck name is valid and if it is either in the
list specified by the "deck_names" entry or if it matches the regular
expression.

This functionality is useful to implement the well probes for the
tracers as well as replacing the current "wild card keyword"
implementation which only allows a star as a suffix.
2014-06-29 14:32:06 +02:00
Andreas Lauser
5f949c11c3 add support for parser keywords specifying to multiple deck keywords
Say hello to the complete set of well, region, field and group output
specifiers soon...
2014-06-13 13:17:03 +02:00
Andreas Lauser
d820a4d435 change construction of ParserKeyword objects to the factory paradigm
this makes it more explicit what the object is supposed to represent.
2014-06-11 15:08:58 +02:00
Atle Haugan
ed17058ad3 Renamed FLOAT to DOUBLE in JSON files, tests and some code using the enum 2014-02-17 15:02:40 +01:00
Andreas Lauser
0129a382a8 units: Replace "L" by "Length" 2014-02-11 12:45:43 +01:00
Andreas Lauser
6a97d78cc6 units: replace "t" with "Time"
this makes things more explicit and more readable
2014-02-11 12:45:41 +01:00
Atle Haugan
ddd4563f97 Renamed from 'help' to 'description' for ParserKeyword and ParserItem 2014-01-10 10:57:35 +01:00
Atle Haugan
3271156f9d First pull request candidate with help support 2014-01-09 13:33:32 +01:00
Atle Haugan
d3d6dc2c90 Added unit tests for ParserKeyword.help() 2014-01-09 08:42:27 +01:00
Joakim Hove
ae2260aa43 Table collection keywords PVTO and PVTG now have individual items: settings. 2013-12-19 13:54:51 +01:00
Joakim Hove
5a69f64aef Added functionality to apply dimensions to ParserItem from JsonConfig. 2013-12-10 17:35:20 +01:00
Joakim Hove
bb8b3ab240 Added ability to push_back() dimension strings to ParserItems; and then to query the
ParserItem -> ParserRecord -> ParserKeyword() structure whether it has dimension.
2013-12-09 21:12:27 +01:00
Joakim Hove
24e233a53c Support for parsing keywords with unknown size. 2013-12-05 08:26:29 +01:00
Joakim Hove
9ccc70b58d Added enum for size of rawkeywords. 2013-12-04 17:21:54 +01:00
Joakim Hove
ed06ebf4d3 Added UNKNOWN enum value in ParserKeywordSize enum throughout. 2013-12-04 15:31:28 +01:00
Kristian Flikka
d007e8400f Added new UNKNOWN for keywordSizeEnum 2013-12-04 14:26:08 +01:00
Joakim Hove
17ee1cca38 Added simple wildcard (trailing '*') support in ParserKeyword. 2013-12-01 09:25:52 +01:00
Joakim Hove
997d53ea99 Merge branch 'store-file-and-line' into keyword-status 2013-10-08 15:28:21 +02:00
Joakim Hove
f0770f47fb Added filename and line nr to RawRecord 2013-10-08 15:23:45 +02:00
Joakim Hove
cc21644c9e Added Json parsing of action attribute 2013-10-08 14:13:45 +02:00
Joakim Hove
e6b38c6445 Added action value to ParserKeyword constructor 2013-10-08 13:46:55 +02:00
Joakim Hove
b4b4a50092 Completed tableCollection implementation - added PVTG based testing 2013-10-01 17:13:40 +02:00
Joakim Hove
2913b526d7 Added isTableCollection attribute on Parser and Raw keyword - mainly to parse PVTG keyword 2013-10-01 16:35:55 +02:00
Joakim Hove
b938057dbd Renamed sizeType UNDEFINED -> SLASH_TERMINATED 2013-10-01 15:50:43 +02:00
Joakim Hove
5ea0b8de20 Fixed readFromRawRecord to correctly handle empty records with sizeType == ALL 2013-10-01 15:45:28 +02:00
Joakim Hove
d7ca4fee83 Added support for 'data' keywords ~ the PORO and PERMX keywords 2013-09-22 17:23:27 +02:00
Joakim Hove
0afbcfc6e4 sizeType is default set to SINGLE - and optional in Json config 2013-09-18 07:16:09 +02:00
Joakim Hove
e75998666d Updated ParserKeyword::validName() to disregard names with not alphanumeric (c) 2013-08-21 23:15:40 +02:00
Joakim Hove
4202ad027d Added static method ParserKeyword::validName() 2013-08-21 12:43:15 +02:00
Joakim Hove
47d29cc804 Added parser->size() and parser->loadKeywordFromFile() 2013-08-19 22:37:48 +02:00
Joakim Hove
75de3033f9 Renamed variables related keyword inferring size from other keyword 2013-08-14 08:43:54 +02:00