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

Typedefs

using FormulaRule = boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< Formula >(), boost::spirit::ascii::space_type >
 
using PredicateRule = boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< Predicate >(), boost::spirit::ascii::space_type >
 

Functions

FormulaRuleformula ()
 
PredicateRulepredicate ()
 
PredicateRulepredicate_n ()
 
PredicateRulepredicate_0 ()
 
auto & parsers ()
 

Typedef Documentation

◆ FormulaRule

typedef boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< Formula >(), boost::spirit::ascii::space_type > knowrob::parsers::formula::FormulaRule

Definition at line 14 of file formula.h.

◆ PredicateRule

typedef boost::spirit::qi::rule< std::string::const_iterator, std::shared_ptr< Predicate >(), boost::spirit::ascii::space_type > knowrob::parsers::formula::PredicateRule

Definition at line 15 of file formula.h.

Function Documentation

◆ formula()

FormulaRule & knowrob::parsers::formula::formula ( )
Returns
a parser for formulas.

Definition at line 283 of file formula.cpp.

283  {
284  return parsers().formula;
285  }

◆ parsers()

auto& knowrob::parsers::formula::parsers ( )

Definition at line 278 of file formula.cpp.

278  {
279  static parsers_struct p;
280  return p;
281  }

◆ predicate()

PredicateRule & knowrob::parsers::formula::predicate ( )
Returns
a parser for predicates.

Definition at line 221 of file formula.cpp.

221  {
223  }
PredicateRule & predicate_n()
Definition: formula.cpp:212
PredicateRule & predicate_0()
Definition: formula.cpp:217
#define RETURN_PREDICATE_RULE(expr)
Definition: formula.cpp:25

◆ predicate_0()

PredicateRule& knowrob::parsers::formula::predicate_0 ( )

Definition at line 217 of file formula.cpp.

217  {
218  RETURN_PREDICATE_RULE(str::atom_or_iri() [qi::_val = ptr_<Predicate>()(qi::_1, std::vector<TermPtr>())]);
219  }
StringRule & atom_or_iri()
Definition: strings.cpp:58

◆ predicate_n()

PredicateRule& knowrob::parsers::formula::predicate_n ( )

Definition at line 212 of file formula.cpp.

212  {
213  RETURN_PREDICATE_RULE((str::atom_or_iri() >> '(' >> (term() % ',') >> ')')
214  [qi::_val = ptr_<Predicate>()(qi::_1, qi::_2)]);
215  }
TermRule & term()
Definition: terms.cpp:136