/*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2001-2008 Hartmut Kaiser Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(BOOST_SPIRIT_PLACEHOLDERS_NOV_18_2006_0326PM) #define BOOST_SPIRIT_PLACEHOLDERS_NOV_18_2006_0326PM #include #include #include namespace boost { namespace spirit { // This file contains the common placeholders. If you have a placeholder // that can be (re)used in different spirit domains. This is the place // to put them in. namespace tag { struct char_ {}; struct wchar {}; struct lit {}; struct wlit {}; struct eol {}; struct eoi {}; struct bin {}; struct oct {}; struct hex {}; struct byte {}; struct word {}; struct dword {}; struct big_word {}; struct big_dword {}; struct little_word {}; struct little_dword {}; #ifdef BOOST_HAS_LONG_LONG struct qword {}; struct big_qword {}; struct little_qword {}; #endif struct pad {}; struct ushort {}; struct ulong {}; struct uint {}; struct short_ {}; struct long_ {}; struct int_ {}; #ifdef BOOST_HAS_LONG_LONG struct ulong_long {}; struct long_long {}; #endif struct float_ {}; struct double_ {}; struct long_double {}; struct left_align {}; struct right_align {}; struct center {}; struct delimit {}; struct verbatim {}; struct none {}; struct eps {}; struct lexeme {}; struct lazy {}; struct omit {}; struct raw {}; struct stream {}; struct wstream {}; struct token {}; } //////////////////////////////////////////////////////////////////////////// typedef proto::terminal::type char_type; typedef proto::terminal::type wchar_type; typedef proto::terminal::type lit_type; typedef proto::terminal::type wlit_type; typedef proto::terminal::type eol_type; typedef proto::terminal::type eoi_type; typedef proto::terminal::type bin_type; typedef proto::terminal::type oct_type; typedef proto::terminal::type hex_type; typedef proto::terminal::type byte_type; typedef proto::terminal::type word_type; typedef proto::terminal::type dword_type; typedef proto::terminal::type big_word_type; typedef proto::terminal::type big_dword_type; typedef proto::terminal::type little_word_type; typedef proto::terminal::type little_dword_type; #ifdef BOOST_HAS_LONG_LONG typedef proto::terminal::type qword_type; typedef proto::terminal::type big_qword_type; typedef proto::terminal::type little_qword_type; #endif typedef proto::terminal::type pad_type; typedef proto::terminal::type ushort_type; typedef proto::terminal::type ulong_type; typedef proto::terminal::type uint_type; typedef proto::terminal::type short_type; typedef proto::terminal::type long_type; typedef proto::terminal::type int_type; #ifdef BOOST_HAS_LONG_LONG typedef proto::terminal::type ulong_long_type; typedef proto::terminal::type long_long_type; #endif typedef proto::terminal::type float_type; typedef proto::terminal::type double_type; typedef proto::terminal::type long_double_type; typedef proto::terminal::type left_align_type; typedef proto::terminal::type right_align_type; typedef proto::terminal::type center_type; typedef proto::terminal::type delimit_type; typedef proto::terminal::type verbatim_type; typedef proto::terminal::type none_type; typedef proto::terminal::type eps_type; typedef proto::terminal::type lexeme_type; typedef proto::terminal::type lazy_type; typedef proto::terminal::type omitted; typedef proto::terminal::type raw_type; typedef proto::terminal::type stream_type; typedef proto::terminal::type wstream_type; typedef proto::terminal::type token_type; //////////////////////////////////////////////////////////////////////////// proto::terminal::type const char_ = {{}}; proto::terminal::type const wchar = {{}}; proto::terminal::type const lit = {{}}; proto::terminal::type const wlit = {{}}; proto::terminal::type const eol = {{}}; proto::terminal::type const eoi = {{}}; proto::terminal::type const bin = {{}}; proto::terminal::type const oct = {{}}; proto::terminal::type const hex = {{}}; proto::terminal::type const byte = {{}}; proto::terminal::type const word = {{}}; proto::terminal::type const dword = {{}}; proto::terminal::type const big_word = {{}}; proto::terminal::type const big_dword = {{}}; proto::terminal::type const little_word = {{}}; proto::terminal::type const little_dword = {{}}; #ifdef BOOST_HAS_LONG_LONG proto::terminal::type const qword = {{}}; proto::terminal::type const big_qword = {{}}; proto::terminal::type const little_qword = {{}}; #endif proto::terminal::type const pad = {{}}; proto::terminal::type const ushort = {{}}; proto::terminal::type const ulong = {{}}; proto::terminal::type const uint = {{}}; proto::terminal::type const short_ = {{}}; proto::terminal::type const long_ = {{}}; proto::terminal::type const int_ = {{}}; #ifdef BOOST_HAS_LONG_LONG proto::terminal::type const ulong_long = {{}}; proto::terminal::type const long_long = {{}}; #endif proto::terminal::type const float_ = {{}}; proto::terminal::type const double_ = {{}}; proto::terminal::type const long_double = {{}}; proto::terminal::type const left_align = {{}}; proto::terminal::type const right_align = {{}}; proto::terminal::type const center = {{}}; proto::terminal::type const delimit = {{}}; proto::terminal::type const verbatim = {{}}; proto::terminal::type const none = {{}}; proto::terminal::type const eps = {{}}; proto::terminal::type const lexeme = {{}}; proto::terminal::type const lazy = {{}}; proto::terminal::type const omit = {{}}; proto::terminal::type const raw = {{}}; proto::terminal::type const stream = {{}}; proto::terminal::type const wstream = {{}}; proto::terminal::type const token = {{}}; // Some platforms/compilers have conflict with these terminals below // we'll provide variations for them with trailing underscores as // substitutes. proto::terminal::type const uint_ = {{}}; #if defined(__GNUC__) inline void silence_unused_warnings__placeholders() { (void) char_; (void) wchar; (void) lit; (void) wlit; (void) eol; (void) eoi; (void) bin; (void) oct; (void) hex; (void) byte; (void) word; (void) dword; (void) big_word; (void) big_dword; (void) little_word; (void) little_dword; (void) ushort; (void) uint; (void) ulong; (void) short_; (void) int_; (void) long_; #ifdef BOOST_HAS_LONG_LONG (void) qword; (void) little_qword; (void) big_qword; (void) ulong_long; (void) long_long; #endif (void) pad; (void) float_; (void) double_; (void) long_double; (void) left_align; (void) right_align; (void) center; (void) delimit; (void) verbatim; (void) none; (void) eps; (void) lazy; (void) lexeme; (void) omit; (void) raw; (void) stream; (void) wstream; (void) token; } #endif /////////////////////////////////////////////////////////////////////////// // test if a tag is an int tag /////////////////////////////////////////////////////////////////////////// template struct is_int_tag : mpl::false_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; #ifdef BOOST_HAS_LONG_LONG template struct is_int_tag : mpl::true_ {}; template struct is_int_tag : mpl::true_ {}; #endif /////////////////////////////////////////////////////////////////////////// // test if a tag is an integer type /////////////////////////////////////////////////////////////////////////// template struct is_int_lit_tag : is_enum {}; template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; #ifdef BOOST_HAS_LONG_LONG template struct is_int_lit_tag : mpl::true_ {}; template struct is_int_lit_tag : mpl::true_ {}; #endif /////////////////////////////////////////////////////////////////////////// // test if a tag is an floating point tag /////////////////////////////////////////////////////////////////////////// template struct is_real_tag : mpl::false_ {}; template struct is_real_tag : mpl::true_ {}; template struct is_real_tag : mpl::true_ {}; template struct is_real_tag : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // test if a tag is a floating type /////////////////////////////////////////////////////////////////////////// template struct is_real_lit_tag : mpl::false_ {}; template struct is_real_lit_tag : mpl::true_ {}; template struct is_real_lit_tag : mpl::true_ {}; template struct is_real_lit_tag : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // test if a tag is a character literal type /////////////////////////////////////////////////////////////////////////// template struct is_char_tag : mpl::false_ {}; template struct is_char_tag : mpl::true_ {}; template struct is_char_tag : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // test if a tag is a character literal type /////////////////////////////////////////////////////////////////////////// template struct is_lit_tag : mpl::false_ {}; template struct is_lit_tag : mpl::true_ {}; template struct is_lit_tag : mpl::true_ {}; /////////////////////////////////////////////////////////////////////////// // test if a tag is a binary type /////////////////////////////////////////////////////////////////////////// template struct is_binary_tag : mpl::false_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; #ifdef BOOST_HAS_LONG_LONG template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; template struct is_binary_tag : mpl::true_ {}; #endif /////////////////////////////////////////////////////////////////////////// // test if a tag is a stream terminal /////////////////////////////////////////////////////////////////////////// template struct is_stream_tag : mpl::false_ {}; template struct is_stream_tag : mpl::true_ {}; template struct is_stream_tag : mpl::true_ {}; }} #endif