1 /*=============================================================================
2 Copyright (c) 2009 Francois Barel
3 Copyright (c) 2001-2010 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_SPIRIT_REPOSITORY_SUPPORT_SUBRULE_CONTEXT_AUGUST_12_2009_0539PM)
9 #define BOOST_SPIRIT_REPOSITORY_SUPPORT_SUBRULE_CONTEXT_AUGUST_12_2009_0539PM
15 #include <boost/spirit/home/support/context.hpp>
17 ///////////////////////////////////////////////////////////////////////////////
18 namespace boost { namespace spirit { namespace repository
20 ///////////////////////////////////////////////////////////////////////////
21 // subrule_context: special context used with subrules, to pass around
22 // the current set of subrule definitions (subrule_group)
23 ///////////////////////////////////////////////////////////////////////////
24 template <typename Group, typename Attributes, typename Locals>
25 struct subrule_context
26 : context<Attributes, Locals>
28 typedef context<Attributes, Locals> base_type;
29 typedef Group group_type;
33 , typename Attributes::car_type attribute
34 ) : base_type(attribute), group(group)
38 template <typename Args, typename Context>
41 , typename Attributes::car_type attribute
43 , Context& caller_context
44 ) : base_type(attribute, args, caller_context), group(group)
48 subrule_context(Group const& group, Attributes const& attributes)
49 : base_type(attributes), group(group)