Commit Graph

2478 Commits

Author SHA1 Message Date
Liu Ming
c8625b2fc0 log messages to message container. 2016-05-14 08:42:40 +02:00
Liu Ming
e538ed43dc log messages before handleError. 2016-05-14 08:42:40 +02:00
Joakim Hove
e20bdc3788 Merge pull request #805 from totto82/add_spe9_cp_group
Add SPE9_CP_GROUP as test case for the parser
2016-05-13 11:04:47 +02:00
Tor Harald Sandve
7f7c840364 Add SPE9_CP_GROUP as test case for the parser 2016-05-12 11:37:04 +02:00
Jørgen Kvalsvik
dfb9a629e4 Support for eclipse -> SI unit conversions 2016-05-12 11:30:51 +02:00
Joakim Hove
64fe528f6d Merge pull request #801 from pgdr/deckkeyword-throw-name
Throw now contains name() of deckKeyword
2016-05-10 15:23:04 +02:00
Pål Grønås Drange
3124c9569c Throw now contains name() of deckKeyword 2016-05-10 14:45:35 +02:00
Jørgen Kvalsvik
99829e1696 Ignore RPTONLY 2016-05-10 14:43:19 +02:00
Jørgen Kvalsvik
42992d9b91 Add missing member constructor call. 2016-05-10 10:08:29 +02:00
Joakim Hove
afc76ccd7e Merge pull request #797 from jokva/summary-config-from-eclipsestate
Summary config from eclipsestate
2016-05-10 09:55:11 +02:00
Jørgen Kvalsvik
822ac1bcb2 SI-to-unitsystem conversion tables. 2016-05-09 15:10:23 +02:00
Jørgen Kvalsvik
3106e6ae8a Create SummaryConfig object in EclipseState 2016-05-09 15:10:21 +02:00
Jørgen Kvalsvik
00066e225f Special-case handling of RUNSUM keyword
The RUNSUM keyword is identified as a Region-type keyword, but isn't
really. It's to be ignored by the SummaryConfig construction.
2016-05-09 15:09:43 +02:00
Jørgen Kvalsvik
63fd998e2a Allow Section objects to be empty
Preserves expect Deck-like behaviour by allowing empty sections.
2016-05-09 15:09:43 +02:00
Jørgen Kvalsvik
79a8f6efc5 Clean up initialisation order in EclipseState
The previous order was inaccurate and confusing. Clean up member and
initialisation order to more closely reflect the actual intent and
behaviour.
2016-05-09 15:09:42 +02:00
Jørgen Kvalsvik
0aa3e533f8 Remove unused EclipseGrid argument from Compsegs 2016-05-09 14:56:04 +02:00
Jørgen Kvalsvik
caa10631b0 IOConfig::handle* takes references over shared_ptr 2016-05-09 14:56:04 +02:00
Jørgen Kvalsvik
1d5ae5ea55 EclipseGrid::getNXYZ which returns xyz as array 2016-05-09 14:55:24 +02:00
Jørgen Kvalsvik
ee8710d3cb SummaryConfig does not require EclipseState
Rewrite construction to accept EclipseState components instead of the
full state. Enables having SummaryConfig as a member in EclipseState.
2016-05-09 14:55:24 +02:00
Jørgen Kvalsvik
28ae15cf0f Move getRegions into 3DProperties 2016-05-09 14:55:24 +02:00
Joakim Hove
3289b046c3 Check deck for ACTNUM keyword. 2016-05-09 09:44:31 +02:00
Pål Grønås Drange
091dc196f3 Added parse functions for Parser, for simpler creation of state and grids 2016-05-06 12:21:41 +02:00
Pål Grønås Drange
b8b1ba9528 ParseContext is now a member of EclipseState
* EclipseState now copies input ParseContext and keeps it as member
* Made the argument (ParseContext) default as ParseContext()
* Now you can make a new EclipseState with only deck as argument
* Removed test that tested address equality of ParseContext objects
2016-05-06 11:37:26 +02:00
Joakim Hove
350297e8ec Merge pull request #792 from jokva/bugfixes
Bugfixes
2016-05-04 09:30:30 +02:00
Jørgen Kvalsvik
1f2c2ba98d Name cases where TITLE is unset
When the TITLE keyword was present in the deck, but no parameter was
given the parser would consume the next keyword as the simulation TITLE.
Override this by writing a default TITLE if it's unset.
2016-05-03 15:42:30 +02:00
Pål Grønås Drange
672b240e00 fixed bug in Parser, use openRootFile 2016-05-03 15:22:34 +02:00
Pål Grønås Drange
d9eb3ebf86 Added test for IOConfigBaseName and fixed a self-introduced bug in E.S. 2016-05-03 14:07:01 +02:00
Jørgen Kvalsvik
0966a9cb8c Fix RawKeywor tests to reflect assumptions 2016-05-03 13:39:36 +02:00
Pål Grønås Drange
3a3ec10649 moved initialization of primary's to header, fixed rebase 2016-05-03 13:22:57 +02:00
Pål Grønås Drange
5a7dcc5427 Made FaultCollection reference in State thereby fixing compiler warn 2016-05-03 13:22:57 +02:00
Pål Grønås Drange
63e452167c Introduce deckptr-less EclipseState and EclipseGrid 2016-05-03 13:22:56 +02:00
Jørgen Kvalsvik
41fc16ad92 Keep ParserKeyword instances; internalName removed
Internal names are deprecated, and instead added ParserKeyword instances
are maintained and kept for the lifetime of the ParserKeyword instance.
Querying keyword existence from python picks up on Deck names, expected
to always be the intended case, instead of internal names.
2016-05-03 12:59:57 +02:00
Jørgen Kvalsvik
ba5983483e Throw on error from fread 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
dcc3668fdd Rename strip_after -> find_terimnator 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
8cb64dad72 Encapsulate ParserState's internals. 2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
ff301622b6 Append newline to input; remove branch in getline
By allowing getline to assume that the next line always starts after the
found \n *or* that after the found newline is the \0, we can avoid a
branch and potential stall.
2016-05-03 09:30:57 +02:00
Jørgen Kvalsvik
8014ec817c Prefer empty over size 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
a7d18cd8df Reindentation. 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
de3db110c9 Replace static with anon namespace
This is done to hide symbols such as class definitions in addition to
functions.
2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
de691c0bd5 Replace ParserState shared_ptr with auto var 2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
64291e6cca Moved parseState out of Parser; source-file only
This function is not an obvious member of Parser, as it is just as
reliant on ParserState which is source-file private to Parser. Moves to
source file only, without externally-visible private symbol table entry.
2016-05-03 09:30:56 +02:00
Jørgen Kvalsvik
9031ca9406 Make tryParseKeyword/createRawKeyword non-visible
tryParseKeyword and createRawKeyword don't use anything non-public and
does not rely on any non-public parser state, so they are now
implemented as functions private/static in Parser.cpp
2016-05-03 09:19:23 +02:00
Jørgen Kvalsvik
6df67c7de2 Encapsulate getline behaviour onto ParserState
A getline implementation that carries mostly the same assumptions as
istream::getline. Requires ParserState::done() to always be checked (for
negative) to safely retrieve the next line.

Enables tryParseKeywords and friend to only maintain a high level view
of the parsing procedure, and not deal with stream positioning.
2016-05-03 09:19:23 +02:00
Jørgen Kvalsvik
9cf2c9fd98 Formalised stack semantics for input in parser
Moves the storage/lifetime components of ParserState into its own
helper utility class. Splits the implementation responsibility so that
all input data and state is handled by the InputStack, and "global"
information is managed directly by ParserState.
2016-05-03 09:19:22 +02:00
Jørgen Kvalsvik
120a30e94b Replace std::isspace in parser; add \r to is_sep 2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
1622a5bd49 Use explicit loop invariant in loadFromDeckKeyword
gcc doesn't seem to do this for us.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
784a1a5d78 Replace std::isspace with hand-rolled version
Profiling indicate isspace isn't inlined properly, so we replace it with
a hand-rolled easier-to-inline version.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
60c20f8057 Explicitly store loop invariants in assertSIData
Profiling shows that gcc isn't recognising these as loop invariants, so
we help it a little bit by explicitly storing them.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
8a4eb5279c Splitting records with string_view; test updates
The splitting of RawRecords into individual symbols uses string_view.
Also updates tests since RawRecord now assumes that the record string it
receives is complete and does *not* contain the terminating slash.
2016-05-03 09:16:28 +02:00
Jørgen Kvalsvik
a105f3a193 string_view char* constructor 2016-05-03 09:16:28 +02:00