How to define skipper grammar in separate translation unit?
What is the type of output attribute should be? Or can I simply specify boost::spirit::x3::unused_type
as Attribute
template parameter to boost::spirit::x3::rule
template class for skipper grammar? I think the skipper grammar should only internally move forward input iterator over blanks, newlines, comments, etc. It is better in sense of performance and memory allocations/frees. How to define a context type for such grammar, which should I provide to BOOST_SPIRIT_INSTANTIATE
macro?
Asked
Active
Viewed 480 times
4

sehe
- 374,641
- 47
- 450
- 633

Tomilov Anatoliy
- 15,657
- 10
- 64
- 169
-
1I guess this is a sign I should start looking at Spirit X3 :/ – sehe Sep 11 '14 at 08:56
1 Answers
3
Finally I found the solution.
using skipper_parser = x3::rule< class skipper_class, x3::unused_type const >;
is the definition of skipper parser type (const
-ness of returned type is important thing).
BOOST_SPIRIT_INSTANTIATE(skipper_parser, iterator_type, x3::unused_type)
is the instantiation of parse_rule
template function for the skipper somewere in separate translation unit.

Tomilov Anatoliy
- 15,657
- 10
- 64
- 169