knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::parsers::graph Namespace Reference

Typedefs

using GraphTermRule = boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< GraphTerm >(), boost::spirit::ascii::space_type >
 
using GraphPatternRule = boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< GraphPattern >(), boost::spirit::ascii::space_type >
 

Functions

GraphTermRulegraphTerm ()
 
GraphTermRulepattern ()
 
auto & parsers ()
 

Typedef Documentation

◆ GraphPatternRule

typedef boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< GraphPattern >(), boost::spirit::ascii::space_type > knowrob::parsers::graph::GraphPatternRule

Definition at line 15 of file graph.h.

◆ GraphTermRule

typedef boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< GraphTerm >(), boost::spirit::ascii::space_type > knowrob::parsers::graph::GraphTermRule

Definition at line 14 of file graph.h.

Function Documentation

◆ graphTerm()

GraphTermRule & knowrob::parsers::graph::graphTerm ( )
Returns
a parser for formulas.

Definition at line 77 of file graph.cpp.

77  {
78  return parsers().term;
79  }

◆ parsers()

auto& knowrob::parsers::graph::parsers ( )

Definition at line 72 of file graph.cpp.

72  {
73  static graph_parsers_struct p;
74  return p;
75  }

◆ pattern()

GraphTermRule& knowrob::parsers::graph::pattern ( )

Definition at line 23 of file graph.cpp.

23  {
24  RETURN_GRAPH_PAT_RULE((iri() >> '(' >> term() >> ',' >> term() >> ')')
25  [qi::_val = ptr_<GraphPattern>()(qi::_2, qi::_1, qi::_3)]);
26  }
#define RETURN_GRAPH_PAT_RULE(expr)
Definition: graph.cpp:15
StringRule & iri()
Definition: strings.cpp:49
TermRule & term()
Definition: terms.cpp:136