Index: home/lex/lexer/meta_grammar.hpp =================================================================== --- home/lex/lexer/meta_grammar.hpp (revision 49619) +++ home/lex/lexer/meta_grammar.hpp (working copy) @@ -94,11 +94,11 @@ // semantic actions for tokens meta_grammar::binary_rule< lex::domain, proto::tag::subscript, action, - token_def_meta_grammar, proto::when + token_def_meta_grammar, proto::when >, meta_grammar::binary_rule< lex::domain, proto::tag::subscript, action, - action_lexer_meta_grammar, proto::when + action_lexer_meta_grammar, proto::when > > { Index: home/lex/lexer/terminal_holder.hpp =================================================================== --- home/lex/lexer/terminal_holder.hpp (revision 49619) +++ home/lex/lexer/terminal_holder.hpp (working copy) @@ -7,7 +7,7 @@ #if !defined(BOOST_SPIRIT_LEX_TERMINAL_HOLDER_MAR_22_2007_0217PM) #define BOOST_SPIRIT_LEX_TERMINAL_HOLDER_MAR_22_2007_0217PM -#include +#include namespace boost { namespace spirit { namespace lex { Index: home/lex/set_state.hpp =================================================================== --- home/lex/set_state.hpp (revision 49619) +++ home/lex/set_state.hpp (working copy) @@ -10,7 +10,7 @@ #pragma once // MS compatible compilers support #pragma once #endif -#include +#include /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit Index: home/lex/qi/state/in_state.hpp =================================================================== --- home/lex/qi/state/in_state.hpp (revision 49619) +++ home/lex/qi/state/in_state.hpp (working copy) @@ -10,7 +10,7 @@ #pragma once // MS compatible compilers support #pragma once #endif -#include +#include /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { namespace qi Index: home/lex/qi/state/state_switcher.hpp =================================================================== --- home/lex/qi/state/state_switcher.hpp (revision 49619) +++ home/lex/qi/state/state_switcher.hpp (working copy) @@ -142,7 +142,7 @@ // the state has to be reset at exit in any case detail::reset_state_on_exit guard( - first, proto::arg_c<0>(argument1(component)).name); + first, proto::child_c<0>(argument1(component)).name); return director::parse(spirit::subject(component), first, last, context, skipper, attr); @@ -153,7 +153,7 @@ { std::string result("in_state(\""); result += spirit::detail::to_narrow_string( - proto::arg_c<0>(argument1(component)).name); + proto::child_c<0>(argument1(component)).name); result += "\")["; typedef typename Index: home/lex/qi/utility/plain_token.hpp =================================================================== --- home/lex/qi/utility/plain_token.hpp (revision 49619) +++ home/lex/qi/utility/plain_token.hpp (working copy) @@ -11,7 +11,7 @@ #endif #include -#include +#include #include namespace boost { namespace spirit { namespace qi Index: home/qi/binary/meta_grammar.hpp =================================================================== --- home/qi/binary/meta_grammar.hpp (revision 49619) +++ home/qi/binary/meta_grammar.hpp (working copy) @@ -197,7 +197,7 @@ struct int_binary_meta_grammar : meta_grammar::compose_empty< proto::if_< - is_int_lit_tag() + is_int_lit_tag() >, qi::domain, mpl::identity > @@ -209,7 +209,7 @@ : proto::or_< meta_grammar::compose_empty< proto::if_< - is_binary_tag() + is_binary_tag() >, qi::domain, mpl::identity > @@ -217,7 +217,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_binary_tag() + is_binary_tag() >, int_binary_meta_grammar >, Index: home/qi/nonterminal/nonterminal.hpp =================================================================== --- home/qi/nonterminal/nonterminal.hpp (revision 49619) +++ home/qi/nonterminal/nonterminal.hpp (working copy) @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include Index: home/qi/stream/meta_grammar.hpp =================================================================== --- home/qi/stream/meta_grammar.hpp (revision 49619) +++ home/qi/stream/meta_grammar.hpp (working copy) @@ -95,7 +95,7 @@ // stream, wstream meta_grammar::compose_empty< proto::if_< - is_stream_tag() + is_stream_tag() >, qi::domain, mpl::identity > Index: home/qi/operator/meta_grammar.hpp =================================================================== --- home/qi/operator/meta_grammar.hpp (revision 49619) +++ home/qi/operator/meta_grammar.hpp (working copy) @@ -99,7 +99,7 @@ > // +a , meta_grammar::unary_rule< - qi::domain, proto::tag::posit, plus + qi::domain, proto::tag::unary_plus, plus , main_meta_grammar > // &a Index: home/qi/numeric/meta_grammar.hpp =================================================================== --- home/qi/numeric/meta_grammar.hpp (revision 49619) +++ home/qi/numeric/meta_grammar.hpp (working copy) @@ -271,7 +271,7 @@ /////////////////////////////////////////////////////////////////////////// struct int_meta_grammar : meta_grammar::compose_empty< - proto::if_()> + proto::if_()> , qi::domain , mpl::identity > > @@ -279,7 +279,7 @@ struct real_meta_grammar : meta_grammar::compose_single< - proto::if_()> + proto::if_()> , qi::domain , mpl::identity > > Index: home/qi/string/meta_grammar.hpp =================================================================== --- home/qi/string/meta_grammar.hpp (revision 49619) +++ home/qi/string/meta_grammar.hpp (working copy) @@ -159,7 +159,7 @@ , meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_lit_tag()> + is_lit_tag()> , proto::or_ > , qi::domain @@ -170,7 +170,7 @@ , tag::lit , lazy_string , proto::if_< - detail::is_not_convertible_to_int() > + detail::is_not_convertible_to_int() > > , meta_grammar::terminal_rule< qi::domain Index: home/qi/string/symbols.hpp =================================================================== --- home/qi/string/symbols.hpp (revision 49619) +++ home/qi/string/symbols.hpp (working copy) @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include @@ -92,7 +92,7 @@ : add(*this) , remove(*this) { - proto::arg(*this).lookup = ptr_type(new Lookup()); + proto::child(*this).lookup = ptr_type(new Lookup()); } template @@ -100,7 +100,7 @@ : add(*this) , remove(*this) { - proto::arg(*this).lookup = ptr_type(new Lookup()); + proto::child(*this).lookup = ptr_type(new Lookup()); typename range_const_iterator::type si = boost::begin(syms); while (si != boost::end(syms)) add(*si++); @@ -111,7 +111,7 @@ : add(*this) , remove(*this) { - proto::arg(*this).lookup = ptr_type(new Lookup()); + proto::child(*this).lookup = ptr_type(new Lookup()); typename range_const_iterator::type si = boost::begin(syms); typename range_const_iterator::type di = boost::begin(data); while (si != boost::end(syms)) @@ -121,7 +121,7 @@ symbols& operator=(symbols const& rhs) { - proto::arg(*this) = proto::arg(rhs); + proto::child(*this) = proto::child(rhs); return *this; } @@ -154,7 +154,7 @@ ptr_type lookup() const { - return proto::arg(*this).lookup; + return proto::child(*this).lookup; } template Index: home/qi/auxiliary/confix.hpp =================================================================== --- home/qi/auxiliary/confix.hpp (revision 49619) +++ home/qi/auxiliary/confix.hpp (working copy) @@ -82,7 +82,7 @@ // parse the prefix parse_helper(first, last, context, skipper, spirit::detail::confix_extractor::prefix( - proto::arg_c<0>(spirit::argument1(component)))); + proto::child_c<0>(spirit::argument1(component)))); // generate the embedded items typedef typename @@ -94,7 +94,7 @@ // append the suffix parse_helper(first, last, context, skipper, spirit::detail::confix_extractor::suffix( - proto::arg_c<0>(spirit::argument1(component)))); + proto::child_c<0>(spirit::argument1(component)))); return result; } @@ -105,11 +105,11 @@ std::string result = "confix("; result += what_helper(spirit::detail::confix_extractor::prefix( - proto::arg_c<0>(spirit::argument1(component))), ctx); + proto::child_c<0>(spirit::argument1(component))), ctx); result += ", "; result += what_helper(spirit::detail::confix_extractor::suffix( - proto::arg_c<0>(spirit::argument1(component))), ctx); + proto::child_c<0>(spirit::argument1(component))), ctx); result += ")["; typedef typename Index: home/qi/action/meta_grammar.hpp =================================================================== --- home/qi/action/meta_grammar.hpp (revision 49619) +++ home/qi/action/meta_grammar.hpp (working copy) @@ -31,7 +31,7 @@ struct action_meta_grammar : meta_grammar::binary_rule< qi::domain, proto::tag::subscript, action - , main_meta_grammar, proto::when + , main_meta_grammar, proto::when > { }; Index: home/qi/char/meta_grammar.hpp =================================================================== --- home/qi/char/meta_grammar.hpp (revision 49619) +++ home/qi/char/meta_grammar.hpp (working copy) @@ -263,7 +263,7 @@ // char_, wchar --> any_char meta_grammar::compose_empty< proto::if_< - is_char_tag() + is_char_tag() > , qi::domain , mpl::identity > @@ -272,7 +272,7 @@ , meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_char_tag() + is_char_tag() > , single_char_literal_meta_grammar > @@ -283,7 +283,7 @@ , meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_lit_tag() + is_lit_tag() > , basic_char_literal_meta_grammar > @@ -294,7 +294,7 @@ , meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_char_tag()> + is_char_tag()> , proto::or_ > , qi::domain @@ -310,7 +310,7 @@ , meta_grammar::compose_function2_eval< proto::function< proto::if_< - is_char_tag() + is_char_tag() > , basic_char_literal_meta_grammar , basic_char_literal_meta_grammar Index: home/karma/binary/meta_grammar.hpp =================================================================== --- home/karma/binary/meta_grammar.hpp (revision 49619) +++ home/karma/binary/meta_grammar.hpp (working copy) @@ -199,7 +199,7 @@ struct int_binary_meta_grammar : meta_grammar::compose_empty< proto::if_< - is_int_lit_tag() + is_int_lit_tag() >, karma::domain, mpl::identity > @@ -211,7 +211,7 @@ : proto::or_< meta_grammar::compose_empty< proto::if_< - is_binary_tag() + is_binary_tag() >, karma::domain, mpl::identity > @@ -219,7 +219,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_binary_tag() + is_binary_tag() >, int_binary_meta_grammar >, Index: home/karma/nonterminal/nonterminal.hpp =================================================================== --- home/karma/nonterminal/nonterminal.hpp (revision 49619) +++ home/karma/nonterminal/nonterminal.hpp (working copy) @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include Index: home/karma/stream/meta_grammar.hpp =================================================================== --- home/karma/stream/meta_grammar.hpp (revision 49619) +++ home/karma/stream/meta_grammar.hpp (working copy) @@ -75,7 +75,7 @@ // stream, wstream meta_grammar::compose_empty< proto::if_< - is_stream_tag() + is_stream_tag() >, karma::domain, mpl::identity > @@ -84,7 +84,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_stream_tag() + is_stream_tag() >, proto::_ >, Index: home/karma/operator/meta_grammar.hpp =================================================================== --- home/karma/operator/meta_grammar.hpp (revision 49619) +++ home/karma/operator/meta_grammar.hpp (working copy) @@ -70,7 +70,7 @@ main_meta_grammar >, meta_grammar::unary_rule< - karma::domain, proto::tag::posit, plus, + karma::domain, proto::tag::unary_plus, plus, main_meta_grammar >, meta_grammar::binary_rule< Index: home/karma/numeric/meta_grammar.hpp =================================================================== --- home/karma/numeric/meta_grammar.hpp (revision 49619) +++ home/karma/numeric/meta_grammar.hpp (working copy) @@ -359,7 +359,7 @@ struct int_literal_meta_grammar : meta_grammar::compose_empty< proto::if_< - is_int_lit_tag() + is_int_lit_tag() >, karma::domain, mpl::identity > @@ -372,7 +372,7 @@ : proto::or_< meta_grammar::compose_empty< proto::if_< - is_int_tag() + is_int_tag() >, karma::domain, mpl::identity > @@ -380,7 +380,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_int_tag() + is_int_tag() >, int_literal_meta_grammar >, @@ -394,7 +394,7 @@ struct real_literal_meta_grammar : meta_grammar::compose_empty< proto::if_< - is_real_lit_tag() + is_real_lit_tag() >, karma::domain, mpl::identity > @@ -405,7 +405,7 @@ : proto::or_< meta_grammar::compose_single< proto::if_< - is_real_tag() + is_real_tag() >, karma::domain, mpl::identity > @@ -413,7 +413,7 @@ meta_grammar::compose_function1_full< proto::function< proto::if_< - is_real_tag() + is_real_tag() >, real_literal_meta_grammar >, Index: home/karma/string/meta_grammar.hpp =================================================================== --- home/karma/string/meta_grammar.hpp (revision 49619) +++ home/karma/string/meta_grammar.hpp (working copy) @@ -185,7 +185,7 @@ std_string_meta_grammar, meta_grammar::compose_empty< proto::if_< - is_lit_tag() + is_lit_tag() >, karma::domain, mpl::identity > @@ -193,7 +193,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_lit_tag() + is_lit_tag() >, proto::or_< basic_string_literal_meta_grammar, @@ -206,7 +206,7 @@ meta_grammar::function1_rule< karma::domain, tag::lit, lazy_string, proto::if_< - detail::is_not_convertible_to_int() + detail::is_not_convertible_to_int() > > > Index: home/karma/auxiliary/confix.hpp =================================================================== --- home/karma/auxiliary/confix.hpp (revision 49619) +++ home/karma/auxiliary/confix.hpp (working copy) @@ -76,7 +76,7 @@ // generate the prefix generate_helper(sink, ctx, d, spirit::detail::confix_extractor::prefix( - proto::arg_c<0>(spirit::argument1(component)))); + proto::child_c<0>(spirit::argument1(component)))); // generate the embedded items typedef typename @@ -88,7 +88,7 @@ // append the suffix generate_helper(sink, ctx, d, spirit::detail::confix_extractor::suffix( - proto::arg_c<0>(spirit::argument1(component)))); + proto::child_c<0>(spirit::argument1(component)))); return result; } @@ -99,11 +99,11 @@ std::string result = "confix("; result += what_helper(spirit::detail::confix_extractor::prefix( - proto::arg_c<0>(spirit::argument1(component))), ctx); + proto::child_c<0>(spirit::argument1(component))), ctx); result += ", "; result += what_helper(spirit::detail::confix_extractor::suffix( - proto::arg_c<0>(spirit::argument1(component))), ctx); + proto::child_c<0>(spirit::argument1(component))), ctx); result += ")["; typedef typename Index: home/karma/action/meta_grammar.hpp =================================================================== --- home/karma/action/meta_grammar.hpp (revision 49619) +++ home/karma/action/meta_grammar.hpp (working copy) @@ -35,7 +35,7 @@ struct action_meta_grammar : meta_grammar::binary_rule< karma::domain, proto::tag::subscript, action, - main_meta_grammar, proto::when + main_meta_grammar, proto::when > { }; Index: home/karma/char/meta_grammar.hpp =================================================================== --- home/karma/char/meta_grammar.hpp (revision 49619) +++ home/karma/char/meta_grammar.hpp (working copy) @@ -163,7 +163,7 @@ // char_, wchar, space meta_grammar::compose_empty< proto::if_< - is_char_tag() + is_char_tag() >, karma::domain, mpl::identity > @@ -172,7 +172,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_char_tag() + is_char_tag() >, basic_char_literal_meta_grammar >, @@ -183,7 +183,7 @@ meta_grammar::compose_function1_eval< proto::function< proto::if_< - is_lit_tag() + is_lit_tag() >, basic_char_literal_meta_grammar >, Index: home/karma/directive/right_alignment.hpp =================================================================== --- home/karma/directive/right_alignment.hpp (revision 49619) +++ home/karma/directive/right_alignment.hpp (working copy) @@ -96,7 +96,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::right_align_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), ' '); + subject(component), proto::child_c<0>(argument1(component)), ' '); } template @@ -105,7 +105,7 @@ std::string result = "right_align("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ")["; typedef typename @@ -194,7 +194,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::right_align_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), + subject(component), proto::child_c<0>(argument1(component)), argument2(component)); } @@ -204,7 +204,7 @@ std::string result = "right_align("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ", "; typedef typename Index: home/karma/directive/center_alignment.hpp =================================================================== --- home/karma/directive/center_alignment.hpp (revision 49619) +++ home/karma/directive/center_alignment.hpp (working copy) @@ -96,7 +96,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::center_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), ' '); + subject(component), proto::child_c<0>(argument1(component)), ' '); } template @@ -105,7 +105,7 @@ std::string result = "center("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ")["; typedef typename @@ -194,7 +194,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::center_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), + subject(component), proto::child_c<0>(argument1(component)), argument2(component)); } @@ -204,7 +204,7 @@ std::string result = "center("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ", "; typedef typename Index: home/karma/directive/left_alignment.hpp =================================================================== --- home/karma/directive/left_alignment.hpp (revision 49619) +++ home/karma/directive/left_alignment.hpp (working copy) @@ -95,7 +95,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::left_align_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), ' '); + subject(component), proto::child_c<0>(argument1(component)), ' '); } template @@ -104,7 +104,7 @@ std::string result = "left_align("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ")["; typedef typename @@ -193,7 +193,7 @@ Context& ctx, Delimiter const& d, Parameter const& param) { return detail::left_align_generate(sink, ctx, d, param, - subject(component), proto::arg_c<0>(argument1(component)), + subject(component), proto::child_c<0>(argument1(component)), argument2(component)); } @@ -203,7 +203,7 @@ std::string result = "left_align("; result += boost::lexical_cast( - proto::arg_c<0>(argument1(component))); + proto::child_c<0>(argument1(component))); result += ", "; typedef typename Index: home/support/standard.hpp =================================================================== --- home/support/standard.hpp (revision 49619) +++ home/support/standard.hpp (working copy) @@ -8,7 +8,7 @@ #define SPIRIT_STANDARD_JAN_31_2006_0529PM #include -#include +#include namespace boost { namespace spirit { namespace standard { Index: home/support/nonterminal/nonterminal.hpp =================================================================== --- home/support/nonterminal/nonterminal.hpp (revision 49619) +++ home/support/nonterminal/nonterminal.hpp (working copy) @@ -7,7 +7,7 @@ #if !defined(BOOST_SPIRIT_NONTERMINAL_MAR_06_2007_0236PM) #define BOOST_SPIRIT_NONTERMINAL_MAR_06_2007_0236PM -#include +#include #include #include #include Index: home/support/component.hpp =================================================================== --- home/support/component.hpp (revision 49619) +++ home/support/component.hpp (working copy) @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include @@ -198,12 +198,8 @@ { typedef typename meta_grammar::grammar::type grammar; typedef typename proto::result_of::as_expr::type proto_xpr; - - typedef typename - grammar::template result< - void(proto_xpr, State, Visitor) - >::type - type; + typedef typename grammar::template impl callable; + typedef typename callable::result_type type; }; // special case for arrays @@ -214,12 +210,8 @@ { typedef typename meta_grammar::grammar::type grammar; typedef typename proto::result_of::as_expr::type proto_xpr; - - typedef typename - grammar::template result< - void(proto_xpr, State, Visitor) - >::type - type; + typedef typename grammar::template impl callable; + typedef typename callable::result_type type; }; // special case for components @@ -229,24 +221,36 @@ { }; } + + namespace detail + { + template + T &decay(T &t) + { + return t; + } + template + T *decay(T (&t)[N]) + { + return t; + } + } + template inline typename result_of::as_component::type as_component(Domain, Expr const& xpr) { - unused_type unused; - typedef typename result_of::as_component::grammar grammar; - return grammar()(proto::as_expr(xpr), unused, unused); + typedef typename result_of::as_component::callable callable; + return callable()(proto::as_expr(detail::decay(xpr)), unused_type(), unused_type()); } template inline typename result_of::as_component::type as_component(Domain, Expr const& xpr, State const& state, Visitor& visitor) { - typedef typename - result_of::as_component::grammar - grammar; - return grammar()(proto::as_expr(xpr), state, visitor); + typedef typename result_of::as_component::callable callable; + return callable()(proto::as_expr(detail::decay(xpr)), state, visitor); } template Index: home/support/placeholders.hpp =================================================================== --- home/support/placeholders.hpp (revision 49619) +++ home/support/placeholders.hpp (working copy) @@ -8,7 +8,7 @@ #if !defined(BOOST_SPIRIT_PLACEHOLDERS_NOV_18_2006_0326PM) #define BOOST_SPIRIT_PLACEHOLDERS_NOV_18_2006_0326PM -#include +#include #include #include Index: home/support/meta_grammar/basic_rules.hpp =================================================================== --- home/support/meta_grammar/basic_rules.hpp (revision 49619) +++ home/support/meta_grammar/basic_rules.hpp (working copy) @@ -11,8 +11,8 @@ #include #include #include -#include -#include +#include +#include #include namespace boost { namespace spirit { namespace meta_grammar Index: home/support/meta_grammar/basic_transforms.hpp =================================================================== --- home/support/meta_grammar/basic_transforms.hpp (revision 49619) +++ home/support/meta_grammar/basic_transforms.hpp (working copy) @@ -12,8 +12,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -25,6 +25,21 @@ namespace boost { namespace spirit { namespace meta_grammar { /////////////////////////////////////////////////////////////////////////// + // Invoke the specified grammar in the "Proto v2" way, dropping top + // level const and reference on the three parameters + //template + //typename Grammar::template impl::result_type + //invoke_grammar(Expr const &expr, State const &state, Data &data) + //{ + // return typename Grammar::template impl()(expr, state, data); + //} + + template + struct invoke_grammar + : Grammar::template impl + {}; + + /////////////////////////////////////////////////////////////////////////// // A proto transform for creating empty component meta descriptions // (proto expressions) usable for defining meta grammars. Additionally, // this is used to make the corresponding spirit component. @@ -37,35 +52,33 @@ // domain (i.e.: any_char) /////////////////////////////////////////////////////////////////////////// template - struct compose_empty : Grammar + struct compose_empty : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { - typedef typename proto::result_of::arg::type arg_type; + typedef typename proto::result_of::child::type arg_type; typedef traits::make_component< Domain , typename mpl::apply1::type , fusion::nil - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const&, State const&, Visitor&) const - { - typedef typename result::make_component result; - return result::call(fusion::nil()); - } + result_type operator ()( + typename impl::expr_param + , typename impl::state_param + , typename impl::data_param + ) const + { + return make_component::call(fusion::nil()); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -80,43 +93,41 @@ // domain (i.e.: negated_char_parser<...>) /////////////////////////////////////////////////////////////////////////// template - struct compose_single : Grammar + struct compose_single : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename Grammar::template result::type + proto::result_of::child< + typename Grammar::template impl::result_type >::type arg_type; - + typedef traits::make_component< Domain , typename mpl::apply1::type , typename fusion::result_of::make_cons::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef typename result::make_component result; - return result::call( - fusion::make_cons( - proto::arg(Grammar()(expr, state, visitor)) - ) - ); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + return make_component::call( + fusion::make_cons( + proto::child(invoke_grammar()(expr, state, data)) + ) + ); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -131,16 +142,13 @@ // domain (i.e.: difference) /////////////////////////////////////////////////////////////////////////// template - struct compose_double : Grammar + struct compose_double : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; typedef typename proto::result_of::left::type left_type; @@ -154,26 +162,24 @@ Domain , typename mpl::apply1::type , list_type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - - typename apply::trans trans = Grammar()(expr, state, visitor); - return result::call( - fusion::make_list(proto::left(trans), proto::right(trans)) - ); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); + return make_component::call( + fusion::make_list(proto::left(t), proto::right(t)) + ); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -189,21 +195,18 @@ /////////////////////////////////////////////////////////////////////////// template - struct compose_triple : Grammar + struct compose_triple : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; - typedef typename proto::result_of::arg_c::type arg0_type; - typedef typename proto::result_of::arg_c::type arg1_type; - typedef typename proto::result_of::arg_c::type arg2_type; + typedef typename proto::result_of::child_c::type arg0_type; + typedef typename proto::result_of::child_c::type arg1_type; + typedef typename proto::result_of::child_c::type arg2_type; typedef typename fusion::result_of::make_list::type @@ -214,26 +217,24 @@ Domain , typename mpl::apply1::type , list_type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - - typename apply::trans trans = Grammar()(expr, state, visitor); - return result::call( - fusion::make_list(proto::arg_c<0>(trans), proto::arg_c<1>(trans), proto::arg_c<2>(trans)) - ); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); + return make_component::call( + fusion::make_list(proto::child_c<0>(t), proto::child_c<1>(t), proto::child_c<2>(t)) + ); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -249,16 +250,13 @@ // domain (i.e.: difference) /////////////////////////////////////////////////////////////////////////// template - struct compose_right : Grammar + struct compose_right : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; typedef typename proto::result_of::right::type right_type; @@ -271,26 +269,24 @@ Domain , typename mpl::apply1::type , list_type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - - typename apply::trans trans = Grammar()(expr, state, visitor); - return result::call( - fusion::make_list(proto::right(trans)) - ); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); + return make_component::call( + fusion::make_list(proto::right(t)) + ); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -299,7 +295,7 @@ /////////////////////////////////////////////////////////////////////////// template struct if_transform - : proto::when, proto::bind > + : proto::when, proto::lazy > { }; @@ -307,33 +303,30 @@ // A proto transform that composes components from a fusion::list /////////////////////////////////////////////////////////////////////////// template - struct compose_list : Grammar + struct compose_list : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef traits::make_component< Domain, Director - , typename Grammar::template - result::type - , Visitor + , typename Grammar::template impl::result_type + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef typename result::make_component result; - return result::call(Grammar()(expr, state, visitor)); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + return make_component::call(invoke_grammar()(expr, state, data)); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -341,17 +334,14 @@ // from a 1-arity proto function expression (e.g. f(x)) /////////////////////////////////////////////////////////////////////////// template - struct compose_function1 : Grammar + struct compose_function1 : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg1; @@ -359,41 +349,39 @@ traits::make_component< Domain, Director , typename fusion::result_of::make_cons::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const&, Visitor&) const - { - typedef typename result::make_component result; - return result::call(fusion::make_cons(proto::arg(proto::arg_c<1>(expr)))); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + return make_component::call(fusion::make_cons(proto::child(proto::child_c<1>(expr)))); + } + }; }; // Same as compose_function1, except that DirectorF is a meta-function to // be evaluated to get the director template - struct compose_function1_eval : Grammar + struct compose_function1_eval : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type function; typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg1; @@ -402,42 +390,41 @@ Domain , typename mpl::apply2::type , typename fusion::result_of::make_cons::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const&, Visitor&) const - { - typedef typename result::make_component result; - return result::call( - fusion::make_cons(proto::arg(proto::arg_c<1>(expr)))); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + return make_component::call( + fusion::make_cons(proto::child(proto::child_c<1>(expr)))); + } + }; }; // Same as compose_function1, except that the generated component holds // not only the function argument, but the function tag as well template - struct compose_function1_full : Grammar + struct compose_function1_full : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type function; + typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg1; @@ -446,23 +433,24 @@ Domain , typename mpl::apply2::type , typename fusion::result_of::make_list::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& /*state*/, Visitor& /*visitor*/) const - { - typedef typename result::make_component result; - return result::call(fusion::make_list( - proto::arg(proto::arg_c<0>(expr)), - proto::arg(proto::arg_c<1>(expr)) - )); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param + , typename impl::data_param + ) const + { + return make_component::call(fusion::make_list( + proto::child(proto::child_c<0>(expr)), + proto::child(proto::child_c<1>(expr)) + )); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -470,23 +458,20 @@ // from a 2-arity proto function expression (e.g. f(x, y)) /////////////////////////////////////////////////////////////////////////// template - struct compose_function2 : Grammar + struct compose_function2 : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg1; typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg2; @@ -494,49 +479,49 @@ traits::make_component< Domain, Director , typename fusion::result_of::make_list::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& /*state*/, Visitor& /*visitor*/) const - { - typedef typename result::make_component result; - return result::call(fusion::make_list( - proto::arg(proto::arg_c<1>(expr)) - , proto::arg(proto::arg_c<2>(expr)) - )); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param + , typename impl::data_param + ) const + { + return make_component::call(fusion::make_list( + proto::child(proto::child_c<1>(expr)) + , proto::child(proto::child_c<2>(expr)) + )); + } + }; }; // Same as compose_function2, except that DirectorF is a meta-function to // be evaluated to get the director template - struct compose_function2_eval : Grammar + struct compose_function2_eval : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type function; + typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg1; + typedef typename - proto::result_of::arg< - typename proto::result_of::arg_c::type + proto::result_of::child< + typename proto::result_of::child_c::type >::type arg2; @@ -545,65 +530,59 @@ Domain , typename mpl::apply2::type , typename fusion::result_of::make_list::type - , Visitor + , Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& /*state*/, Visitor& /*visitor*/) const - { - typedef typename result::make_component result; - return result::call(fusion::make_list( - proto::arg(proto::arg_c<1>(expr)) - , proto::arg(proto::arg_c<2>(expr)) - )); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param + , typename impl::data_param + ) const + { + return make_component::call(fusion::make_list( + proto::child(proto::child_c<1>(expr)) + , proto::child(proto::child_c<2>(expr)) + )); + } + }; }; /////////////////////////////////////////////////////////////////////////// // A proto transform for directives. The directive (terminal) tag - // is pushed into the modifier state (the Visitor). + // is pushed into the modifier state (the Data). /////////////////////////////////////////////////////////////////////////// template - struct compose_deep_directive : Grammar + struct compose_deep_directive : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { typedef typename add_modifier< - Visitor - , typename proto::result_of::arg< - typename proto::result_of::arg_c::type + Data + , typename proto::result_of::child< + typename proto::result_of::child_c::type >::type >::type modifier_type; typedef typename - Grammar::template result::type - type; - }; + Grammar::template impl::result_type + result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor&) const - { - typename add_modifier< - Visitor - , typename proto::result_of::arg< - typename proto::result_of::arg_c::type - >::type - >::type - modifier; - return Grammar()(expr, state, modifier); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param + ) const + { + modifier_type modifier; + return invoke_grammar()(expr, state, modifier); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -615,48 +594,43 @@ // /////////////////////////////////////////////////////////////////////////// template - struct compose_subscript : Grammar + struct compose_subscript : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { // apply all grammar transformations mandated for the whole // expression typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; // this calculates the type of the directive - typedef typename proto::result_of::arg_c::type directive; + typedef typename proto::result_of::child_c::type directive; // this calculates the type of the embedded expression - typedef typename proto::result_of::arg_c::type embedded; + typedef typename proto::result_of::child_c::type embedded; // this is the type of the contained data typedef fusion::list list_type; typedef - traits::make_component + traits::make_component make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - typename apply::trans trans = Grammar()(expr, state, visitor); - - return result::call( - list_type(proto::arg_c<1>(trans), proto::arg_c<0>(trans))); - } + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); + return make_component::call( + list_type(proto::child_c<1>(t), proto::child_c<0>(t))); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -668,27 +642,24 @@ // /////////////////////////////////////////////////////////////////////////// template - struct compose_subscript_function1 : Grammar + struct compose_subscript_function1 : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { // apply all grammar transformations mandated for the whole // expression typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; // this calculates the type of the embedded expression - typedef typename proto::result_of::arg_c::type embedded; + typedef typename proto::result_of::child_c::type embedded; // this calculates the type of the argument of the function typedef typename - proto::result_of::arg_c< - typename proto::result_of::arg_c::type, 1 + proto::result_of::child_c< + typename proto::result_of::child_c::type, 1 >::type arg1; @@ -699,26 +670,25 @@ traits::make_component< Domain, Director, list_type, - Visitor + Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - typename apply::trans trans = Grammar()(expr, state, visitor); + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); - return result::call(list_type( - proto::arg_c<1>(trans), - proto::arg_c<1>(proto::arg_c<0>(trans)))); - } + return make_component::call(list_type( + proto::child_c<1>(t), + proto::child_c<1>(proto::child_c<0>(t)))); + } + }; }; /////////////////////////////////////////////////////////////////////////// @@ -730,54 +700,50 @@ // /////////////////////////////////////////////////////////////////////////// template - struct compose_subscript_function2 : Grammar + struct compose_subscript_function2 : proto::transform >, Grammar { - template - struct result; - - template - struct result + template + struct impl : proto::transform_impl { // apply all grammar transformations mandated for the whole // expression typedef typename - Grammar::template result::type + Grammar::template impl::result_type trans; // this calculates the types of the arguments of the function - typedef typename proto::result_of::arg_c::type arg0; - typedef typename proto::result_of::arg_c::type arg1; - typedef typename proto::result_of::arg_c::type arg2; + typedef typename proto::result_of::child_c::type arg0; + typedef typename proto::result_of::child_c::type arg1; + typedef typename proto::result_of::child_c::type arg2; // this calculates the type of the embedded expression - typedef typename proto::result_of::arg_c::type embedded; + typedef typename proto::result_of::child_c::type embedded; typedef fusion::list list_type; typedef traits::make_component< Domain, Director, list_type, - Visitor + Data > make_component; - typedef typename make_component::type type; - }; + typedef typename make_component::type result_type; - template - typename result::type - operator ()(Expr const& expr, State const& state, Visitor& visitor) const - { - typedef result apply; - typedef typename apply::make_component result; - typedef typename apply::list_type list_type; - typename apply::trans trans = Grammar()(expr, state, visitor); - typename apply::arg0 arg0 = proto::arg_c<0>(trans); + result_type operator ()( + typename impl::expr_param expr + , typename impl::state_param state + , typename impl::data_param data + ) const + { + trans t = invoke_grammar()(expr, state, data); + arg0 a0 = proto::child_c<0>(t); - return result::call(list_type( - proto::arg_c<1>(trans), proto::arg_c<1>(arg0), - proto::arg_c<2>(arg0))); - } + return make_component::call(list_type( + proto::child_c<1>(t), proto::child_c<1>(a0), + proto::child_c<2>(a0))); + } + }; }; }}} Index: home/support/iso8859_1.hpp =================================================================== --- home/support/iso8859_1.hpp (revision 49619) +++ home/support/iso8859_1.hpp (working copy) @@ -8,7 +8,7 @@ #define SPIRIT_ISO8859_1_JAN_31_2006_0529PM #include -#include +#include namespace boost { namespace spirit { namespace iso8859_1 { Index: home/support/standard_wide.hpp =================================================================== --- home/support/standard_wide.hpp (revision 49619) +++ home/support/standard_wide.hpp (working copy) @@ -8,7 +8,7 @@ #define SPIRIT_STANDARD_WIDE_JAN_31_2006_0529PM #include -#include +#include namespace boost { namespace spirit { namespace standard_wide { Index: home/support/auxiliary/functor_holder.hpp =================================================================== --- home/support/auxiliary/functor_holder.hpp (revision 49619) +++ home/support/auxiliary/functor_holder.hpp (working copy) @@ -10,7 +10,7 @@ #pragma once // MS compatible compilers support #pragma once #endif -#include +#include namespace boost { namespace spirit { Index: home/support/ascii.hpp =================================================================== --- home/support/ascii.hpp (revision 49619) +++ home/support/ascii.hpp (working copy) @@ -8,7 +8,7 @@ #define SPIRIT_ASCII_JAN_31_2006_0529PM #include -#include +#include namespace boost { namespace spirit { namespace ascii {