Chris@16: /*============================================================================= Chris@16: Boost.Wave: A Standard compliant C++ preprocessor library Chris@16: Chris@16: Global application configuration Chris@16: Chris@16: http://www.boost.org/ Chris@16: Chris@16: Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost Chris@16: Software License, Version 1.0. (See accompanying file Chris@16: LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: =============================================================================*/ Chris@16: Chris@16: #if !defined(BOOST_SPIRIT_PATTERN_PARSER_HPP) Chris@16: #define BOOST_SPIRIT_PATTERN_PARSER_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: // this must occur after all of the includes and before any code appears Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: #include BOOST_ABI_PREFIX Chris@16: #endif Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: namespace boost { Chris@16: namespace wave { Chris@16: namespace util { Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: // Chris@16: // pattern_and class Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////// Chris@16: template Chris@16: struct pattern_and Chris@16: : public boost::spirit::classic::char_parser > Chris@16: { Chris@16: pattern_and(CharT pattern_, unsigned long pattern_mask_ = 0UL) Chris@16: : pattern(pattern_), Chris@16: pattern_mask((0UL != pattern_mask_) ? Chris@16: pattern_mask_ : (unsigned long)pattern_) Chris@16: {} Chris@16: Chris@16: template Chris@16: bool test(T pattern_) const Chris@16: { return ((unsigned long)pattern_ & pattern_mask) == (unsigned long)pattern; } Chris@16: Chris@16: CharT pattern; Chris@16: unsigned long pattern_mask; Chris@16: }; Chris@16: Chris@16: template Chris@16: inline pattern_and Chris@16: pattern_p(CharT pattern, unsigned long pattern_mask = 0UL) Chris@16: { return pattern_and(pattern, pattern_mask); } Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: } // namespace util Chris@16: } // namespace wave Chris@16: } // namespace boost Chris@16: Chris@16: // the suffix header occurs after all of the code Chris@16: #ifdef BOOST_HAS_ABI_HEADERS Chris@16: #include BOOST_ABI_SUFFIX Chris@16: #endif Chris@16: Chris@16: #endif // defined(BOOST_SPIRIT_PATTERN_PARSER_HPP)