Menu

[94f52a]: / parser / tree_joined.hpp  Maximize  Restore  History

Download this file

53 lines (43 with data), 1.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef CHILON_PARSER_TREE_JOINED_HPP
#define CHILON_PARSER_TREE_JOINED_HPP
#include <chilon/parser/tree.hpp>
#include <chilon/parser/sequence.hpp>
#include <chilon/parser/detail/tree_joined.hpp>
namespace chilon { namespace parser {
/**
* Implements T |% J in TBPEG notation.
* Stores flatten_variant< stored<T>::type, vector< stored<T>::type > >::type
* @tparam J Join expression.
* @tparam T Expression to match.
*/
template <class J, class... T>
struct tree_joined : tree_joined<J, sequence<T...> > {};
template <class J, class T>
struct tree_joined<J, T>
: tree,
parse_base<detail::parse_tree_joined<
J, T, self, typename stored<joined_plus<J, T>>::type>>
{
template <class M, class N>
struct parser_type_node : detail::parse_tree_joined<J, T, M, N> {};
};
/**
* Implements T |^% J in TBPEG notation.
* Same as T |% J but no whitespace permitted around the join expression
*/
template <class J, class... T>
struct tree_joined_lexeme : tree_joined_lexeme<J, sequence<T...> > {};
template <class J, class T>
struct tree_joined_lexeme<J, T>
: tree,
parse_base<detail::parse_tree_joined<
J, T, self, typename stored<joined_plus<J, T>>::type, false>>
{
template <class M, class N>
struct parser_type_node : detail::parse_tree_joined<J, T, M, N, false> {};
};
template <class J, class T, class M, class N, bool Skip_whitespace>
struct parse< detail::parse_tree_joined<J, T, M, N, Skip_whitespace> >
: detail::parse_tree_joined<J, T, M, N, Skip_whitespace> {};
} }
#endif
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.