1 | /*============================================================================= |
---|
2 | Copyright (c) 2001-2003 Joel de Guzman |
---|
3 | Copyright (c) 2002-2003 Hartmut Kaiser |
---|
4 | http://spirit.sourceforge.net/ |
---|
5 | |
---|
6 | Use, modification and distribution is subject to the Boost Software |
---|
7 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
8 | http://www.boost.org/LICENSE_1_0.txt) |
---|
9 | =============================================================================*/ |
---|
10 | #if !defined(BOOST_SPIRIT_PARSER_NAMES_HPP) |
---|
11 | #define BOOST_SPIRIT_PARSER_NAMES_HPP |
---|
12 | |
---|
13 | #if defined(BOOST_SPIRIT_DEBUG) |
---|
14 | |
---|
15 | ////////////////////////////////// |
---|
16 | #include <boost/spirit/core.hpp> |
---|
17 | |
---|
18 | namespace boost { namespace spirit { |
---|
19 | |
---|
20 | /////////////////////////////////////////////////////////////////////////////// |
---|
21 | // |
---|
22 | // Declaration of helper functions, which return the name of a concrete |
---|
23 | // parser instance. The functions are specialized on the parser types. The |
---|
24 | // functions declared in this file are for the predefined parser types from |
---|
25 | // the Spirit core library only, so additional functions might be provided as |
---|
26 | // needed. |
---|
27 | // |
---|
28 | /////////////////////////////////////////////////////////////////////////////// |
---|
29 | |
---|
30 | /////////////////////////////////////////////////////////////////////////////// |
---|
31 | // from actions.hpp |
---|
32 | template <typename ParserT, typename ActionT> |
---|
33 | std::string |
---|
34 | parser_name(action<ParserT, ActionT> const& p); |
---|
35 | |
---|
36 | /////////////////////////////////////////////////////////////////////////////// |
---|
37 | // from directives.hpp |
---|
38 | template <typename ParserT> |
---|
39 | std::string |
---|
40 | parser_name(contiguous<ParserT> const& p); |
---|
41 | |
---|
42 | template <typename ParserT> |
---|
43 | std::string |
---|
44 | parser_name(inhibit_case<ParserT> const& p); |
---|
45 | |
---|
46 | template <typename A, typename B> |
---|
47 | std::string |
---|
48 | parser_name(longest_alternative<A, B> const& p); |
---|
49 | |
---|
50 | template <typename A, typename B> |
---|
51 | std::string |
---|
52 | parser_name(shortest_alternative<A, B> const& p); |
---|
53 | |
---|
54 | /////////////////////////////////////////////////////////////////////////////// |
---|
55 | // from grammar.hpp |
---|
56 | template <typename DerivedT, typename ContextT> |
---|
57 | std::string |
---|
58 | parser_name(grammar<DerivedT, ContextT> const& p); |
---|
59 | |
---|
60 | /////////////////////////////////////////////////////////////////////////////// |
---|
61 | // from numerics.hpp |
---|
62 | template <typename T, int Radix, unsigned MinDigits, int MaxDigits> |
---|
63 | std::string |
---|
64 | parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& p); |
---|
65 | |
---|
66 | template <typename T, int Radix, unsigned MinDigits, int MaxDigits> |
---|
67 | std::string |
---|
68 | parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& p); |
---|
69 | |
---|
70 | template <typename T, typename RealPoliciesT> |
---|
71 | std::string |
---|
72 | parser_name(real_parser<T, RealPoliciesT> const& p); |
---|
73 | |
---|
74 | /////////////////////////////////////////////////////////////////////////////// |
---|
75 | // from operators.hpp |
---|
76 | template <typename A, typename B> |
---|
77 | std::string |
---|
78 | parser_name(sequence<A, B> const& p); |
---|
79 | |
---|
80 | template <typename A, typename B> |
---|
81 | std::string |
---|
82 | parser_name(sequential_or<A, B> const& p); |
---|
83 | |
---|
84 | template <typename A, typename B> |
---|
85 | std::string |
---|
86 | parser_name(alternative<A, B> const& p); |
---|
87 | |
---|
88 | template <typename A, typename B> |
---|
89 | std::string |
---|
90 | parser_name(intersection<A, B> const& p); |
---|
91 | |
---|
92 | template <typename A, typename B> |
---|
93 | std::string |
---|
94 | parser_name(difference<A, B> const& p); |
---|
95 | |
---|
96 | template <typename A, typename B> |
---|
97 | std::string |
---|
98 | parser_name(exclusive_or<A, B> const& p); |
---|
99 | |
---|
100 | template <typename S> |
---|
101 | std::string |
---|
102 | parser_name(optional<S> const& p); |
---|
103 | |
---|
104 | template <typename S> |
---|
105 | std::string |
---|
106 | parser_name(kleene_star<S> const& p); |
---|
107 | |
---|
108 | template <typename S> |
---|
109 | std::string |
---|
110 | parser_name(positive<S> const& p); |
---|
111 | |
---|
112 | /////////////////////////////////////////////////////////////////////////////// |
---|
113 | // from parser.hpp |
---|
114 | template <typename DerivedT> |
---|
115 | std::string |
---|
116 | parser_name(parser<DerivedT> const& p); |
---|
117 | |
---|
118 | /////////////////////////////////////////////////////////////////////////////// |
---|
119 | // from primitives.hpp |
---|
120 | template <typename DerivedT> |
---|
121 | std::string |
---|
122 | parser_name(char_parser<DerivedT> const &p); |
---|
123 | |
---|
124 | template <typename CharT> |
---|
125 | std::string |
---|
126 | parser_name(chlit<CharT> const &p); |
---|
127 | |
---|
128 | template <typename CharT> |
---|
129 | std::string |
---|
130 | parser_name(range<CharT> const &p); |
---|
131 | |
---|
132 | template <typename IteratorT> |
---|
133 | std::string |
---|
134 | parser_name(chseq<IteratorT> const &p); |
---|
135 | |
---|
136 | template <typename IteratorT> |
---|
137 | std::string |
---|
138 | parser_name(strlit<IteratorT> const &p); |
---|
139 | |
---|
140 | std::string |
---|
141 | parser_name(nothing_parser const &p); |
---|
142 | |
---|
143 | std::string |
---|
144 | parser_name(epsilon_parser const &p); |
---|
145 | |
---|
146 | std::string |
---|
147 | parser_name(anychar_parser const &p); |
---|
148 | |
---|
149 | std::string |
---|
150 | parser_name(alnum_parser const &p); |
---|
151 | |
---|
152 | std::string |
---|
153 | parser_name(alpha_parser const &p); |
---|
154 | |
---|
155 | std::string |
---|
156 | parser_name(cntrl_parser const &p); |
---|
157 | |
---|
158 | std::string |
---|
159 | parser_name(digit_parser const &p); |
---|
160 | |
---|
161 | std::string |
---|
162 | parser_name(graph_parser const &p); |
---|
163 | |
---|
164 | std::string |
---|
165 | parser_name(lower_parser const &p); |
---|
166 | |
---|
167 | std::string |
---|
168 | parser_name(print_parser const &p); |
---|
169 | |
---|
170 | std::string |
---|
171 | parser_name(punct_parser const &p); |
---|
172 | |
---|
173 | std::string |
---|
174 | parser_name(blank_parser const &p); |
---|
175 | |
---|
176 | std::string |
---|
177 | parser_name(space_parser const &p); |
---|
178 | |
---|
179 | std::string |
---|
180 | parser_name(upper_parser const &p); |
---|
181 | |
---|
182 | std::string |
---|
183 | parser_name(xdigit_parser const &p); |
---|
184 | |
---|
185 | std::string |
---|
186 | parser_name(eol_parser const &p); |
---|
187 | |
---|
188 | std::string |
---|
189 | parser_name(end_parser const &p); |
---|
190 | |
---|
191 | /////////////////////////////////////////////////////////////////////////////// |
---|
192 | // from rule.hpp |
---|
193 | template<typename T0, typename T1, typename T2> |
---|
194 | std::string |
---|
195 | parser_name(rule<T0, T1, T2> const& p); |
---|
196 | |
---|
197 | /////////////////////////////////////////////////////////////////////////////// |
---|
198 | // from subrule.hpp |
---|
199 | template <typename FirstT, typename RestT> |
---|
200 | std::string |
---|
201 | parser_name(subrule_list<FirstT, RestT> const &p); |
---|
202 | |
---|
203 | template <int ID, typename DefT, typename ContextT> |
---|
204 | std::string |
---|
205 | parser_name(subrule_parser<ID, DefT, ContextT> const &p); |
---|
206 | |
---|
207 | template <int ID, typename ContextT> |
---|
208 | std::string |
---|
209 | parser_name(subrule<ID, ContextT> const &p); |
---|
210 | |
---|
211 | /////////////////////////////////////////////////////////////////////////////// |
---|
212 | // from chset.hpp |
---|
213 | |
---|
214 | /////////////////////////////////////////////////////////////////////////////// |
---|
215 | // |
---|
216 | // Decide, if a node is to be traced or not |
---|
217 | // |
---|
218 | /////////////////////////////////////////////////////////////////////////////// |
---|
219 | template< |
---|
220 | typename DerivedT, typename EmbedT, |
---|
221 | typename T0, typename T1, typename T2 |
---|
222 | > |
---|
223 | bool |
---|
224 | trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> |
---|
225 | const& p); |
---|
226 | |
---|
227 | template <typename DerivedT, typename ContextT> |
---|
228 | bool |
---|
229 | trace_parser(grammar<DerivedT, ContextT> const& p); |
---|
230 | |
---|
231 | template <int ID, typename ContextT> |
---|
232 | bool |
---|
233 | trace_parser(subrule<ID, ContextT> const& p); |
---|
234 | |
---|
235 | template <typename ParserT, typename ActorTupleT> |
---|
236 | struct init_closure_parser; |
---|
237 | |
---|
238 | template <typename ParserT, typename ActorTupleT> |
---|
239 | bool |
---|
240 | trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p); |
---|
241 | |
---|
242 | /////////////////////////////////////////////////////////////////////////////// |
---|
243 | }} // namespace boost::spirit |
---|
244 | |
---|
245 | ////////////////////////////////// |
---|
246 | #include <boost/spirit/debug/impl/parser_names.ipp> |
---|
247 | |
---|
248 | #endif // defined(BOOST_SPIRIT_DEBUG) |
---|
249 | |
---|
250 | #endif // !defined(BOOST_SPIRIT_PARSER_NAMES_HPP) |
---|