#include <cpp_macromap.hpp>
Public Types | |
typedef defined_macros_type::name_iterator | name_iterator |
typedef defined_macros_type::const_name_iterator | const_name_iterator |
Public Member Functions | |
macromap (ContextT &ctx_) | |
~macromap () | |
bool | add_macro (token_type const &name, bool has_parameters, parameter_container_type ¶meters, definition_container_type &definition, bool is_predefined=false, defined_macros_type *scope=0) |
bool | is_defined (string_type const &name, typename defined_macros_type::iterator &it, defined_macros_type *scope=0) const |
template<typename IteratorT > | |
bool | is_defined (IteratorT const &begin, IteratorT const &end) const |
bool | is_defined (string_type const &str) const |
bool | get_macro (string_type const &name, bool &has_parameters, bool &is_predefined, position_type &pos, parameter_container_type ¶meters, definition_container_type &definition, defined_macros_type *scope=0) const |
bool | remove_macro (string_type const &name, position_type const &pos, bool even_predefined=false) |
template<typename IteratorT , typename ContainerT > | |
token_type const & | expand_tokensequence (IteratorT &first, IteratorT const &last, ContainerT &pending, ContainerT &expanded, bool &seen_newline, bool expand_operator_defined) |
template<typename IteratorT , typename ContainerT > | |
void | expand_whole_tokensequence (ContainerT &expanded, IteratorT &first, IteratorT const &last, bool expand_operator_defined) |
void | init_predefined_macros (char const *fname="<Unknown>", defined_macros_type *scope=0, bool at_global_scope=true) |
void | predefine_macro (defined_macros_type *scope, string_type const &name, token_type const &t) |
void | reset_macromap () |
position_type & | get_main_pos () |
position_type const & | get_main_pos () const |
name_iterator | begin () |
name_iterator | end () |
const_name_iterator | begin () const |
const_name_iterator | end () const |
template<typename ContextT > | |
bool | is_defined (typename token_type::string_type const &name, typename defined_macros_type::iterator &it, defined_macros_type *scope) const |
template<typename IteratorT , typename ContainerT > | |
ContextT::token_type const & | expand_tokensequence (IteratorT &first, IteratorT const &last, ContainerT &pending, ContainerT &expanded, bool &seen_newline, bool expand_operator_defined) |
template<typename IteratorT , typename ContainerT > | |
ContextT::token_type const & | expand_tokensequence_worker (ContainerT &pending, unput_queue_iterator< IteratorT, token_type, ContainerT > &first, unput_queue_iterator< IteratorT, token_type, ContainerT > const &last, bool &seen_newline, bool expand_operator_defined) |
template<typename IteratorT , typename ContainerT , typename SizeT > | |
std::vector< ContainerT > ::size_type | collect_arguments (token_type const curr_token, std::vector< ContainerT > &arguments, IteratorT &next, IteratorT &endparen, IteratorT const &end, SizeT const ¶meter_count, bool &seen_newline) |
template<typename IteratorT , typename ContainerT > | |
ContextT::token_type const & | resolve_defined (IteratorT &first, IteratorT const &last, ContainerT &pending) |
Protected Member Functions | |
template<typename IteratorT , typename ContainerT > | |
token_type const & | expand_tokensequence_worker (ContainerT &pending, unput_queue_iterator< IteratorT, token_type, ContainerT > &first, unput_queue_iterator< IteratorT, token_type, ContainerT > const &last, bool &seen_newline, bool expand_operator_defined) |
template<typename IteratorT , typename ContainerT , typename SizeT > | |
std::vector< ContainerT > ::size_type | collect_arguments (token_type const curr_token, std::vector< ContainerT > &arguments, IteratorT &next, IteratorT &endparen, IteratorT const &end, SizeT const ¶meter_count, bool &seen_newline) |
template<typename IteratorT , typename ContainerT > | |
bool | expand_macro (ContainerT &pending, token_type const &name, typename defined_macros_type::iterator it, IteratorT &first, IteratorT const &last, bool &seen_newline, bool expand_operator_defined, defined_macros_type *scope=0, ContainerT *queue_symbol=0) |
template<typename ContainerT > | |
bool | expand_predefined_macro (token_type const &curr_token, ContainerT &expanded) |
template<typename ContainerT > | |
void | expand_argument (typename std::vector< ContainerT >::size_type arg, std::vector< ContainerT > &arguments, std::vector< ContainerT > &expanded_args, bool expand_operator_defined, std::vector< bool > &has_expanded_args) |
template<typename ContainerT > | |
void | expand_replacement_list (macro_definition_type const ¯odefinition, std::vector< ContainerT > &arguments, bool expand_operator_defined, ContainerT &expanded) |
template<typename IteratorT , typename ContainerT > | |
void | rescan_replacement_list (token_type const &curr_token, macro_definition_type ¯odef, ContainerT &replacement_list, ContainerT &expanded, bool expand_operator_defined, IteratorT &nfirst, IteratorT const &nlast) |
template<typename IteratorT , typename ContainerT > | |
token_type const & | resolve_defined (IteratorT &first, IteratorT const &last, ContainerT &expanded) |
template<typename IteratorT , typename ContainerT > | |
bool | resolve_operator_pragma (IteratorT &first, IteratorT const &last, ContainerT &expanded, bool &seen_newline) |
template<typename ContainerT > | |
bool | concat_tokensequence (ContainerT &expanded) |
template<typename ContainerT > | |
bool | is_valid_concat (string_type new_value, position_type const &pos, ContainerT &rescanned) |
typedef defined_macros_type::const_name_iterator boost::wave::util::macromap< ContextT >::const_name_iterator |
typedef defined_macros_type::name_iterator boost::wave::util::macromap< ContextT >::name_iterator |
|
inline |
|
inline |
|
inline |
References boost::wave::AltExtTokenType, BOOST_WAVE_THROW_NAME_CTX, boost::current_scope(), boost::wave::util::impl::definition_equals(), boost::wave::util::macromap< ContextT >::end(), boost::wave::ExtTokenOnlyMask, boost::wave::util::macro_definition< TokenT, ContainerT >::is_functionlike, boost::wave::util::impl::is_special_macroname(), boost::it, boost::wave::util::macro_definition< TokenT, ContainerT >::macrodefinition, boost::wave::util::macro_definition< TokenT, ContainerT >::macroparameters, boost::iostreams::gzip::flags::name, boost::wave::need_variadics(), boost::multiprecision::backends::p, boost::wave::util::impl::parameters_equal(), boost::locale::period::marks::second, and boost::swap.
Referenced by boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::add_macro_definition(), and boost::wave::util::macromap< ContextT >::predefine_macro().
|
inline |
|
inline |
|
protected |
|
inline |
References BOOST_ASSERT, BOOST_WAVE_THROW_CTX, IS_CATEGORY, boost::wave::util::impl::is_whitespace_only(), boost::wave::need_variadics(), boost::next(), boost::wave::T_CCOMMENT, boost::wave::T_COMMA, boost::wave::T_LEFTPAREN, boost::wave::T_NEWLINE, boost::wave::T_PLACEHOLDER, boost::wave::T_PLACEMARKER, boost::wave::T_RIGHTPAREN, boost::wave::T_SPACE, boost::wave::T_SPACE2, and boost::wave::WhiteSpaceTokenType.
|
inlineprotected |
References BASE_TOKEN, BOOST_WAVE_THROW_CTX, boost::wave::util::macromap< ContextT >::end(), IS_CATEGORY, boost::wave::util::macromap< ContextT >::is_valid_concat(), boost::it, boost::wave::need_variadics(), boost::next(), boost::wave::util::report_invalid_concatenation(), boost::wave::T_IDENTIFIER, boost::wave::T_NONREPLACABLE_IDENTIFIER, boost::wave::T_PLACEMARKER, boost::wave::T_POUND_POUND, and boost::wave::WhiteSpaceTokenType.
Referenced by boost::wave::util::macromap< ContextT >::expand_macro(), and boost::wave::util::macromap< ContextT >::expand_replacement_list().
|
inline |
Referenced by boost::wave::util::macromap< ContextT >::add_macro(), boost::wave::util::macromap< ContextT >::concat_tokensequence(), boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::macro_names_end(), and boost::wave::util::macromap< ContextT >::resolve_operator_pragma().
|
inline |
|
inlineprotected |
|
inlineprotected |
References boost::wave::AltExtTokenType, boost::wave::BoolLiteralTokenType, BOOST_ASSERT, BOOST_WAVE_THROW_CTX, boost::wave::util::macromap< ContextT >::collect_arguments(), boost::wave::util::macromap< ContextT >::concat_tokensequence(), boost::wave::util::macromap< ContextT >::expand_predefined_macro(), boost::wave::util::macromap< ContextT >::expand_replacement_list(), boost::xpressive::first, boost::geometry::index::inserter(), boost::wave::util::macro_definition< TokenT, ContainerT >::is_available_for_replacement, IS_CATEGORY, IS_EXTCATEGORY, boost::wave::util::macro_definition< TokenT, ContainerT >::is_functionlike, boost::wave::KeywordTokenType, boost::wave::util::macro_definition< TokenT, ContainerT >::macrodefinition, boost::wave::util::macro_definition< TokenT, ContainerT >::macroname, boost::wave::util::macro_definition< TokenT, ContainerT >::macroparameters, boost::wave::OperatorTokenType, boost::remove_copy_if(), boost::wave::util::macro_definition< TokenT, ContainerT >::replace_parameters(), boost::wave::util::macromap< ContextT >::rescan_replacement_list(), boost::wave::util::impl::skip_to_token(), boost::wave::T_IDENTIFIER, boost::wave::T_LEFTPAREN, and boost::wave::T_NONREPLACABLE_IDENTIFIER.
Referenced by boost::wave::util::macromap< ContextT >::expand_tokensequence_worker().
|
inlineprotected |
|
inlineprotected |
References boost::wave::util::impl::as_stringlit(), BASE_TOKEN, boost::wave::util::macromap< ContextT >::begin(), BOOST_ASSERT, BOOST_WAVE_THROW_CTX, boost::wave::util::macromap< ContextT >::concat_tokensequence(), boost::filesystem::detail::copy(), boost::empty(), boost::wave::util::macromap< ContextT >::expand_argument(), boost::wave::ExtParameterTokenType, boost::multiprecision::backends::i, boost::geometry::index::inserter(), IS_CATEGORY, IS_EXTCATEGORY, boost::wave::util::macro_definition< TokenT, ContainerT >::macrodefinition, boost::wave::need_variadics(), boost::wave::ParameterTokenType, boost::wave::T_EXTPARAMETERBASE, boost::wave::T_PARAMETERBASE, boost::wave::T_POUND, boost::wave::T_POUND_POUND, boost::wave::T_STRINGLIT, boost::wave::util::impl::trim_sequence(), boost::wave::util::impl::trim_sequence_left(), boost::wave::util::impl::trim_sequence_right(), and boost::wave::WhiteSpaceTokenType.
Referenced by boost::wave::util::macromap< ContextT >::expand_macro().
token_type const& boost::wave::util::macromap< ContextT >::expand_tokensequence | ( | IteratorT & | first, |
IteratorT const & | last, | ||
ContainerT & | pending, | ||
ContainerT & | expanded, | ||
bool & | seen_newline, | ||
bool | expand_operator_defined | ||
) |
|
inline |
|
protected |
|
inline |
References boost::wave::AltExtTokenType, boost::wave::BoolLiteralTokenType, boost::wave::util::macromap< ContextT >::expand_macro(), boost::wave::util::macromap< ContextT >::expand_tokensequence_worker(), boost::xpressive::first, boost::wave::util::unput_queue_iterator< IteratorT, TokenT, ContainerT >::get_unput_queue(), IS_CATEGORY, boost::wave::util::macromap< ContextT >::is_defined(), IS_EXTCATEGORY, boost::it, boost::wave::KeywordTokenType, boost::wave::need_variadics(), boost::wave::OperatorTokenType, boost::wave::util::macromap< ContextT >::resolve_defined(), boost::wave::util::macromap< ContextT >::resolve_operator_pragma(), boost::wave::T_IDENTIFIER, boost::wave::T_INTLIT, boost::wave::T_PLACEHOLDER, and boost::wave::T_TRUE.
|
inline |
References BOOST_ASSERT, boost::empty(), boost::wave::util::macromap< ContextT >::expand_tokensequence_worker(), and boost::range::generate().
Referenced by boost::wave::util::macromap< ContextT >::expand_argument(), boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::expand_whole_tokensequence(), boost::wave::util::macromap< ContextT >::rescan_replacement_list(), and boost::wave::util::macromap< ContextT >::resolve_operator_pragma().
|
inline |
References boost::wave::util::macromap< ContextT >::is_defined(), boost::wave::util::macro_definition< TokenT, ContainerT >::is_functionlike, boost::wave::util::macro_definition< TokenT, ContainerT >::is_predefined, boost::it, boost::wave::util::macro_definition< TokenT, ContainerT >::macrodefinition, boost::wave::util::macro_definition< TokenT, ContainerT >::macroname, and boost::wave::util::macro_definition< TokenT, ContainerT >::macroparameters.
Referenced by boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::get_macro_definition().
|
inline |
|
inline |
|
inline |
References boost::wave::util::create_path(), boost::current_scope(), boost::wave::util::impl::escape_lit(), boost::wave::util::predefined_macros::dynamic_macros::generator, boost::multiprecision::backends::i, boost::wave::util::predefined_macros::static_macros::name, boost::wave::util::predefined_macros::dynamic_macros::name, boost::wave::util::native_file_string(), boost::wave::need_c99(), boost::wave::need_cpp0x(), boost::wave::need_variadics(), boost::wave::util::macromap< ContextT >::predefine_macro(), boost::wave::T_INTLIT, boost::wave::T_STRINGLIT, boost::wave::util::predefined_macros::static_macros::token_id, boost::wave::util::predefined_macros::dynamic_macros::token_id, and boost::wave::util::predefined_macros::static_macros::value.
Referenced by boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::context(), and boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::reset_macro_definitions().
bool boost::wave::util::macromap< ContextT >::is_defined | ( | string_type const & | name, |
typename defined_macros_type::iterator & | it, | ||
defined_macros_type * | scope = 0 |
||
) | const |
Referenced by boost::wave::util::macromap< ContextT >::expand_tokensequence_worker(), boost::wave::util::macromap< ContextT >::get_macro(), boost::wave::util::macromap< ContextT >::is_defined(), boost::wave::context< IteratorT, LexIteratorT, InputPolicyT, HooksT, DerivedT >::is_defined_macro(), and boost::wave::util::macromap< ContextT >::resolve_defined().
|
inline |
References boost::wave::AltExtTokenType, boost::wave::util::macromap< ContextT >::begin(), boost::wave::BoolLiteralTokenType, BOOST_WAVE_THROW_CTX, boost::wave::util::impl::get_full_name(), IS_CATEGORY, boost::wave::util::macromap< ContextT >::is_defined(), IS_EXTCATEGORY, boost::it, boost::wave::KeywordTokenType, boost::iostreams::gzip::flags::name, boost::wave::OperatorTokenType, and boost::wave::T_IDENTIFIER.
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inlineprotected |
References boost::wave::util::macromap< ContextT >::expand_whole_tokensequence(), boost::wave::util::macro_definition< TokenT, ContainerT >::is_available_for_replacement, boost::it, boost::wave::need_variadics(), boost::wave::T_PLACEHOLDER, boost::wave::T_PLACEMARKER, and boost::wave::util::impl::trim_replacement_list().
Referenced by boost::wave::util::macromap< ContextT >::expand_macro().
|
inline |
|
protected |
|
inline |
|
inlineprotected |
References BOOST_WAVE_THROW_CTX, boost::wave::util::macromap< ContextT >::collect_arguments(), boost::wave::util::macromap< ContextT >::end(), boost::wave::util::macromap< ContextT >::expand_whole_tokensequence(), boost::xpressive::first, boost::wave::util::interpret_pragma(), IS_CATEGORY, boost::it, boost::wave::util::impl::skip_to_token(), boost::wave::T_EOF, boost::wave::T_LEFTPAREN, boost::wave::T_RIGHTPAREN, boost::wave::T_SPACE, boost::wave::T_STRINGLIT, boost::wave::util::impl::unescape_lit(), and boost::wave::WhiteSpaceTokenType.
Referenced by boost::wave::util::macromap< ContextT >::expand_tokensequence_worker().