summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/nonterminal/detail/rule.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/nonterminal/detail/rule.hpp')
-rw-r--r--boost/spirit/home/x3/nonterminal/detail/rule.hpp63
1 files changed, 14 insertions, 49 deletions
diff --git a/boost/spirit/home/x3/nonterminal/detail/rule.hpp b/boost/spirit/home/x3/nonterminal/detail/rule.hpp
index 54e2eef234..71dc4c549f 100644
--- a/boost/spirit/home/x3/nonterminal/detail/rule.hpp
+++ b/boost/spirit/home/x3/nonterminal/detail/rule.hpp
@@ -7,11 +7,10 @@
#if !defined(BOOST_SPIRIT_X3_DETAIL_RULE_JAN_08_2012_0326PM)
#define BOOST_SPIRIT_X3_DETAIL_RULE_JAN_08_2012_0326PM
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
+#include <boost/spirit/home/x3/auxiliary/guard.hpp>
#include <boost/spirit/home/x3/core/parser.hpp>
+#include <boost/spirit/home/x3/core/skip_over.hpp>
+#include <boost/spirit/home/x3/directive/expect.hpp>
#include <boost/spirit/home/x3/support/traits/make_attribute.hpp>
#include <boost/spirit/home/x3/support/utility/sfinae.hpp>
#include <boost/spirit/home/x3/nonterminal/detail/transform_attribute.hpp>
@@ -25,8 +24,8 @@ namespace boost { namespace spirit { namespace x3
{
template <typename ID>
struct identity;
-
- template <typename ID, typename Attribute = unused_type>
+
+ template <typename ID, typename Attribute = unused_type, bool force_attribute = false>
struct rule;
struct parse_pass_context_tag;
@@ -43,7 +42,7 @@ namespace boost { namespace spirit { namespace x3
bool r;
};
}
-
+
// default parse_rule implementation
template <typename ID, typename Attribute, typename Iterator
, typename Context, typename ActualAttribute>
@@ -88,7 +87,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
detail::simple_trace_type& f;
};
#endif
-
+
template <typename ID, typename Iterator, typename Context, typename Enable = void>
struct has_on_error : mpl::false_ {};
@@ -106,7 +105,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
>
: mpl::true_
{};
-
+
template <typename ID, typename Iterator, typename Attribute, typename Context, typename Enable = void>
struct has_on_success : mpl::false_ {};
@@ -136,7 +135,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
typedef identity<ID> type;
};
-
+
template <typename ID, typename RHS, typename Context>
Context const&
make_rule_context(RHS const& rhs, Context const& context
@@ -144,7 +143,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
return context;
}
-
+
template <typename ID, typename RHS, typename Context>
auto make_rule_context(RHS const& rhs, Context const& context
, mpl::true_ /* is_default_parse_rule */ )
@@ -163,7 +162,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
{
return true;
}
-
+
template <typename Iterator, typename Context, typename ActualAttribute>
static bool call_on_success(
Iterator& first, Iterator const& last
@@ -179,7 +178,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
);
return pass;
}
-
+
template <typename RHS, typename Iterator, typename Context
, typename RContext, typename ActualAttribute>
static bool parse_rhs_main(
@@ -219,7 +218,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
r = call_on_success(first_, i, context, attr
, has_on_success<ID, Iterator, Context, ActualAttribute>());
}
-
+
if (r)
first = i;
return r;
@@ -331,7 +330,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
#endif
ok_parse=parse_rhs(rhs, first, last, context, attr_, attr_
, mpl::bool_
- < ( RHS::has_action
+ < ( RHS::has_action
&& !ExplicitAttrPropagation::value
)
>()
@@ -345,40 +344,6 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
}
return ok_parse;
}
-
-// template <typename RuleDef, typename Iterator, typename Context
-// , typename ActualAttribute, typename AttributeContext>
-// static bool call_from_rule(
-// RuleDef const& rule_def
-// , char const* rule_name
-// , Iterator& first, Iterator const& last
-// , Context const& context, ActualAttribute& attr, AttributeContext& attr_ctx)
-// {
-// // This is called when a rule-body has already been established.
-// // The rule body is already established by the rule_definition class,
-// // we will not do it again. We'll simply call the RHS by calling
-// // call_rule_definition.
-//
-// return call_rule_definition(
-// rule_def.rhs, rule_name, first, last
-// , context, attr, attr_ctx.attr_ptr
-// , mpl::bool_<(RuleDef::explicit_attribute_propagation)>());
-// }
-//
-// template <typename RuleDef, typename Iterator, typename Context
-// , typename ActualAttribute>
-// static bool call_from_rule(
-// RuleDef const& rule_def
-// , char const* rule_name
-// , Iterator& first, Iterator const& last
-// , Context const& context, ActualAttribute& attr, unused_type)
-// {
-// // This is called when a rule-body has *not yet* been established.
-// // The rule body is established by the rule_definition class, so
-// // we call it to parse and establish the rule-body.
-//
-// return rule_def.parse(first, last, context, unused, attr); // $$$ fix unused param $$$
-// }
};
}}}}