knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
strings.h
Go to the documentation of this file.
1 /*
2  * This file is part of KnowRob, please consult
3  * https://github.com/knowrob/knowrob for license details.
4  */
5 
6 #ifndef KNOWROB_STRING_PARSERS_H
7 #define KNOWROB_STRING_PARSERS_H
8 
9 #include <boost/spirit/include/qi.hpp>
10 
11 namespace knowrob::parsers::str {
12  using StringRule = boost::spirit::qi::rule<std::string::const_iterator, std::string()>;
13 
15 
17 
19 
21 
22  // a IRI namespace is an alphanumeric word.
23  // note that no single quotes are allowed, the greedy parser would match the `singleQuotes` rule before.
24  StringRule &iri_ns();
25 
26  // right part of colon must be an alphanumeric word, or wrapped in single quoted.
27  // Note that there is no need to enquote entities whose name starts with an uppercase character.
29 
30  // IRIs are encoded as "ns:entity", ns must be a registered namespace at parse-time
31  StringRule &iri();
32 
33  // Atoms are either a single quoted string, or words that start with a lowercase letter.
34  StringRule &atom();
35 
36  // A typed IRI or another type atom
38 
39  // A single blank character
40  StringRule &blank();
41 
42  // A number as a string
43  StringRule &number();
44 
45  // The value of a typed XSD literal as a string
47 }
48 
49 #endif //KNOWROB_STRING_PARSERS_H
StringRule & number()
Definition: strings.cpp:66
StringRule & iri()
Definition: strings.cpp:49
boost::spirit::qi::rule< std::string::const_iterator, std::string()> StringRule
Definition: strings.h:12
StringRule & atom_or_iri()
Definition: strings.cpp:58
StringRule & upper_prefix()
Definition: strings.cpp:37
StringRule & blank()
Definition: strings.cpp:62
StringRule & iri_entity()
Definition: strings.cpp:45
StringRule & single_quotes()
Definition: strings.cpp:25
StringRule & lower_prefix()
Definition: strings.cpp:33
StringRule & iri_ns()
Definition: strings.cpp:41
StringRule & double_quotes()
Definition: strings.cpp:29
StringRule & xsd_value()
Definition: strings.cpp:70
StringRule & atom()
Definition: strings.cpp:54
TermRule & string()
Definition: terms.cpp:63