1pub mod async_srdf;
9pub mod bnode;
10pub mod lang;
11pub mod literal;
12pub mod neighs;
13pub mod numeric_literal;
14pub mod object;
15pub mod query_srdf;
16pub mod rdf;
17pub mod rdf_data_config;
18pub mod rdf_format;
19pub mod shacl_path;
20pub mod srdf;
21pub mod srdf_basic;
22pub mod srdf_builder;
23pub mod srdf_graph;
24pub mod srdf_parser;
25pub mod srdf_sparql;
26pub mod matcher;
28pub mod vocab;
29
30pub use crate::async_srdf::*;
31pub use crate::neighs::*;
32pub use crate::query_srdf::*;
33pub use crate::rdf_data_config::*;
34pub use crate::srdf::*;
35pub use crate::srdf_basic::*;
36pub use bnode::*;
37pub use object::*;
38pub use rdf::*;
39pub use rdf_format::*;
40pub use shacl_path::*;
41pub use srdf_builder::*;
42pub use srdf_graph::*;
43pub use srdf_parser::*;
44pub use srdf_sparql::*;
45pub use vocab::*;
47
48#[macro_export]
51macro_rules! int {
52 (
53 $n: tt
54 ) => {
55 $crate::literal::Literal::integer($n)
56 };
57}
58
59#[macro_export]
91macro_rules! rdf_parser {
92 (
93 $(#[$attr:meta])*
94 $fn_vis: vis fn $name: ident [$($type_params: tt)*]( $($arg: ident : $arg_type: ty),*)
95 ($input_type: ty) -> $output_type: ty
96 where [$($where_clause: tt)*]
97 $parser: block
98 ) => {
99 $crate::combine_rdf_parser_impl!{
100 #[allow(non_camel_case_types)]
101 #[doc(hidden)]
102 $fn_vis struct $name;
103 $(#[$attr])*
104 $fn_vis fn $name [$($type_params)*]($($arg : $arg_type),*)($input_type) -> $output_type
105 where [$($where_clause)*]
106 $parser
107 }
108 };
109}
110
111#[macro_export]
113macro_rules! combine_rdf_parser_impl {
114 (
115 $(#[$derive:meta])*
116 $struct_vis: vis struct $type_name: ident;
117 $(#[$attr:meta])*
118 $fn_vis: vis fn $name: ident [$($type_params: tt)*]( $($arg: ident : $arg_type: ty),*)
119 ($input_type: ty) -> $output_type: ty
120 where [$($where_clause: tt)*]
121 $parser: block
122 ) => {
123
124 $(#[$derive])*
125 $struct_vis struct $type_name<$($type_params)*>
126 where
127 $input_type : $crate::FocusRDF,
128 $($where_clause)*
129 {
130 $(pub $arg : $arg_type,)*
131 __marker: ::std::marker::PhantomData<$input_type>,
132 }
133
134 impl <$($type_params)*> $crate::RDFNodeParse<$input_type> for $type_name<$($type_params)*>
135 where
136 $input_type : $crate::FocusRDF,
137 $($where_clause)*
138 {
139
140 type Output = $output_type;
141
142 #[inline]
143 fn parse_impl(
144 &mut self,
145 input: &mut $input_type,
146 ) -> $crate::srdf_parser::PResult<$output_type>
147 {
148 let $type_name { $( $arg: ref mut $arg,)* .. } = *self;
149 let r = $parser.parse_impl(input)?;
150 Ok(r)
151 }
152 }
153
154 $(#[$attr])*
155 #[inline]
156 $fn_vis fn $name< $($type_params)* >(
157 $($arg : $arg_type),*
158 ) -> $type_name<$($type_params)*>
159 where
160 $input_type: $crate::FocusRDF,
161 $($where_clause)*
162 {
163 $type_name {
164 $($arg,)*
165 __marker: ::std::marker::PhantomData,
166 }
167 }
168 }
169}
170
171#[macro_export]
172macro_rules! combine_parsers {
173 ($first : expr) => {
174 $first
175 };
176 ($first : expr, $($rest : expr),+) => {
177 combine_vec($first, combine_parsers!($($rest),+))
178 }
179}