Commit Graph

36 Commits

Author SHA1 Message Date
chflo
0db3abab94 Added copyright header to files that were without it 2016-03-04 14:56:18 +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
c2eb0ea934 ParserKeywords split into multiple files
In order to reduce parsing load on clients, the generated ParserKeywords
now come in their own sorted-by-first-letter files, so that inclusion of
the entire tree is unnecessary when only a handful of keywords will do.

This also applies to the generated source code (which is pretty heavy to
compile), which now is split into multiple files to enable parallel
builds.
2016-01-19 15:16:53 +01:00
Joakim Hove
fb0daa39f4 Changed std::cout message for keywordloader. 2015-09-11 14:03:28 +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
8756435766 Added JsonObject::to_string() - removed content. 2015-06-05 14:26:35 +02:00
Joakim Hove
875f591a1b Changed ParserKeyword to use vector of records 2015-02-20 00:21:32 +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
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
Andreas Lauser
6b6a5bf69e change the name for the generated keyword tests to make them unambigous
the problem was the ALL keyword which caused a naming conflict with
Opm::ParserItemSizeEnum::ALL. I haven't considered the possibility to
break the build by adding a keyword, so sorry for the breakage.

On a more philosophical ground I think it is a bit questionable to
auto-generate test cases at build time because they will automatically
match the keyword definition, whether this definition makes sense or
not...
2014-10-14 12:03:58 +02:00
Andreas Lauser
180a4db1d5 work around an optimizer performance bug in clang.
It seems like some optimization passes of CLang which are enabled by
-O2 (at least in my version, 3.3) do not like nested scopes and long
functions too much. Thus, slightly change the generated source. Timing
on my (quite beefy) machine:

without patch:

make
rm -rf generated-source; time make
time make
[...]
real    10m31.110s
user    10m16.264s
sys     0m13.672s

with patch:

make
rm -rf generated-source; time make
time make
[...]
real    0m47.011s
user    0m44.670s
sys     0m1.968s

the memory used by the compiler goes from 28.8GB to about 330 MB. (I
suppose not everybody has 32 Gigs of memory yet. ;)
2014-08-25 16:08:27 +02:00
Andreas Lauser
fe638c2fc8 separate the internal keyword names and the deck names more clearly
so far, these two concepts were partially mingled in Opm::Parser...
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
Arne Morten Kvarving
3827ddca64 fixed: mark static symbols as such to quell warnings 2014-05-15 14:46:16 +02:00
Atgeirr Flø Rasmussen
e3d167048f Commented out unused function arguments. 2014-04-15 09:48:19 +02:00
Joakim Hove
e93a377eb6 Large changes to createDefaultkeywordlist: Will create both tests and testSource in one pass. The special sorce code to create test source is removed. The test source is marked with Generated_source attribute. 2014-04-08 01:44:27 +02:00
Joakim Hove
0a24d926c1 The createDefaultkeywordlist program will create the generated-source/ directory if it does not exist. 2014-04-07 17:07:24 +02:00
Joakim Hove
9ebd9a227b Moved test of valid keywordname to ensure that e.g editor backupfiles are not parsed. 2014-04-07 16:54:09 +02:00
atleh
07809cae2e Ready for merge? 2014-04-04 12:04:21 +02:00
atleh
02a915ba2d Adjustments in createDefaultKeywordList 2014-04-04 12:02:40 +02:00
atleh
25a5578677 Fixed bug regarding dump file usage in createDefaultKeywordList 2014-04-04 12:02:40 +02:00
atleh
c21a667f0e Some adjustments to createDefaultKeywordList. Not complete. 2014-04-04 12:02:40 +02:00
atleh
bd150b5684 Marked parameter as const 2014-04-04 12:02:40 +02:00
atleh
a6cd64afb7 added support for dump files in createDefaultKeywordList.cpp 2014-04-04 12:02:40 +02:00
atleh
47713c7a00 createDefaultKeywordList - minor refactoring 2014-04-04 12:02:40 +02:00
atleh
0505c0a9ca createDefaultKeywordList now able to generate dump file. 2014-04-04 12:02:40 +02:00
Joakim Hove
c8b6071f8f Added many keyword config files + createDefaultKeywordList will print 2013-09-26 22:49:27 +02:00
Joakim Hove
ff52309c72 Will print a error message and continue when meeting malformed json 2013-09-26 00:05:34 +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
414feb1132 Added dynamic creation of inline default list of keywords 2013-09-14 21:44:20 +02:00