Commit Graph

377 Commits

Author SHA1 Message Date
chflo
d70504e7a4 Fixed bug in Parser<double|float>Item.cpp:
Too low precision for floating point values in generated source code.
2015-04-20 15:13:22 +02:00
Fredrik Gundersen
574deeff18 Clean up and fix indentation 2015-04-01 13:37:55 +02:00
Fredrik Gundersen
89960331cf Rewrite of constructor to support g++4.4 2015-04-01 13:34:23 +02:00
Fredrik Gundersen
5401b828ba Changed to use C++11 syntax for constructor 2015-04-01 08:49:36 +02:00
Fredrik Gundersen
a64c3a62bf Added new constuctor with PATHS parameter 2015-03-31 13:30:02 +02:00
Joakim Hove
9fb229ccd7 Replaced references to logger with OpmLog::addMessage() 2015-03-04 22:14:31 +01:00
Joakim Hove
3a60605d99 Removed most of the functionality from CounterLog 2015-03-04 22:12:53 +01:00
Joakim Hove
25bff6480d Renamed MessageCounter -> CounterLog 2015-03-04 22:12:52 +01:00
Joakim Hove
d3277543ec Renamed existing Logger -> MessageCounter 2015-03-04 22:09:54 +01:00
Joakim Hove
ecb1d5bd74 Update code generator to use record iterator. 2015-03-03 13:30:42 +01:00
Joakim Hove
f0fb5c993f Added recordBegin() and recordEnd() 2015-03-03 13:30:42 +01:00
Joakim Hove
233922e935 Using correct ParserRecord when applying units. 2015-03-03 13:30:41 +01:00
Joakim Hove
be95805f15 Using variable ParserRecord when parsing. 2015-02-26 22:01:30 +01: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
8ac17f744e Added Data awareness to ParserRecord. 2015-02-26 11:46:25 +01:00
Joakim Hove
875f591a1b Changed ParserKeyword to use vector of records 2015-02-20 00:21:32 +01:00
Robert K
05af9e32b7 remove warnings, that is:
sizeType --> p_sizeType since it shadows a member method
trailing ;
comparison of signed and unsigned int
2015-02-13 14:19:24 +01:00
Joakim Hove
eda7b60f54 Handle missing xxxDIMS keywords
For some keywords the number of records is given as the value of an item
in another keyword, for instance the number of records in the EQUIL
keyword is given by NTEQUL item in the EQLDIMS keyword.

If the EQLDIMS keyword is not given in the deck the Parser will consult
the default values of EQLDIMS keyword; i.e. a missing keyword is treated
as all-defaulted.
2015-02-06 13:04:17 +01:00
Joakim Hove
af249cefd7 Added method to get keyword from Parser. 2015-02-06 13:03:44 +01:00
chflo
3298fe4337 OPM-145: Removed tests for ACTION 2015-01-14 10:14:06 +01:00
chflo
26a4a1d57d OPM-145: Removed action-related code from Parser class 2015-01-14 10:08:40 +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
Joakim Hove
cf97b3bbe6 Revert "Revert "make the parsing stage pass even if non-defaultable items have been defaulted""
This reverts commit 13d31809e8ca7b9f283bf29a0871110071263449.
2015-01-02 16:51:15 +01:00
Andreas Lauser
e0706524e0 Revert "make the parsing stage pass even if non-defaultable items have been defaulted"
This reverts commit 5ce5a3539641ac6eac9362d9c2b8a09084f9c35b.
2014-12-19 19:02:53 +01:00
Andreas Lauser
e12a0aab1b parser main loop: handle unknown sized keywords in a better way 2014-12-19 10:59:12 +01:00
Andreas Lauser
231cf39d47 make the parsing stage pass even if non-defaultable items have been defaulted
... but throw later when trying to access the data of the item in
question.

Note that this was demanded by [at] joakim-hove and that I do not want
to be held responsible for any issues which are caused by this
approach. (read: please direct your barks to Joakim if you fell on
your nose because of this...)
2014-12-18 11:43:52 +01:00
Andreas Lauser
0262b333fd make items which do not have a default un-defaultable
this was a much more common problem than it seemed initially...
2014-12-18 11:43:52 +01:00
Joakim Hove
b585655a5c Changes in the log class:
1. Moved to from eclipse/Parser -> eclipse/Log
 2. Renamed ParserLog -> OpmLog
2014-12-15 17:36:10 +01:00
Andreas Lauser
cf7e293635 make the build fail if a JSON keyword definition file could not be parsed 2014-12-15 17:19:32 +01:00
Andreas Lauser
c1988ad8a3 get rid of the 'strict parsing' concept
this is the 'Joakim-style' variant of the patch, i.e., an exception
will always be thrown if an unknown keyword is encountered.
2014-12-11 12:43:12 +01:00
Joakim Hove
994932738d Merge pull request #339 from andlaus/low_level_improvments
Low level improvments
2014-12-11 11:49:32 +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
f4e4ab2796 Parser::parseState(): remove the 'verbose' debugging facility
This one could only be enable by modifying the source code. If such
debugging output is needed, it should be directly added via std::cout
and removed it before proposing the PR...
2014-12-09 11:55:03 +01:00
Andreas Lauser
755c3311f3 don't enter the parsing main loop if the leftover-from-last time keyword does not have any records 2014-12-09 11:54:55 +01:00
Andreas Lauser
017e582e5a handle comments and empty lines directly in the parser's main loop
note that comment handling is currently a bit too simplistic as stuff
like

FOO
'-- hello' /

won't work. as far as I can see, this is not different from the state
before this patch, though.
2014-12-09 11:54:55 +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
Kristian Flikka
83a1016aaf Changed behaviour when same keyword occurs again, delete existing entry, replace with new. 2014-11-18 11:51:35 +01:00
Kristian Flikka
71e8321d7c Created folders for keywords, these will be read in an alphanumerical sorted order. To enable organization and override of keywords. 2014-11-17 13:37:00 +01:00
Kristian Flikka
b8f87a1eb1 Prints a warning if a keyword that has already been added, occurs again. Next step, process keywords from several ordered, top-level folders 2014-11-17 13:37:00 +01:00
Kristian Flikka
94306e6fdc Changed the KeywordMap to use keyword and not path as key, to enable check for existing keyword 2014-11-17 13:37:00 +01:00
Kristian Flikka
86d2fd2907 Removed unused variable 2014-11-17 13:37:00 +01:00
Joakim Hove
bae5a0cb46 Merge pull request #353 from joakim-hove/EclipsestateNoGrid
Eclipsestate no grid
2014-11-11 11:00:58 +01:00
Andreas Lauser
4e293ee3e6 EclipseState: make it instantiable without a grid
instead of throwing, we now add a warning to the parser log...
2014-11-08 23:55:25 +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
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
af8cab1a64 ParserKeyword: fix typos and improve exception messages 2014-11-07 12:02:05 +01:00
Andreas Lauser
7955ea5dac ParserState: make it possible to detect if initialization went wrong
this is required to get meaningful error messages if the file
specified by INCLUDE does not exist.
2014-11-06 16:16:29 +01:00