size_type BOOST_PP_CAT(name,_offset)() const { \
return field_offset_(static_cast<senf::mpl::rv<BOOST_PP_CAT(name,_index)-1>*>(0)); \
} \
- static size_type const BOOST_PP_CAT(name, _init_bytes) = SENF_MPL_SLOT_GET(init_bytes);
+ static size_type const BOOST_PP_CAT(name, _init_bytes) = \
+ SENF_MPL_SLOT_GET(init_bytes);
#
# define SENF_PARSER_I_FIELD_OFS_fix(name, type, access) \
- static size_type const BOOST_PP_CAT(name, _offset) = SENF_MPL_SLOT_GET(offset);
+ static size_type const BOOST_PP_CAT(name, _offset) = \
+ SENF_MPL_SLOT_GET(offset);
#
# ////////////////////////////////////////
# // SENF_PARSER_I_ADVANCE_OFS_*
return field_offset_(static_cast<senf::mpl::rv<BOOST_PP_CAT(name,_index)-1>*>(0)) \
- SENF_MPL_SLOT_GET(bitfield_size); \
} \
- static size_type const BOOST_PP_CAT(name, _init_bytes) = SENF_MPL_SLOT_GET(init_bytes) \
- - SENF_MPL_SLOT_GET(bitfield_size);
+ static size_type const BOOST_PP_CAT(name, _init_bytes) = \
+ SENF_MPL_SLOT_GET(init_bytes) - SENF_MPL_SLOT_GET(bitfield_size);
#
# define SENF_PARSER_I_BITFIELD_OFS_fix(name, type, access) \
- static size_type const BOOST_PP_CAT(name, _offset) = SENF_MPL_SLOT_GET(offset) \
- - SENF_MPL_SLOT_GET(bitfield_size);
+ static size_type const BOOST_PP_CAT(name, _offset) = \
+ SENF_MPL_SLOT_GET(offset) - SENF_MPL_SLOT_GET(bitfield_size);
#
# ////////////////////////////////////////
# // SENF_PARSER_I_BITFIELD_RESET
# define SENF_PARSER_SKIP_BITS_fix(bits) SENF_PARSER_I_SKIP_BITS(bits, fix)
#
# define SENF_PARSER_I_SKIP_BITS(bits, ofstype) \
- SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits)
+ private: \
+ SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits); \
+ public:
#
# ///////////////////////////////////////////////////////////////////////////
# // SENF_PARSER_GOTO_*
# // SENF_PARSER_COLLECTION_I
#
# ifndef DOXYGEN
-#
- namespace senf { namespace detail { namespace auxtag {
+#
+ namespace senf { namespace detail { namespace auxtag {
struct none {}; } } }
- namespace senf { namespace detail { namespace auxtag {
+ namespace senf { namespace detail { namespace auxtag {
struct bytes {}; } } }
- namespace senf { namespace detail { namespace auxtag {
- template <class Transform, class Tag>
+ namespace senf { namespace detail { namespace auxtag {
+ template <class Transform, class Tag>
struct transform {}; } } }
-#
+#
# endif
#
# define SENF_PARSER_COLLECTION_TAG_GOBBLE__bytes(x)
# define SENF_CAT_RECURS1_I(a, b) a ## b
# define SENF_CAT_RECURS2(a, b) SENF_CAT_RECURS2_I(a,b)
# define SENF_CAT_RECURS2_I(a, b) a ## b
+# define SENF_CAT_RECURS3(a, b) SENF_CAT_RECURS3_I(a,b)
+# define SENF_CAT_RECURS3_I(a, b) a ## b
#
# define SENF_PARSER_COLLECTION_TAG_GOBBLE__transform(x,y)
# define SENF_PARSER_COLLECTION_TAG__transform(x,y) \
# define SENF_PARSER_COLLECTION_HAS_KEYWORD(x) \
BOOST_PP_IS_EMPTY( SENF_CAT_RECURS1(SENF_PARSER_COLLECTION_TAG_GOBBLE__, x) )
#
+# define SENF_PARSER_COLLECTION_GETAUX(aux) \
+ BOOST_PP_IF( SENF_PARSER_COLLECTION_HAS_KEYWORD(aux), \
+ SENF_CAT_RECURS2(SENF_PARSER_COLLECTION_TAG_GETAUX__, aux), \
+ aux )
+
# define SENF_PARSER_COLLECTION_I(access, name, aux, traits) \
BOOST_PP_EXPAND( \
SENF_PARSER_COLLECTION_II \
template <class Parser> struct DynamicAuxParserPolicy;
template <class Parser, unsigned offset> struct FixedAuxParserPolicy;
template <class Parser, unsigned fixedOffset, bool fixedDelta>
- struct ParserAuxPolicySelect
+ struct ParserAuxPolicySelect
{ typedef senf::detail::DynamicAuxParserPolicy<Parser> type; };
template <class Parser, unsigned fixedOffset>
- struct ParserAuxPolicySelect<Parser, fixedOffset, true>
+ struct ParserAuxPolicySelect<Parser, fixedOffset, true>
{ typedef senf::detail::FixedAuxParserPolicy<Parser, fixedOffset> type; };
}};
#
template <class T> T BOOST_PP_CAT(name, _dispatch)(boost::true_type) const \
{ return parse<T>( SENF_PARSER_OFFSET(name) ); } \
template <class T> T BOOST_PP_CAT(name, _dispatch)(boost::false_type) const \
- { return parse<T>( aux(), SENF_PARSER_OFFSET(name) ); } \
+ { return parse<T>( BOOST_PP_CAT(aux,_)(), SENF_PARSER_OFFSET(name) ); } \
BOOST_PP_CAT(name, _t) BOOST_PP_CAT(name, _)() const \
{ return BOOST_PP_CAT(name, _dispatch) <BOOST_PP_CAT(name, _t)>( \
boost::integral_constant<bool, BOOST_PP_CAT(name, _aux_fixed)>()); } \