Hi, Am Montag, 4. März 2013, 07:58:34 schrieb Joakim Hove: > > std::map<std::string, std::vector<string> > > > That's not nearly enough. By a long shot. First of all, keywords can be > repeated, can specify parts of the data in one instance and the rest in > another. Or overwrite existing data. Second, keyword data for anything > other than mere block properties have (very) specialised formats so teasing > it into a list of strings requires at least *some* intelligence. There is > also the 'INCLUDE' (and IMPORT) keyword as well as 'PATHS'. > > Well; I must agree with Bård here. My experience from working with ECLIPSE > files (mostly binary, but also some of the .DATA content) is that the > amount of special cases, weirdness and surprises is quite large; if you > start out with too low level of abstraction on your data structures you > will pay for it ☹
Hm, okay. Seems like the eclipse files I have are too simplistic. But isn't there a (relatively) simple generic syntax for the file format? I mean keywords may occur multiple times and their order of occurence may matter, so std::map is out, but how about a list of (keyword, parameters) tuples? I assumption is that if you do not have to deal with seemingly simple stuff like comments, line continuation, include statements, etc in the code which adds sematics to the syntax, that code will be much easier to write and to understand... cheers Andreas -- Andreas Lauser Department of Hydromechanics and Modelling of Hydrosystems University of Stuttgart Pfaffenwaldring 61 D-70569 Stuttgart Phone: (+49) 711 685-64719 Fax: (+49) 711 685-60430 www.hydrosys.uni-stuttgart.de _______________________________________________ Opm mailing list Opm@opm-project.org http://www.opm-project.org/mailman/listinfo/opm