Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:09:32

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Hartmut Kaiser
0003     Copyright (c) 2001-2011 Joel de Guzman
0004     Copyright (c)      2010 Bryce Lelbach
0005 
0006     Distributed under the Boost Software License, Version 1.0. (See accompanying
0007     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 ==============================================================================*/
0009 #if !defined(BOOST_SPIRIT_ATTRIBUTES_FWD_OCT_01_2009_0715AM)
0010 #define BOOST_SPIRIT_ATTRIBUTES_FWD_OCT_01_2009_0715AM
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/config.hpp>
0017 #if (defined(__GNUC__) && (__GNUC__ < 4)) || \
0018     (defined(__APPLE__) && defined(__INTEL_COMPILER))
0019 #include <boost/utility/enable_if.hpp>
0020 #endif
0021 #include <boost/spirit/home/support/unused.hpp>
0022 
0023 ///////////////////////////////////////////////////////////////////////////////
0024 namespace boost { namespace spirit { namespace result_of
0025 {
0026     // forward declaration only
0027     template <typename Exposed, typename Attribute>
0028     struct extract_from;
0029 
0030     template <typename T, typename Attribute>
0031     struct attribute_as;
0032 
0033     template <typename T>
0034     struct optional_value;
0035 
0036     template <typename Container>
0037     struct begin;
0038 
0039     template <typename Container>
0040     struct end;
0041 
0042     template <typename Iterator>
0043     struct deref;
0044 }}}
0045 
0046 ///////////////////////////////////////////////////////////////////////////////
0047 namespace boost { namespace spirit { namespace traits
0048 {
0049     ///////////////////////////////////////////////////////////////////////////
0050     // Find out if T can be a strong substitute for Expected attribute
0051     ///////////////////////////////////////////////////////////////////////////
0052     template <typename T, typename Expected, typename Enable = void>
0053     struct is_substitute;
0054 
0055     ///////////////////////////////////////////////////////////////////////////
0056     // Find out if T can be a weak substitute for Expected attribute
0057     ///////////////////////////////////////////////////////////////////////////
0058     template <typename T, typename Expected, typename Enable = void>
0059     struct is_weak_substitute;
0060 
0061     ///////////////////////////////////////////////////////////////////////////
0062     // Determine if T is a proxy
0063     ///////////////////////////////////////////////////////////////////////////
0064     template <typename T, typename Enable = void>
0065     struct is_proxy;
0066 
0067     ///////////////////////////////////////////////////////////////////////////
0068     // Retrieve the attribute type to use from the given type
0069     //
0070     // This is needed to extract the correct attribute type from proxy classes
0071     // as utilized in FUSION_ADAPT_ADT et. al.
0072     ///////////////////////////////////////////////////////////////////////////
0073     template <typename Attribute, typename Enable = void>
0074     struct attribute_type;
0075 
0076     ///////////////////////////////////////////////////////////////////////////
0077     // Retrieve the size of a fusion sequence (compile time)
0078     ///////////////////////////////////////////////////////////////////////////
0079     template <typename T>
0080     struct sequence_size;
0081 
0082     ///////////////////////////////////////////////////////////////////////////
0083     // Retrieve the size of an attribute (runtime)
0084     ///////////////////////////////////////////////////////////////////////////
0085     template <typename Attribute, typename Enable = void>
0086     struct attribute_size;
0087 
0088     template <typename Attribute>
0089     typename attribute_size<Attribute>::type
0090     size(Attribute const& attr);
0091 
0092     ///////////////////////////////////////////////////////////////////////////
0093     // Determines how we pass attributes to semantic actions. This
0094     // may be specialized. By default, all attributes are wrapped in
0095     // a fusion sequence, because the attribute has to be treated as being
0096     // a single value in any case (even if it actually already is a fusion
0097     // sequence in its own).
0098     ///////////////////////////////////////////////////////////////////////////
0099     template <typename Component, typename Attribute, typename Enable = void>
0100     struct pass_attribute;
0101 
0102     ///////////////////////////////////////////////////////////////////////////
0103     template <typename T, typename Enable = void>
0104     struct optional_attribute;
0105 
0106     ///////////////////////////////////////////////////////////////////////////
0107     // Sometimes the user needs to transform the attribute types for certain
0108     // attributes. This template can be used as a customization point, where
0109     // the user is able specify specific transformation rules for any attribute
0110     // type.
0111     ///////////////////////////////////////////////////////////////////////////
0112     template <typename Exposed, typename Transformed, typename Domain
0113       , typename Enable = void>
0114     struct transform_attribute;
0115 
0116     ///////////////////////////////////////////////////////////////////////////
0117     // Qi only
0118     template <typename Attribute, typename Iterator, typename Enable = void>
0119     struct assign_to_attribute_from_iterators;
0120 
0121     template <typename Iterator, typename Attribute>
0122     void assign_to(Iterator const& first, Iterator const& last, Attribute& attr);
0123 
0124     template <typename Iterator>
0125     void assign_to(Iterator const&, Iterator const&, unused_type);
0126 
0127     template <typename Attribute, typename T, typename Enable = void>
0128     struct assign_to_attribute_from_value;
0129 
0130     template <typename Attribute, typename T, typename Enable = void>
0131     struct assign_to_container_from_value;
0132 
0133     template <typename T, typename Attribute>
0134     void assign_to(T const& val, Attribute& attr);
0135 
0136     template <typename T>
0137     void assign_to(T const&, unused_type);
0138 
0139     ///////////////////////////////////////////////////////////////////////////
0140     // Karma only
0141     template <typename Attribute, typename Exposed, typename Enable = void>
0142     struct extract_from_attribute;
0143 
0144     template <typename Attribute, typename Exposed, typename Enable = void>
0145     struct extract_from_container;
0146 
0147     template <typename Exposed, typename Attribute, typename Context>
0148     typename spirit::result_of::extract_from<Exposed, Attribute>::type
0149     extract_from(Attribute const& attr, Context& ctx
0150 #if (defined(__GNUC__) && (__GNUC__ < 4)) || \
0151     (defined(__APPLE__) && defined(__INTEL_COMPILER))
0152       , typename enable_if<traits::not_is_unused<Attribute> >::type* = NULL
0153 #endif
0154     );
0155 
0156     ///////////////////////////////////////////////////////////////////////////
0157     // Karma only
0158     template <typename T, typename Attribute, typename Enable = void>
0159     struct attribute_as;
0160 
0161     template <typename T, typename Attribute>
0162     typename spirit::result_of::attribute_as<T, Attribute>::type
0163     as(Attribute const& attr);
0164 
0165     template <typename T, typename Attribute>
0166     bool valid_as(Attribute const& attr);
0167 
0168     ///////////////////////////////////////////////////////////////////////////
0169     // return the type currently stored in the given variant
0170     ///////////////////////////////////////////////////////////////////////////
0171     template <typename T, typename Enable = void>
0172     struct variant_which;
0173 
0174     template <typename T>
0175     int which(T const& v);
0176 
0177     ///////////////////////////////////////////////////////////////////////////
0178     // Determine, whether T is a variant like type
0179     ///////////////////////////////////////////////////////////////////////////
0180     template <typename T, typename Domain = unused_type, typename Enable = void>
0181     struct not_is_variant;
0182 
0183     ///////////////////////////////////////////////////////////////////////////
0184     // Determine, whether T is a variant like type
0185     ///////////////////////////////////////////////////////////////////////////
0186     template <typename T, typename Domain = unused_type, typename Enable = void>
0187     struct not_is_optional;
0188 
0189     ///////////////////////////////////////////////////////////////////////////
0190     // Clear data efficiently
0191     ///////////////////////////////////////////////////////////////////////////
0192     template <typename T, typename Enable = void>
0193     struct clear_value;
0194 
0195     ///////////////////////////////////////////////////////////////////////
0196     // Determine the value type of the given container type
0197     ///////////////////////////////////////////////////////////////////////
0198     template <typename Container, typename Enable = void>
0199     struct container_value;
0200 
0201     template <typename Container, typename Enable = void>
0202     struct container_iterator;
0203 
0204     template <typename T, typename Enable = void>
0205     struct is_container;
0206 
0207     template <typename T, typename Enable = void>
0208     struct is_iterator_range;
0209 
0210     ///////////////////////////////////////////////////////////////////////////
0211     template <typename T, typename Attribute, typename Context = unused_type
0212             , typename Iterator = unused_type, typename Enable = void>
0213     struct handles_container;
0214 
0215     template <typename Container, typename ValueType, typename Attribute
0216       , typename Sequence, typename Domain, typename Enable = void>
0217     struct pass_through_container;
0218 
0219     ///////////////////////////////////////////////////////////////////////////
0220     // Qi only
0221     template <typename Container, typename T, typename Enable = void>
0222     struct push_back_container;
0223 
0224     template <typename Container, typename Enable = void>
0225     struct is_empty_container;
0226 
0227     template <typename Container, typename Enable = void>
0228     struct make_container_attribute;
0229 
0230     ///////////////////////////////////////////////////////////////////////
0231     // Determine the iterator type of the given container type
0232     // Karma only
0233     ///////////////////////////////////////////////////////////////////////
0234     template <typename Container, typename Enable = void>
0235     struct begin_container;
0236 
0237     template <typename Container, typename Enable = void>
0238     struct end_container;
0239 
0240     template <typename Iterator, typename Enable = void>
0241     struct deref_iterator;
0242 
0243     template <typename Iterator, typename Enable = void>
0244     struct next_iterator;
0245 
0246     template <typename Iterator, typename Enable = void>
0247     struct compare_iterators;
0248 
0249     ///////////////////////////////////////////////////////////////////////////
0250     // Print the given attribute of type T to the stream given as Out
0251     ///////////////////////////////////////////////////////////////////////////
0252     template <typename Out, typename T, typename Enable = void>
0253     struct print_attribute_debug;
0254 
0255     template <typename Out, typename T>
0256     void print_attribute(Out&, T const&);
0257 
0258     template <typename Out>
0259     void print_attribute(Out&, unused_type);
0260 
0261     ///////////////////////////////////////////////////////////////////////////
0262     template <typename Char, typename Enable = void>
0263     struct token_printer_debug;
0264 
0265     template<typename Out, typename T>
0266     void print_token(Out&, T const&);
0267 
0268     ///////////////////////////////////////////////////////////////////////////
0269     // Access attributes from a karma symbol table
0270     ///////////////////////////////////////////////////////////////////////////
0271     template <typename T, typename Attribute, typename Enable = void>
0272     struct symbols_lookup;
0273 
0274     template <typename Attribute, typename T, typename Enable = void>
0275     struct symbols_value;
0276 
0277     ///////////////////////////////////////////////////////////////////////////
0278     // transform attribute types exposed from compound operator components
0279     ///////////////////////////////////////////////////////////////////////////
0280     template <typename Attribute, typename Domain>
0281     struct alternative_attribute_transform;
0282 
0283     template <typename Attribute, typename Domain>
0284     struct sequence_attribute_transform;
0285 
0286     template <typename Attribute, typename Domain>
0287     struct permutation_attribute_transform;
0288 
0289     template <typename Attribute, typename Domain>
0290     struct sequential_or_attribute_transform;
0291 }}}
0292 
0293 #endif
0294