#include <Parser.hpp>

Public Member Functions

 Parser (bool addDefault=true)
 
Deck parseFile (const std::string &dataFile, const ParseContext &, ErrorGuard &errors) const
 The starting point of the parsing process. The supplied file is parsed, and the resulting Deck is returned. More...
 
Deck parseFile (const std::string &, const ParseContext &) const
 
Deck parseFile (const std::string &datafile) const
 
Deck parseString (const std::string &data, const ParseContext &, ErrorGuard &errors) const
 
Deck parseString (const std::string &data, const ParseContext &) const
 
Deck parseString (const std::string &data) const
 
Deck parseStream (std::unique_ptr< std::istream > &&inputStream, const ParseContext &parseContext, ErrorGuard &errors) const
 
void addParserKeyword (const Json::JsonObject &jsonKeyword)
 Method to add ParserKeyword instances, these holding type and size information about the keywords and their data. More...
 
void addParserKeyword (ParserKeyword &&parserKeyword)
 
bool hasKeyword (const std::string &) const
 Returns whether the parser knows about a keyword. More...
 
const ParserKeywordgetKeyword (const std::string &name) const
 
bool isRecognizedKeyword (const string_view &deckKeywordName) const
 
const ParserKeywordgetParserKeywordFromDeckName (const string_view &deckKeywordName) const
 
std::vector< std::stringgetAllDeckNames () const
 
void loadKeywords (const Json::JsonObject &jsonKeywords)
 
bool loadKeywordFromFile (const Opm::filesystem::path &configFile)
 
void loadKeywordsFromDirectory (const Opm::filesystem::path &directory, bool recursive=true)
 
void applyUnitsToDeck (Deck &deck) const
 
size_t size () const
 Returns the approximate number of recognized keywords in decks. More...
 
template<class T >
void addKeyword ()
 
const std::vector< std::pair< std::string, std::string > > codeKeywords () const
 

Static Public Member Functions

static std::string stripComments (const std::string &inputString)
 
static EclipseState parse (const Deck &deck, const ParseContext &context)
 
static EclipseState parse (const std::string &filename, const ParseContext &context, ErrorGuard &errors)
 
static EclipseState parseData (const std::string &data, const ParseContext &context, ErrorGuard &errors)
 
static EclipseGrid parseGrid (const std::string &filename, const ParseContext &context, ErrorGuard &errors)
 
static EclipseGrid parseGrid (const Deck &deck, const ParseContext &context)
 
static EclipseGrid parseGridData (const std::string &data, const ParseContext &context, ErrorGuard &errors)
 

Detailed Description

The hub of the parsing process. An input file in the eclipse data format is specified, several steps of parsing is performed and the semantically parsed result is returned.

Constructor & Destructor Documentation

◆ Parser()

Opm::Parser::Parser ( bool  addDefault = true)
explicit

Member Function Documentation

◆ addKeyword()

template<class T >
void Opm::Parser::addKeyword ( )
inline

References addParserKeyword().

◆ addParserKeyword() [1/2]

void Opm::Parser::addParserKeyword ( const Json::JsonObject jsonKeyword)

Method to add ParserKeyword instances, these holding type and size information about the keywords and their data.

Referenced by addKeyword().

◆ addParserKeyword() [2/2]

void Opm::Parser::addParserKeyword ( ParserKeyword &&  parserKeyword)

◆ applyUnitsToDeck()

void Opm::Parser::applyUnitsToDeck ( Deck deck) const

◆ codeKeywords()

const std::vector< std::pair< std::string, std::string > > Opm::Parser::codeKeywords ( ) const

◆ getAllDeckNames()

std::vector< std::string > Opm::Parser::getAllDeckNames ( ) const

◆ getKeyword()

const ParserKeyword & Opm::Parser::getKeyword ( const std::string name) const

◆ getParserKeywordFromDeckName()

const ParserKeyword & Opm::Parser::getParserKeywordFromDeckName ( const string_view deckKeywordName) const

◆ hasKeyword()

bool Opm::Parser::hasKeyword ( const std::string ) const

Returns whether the parser knows about a keyword.

◆ isRecognizedKeyword()

bool Opm::Parser::isRecognizedKeyword ( const string_view deckKeywordName) const

◆ loadKeywordFromFile()

bool Opm::Parser::loadKeywordFromFile ( const Opm::filesystem::path &  configFile)

◆ loadKeywords()

void Opm::Parser::loadKeywords ( const Json::JsonObject jsonKeywords)

◆ loadKeywordsFromDirectory()

void Opm::Parser::loadKeywordsFromDirectory ( const Opm::filesystem::path &  directory,
bool  recursive = true 
)

◆ parse() [1/2]

static EclipseState Opm::Parser::parse ( const Deck deck,
const ParseContext context 
)
static

◆ parse() [2/2]

static EclipseState Opm::Parser::parse ( const std::string filename,
const ParseContext context,
ErrorGuard errors 
)
static

◆ parseData()

static EclipseState Opm::Parser::parseData ( const std::string data,
const ParseContext context,
ErrorGuard errors 
)
static

◆ parseFile() [1/3]

Deck Opm::Parser::parseFile ( const std::string ,
const ParseContext  
) const

◆ parseFile() [2/3]

Deck Opm::Parser::parseFile ( const std::string datafile) const

◆ parseFile() [3/3]

Deck Opm::Parser::parseFile ( const std::string dataFile,
const ParseContext ,
ErrorGuard errors 
) const

The starting point of the parsing process. The supplied file is parsed, and the resulting Deck is returned.

◆ parseGrid() [1/2]

static EclipseGrid Opm::Parser::parseGrid ( const Deck deck,
const ParseContext context 
)
static

Parses the provided deck. If context contains ParseContext::PARSE_PARTIAL_DECK, we construct only a lean grid, otherwise, we construct a full EclipseState and return the fully constructed InputGrid

◆ parseGrid() [2/2]

static EclipseGrid Opm::Parser::parseGrid ( const std::string filename,
const ParseContext context,
ErrorGuard errors 
)
static

Parses the deck specified in filename. If context contains ParseContext::PARSE_PARTIAL_DECK, we construct only a lean grid, otherwise, we construct a full EclipseState and return the fully constructed InputGrid

◆ parseGridData()

static EclipseGrid Opm::Parser::parseGridData ( const std::string data,
const ParseContext context,
ErrorGuard errors 
)
static

Parses the provided deck string. If context contains ParseContext::PARSE_PARTIAL_DECK, we construct only a lean grid, otherwise, we construct a full EclipseState and return the fully constructed InputGrid

◆ parseStream()

Deck Opm::Parser::parseStream ( std::unique_ptr< std::istream > &&  inputStream,
const ParseContext parseContext,
ErrorGuard errors 
) const

◆ parseString() [1/3]

Deck Opm::Parser::parseString ( const std::string data) const

◆ parseString() [2/3]

Deck Opm::Parser::parseString ( const std::string data,
const ParseContext  
) const

◆ parseString() [3/3]

Deck Opm::Parser::parseString ( const std::string data,
const ParseContext ,
ErrorGuard errors 
) const

◆ size()

size_t Opm::Parser::size ( ) const

Returns the approximate number of recognized keywords in decks.

This is an approximate number because regular expresions are disconsidered.

◆ stripComments()

static std::string Opm::Parser::stripComments ( const std::string inputString)
static

The documentation for this class was generated from the following file: