Refactor initial parsing stage

- Reduced the amount of state in the RawKeyword and ParserState classes.
 - RawKeyword class has normal constructor - remove init method.
 - The Rawxxx symbols are module private and the header files are not installed.
 - Removed several unused static methods from Rawxxx and ParserKeyword.
This commit is contained in:
Joakim Hove
2019-08-15 23:03:23 +02:00
parent 441b065b3d
commit e5013125f1
25 changed files with 539 additions and 698 deletions

View File

@@ -90,7 +90,6 @@ namespace Opm {
typedef std::set<std::string> SectionNameSet;
static string_view getDeckName(const string_view& rawString);
static bool validInternalName(const std::string& name);
static bool validDeckName(const string_view& name);
bool hasMatchRegex() const;
@@ -127,7 +126,7 @@ namespace Opm {
enum ParserKeywordSizeEnum getSizeType() const;
const KeywordSize& getKeywordSize() const;
bool isDataKeyword() const;
bool slashTerminatedRecords() const;
bool rawStringKeyword() const;
std::string createDeclaration(const std::string& indent) const;
std::string createDecl() const;
@@ -149,7 +148,7 @@ namespace Opm {
size_t m_fixedSize;
bool m_isTableCollection;
std::string m_Description;
bool slash_terminated_records = true;
bool raw_string_keyword = false;
static bool validNameStart(const string_view& name);
void initDeckNames( const Json::JsonObject& jsonConfig );

View File

@@ -54,12 +54,12 @@ namespace Opm {
bool operator==( const ParserRecord& ) const;
bool operator!=( const ParserRecord& ) const;
bool slashTerminatedRecords() const;
bool rawStringRecord() const;
private:
bool m_dataRecord;
std::vector< ParserItem > m_items;
bool slash_terminated_records = true;
bool raw_string_record = false;
};
std::ostream& operator<<( std::ostream&, const ParserRecord& );