Commit Graph

29 Commits

Author SHA1 Message Date
Jørgen Kvalsvik
0da5cadc75 RawRecords auto store, strings moved to RawRecord
The accumulated strings are moved into RawRecords, which reduces
execution time (rough measurements indicates 4-8%). To facilitate this,
RawRecords are stored directly in the vector in favour of via
shared_ptrs.
2016-03-22 08:58:48 +01:00
Liu Ming
705a9dc168 rename ParseMode as ParseContex in Parser folder. 2016-03-16 16:34:58 +08:00
Jørgen Kvalsvik
84e245bdb5 DeckRecord preallocation support.
The translation between ParserRecord knows in advance how many DeckItem
entries there are in the resulting DeckRecord. We can use this
information to efficiently preallocate memory in the DeckRecord.
2016-03-14 08:29:54 +01:00
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
f404828d63 Cleans up headers to improve build preformance
This is an effort to improve build performance.  Several includes
scattered across the project are either unused or partially used (i.e.
just used to import a type name, not depending on the actual contents of
the header file).

Replaces a lot of these includes with forward declarations.
2016-01-21 09:22:06 +01:00
Joakim Hove
1018c9ef4c Use Deck* and Deck& instead of shared_ptr<Deck>. 2016-01-12 12:16:27 +01: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
Joakim Hove
bb4d676d45 Added method ParserRecord::hasItem() 2015-06-05 14:26:34 +02:00
Joakim Hove
8ac17f744e Added Data awareness to ParserRecord. 2015-02-26 11:46:25 +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
Arne Morten Kvarving
670e8b692b changed: don't use parameter names that conflicts with member function names
quells warnings (with gcc 4.8)
2014-05-15 14:46:16 +02:00
Joakim Hove
de16ff8da1 Added methods applyUnitsToDeck() which push units onto the deck. 2013-12-14 10:28:49 +01:00
Joakim Hove
084fc24174 Changed parserItem::scan to return modifyable DeckItem - this is required to push dimension later. 2013-12-14 10:11:59 +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
flikka
cf0b1235a4 Merge pull request #47 from flikka/throw-on-too-long-records
Throw on too long records
2013-11-11 01:20:11 -08:00
Kristian Flikka
862d2ee302 Added support for WCONPROD, with use of predictionMode. Fixed a bug in the TSTEP reading in Schedule.cpp 2013-11-08 15:55:11 +01:00
Kristian Flikka
006ab6d35d Added keywordName and dataFilename to RawRecord. Using these in the ParserRecord to give better error message when throwing on too long RawRecords 2013-11-07 12:32:07 +01:00
Joakim Hove
ccac972d6c Removed - not needed - ParserRecord::inlineNew 2013-09-14 21:46:16 +02:00
Joakim Hove
f461ba6f07 Created code to create cpp representation of complete ParserKeyword 2013-09-13 22:23:12 +02:00
Joakim Hove
c04f9728b0 Added temporaryr library target buildParser which is used for executables creating source 2013-09-13 12:50:40 +02:00
Joakim Hove
b36fa7d42c Added inlineNew() method to create ParserRecord 2013-09-13 12:34:38 +02:00
Joakim Hove
c11fdeeb42 Added ParserRecord::equal() method 2013-09-13 10:16:00 +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
Kristian Flikka
b43d95c5a2 Starting to wrap up from the top, added the missing DeckKW, and refactored a bit in some of the Raw classes that returned the internal structure 2013-06-03 15:54:16 +02:00
Kristian Flikka
7998a84b81 Made the ParserIntItem's scan return DeckItem, and put a virtual scan in ParserItem. The ParserRecord now has a simple, but functioning parse method 2013-05-24 10:09:59 +02:00
Kristian Flikka
7bfe185998 Started working on the flow RawRecord->ParserRecord->DeckRecord. DeckRecord has some containers now. 2013-05-23 12:42:59 +02:00
Joakim Hove
d313827627 Added simple ParserRecord implementation 2013-05-14 21:26:42 +02:00
Kristian Flikka
2d6e6842d6 Changed ParserItem from template based to a base-inheritance based system. Corresponds to and creates DeckItem objects 2013-05-07 21:55:49 +02:00