JODA  0.13.1 (59b41972)
JSON On-Demand Analysis
Public Member Functions | Static Public Member Functions | Protected Attributes
joda::queryparsing::QueryParser Class Reference

#include <QueryParser.h>

Collaboration diagram for joda::queryparsing::QueryParser:
[legend]

Public Member Functions

std::shared_ptr< query::Queryparse (const std::string &str)
 
std::vector< std::shared_ptr< query::Query > > parseMultiple (const std::string &str)
 
const std::string getLastError () const
 
const std::string getLastErrorColor () const
 

Static Public Member Functions

static std::string getFunctionNames ()
 
static const size_t checkLanguage ()
 

Protected Attributes

std::unique_ptr< tao::pegtl::parse_error > lastError
 

Detailed Description

The QueryParser is responsible for parsing queries from textual representation into the internal Query class.

Member Function Documentation

◆ checkLanguage()

const size_t joda::queryparsing::QueryParser::checkLanguage ( )
static

Analyzes the underlying query grammar. Used during testing.

Returns
A error code describing issues with the grammar.

◆ getFunctionNames()

std::string joda::queryparsing::QueryParser::getFunctionNames ( )
static

Returns a string containing a space seperated list of functions supported by the system.

Returns

◆ getLastError()

const std::string joda::queryparsing::QueryParser::getLastError ( ) const

Returns the current error message, if parsing did not succeed. An empty string is returned of no error happened

Returns
Here is the caller graph for this function:

◆ getLastErrorColor()

const std::string joda::queryparsing::QueryParser::getLastErrorColor ( ) const

Returns the current error message with UNIX terminal color codes embedded, if parsing did not succeed. An empty string is returned of no error happened

Returns
Here is the caller graph for this function:

◆ parse()

std::shared_ptr< joda::query::Query > joda::queryparsing::QueryParser::parse ( const std::string &  str)

Parses the given input string into a Query. If an error occurs, it is logged, stored and a nullpointer is returned.

Parameters
strthe input textual representation
Returns
A Query if the input was a valid JODA query, nullpointer if not.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseMultiple()

std::vector< std::shared_ptr< joda::query::Query > > joda::queryparsing::QueryParser::parseMultiple ( const std::string &  str)

Parses the given input string into one or multiple Query objects. If an error occurs, it is logged, stored, and a empty list is returned.

Parameters
strthe input textual representation
Returns
A list of Query pointers if the input was valid, empty list if not.
Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ lastError

std::unique_ptr<tao::pegtl::parse_error> joda::queryparsing::QueryParser::lastError
protected

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