2 #include <State/Address.hpp>
3 #include <State/Relation.hpp>
4 #include <State/ValueParser.hpp>
5 BOOST_FUSION_ADAPT_STRUCT(
State::Address, (QString, device)(QStringList, path))
7 BOOST_FUSION_ADAPT_STRUCT(
8 ossia::destination_qualifiers,
9 (ossia::destination_index, accessors)(ossia::unit_t, unit))
11 BOOST_FUSION_ADAPT_STRUCT(
13 (
State::Address, address)(ossia::destination_qualifiers, qualifiers))
19 namespace qi = boost::spirit::qi;
21 using boost::spirit::qi::rule;
23 template <
typename Iterator>
24 struct Address_parser : qi::grammar<Iterator, State::Address()>
27 : Address_parser::base_type(start)
31 dev = +qi::char_(std::string(ossia::net::device_characters()));
32 member_elt = +qi::char_(std::string(ossia::net::pattern_match_characters()));
33 path %= (+(
"/" >> member_elt) |
"/");
34 start %= -dev >>
":" >> path;
38 qi::rule<
Iterator, QString()> member_elt;
39 qi::rule<
Iterator, QStringList()> path;
43 template <
typename Iterator>
44 struct AccessorList_parser : qi::grammar<Iterator, ossia::destination_index()>
47 : AccessorList_parser::base_type(start)
49 using boost::spirit::int_;
50 using boost::spirit::qi::skip;
51 using boost::spirit::standard::space;
54 index %= skip(space)[
"[" >> int_ >>
"]"];
55 start %= skip(space)[+(index)];
58 qi::rule<
Iterator, ossia::destination_index()> start;
62 template <
typename Iterator>
63 struct AddressQualifiers_parser : qi::grammar<Iterator, ossia::destination_qualifiers()>
65 AddressQualifiers_parser()
66 : AddressQualifiers_parser::base_type(start)
68 using boost::spirit::int_;
69 using boost::spirit::qi::skip;
70 using boost::spirit::standard::space;
73 unit %= boost::spirit::eoi;
74 start %=
"@" >> ((accessors >> -unit) | (
"[" >> ossia::get_unit_parser() >>
"]"));
77 qi::rule<
Iterator, ossia::destination_qualifiers()> start;
78 AccessorList_parser<Iterator> accessors;
79 qi::rule<
Iterator, ossia::unit_t()> unit;
82 template <
typename Iterator>
83 struct AddressAccessor_parser : qi::grammar<Iterator, State::AddressAccessor()>
85 AddressAccessor_parser()
86 : AddressAccessor_parser::base_type(start)
88 using boost::spirit::int_;
89 using boost::spirit::qi::skip;
90 using boost::spirit::standard::space;
93 start %= skip(space)[address >> qualifiers];
97 Address_parser<Iterator> address;
98 AddressQualifiers_parser<Iterator> qualifiers;
Definition: lv2_atom_helpers.hpp:99
Definition: Address.hpp:108
The Address struct.
Definition: Address.hpp:58
Definition: Relation.hpp:71