/*============================================================================= Copyright (c) 2001-2011 Hartmut Kaiser Copyright (c) 2001-2011 Joel de Guzman Copyright (c) 2010 Bryce Lelbach 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_ATTRIBUTES_FWD_OCT_01_2009_0715AM) #define BOOST_SPIRIT_ATTRIBUTES_FWD_OCT_01_2009_0715AM #if defined(_MSC_VER) #pragma once #endif #include #if (defined(__GNUC__) && (__GNUC__ < 4)) || \ (defined(__APPLE__) && defined(__INTEL_COMPILER)) #include #endif #include /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { namespace result_of { // forward declaration only template struct extract_from; template struct attribute_as; template struct pre_transform; template struct optional_value; template struct begin; template struct end; template struct deref; }}} /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { namespace traits { /////////////////////////////////////////////////////////////////////////// // Determine if T is a proxy /////////////////////////////////////////////////////////////////////////// template struct is_proxy; /////////////////////////////////////////////////////////////////////////// // Retrieve the attribute type to use from the given type // // This is needed to extract the correct attribute type from proxy classes // as utilized in FUSION_ADAPT_ADT et. al. /////////////////////////////////////////////////////////////////////////// template struct attribute_type; /////////////////////////////////////////////////////////////////////////// // Retrieve the size of a fusion sequence (compile time) /////////////////////////////////////////////////////////////////////////// template struct sequence_size; /////////////////////////////////////////////////////////////////////////// // Retrieve the size of an attribute (runtime) /////////////////////////////////////////////////////////////////////////// template struct attribute_size; template typename attribute_size::type size(Attribute const& attr); /////////////////////////////////////////////////////////////////////////// // Determines how we pass attributes to semantic actions. This // may be specialized. By default, all attributes are wrapped in // a fusion sequence, because the attribute has to be treated as being // a single value in any case (even if it actually already is a fusion // sequence in its own). /////////////////////////////////////////////////////////////////////////// template struct pass_attribute; /////////////////////////////////////////////////////////////////////////// template struct optional_attribute; /////////////////////////////////////////////////////////////////////////// // Sometimes the user needs to transform the attribute types for certain // attributes. This template can be used as a customization point, where // the user is able specify specific transformation rules for any attribute // type. /////////////////////////////////////////////////////////////////////////// template struct transform_attribute; /////////////////////////////////////////////////////////////////////////// // Qi only template struct assign_to_attribute_from_iterators; template void assign_to(Iterator const& first, Iterator const& last, Attribute& attr); template void assign_to(Iterator const&, Iterator const&, unused_type); template struct assign_to_attribute_from_value; template struct assign_to_container_from_value; template void assign_to(T const& val, Attribute& attr); template void assign_to(T const&, unused_type); /////////////////////////////////////////////////////////////////////////// // Karma only template struct extract_from_attribute; template typename spirit::result_of::extract_from::type extract_from(Attribute const& attr, Context& ctx #if (defined(__GNUC__) && (__GNUC__ < 4)) || \ (defined(__APPLE__) && defined(__INTEL_COMPILER)) , typename enable_if >::type* = NULL #endif ); /////////////////////////////////////////////////////////////////////////// // Karma only template struct attribute_as; template typename spirit::result_of::attribute_as::type as(Attribute const& attr); template bool valid_as(Attribute const& attr); /////////////////////////////////////////////////////////////////////////// // return the type currently stored in the given variant /////////////////////////////////////////////////////////////////////////// template struct variant_which; template int which(T const& v); /////////////////////////////////////////////////////////////////////////// // Determine, whether T is a variant like type /////////////////////////////////////////////////////////////////////////// template struct not_is_variant; /////////////////////////////////////////////////////////////////////////// // Determine, whether T is a variant like type /////////////////////////////////////////////////////////////////////////// template struct not_is_optional; /////////////////////////////////////////////////////////////////////////// // Clear data efficiently /////////////////////////////////////////////////////////////////////////// template struct clear_value; /////////////////////////////////////////////////////////////////////// // Determine the value type of the given container type /////////////////////////////////////////////////////////////////////// template struct container_value; template struct container_iterator; template struct is_container; template struct is_iterator_range; /////////////////////////////////////////////////////////////////////////// template struct handles_container; /////////////////////////////////////////////////////////////////////////// // Qi only template struct push_back_container; template struct is_empty_container; template struct make_container_attribute; /////////////////////////////////////////////////////////////////////// // Determine the iterator type of the given container type // Karma only /////////////////////////////////////////////////////////////////////// template struct begin_container; template struct end_container; template struct deref_iterator; template struct next_iterator; template struct compare_iterators; /////////////////////////////////////////////////////////////////////////// // Print the given attribute of type T to the stream given as Out /////////////////////////////////////////////////////////////////////////// template struct print_attribute_debug; template void print_attribute(Out&, T const&); template void print_attribute(Out&, unused_type); /////////////////////////////////////////////////////////////////////////// template struct token_printer_debug; template void print_token(Out&, T const&); /////////////////////////////////////////////////////////////////////////// // Access attributes from a karma symbol table /////////////////////////////////////////////////////////////////////////// template struct symbols_lookup; template struct symbols_value; /////////////////////////////////////////////////////////////////////////// // transform attribute types exposed from compound operator components /////////////////////////////////////////////////////////////////////////// template struct alternative_attribute_transform; template struct sequence_attribute_transform; template struct permutation_attribute_transform; template struct sequential_or_attribute_transform; }}} #endif