Commit Graph

55 Commits

Author SHA1 Message Date
Joakim Hove
f9accc018d Merge pull request #593 from joakim-hove/rename-elastic-vector
Renamed ElasticVector -> RecordVector
2015-09-29 23:04:04 +02:00
Joakim Hove
138e27fd92 Renamed ElasticVector -> RecordVector 2015-09-29 08:08:57 +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
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
155ad22a05 Made constructors explicitly public 2015-06-05 14:26:34 +02:00
Joakim Hove
f0fb5c993f Added recordBegin() and recordEnd() 2015-03-03 13:30:42 +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
4a33b934fa OPM-145: Removed member ParserKeywordActionEnum m_action and all traces of it from class ParserKeyword 2015-01-14 10:06:21 +01:00
Andreas Lauser
9510b976d5 ParserKeyword: make the exception messages more verbose
mostly, include the keyword names, so that the user can fix these
errors without using gdb. (Not that I mind gdb, but I have been told
that gdb is a big no-no. ;)

(this patch also fixes a few typos...)
2014-12-09 13:25:49 +01:00
Joakim Hove
b924f6cd02 DeckKeyword is immutable. 2014-12-09 11:56:05 +01:00
Andreas Lauser
fff0c9cdf0 Revert "also eat keywords containing lowercase letters"
this was inadvertedly merged. the real fix is to make the parser
case-insensitive...
2014-11-07 14:23:08 +01:00
Andreas Lauser
382d449ebb also eat keywords containing lowercase letters
The Norne deck actually exhibits this atrocity in form of the
'fluxnum' keyword in the file 'INCLUDE/PETRO/FLUXNUM_0704.prop'.

I don't know if Eclipse cares about the case of the keywords, but
opm-parser currently does for sure. (If Eclipse turns out to be
case-insensitive, the easiest fix for us is to just make all keywords
ALL_UPPERCASE...)
2014-11-07 12:58:04 +01:00
Andreas Lauser
fbf6008da4 Parser: rename and split canParseKeyword to isRecognizedKeyword
which is more what the method does because the keyword can still
contain an error in its data which would make it non-parseable.

While at it, split the method into a "get keyword name from input
line" and "is a valid keyword name" part. (this will be needed later.)
2014-11-05 13:08:04 +01:00
Andreas Lauser
d94097617b ParserKeyword: add the glue code so that it knows its sections 2014-10-13 16:05:59 +02:00
Kristian Flikka
e8310ffbca Changed from if to ifdef, to clarify the actual functionality 2014-07-08 12:49:12 +02:00
Andreas Lauser
1a72cade01 use std::regex if it is available
it turns out that boost::regex does not work for the libstdc++ debug
mode. This patch should fix this for sufficiently new compilers.

Note that this requires the FindCXX11Features.cmake tests pulled in
from opm-core and an additional compiler flag...
2014-07-07 17:50:46 +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
Joakim Hove
edde68fa6a Added float data accessors. 2014-04-01 09:05:33 +02:00
Atle Haugan
ddd4563f97 Renamed from 'help' to 'description' for ParserKeyword and ParserItem 2014-01-10 10:57:35 +01:00
Atle Haugan
308cfda3c5 Improved some type usage based on code review feedback 2014-01-10 08:53:19 +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
de16ff8da1 Added methods applyUnitsToDeck() which push units onto the deck. 2013-12-14 10:28:49 +01:00
Joakim Hove
39ef9e3798 Calling initDimension for table collections and data keywords like PERMX. 2013-12-11 13:27:21 +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
ed06ebf4d3 Added UNKNOWN enum value in ParserKeywordSize enum throughout. 2013-12-04 15:31:28 +01:00
Kristian Flikka
fa8b9e9aa3 Merge pull request #59 from joakim-hove/wildcard-keywords
Wildcard keywords
2013-12-02 04:24:45 -08:00
Kristian Flikka
1d0135da5e Removed use of boost::shared_ptr, replaced with std::shared_ptr 2013-12-02 13:07:01 +01:00
Joakim Hove
6b5367854a Factored out some common code from validName() and wildCardName(). 2013-12-02 11:19:22 +01:00
Joakim Hove
17ee1cca38 Added simple wildcard (trailing '*') support in ParserKeyword. 2013-12-01 09:25:52 +01: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
d7ca4fee83 Added support for 'data' keywords ~ the PORO and PERMX keywords 2013-09-22 17:23:27 +02:00
Joakim Hove
79a59fc629 Added indent parameter to ParserKeyword::inlineNew() to beautify generated cpp source 2013-09-14 22:14:58 +02:00
Joakim Hove
f461ba6f07 Created code to create cpp representation of complete ParserKeyword 2013-09-13 22:23:12 +02:00
Kristian Flikka
480d14934b Added test for a case with fully, partial and empty record body, defaults are added 2013-08-26 15:17:52 +02:00
Joakim Hove
4b728a5196 Added function declaration in .hpp 2013-08-23 00:20:22 +02:00
Joakim Hove
4202ad027d Added static method ParserKeyword::validName() 2013-08-21 12:43:15 +02:00
Joakim Hove
75de3033f9 Renamed variables related keyword inferring size from other keyword 2013-08-14 08:43:54 +02:00
Joakim Hove
c046fb0bde Added support for keywords getting size from other keywords ~ EQUIL style 2013-08-06 16:26:49 +02:00
Joakim Hove
8bc176d63e Added full(?) Parser configuration from json 2013-07-31 17:58:05 +02:00
Joakim Hove
db60ee2b56 Removed setRecord() method ParserKeyword. Instead ParserRecord is created during ParserKeyword construction 2013-07-31 15:02:00 +02:00