Chris@102: /*============================================================================= Chris@102: Copyright (c) 2001-2014 Joel de Guzman Chris@102: Chris@102: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@102: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@102: =============================================================================*/ Chris@102: #if !defined(SPIRIT_OMIT_MARCH_24_2007_0802AM) Chris@102: #define SPIRIT_OMIT_MARCH_24_2007_0802AM Chris@102: Chris@102: #if defined(_MSC_VER) Chris@102: #pragma once Chris@102: #endif Chris@102: Chris@102: #include Chris@102: #include Chris@102: Chris@102: namespace boost { namespace spirit { namespace x3 Chris@102: { Chris@102: /////////////////////////////////////////////////////////////////////////// Chris@102: // omit_directive forces the attribute of subject parser Chris@102: // to be unused_type Chris@102: /////////////////////////////////////////////////////////////////////////// Chris@102: template Chris@102: struct omit_directive : unary_parser> Chris@102: { Chris@102: typedef unary_parser > base_type; Chris@102: typedef unused_type attribute_type; Chris@102: static bool const has_attribute = false; Chris@102: Chris@102: typedef Subject subject_type; Chris@102: omit_directive(Subject const& subject) Chris@102: : base_type(subject) {} Chris@102: Chris@102: template Chris@102: bool parse(Iterator& first, Iterator const& last Chris@102: , Context const& context, RContext& rcontext, unused_type) const Chris@102: { Chris@102: return this->subject.parse(first, last, context, rcontext, unused); Chris@102: } Chris@102: }; Chris@102: Chris@102: struct omit_gen Chris@102: { Chris@102: template Chris@102: omit_directive::value_type> Chris@102: operator[](Subject const& subject) const Chris@102: { Chris@102: return {as_parser(subject)}; Chris@102: } Chris@102: }; Chris@102: Chris@102: omit_gen const omit = omit_gen(); Chris@102: }}} Chris@102: Chris@102: #endif