update boost
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED)
|
||||
#define CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED
|
||||
#if !defined(BOOST_CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED)
|
||||
#define BOOST_CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -96,12 +96,11 @@ private:
|
||||
>::type actual_context_type;
|
||||
|
||||
public:
|
||||
|
||||
// concept checks
|
||||
// the given iterator should be at least a forward iterator type
|
||||
// concept checks
|
||||
// the given iterator should be at least a forward iterator type
|
||||
BOOST_CLASS_REQUIRE(IteratorT, boost, ForwardIteratorConcept);
|
||||
|
||||
// public typedefs
|
||||
// public typedefs
|
||||
typedef typename LexIteratorT::token_type token_type;
|
||||
typedef typename token_type::string_type string_type;
|
||||
|
||||
@@ -112,14 +111,14 @@ public:
|
||||
typedef InputPolicyT input_policy_type;
|
||||
typedef typename token_type::position_type position_type;
|
||||
|
||||
// type of a token sequence
|
||||
// type of a token sequence
|
||||
typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
||||
token_sequence_type;
|
||||
// type of the policies
|
||||
// type of the policies
|
||||
typedef HooksT hook_policy_type;
|
||||
|
||||
private:
|
||||
// stack of shared_ptr's to the pending iteration contexts
|
||||
// stack of shared_ptr's to the pending iteration contexts
|
||||
typedef boost::shared_ptr<base_iteration_context<context, lexer_type> >
|
||||
iteration_ptr_type;
|
||||
typedef boost::wave::util::iteration_context_stack<iteration_ptr_type>
|
||||
@@ -155,11 +154,11 @@ public:
|
||||
macros.init_predefined_macros(fname);
|
||||
}
|
||||
|
||||
// default copy constructor
|
||||
// default assignment operator
|
||||
// default destructor
|
||||
// default copy constructor
|
||||
// default assignment operator
|
||||
// default destructor
|
||||
|
||||
// iterator interface
|
||||
// iterator interface
|
||||
iterator_type begin()
|
||||
{
|
||||
std::string fname(filename);
|
||||
@@ -185,7 +184,7 @@ public:
|
||||
iterator_type end() const
|
||||
{ return iterator_type(); }
|
||||
|
||||
// maintain include paths
|
||||
// maintain include paths
|
||||
bool add_include_path(char const *path_)
|
||||
{ return includes.add_include_path(path_, false);}
|
||||
bool add_sysinclude_path(char const *path_)
|
||||
@@ -204,7 +203,7 @@ public:
|
||||
get_language());
|
||||
}
|
||||
#endif
|
||||
// Define and undefine macros, macro introspection
|
||||
// Define and undefine macros, macro introspection
|
||||
template <typename StringT>
|
||||
bool add_macro_definition(StringT const &name, position_type const& pos,
|
||||
bool has_params, std::vector<token_type> ¶meters,
|
||||
@@ -249,7 +248,7 @@ public:
|
||||
void reset_macro_definitions()
|
||||
{ macros.reset_macromap(); macros.init_predefined_macros(); }
|
||||
|
||||
// Iterate over names of defined macros
|
||||
// Iterate over names of defined macros
|
||||
typedef boost::wave::util::macromap<context> macromap_type;
|
||||
typedef typename macromap_type::name_iterator name_iterator;
|
||||
typedef typename macromap_type::const_name_iterator const_name_iterator;
|
||||
@@ -259,8 +258,8 @@ public:
|
||||
const_name_iterator macro_names_begin() const { return macros.begin(); }
|
||||
const_name_iterator macro_names_end() const { return macros.end(); }
|
||||
|
||||
// This version now is used internally mainly, but since it was a documented
|
||||
// API function we leave it in the public interface.
|
||||
// This version now is used internally mainly, but since it was a documented
|
||||
// API function we leave it in the public interface.
|
||||
bool add_macro_definition(token_type const &name, bool has_params,
|
||||
std::vector<token_type> ¶meters, token_sequence_type &definition,
|
||||
bool is_predefined = false)
|
||||
@@ -269,7 +268,7 @@ public:
|
||||
is_predefined);
|
||||
}
|
||||
|
||||
// get the Wave version information
|
||||
// get the Wave version information
|
||||
static std::string get_version()
|
||||
{
|
||||
boost::wave::util::predefined_macros p;
|
||||
@@ -281,7 +280,7 @@ public:
|
||||
return util::to_string<std::string>(p.get_versionstr());
|
||||
}
|
||||
|
||||
// access current language options
|
||||
// access current language options
|
||||
void set_language(boost::wave::language_support language_,
|
||||
bool reset_macros = true)
|
||||
{
|
||||
@@ -294,17 +293,17 @@ public:
|
||||
position_type &get_main_pos() { return macros.get_main_pos(); }
|
||||
position_type const& get_main_pos() const { return macros.get_main_pos(); }
|
||||
|
||||
// change and ask for maximal possible include nesting depth
|
||||
// change and ask for maximal possible include nesting depth
|
||||
void set_max_include_nesting_depth(iter_size_type new_depth)
|
||||
{ iter_ctxs.set_max_include_nesting_depth(new_depth); }
|
||||
iter_size_type get_max_include_nesting_depth() const
|
||||
{ return iter_ctxs.get_max_include_nesting_depth(); }
|
||||
|
||||
// access the policies
|
||||
// access the policies
|
||||
hook_policy_type &get_hooks() { return hooks; }
|
||||
hook_policy_type const &get_hooks() const { return hooks; }
|
||||
|
||||
// return type of actually used context type (might be the derived type)
|
||||
// return type of actually used context type (might be the derived type)
|
||||
actual_context_type& derived()
|
||||
{ return *static_cast<actual_context_type*>(this); }
|
||||
actual_context_type const& derived() const
|
||||
@@ -318,9 +317,10 @@ public:
|
||||
protected:
|
||||
friend class boost::wave::pp_iterator<context>;
|
||||
friend class boost::wave::impl::pp_iterator_functor<context>;
|
||||
friend class boost::wave::util::macromap<context>;
|
||||
#endif
|
||||
|
||||
// make sure the context has been initialized
|
||||
// make sure the context has been initialized
|
||||
void init_context()
|
||||
{
|
||||
if (!has_been_initialized) {
|
||||
@@ -339,11 +339,11 @@ protected:
|
||||
bool is_defined_macro(IteratorT2 const &begin, IteratorT2 const &end) const
|
||||
{ return macros.is_defined(begin, end); }
|
||||
|
||||
// maintain include paths (helper functions)
|
||||
// maintain include paths (helper functions)
|
||||
void set_current_directory(char const *path_)
|
||||
{ includes.set_current_directory(path_); }
|
||||
|
||||
// conditional compilation contexts
|
||||
// conditional compilation contexts
|
||||
bool get_if_block_status() const { return ifblocks.get_status(); }
|
||||
bool get_if_block_some_part_status() const
|
||||
{ return ifblocks.get_some_part_status(); }
|
||||
@@ -358,53 +358,56 @@ protected:
|
||||
typename boost::wave::util::if_block_stack::size_type get_if_block_depth() const
|
||||
{ return ifblocks.get_if_block_depth(); }
|
||||
|
||||
// stack of iteration contexts
|
||||
// stack of iteration contexts
|
||||
iteration_ptr_type pop_iteration_context()
|
||||
{ iteration_ptr_type top = iter_ctxs.top(); iter_ctxs.pop(); return top; }
|
||||
void push_iteration_context(position_type const &act_pos, iteration_ptr_type iter_ctx)
|
||||
{ iter_ctxs.push(*this, act_pos, iter_ctx); }
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// expand_tokensequence():
|
||||
// expands all macros contained in a given token sequence, handles '##'
|
||||
// and '#' pp operators and re-scans the resulting sequence
|
||||
// (essentially pre-processes the token sequence).
|
||||
//
|
||||
// The expand_undefined parameter is true during macro expansion inside
|
||||
// a C++ expression given for a #if or #elif statement.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// expand_tokensequence():
|
||||
// expands all macros contained in a given token sequence, handles '##'
|
||||
// and '#' pp operators and re-scans the resulting sequence
|
||||
// (essentially pre-processes the token sequence).
|
||||
//
|
||||
// The expand_defined parameter is true during macro expansion inside
|
||||
// a C++ expression given for a #if or #elif statement.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename IteratorT2>
|
||||
token_type expand_tokensequence(IteratorT2 &first_, IteratorT2 const &last_,
|
||||
token_sequence_type &pending, token_sequence_type &expanded,
|
||||
bool& seen_newline, bool expand_undefined = false)
|
||||
bool& seen_newline, bool expand_defined = false,
|
||||
bool expand_has_include = false)
|
||||
{
|
||||
return macros.expand_tokensequence(first_, last_, pending, expanded,
|
||||
seen_newline, expand_undefined);
|
||||
seen_newline, expand_defined, expand_has_include);
|
||||
}
|
||||
|
||||
template <typename IteratorT2>
|
||||
void expand_whole_tokensequence(IteratorT2 &first_, IteratorT2 const &last_,
|
||||
token_sequence_type &expanded, bool expand_undefined = true)
|
||||
token_sequence_type &expanded, bool expand_defined = true,
|
||||
bool expand_has_include = true)
|
||||
{
|
||||
macros.expand_whole_tokensequence(expanded, first_, last_,
|
||||
expand_undefined);
|
||||
macros.expand_whole_tokensequence(
|
||||
expanded, first_, last_,
|
||||
expand_defined, expand_has_include);
|
||||
|
||||
// remove any contained placeholder
|
||||
// remove any contained placeholder
|
||||
boost::wave::util::impl::remove_placeholders(expanded);
|
||||
}
|
||||
|
||||
public:
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
// support for #pragma once
|
||||
// maintain the real name of the current preprocessed file
|
||||
// support for #pragma once
|
||||
// maintain the real name of the current preprocessed file
|
||||
void set_current_filename(char const *real_name)
|
||||
{ current_filename = real_name; }
|
||||
std::string const &get_current_filename() const
|
||||
{ return current_filename; }
|
||||
|
||||
// maintain the list of known headers containing #pragma once
|
||||
// maintain the list of known headers containing #pragma once
|
||||
bool has_pragma_once(std::string const &filename_)
|
||||
{ return includes.has_pragma_once(filename_); }
|
||||
bool add_pragma_once_header(std::string const &filename_,
|
||||
@@ -500,7 +503,7 @@ private:
|
||||
ar & make_nvp("include_settings", includes);
|
||||
}
|
||||
catch (boost::wave::preprocess_exception const& e) {
|
||||
// catch version mismatch exceptions and call error handler
|
||||
// catch version mismatch exceptions and call error handler
|
||||
get_hooks().throw_exception(derived(), e);
|
||||
}
|
||||
}
|
||||
@@ -508,7 +511,7 @@ private:
|
||||
#endif
|
||||
|
||||
private:
|
||||
// the main input stream
|
||||
// the main input stream
|
||||
target_iterator_type first; // underlying input stream
|
||||
target_iterator_type last;
|
||||
std::string filename; // associated main filename
|
||||
@@ -568,4 +571,4 @@ struct version<boost::wave::context<Iterator, LexIterator, InputPolicy, Hooks> >
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_CONTEXT_HPP_907485E2_6649_4A87_911B_7F7225F3E5B8_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED)
|
||||
#define CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED)
|
||||
#define BOOST_CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
}
|
||||
~cpp_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw() = 0; // to be overloaded
|
||||
char const *what() const throw() BOOST_OVERRIDE = 0; // to be overloaded
|
||||
virtual char const *description() const throw() = 0;
|
||||
virtual int get_errorcode() const throw() = 0;
|
||||
virtual int get_severity() const throw() = 0;
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
macro_insertion_error,
|
||||
bad_include_file,
|
||||
bad_include_statement,
|
||||
bad_has_include_expression,
|
||||
ill_formed_directive,
|
||||
error_directive,
|
||||
warning_directive,
|
||||
@@ -115,6 +116,9 @@ public:
|
||||
ill_formed_operator,
|
||||
bad_define_statement,
|
||||
bad_define_statement_va_args,
|
||||
bad_define_statement_va_opt,
|
||||
bad_define_statement_va_opt_parens,
|
||||
bad_define_statement_va_opt_recurse,
|
||||
too_few_macroarguments,
|
||||
too_many_macroarguments,
|
||||
empty_macroarguments,
|
||||
@@ -161,27 +165,27 @@ public:
|
||||
}
|
||||
~preprocess_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw()
|
||||
char const *what() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return "boost::wave::preprocess_exception";
|
||||
}
|
||||
virtual char const *description() const throw()
|
||||
char const *description() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
virtual int get_severity() const throw()
|
||||
int get_severity() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return severity_level(code);
|
||||
}
|
||||
virtual int get_errorcode() const throw()
|
||||
int get_errorcode() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return code;
|
||||
}
|
||||
virtual char const* get_related_name() const throw()
|
||||
char const* get_related_name() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return "<unknown>";
|
||||
}
|
||||
virtual bool is_recoverable() const throw()
|
||||
bool is_recoverable() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
switch (get_errorcode()) {
|
||||
// these are the exceptions thrown during processing not supposed to
|
||||
@@ -195,6 +199,7 @@ public:
|
||||
case preprocess_exception::invalid_macroname:
|
||||
case preprocess_exception::bad_include_file:
|
||||
case preprocess_exception::bad_include_statement:
|
||||
case preprocess_exception::bad_has_include_expression:
|
||||
case preprocess_exception::ill_formed_directive:
|
||||
case preprocess_exception::error_directive:
|
||||
case preprocess_exception::warning_directive:
|
||||
@@ -204,6 +209,9 @@ public:
|
||||
case preprocess_exception::unbalanced_if_endif:
|
||||
case preprocess_exception::bad_define_statement:
|
||||
case preprocess_exception::bad_define_statement_va_args:
|
||||
case preprocess_exception::bad_define_statement_va_opt:
|
||||
case preprocess_exception::bad_define_statement_va_opt_parens:
|
||||
case preprocess_exception::bad_define_statement_va_opt_recurse:
|
||||
case preprocess_exception::bad_line_statement:
|
||||
case preprocess_exception::bad_line_number:
|
||||
case preprocess_exception::bad_line_filename:
|
||||
@@ -237,8 +245,8 @@ public:
|
||||
|
||||
static char const *error_text(int code)
|
||||
{
|
||||
// error texts in this array must appear in the same order as the items in
|
||||
// the error enum above
|
||||
// error texts in this array must appear in the same order as the items in
|
||||
// the error enum above
|
||||
static char const *preprocess_exception_errors[] = {
|
||||
"no error", // no_error
|
||||
"unexpected error (should not happen)", // unexpected_error
|
||||
@@ -246,6 +254,7 @@ public:
|
||||
"macro definition failed (out of memory?)", // macro_insertion_error
|
||||
"could not find include file", // bad_include_file
|
||||
"ill formed #include directive", // bad_include_statement
|
||||
"ill formed __has_include expression", // bad_has_include_expression
|
||||
"ill formed preprocessor directive", // ill_formed_directive
|
||||
"encountered #error directive or #pragma wave stop()", // error_directive
|
||||
"encountered #warning directive", // warning_directive
|
||||
@@ -256,6 +265,11 @@ public:
|
||||
"ill formed #define directive", // bad_define_statement
|
||||
"__VA_ARGS__ can only appear in the "
|
||||
"expansion of a C99 variadic macro", // bad_define_statement_va_args
|
||||
"__VA_OPT__ can only appear in the "
|
||||
"expansion of a C++20 variadic macro", // bad_define_statement_va_opt
|
||||
"__VA_OPT__ must be followed by a left "
|
||||
"paren in a C++20 variadic macro", // bad_define_statement_va_opt_parens
|
||||
"__VA_OPT__() may not contain __VA_OPT__", // bad_define_statement_va_opt_recurse
|
||||
"too few macro arguments", // too_few_macroarguments
|
||||
"too many macro arguments", // too_many_macroarguments
|
||||
"empty macro arguments are not supported in pure C++ mode, "
|
||||
@@ -310,6 +324,7 @@ public:
|
||||
util::severity_fatal, // macro_insertion_error
|
||||
util::severity_error, // bad_include_file
|
||||
util::severity_error, // bad_include_statement
|
||||
util::severity_error, // bad_has_include_expression
|
||||
util::severity_error, // ill_formed_directive
|
||||
util::severity_fatal, // error_directive
|
||||
util::severity_warning, // warning_directive
|
||||
@@ -319,6 +334,9 @@ public:
|
||||
util::severity_error, // ill_formed_operator
|
||||
util::severity_error, // bad_define_statement
|
||||
util::severity_error, // bad_define_statement_va_args
|
||||
util::severity_error, // bad_define_statement_va_opt
|
||||
util::severity_error, // bad_define_statement_va_opt_parens
|
||||
util::severity_error, // bad_define_statement_va_opt_recurse
|
||||
util::severity_warning, // too_few_macroarguments
|
||||
util::severity_warning, // too_many_macroarguments
|
||||
util::severity_warning, // empty_macroarguments
|
||||
@@ -375,17 +393,17 @@ public:
|
||||
: preprocess_exception(what_, code, line_, column_, filename_)
|
||||
{
|
||||
unsigned int off = 0;
|
||||
while (off < sizeof(name) && *macroname)
|
||||
while (off < sizeof(name) - 1 && *macroname)
|
||||
name[off++] = *macroname++;
|
||||
name[off] = 0;
|
||||
}
|
||||
~macro_handling_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw()
|
||||
char const *what() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return "boost::wave::macro_handling_exception";
|
||||
}
|
||||
char const* get_related_name() const throw()
|
||||
char const* get_related_name() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return name;
|
||||
}
|
||||
@@ -418,4 +436,4 @@ is_recoverable(cpp_exception const& e)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXCEPTIONS_HPP_5190E447_A781_4521_A275_5134FF9917D7_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED)
|
||||
#define CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED
|
||||
#if !defined(BOOST_CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED)
|
||||
#define BOOST_CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED
|
||||
|
||||
#include <iterator>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
@@ -118,7 +118,7 @@ struct base_iteration_context
|
||||
type(type_)
|
||||
{}
|
||||
|
||||
// the actual input stream
|
||||
// the actual input stream
|
||||
IteratorT first; // actual input stream position
|
||||
IteratorT last; // end of input stream
|
||||
BOOST_WAVE_STRINGTYPE real_filename; // real name of the current file
|
||||
@@ -168,4 +168,4 @@ struct iteration_context
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_ITERATION_CONTEXT_HPP_00312288_9DDB_4668_AFE5_25D3994FD095_INCLUDED)
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace boost { namespace wave { namespace util
|
||||
// helper macro for throwing exceptions with additional parameter
|
||||
#if !defined(BOOST_WAVE_THROW_NAME_CTX)
|
||||
#define BOOST_WAVE_THROW_NAME_CTX(ctx, cls, code, msg, act_pos, name) \
|
||||
boost::wave::util::throw_<cls>(cls::code, msg, act_pos, name) \
|
||||
boost::wave::util::throw_<cls>(ctx, cls::code, msg, act_pos, name) \
|
||||
/**/
|
||||
#endif // BOOST_WAVE_THROW_NAME_CTX
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
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(CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#define CONVERT_TRIGRAPHS_HK050403_INCLUDED
|
||||
#if !defined(BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#define BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpplexer/cpplexer_exceptions.hpp>
|
||||
@@ -134,6 +134,6 @@ convert_trigraphs(StringT const &value)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
#endif // !defined(BOOST_CONVERT_TRIGRAPHS_HK050403_INCLUDED)
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#define CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
|
||||
#if !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#define BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/util/file_position.hpp>
|
||||
@@ -70,4 +70,4 @@ struct lex_input_interface
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED)
|
||||
|
||||
@@ -53,9 +53,9 @@ template <
|
||||
>
|
||||
struct BOOST_WAVE_NEW_LEXER_DECL new_lexer_gen
|
||||
{
|
||||
// The NewLexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to decouple the lexer/token
|
||||
// configurations at compile time.
|
||||
// The NewLexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to decouple the lexer/token
|
||||
// configurations at compile time.
|
||||
static lex_input_interface<TokenT> *
|
||||
new_lexer(IteratorT const &first, IteratorT const &last,
|
||||
PositionT const &pos, boost::wave::language_support language);
|
||||
@@ -80,9 +80,9 @@ struct lex_input_interface_generator
|
||||
lex_input_interface_generator() {}
|
||||
~lex_input_interface_generator() {}
|
||||
|
||||
// The new_lexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to distinguish different
|
||||
// lexer/token configurations at compile time.
|
||||
// The new_lexer function allows the opaque generation of a new lexer object.
|
||||
// It is coupled to the token type to allow to distinguish different
|
||||
// lexer/token configurations at compile time.
|
||||
template <typename IteratorT>
|
||||
static lex_input_interface<TokenT> *
|
||||
new_lexer(IteratorT const &first, IteratorT const &last,
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#define CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED
|
||||
#if !defined(BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#define BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
{ return *this; } // nothing to do here
|
||||
#endif
|
||||
|
||||
// interface to the iterator_policies::split_functor_input policy
|
||||
// interface to the iterator_policies::split_functor_input policy
|
||||
typedef TokenT result_type;
|
||||
typedef lex_iterator_functor_shim unique;
|
||||
typedef lex_input_interface<TokenT>* shared;
|
||||
@@ -200,15 +200,15 @@ public:
|
||||
{
|
||||
typedef typename TokenT::position_type position_type;
|
||||
|
||||
// set the new position in the current token
|
||||
token_type const& currtoken = this->base_type::dereference(*this);
|
||||
position_type currpos = currtoken.get_position();
|
||||
// set the new position in the current token
|
||||
token_type const& currtoken = this->base_type::dereference(*this);
|
||||
position_type currpos = currtoken.get_position();
|
||||
|
||||
currpos.set_file(pos.get_file());
|
||||
currpos.set_line(pos.get_line());
|
||||
const_cast<token_type&>(currtoken).set_position(currpos);
|
||||
|
||||
// set the new position for future tokens as well
|
||||
// set the new position for future tokens as well
|
||||
if (token_type::string_type::npos !=
|
||||
currtoken.get_value().find_first_of('\n'))
|
||||
{
|
||||
@@ -240,4 +240,4 @@ public:
|
||||
|
||||
#undef BOOST_WAVE_EOF_PREFIX
|
||||
|
||||
#endif // !defined(CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#define CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
|
||||
#if !defined(BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#define BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#if BOOST_WAVE_SERIALIZATION != 0
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/pool/singleton_pool.hpp>
|
||||
#include <boost/detail/atomic_count.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
@@ -54,12 +55,14 @@ public:
|
||||
: id(T_UNKNOWN), refcnt(1)
|
||||
{}
|
||||
|
||||
token_data(token_id id_, string_type const &value_, position_type const &pos_)
|
||||
: id(id_), value(value_), pos(pos_), refcnt(1)
|
||||
token_data(token_id id_, string_type const &value_,
|
||||
position_type const &pos_,
|
||||
optional<position_type> const & expand_pos_ = boost::none)
|
||||
: id(id_), value(value_), pos(pos_), expand_pos(expand_pos_), refcnt(1)
|
||||
{}
|
||||
|
||||
token_data(token_data const& rhs)
|
||||
: id(rhs.id), value(rhs.value), pos(rhs.pos), refcnt(1)
|
||||
: id(rhs.id), value(rhs.value), pos(rhs.pos), expand_pos(rhs.expand_pos), refcnt(1)
|
||||
{}
|
||||
|
||||
~token_data()
|
||||
@@ -69,14 +72,22 @@ public:
|
||||
std::size_t release() { return --refcnt; }
|
||||
std::size_t get_refcnt() const { return refcnt; }
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
operator token_id() const { return id; }
|
||||
string_type const &get_value() const { return value; }
|
||||
position_type const &get_position() const { return pos; }
|
||||
position_type const &get_expand_position() const
|
||||
{
|
||||
if (expand_pos)
|
||||
return *expand_pos;
|
||||
else
|
||||
return pos;
|
||||
}
|
||||
|
||||
void set_token_id (token_id id_) { id = id_; }
|
||||
void set_value (string_type const &value_) { value = value_; }
|
||||
void set_position (position_type const &pos_) { pos = pos_; }
|
||||
void set_expand_position (position_type const & pos_) { expand_pos = pos_; }
|
||||
|
||||
friend bool operator== (token_data const& lhs, token_data const& rhs)
|
||||
{
|
||||
@@ -105,7 +116,7 @@ public:
|
||||
static void operator delete(void *p, std::size_t size);
|
||||
|
||||
#if defined(BOOST_SPIRIT_DEBUG)
|
||||
// debug support
|
||||
// debug support
|
||||
void print (std::ostream &stream) const
|
||||
{
|
||||
stream << get_token_name(id) << "(";
|
||||
@@ -138,6 +149,7 @@ private:
|
||||
token_id id; // the token id
|
||||
string_type value; // the text, which was parsed into this token
|
||||
position_type pos; // the original file position
|
||||
boost::optional<position_type> expand_pos; // where this token was expanded
|
||||
boost::detail::atomic_count refcnt;
|
||||
};
|
||||
|
||||
@@ -237,16 +249,18 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
operator token_id() const { return 0 != data ? token_id(*data) : T_EOI; }
|
||||
string_type const &get_value() const { return data->get_value(); }
|
||||
position_type const &get_position() const { return data->get_position(); }
|
||||
position_type const &get_expand_position() const { return data->get_expand_position(); }
|
||||
bool is_eoi() const { return 0 == data || token_id(*data) == T_EOI; }
|
||||
bool is_valid() const { return 0 != data && token_id(*data) != T_UNKNOWN; }
|
||||
|
||||
void set_token_id (token_id id_) { make_unique(); data->set_token_id(id_); }
|
||||
void set_value (string_type const &value_) { make_unique(); data->set_value(value_); }
|
||||
void set_position (position_type const &pos_) { make_unique(); data->set_position(pos_); }
|
||||
void set_expand_position (position_type const &pos_) { make_unique(); data->set_expand_position(pos_); }
|
||||
|
||||
friend bool operator== (lex_token const& lhs, lex_token const& rhs)
|
||||
{
|
||||
@@ -259,7 +273,7 @@ public:
|
||||
|
||||
// debug support
|
||||
#if BOOST_WAVE_DUMP_PARSE_TREE != 0
|
||||
// access functions for the tree_to_xml functionality
|
||||
// access functions for the tree_to_xml functionality
|
||||
static int get_token_id(lex_token const &t)
|
||||
{ return token_id(t); }
|
||||
static string_type get_token_value(lex_token const &t)
|
||||
@@ -267,7 +281,7 @@ public:
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_SPIRIT_DEBUG)
|
||||
// debug support
|
||||
// debug support
|
||||
void print (std::ostream &stream) const
|
||||
{
|
||||
data->print(stream);
|
||||
@@ -332,4 +346,4 @@ operator<< (std::ostream &stream, lex_token<PositionT> const &object)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#define CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED
|
||||
#if !defined(BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#define BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED
|
||||
|
||||
#include <exception>
|
||||
#include <string>
|
||||
@@ -32,30 +32,30 @@
|
||||
#include <strstream>
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::strstream stream; \
|
||||
using namespace boost::wave; \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#else
|
||||
#include <sstream>
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW(cls, code, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(cls::code) << ": " \
|
||||
<< cls::error_text(cls::code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), cls::code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#endif // BOOST_NO_STRINGSTREAM
|
||||
#endif // BOOST_WAVE_LEXER_THROW
|
||||
@@ -63,34 +63,34 @@
|
||||
#if !defined(BOOST_WAVE_LEXER_THROW_VAR)
|
||||
#ifdef BOOST_NO_STRINGSTREAM
|
||||
#include <strstream>
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::strstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
std::string throwmsg = stream.str(); stream.freeze(false); \
|
||||
boost::throw_exception(cls(throwmsg.c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#else
|
||||
#include <sstream>
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
#define BOOST_WAVE_LEXER_THROW_VAR(cls, codearg, msg, line, column, name) \
|
||||
{ \
|
||||
using namespace boost::wave; \
|
||||
cls::error_code code = static_cast<cls::error_code>(codearg); \
|
||||
std::stringstream stream; \
|
||||
stream << cls::severity_text(code) << ": " \
|
||||
<< cls::error_text(code); \
|
||||
if ((msg)[0] != 0) stream << ": " << (msg); \
|
||||
stream << std::ends; \
|
||||
boost::throw_exception(cls(stream.str().c_str(), code, line, column, \
|
||||
name)); \
|
||||
} \
|
||||
/**/
|
||||
#endif // BOOST_NO_STRINGSTREAM
|
||||
#endif // BOOST_WAVE_LEXER_THROW
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
}
|
||||
~cpplexer_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw() = 0; // to be overloaded
|
||||
char const *what() const throw() BOOST_OVERRIDE = 0; // to be overloaded
|
||||
virtual char const *description() const throw() = 0;
|
||||
virtual int get_errorcode() const throw() = 0;
|
||||
virtual int get_severity() const throw() = 0;
|
||||
@@ -186,23 +186,23 @@ public:
|
||||
}
|
||||
~lexing_exception() throw() {}
|
||||
|
||||
virtual char const *what() const throw()
|
||||
char const *what() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return "boost::wave::lexing_exception";
|
||||
}
|
||||
virtual char const *description() const throw()
|
||||
char const *description() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
virtual int get_severity() const throw()
|
||||
int get_severity() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return level;
|
||||
}
|
||||
virtual int get_errorcode() const throw()
|
||||
int get_errorcode() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
return code;
|
||||
}
|
||||
virtual bool is_recoverable() const throw()
|
||||
bool is_recoverable() const throw() BOOST_OVERRIDE
|
||||
{
|
||||
switch (get_errorcode()) {
|
||||
case lexing_exception::universal_char_invalid:
|
||||
@@ -287,4 +287,4 @@ is_recoverable(lexing_exception const& e)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
#endif // !defined(BOOST_CPPLEXER_EXCEPTIONS_HPP_1A09DE1A_6D1F_4091_AF7F_5F13AB0D31AB_INCLUDED)
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
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(DETECT_INCLUDE_GUARDS_HK060304_INCLUDED)
|
||||
#define DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
#if !defined(BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED)
|
||||
#define BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
@@ -260,4 +260,4 @@ include_guards<Token>::state_5(Token& t)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
#endif // !BOOST_DETECT_INCLUDE_GUARDS_HK060304_INCLUDED
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#define AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED
|
||||
#if !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#define BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <cstdlib>
|
||||
@@ -61,4 +61,4 @@ BOOST_WAVE_DECL void aq_terminate(aq_queue q);
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
#endif // !defined(BOOST_AQ_HPP_A21D9145_B643_44C0_81E7_DB346DD67EE1_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#define CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED
|
||||
#if !defined(BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#define BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
} \
|
||||
/**/
|
||||
|
||||
#include <iostream>
|
||||
#include <iosfwd>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#define BOOST_WAVE_UPDATE_CURSOR() \
|
||||
@@ -181,7 +181,10 @@ uchar *fill(Scanner<Iterator> *s, uchar *cursor)
|
||||
{
|
||||
if (NULL == s->lim)
|
||||
s->lim = s->top;
|
||||
memmove(s->bot, s->tok, s->lim - s->tok);
|
||||
size_t length = s->lim - s->tok;
|
||||
if(length > 0){
|
||||
memmove(s->bot, s->tok, length);
|
||||
}
|
||||
s->tok = s->cur = s->bot;
|
||||
s->ptr -= cnt;
|
||||
cursor -= cnt;
|
||||
@@ -202,7 +205,10 @@ uchar *fill(Scanner<Iterator> *s, uchar *cursor)
|
||||
return cursor;
|
||||
}
|
||||
|
||||
memmove(buf, s->tok, s->lim - s->tok);
|
||||
size_t length = s->lim - s->tok;
|
||||
if(length > 0){
|
||||
memmove(buf, s->tok, length);
|
||||
}
|
||||
s->tok = s->cur = buf;
|
||||
s->ptr = &buf[s->ptr - s->bot];
|
||||
cursor = &buf[cursor - s->bot];
|
||||
@@ -407,4 +413,4 @@ boost::wave::token_id scan(Scanner<Iterator> *s)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_RE_HPP_B76C4F5E_63E9_4B8A_9975_EC32FA6BF027_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#define CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED
|
||||
#if !defined(BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#define BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include <boost/concept_check.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
@@ -88,7 +87,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
// error reporting from the re2c generated lexer
|
||||
// error reporting from the re2c generated lexer
|
||||
static int report_error(Scanner<IteratorT> const* s, int code, char const *, ...);
|
||||
|
||||
private:
|
||||
@@ -153,6 +152,14 @@ lexer<IteratorT, PositionT, TokenT>::lexer(IteratorT const &first,
|
||||
#else
|
||||
scanner.act_in_cpp0x_mode = false;
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
scanner.act_in_cpp2a_mode = boost::wave::need_cpp2a(language_);
|
||||
scanner.act_in_cpp0x_mode = boost::wave::need_cpp2a(language_)
|
||||
|| boost::wave::need_cpp0x(language_);
|
||||
#else
|
||||
scanner.act_in_cpp2a_mode = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename IteratorT, typename PositionT, typename TokenT>
|
||||
@@ -196,7 +203,6 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
impl::validate_literal(value, actline, scanner.column, filename);
|
||||
break;
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
case T_PP_HHEADER:
|
||||
case T_PP_QHEADER:
|
||||
case T_PP_INCLUDE:
|
||||
@@ -205,13 +211,14 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
value = string_type((char const *)scanner.tok,
|
||||
scanner.cur-scanner.tok);
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
// Skip '#' and whitespace and see whether we find an 'include_next' here.
|
||||
typename string_type::size_type start = value.find("include");
|
||||
if (value.compare(start, 12, "include_next", 12) == 0)
|
||||
id = token_id(id | AltTokenType);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
case T_LONGINTLIT: // supported in C++11, C99 and long_long mode
|
||||
value = string_type((char const *)scanner.tok,
|
||||
@@ -240,8 +247,8 @@ lexer<IteratorT, PositionT, TokenT>::get(TokenT& result)
|
||||
break;
|
||||
|
||||
case T_EOF:
|
||||
// T_EOF is returned as a valid token, the next call will return T_EOI,
|
||||
// i.e. the actual end of input
|
||||
// T_EOF is returned as a valid token, the next call will return T_EOI,
|
||||
// i.e. the actual end of input
|
||||
at_eof = true;
|
||||
value.clear();
|
||||
break;
|
||||
@@ -317,7 +324,7 @@ lexer<IteratorT, PositionT, TokenT>::report_error(Scanner<IteratorT> const *s, i
|
||||
|
||||
BOOST_WAVE_LEXER_THROW_VAR(lexing_exception, errcode, buffer, s->line,
|
||||
s->column, s->file_name);
|
||||
// BOOST_UNREACHABLE_RETURN(0);
|
||||
// BOOST_UNREACHABLE_RETURN(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -342,11 +349,11 @@ public:
|
||||
{}
|
||||
virtual ~lex_functor() {}
|
||||
|
||||
// get the next token from the input stream
|
||||
token_type& get(token_type& result) { return re2c_lexer.get(result); }
|
||||
void set_position(PositionT const &pos) { re2c_lexer.set_position(pos); }
|
||||
// get the next token from the input stream
|
||||
token_type& get(token_type& result) BOOST_OVERRIDE { return re2c_lexer.get(result); }
|
||||
void set_position(PositionT const &pos) BOOST_OVERRIDE { re2c_lexer.set_position(pos); }
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
bool has_include_guards(std::string& guard_name) const
|
||||
bool has_include_guards(std::string& guard_name) const BOOST_OVERRIDE
|
||||
{ return re2c_lexer.has_include_guards(guard_name); }
|
||||
#endif
|
||||
|
||||
@@ -420,4 +427,4 @@ new_lexer_gen<IteratorT, PositionT, TokenT>::new_lexer(IteratorT const &first,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#define SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
|
||||
#if !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#define BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpplexer/re2clex/aq.hpp>
|
||||
@@ -74,6 +74,7 @@ struct Scanner {
|
||||
bool enable_import_keyword; /* recognize import as a keyword */
|
||||
bool single_line_only; /* don't report missing eol's in C++ comments */
|
||||
bool act_in_cpp0x_mode; /* lexer works in C++11 mode */
|
||||
bool act_in_cpp2a_mode; /* lexer works in C++20 mode */
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -87,4 +88,4 @@ struct Scanner {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
#endif // !defined(BOOST_SCANNER_HPP_F4FB01EB_E75C_4537_A146_D34B9895EF37_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#define TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED
|
||||
#if !defined(BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#define BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -69,4 +69,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
#endif // !defined(BOOST_TOKEN_CACHE_HPP_4D2320B7_1D56_4113_A114_397E70FA438C_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
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(VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#define VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED
|
||||
#if !defined(BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#define BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
@@ -72,15 +72,15 @@ in_range(unsigned long ch, unsigned long l, unsigned long u)
|
||||
inline universal_char_type
|
||||
classify_universal_char (unsigned long ch)
|
||||
{
|
||||
// test for invalid characters
|
||||
// test for invalid characters
|
||||
if (ch <= 0x0020 || in_range(ch, 0x007f, 0x009f))
|
||||
return universal_char_type_invalid;
|
||||
|
||||
// test for characters in the range of the base character set
|
||||
// test for characters in the range of the base character set
|
||||
if (in_range(ch, 0x0021, 0x005f) || in_range(ch, 0x0061, 0x007e))
|
||||
return universal_char_type_base_charset;
|
||||
|
||||
// test for additional valid character values (see C++ Standard: Annex E)
|
||||
// test for additional valid character values (see C++ Standard: Annex E)
|
||||
if (in_range(ch, 0x00c0, 0x00d6) || in_range(ch, 0x00d8, 0x00f6) ||
|
||||
in_range(ch, 0x00f8, 0x01f5) || in_range(ch, 0x01fa, 0x0217) ||
|
||||
in_range(ch, 0x0250, 0x02a8) || in_range(ch, 0x1e00, 0x1e9a) ||
|
||||
@@ -227,16 +227,16 @@ validate_identifier_name (StringT const &name, std::size_t line,
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
|
||||
while (StringT::npos != pos) {
|
||||
// the identifier name contains a backslash (must be universal char)
|
||||
// the identifier name contains a backslash (must be universal char)
|
||||
BOOST_ASSERT('u' == name[pos+1] || 'U' == name[pos+1]);
|
||||
|
||||
StringT uchar_val(name.substr(pos+2, ('u' == name[pos+1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
StringT uchar_val(name.substr(pos + 2, ('u' == name[pos + 1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
|
||||
if (universal_char_type_valid != type) {
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos+1]) ? 6 : 10));
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos + 1]) ? 6 : 10));
|
||||
|
||||
if (universal_char_type_invalid == type) {
|
||||
BOOST_WAVE_LEXER_THROW(lexing_exception, universal_char_invalid,
|
||||
@@ -252,7 +252,7 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
}
|
||||
}
|
||||
|
||||
// find next universal char (if appropriate)
|
||||
// find next universal char (if appropriate)
|
||||
pos = name.find_first_of('\\', pos+2);
|
||||
}
|
||||
}
|
||||
@@ -277,20 +277,20 @@ validate_literal (StringT const &name, std::size_t line, std::size_t column,
|
||||
{
|
||||
using namespace std; // some systems have strtoul in namespace std::
|
||||
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
typename StringT::size_type pos = name.find_first_of('\\');
|
||||
|
||||
while (StringT::npos != pos) {
|
||||
// the literal contains a backslash (may be universal char)
|
||||
// the literal contains a backslash (may be universal char)
|
||||
if ('u' == name[pos+1] || 'U' == name[pos+1]) {
|
||||
StringT uchar_val(name.substr(pos+2, ('u' == name[pos+1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
StringT uchar_val(name.substr(pos + 2, ('u' == name[pos + 1]) ? 4 : 8));
|
||||
universal_char_type type =
|
||||
classify_universal_char(strtoul(uchar_val.c_str(), 0, 16));
|
||||
|
||||
if (universal_char_type_valid != type &&
|
||||
universal_char_type_not_allowed_for_identifiers != type)
|
||||
{
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos+1]) ? 6 : 10));
|
||||
// an invalid char was found, so throw an exception
|
||||
StringT error_uchar(name.substr(pos, ('u' == name[pos + 1]) ? 6 : 10));
|
||||
|
||||
if (universal_char_type_invalid == type) {
|
||||
BOOST_WAVE_LEXER_THROW(lexing_exception, universal_char_invalid,
|
||||
@@ -303,7 +303,7 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
}
|
||||
}
|
||||
|
||||
// find next universal char (if appropriate)
|
||||
// find next universal char (if appropriate)
|
||||
pos = name.find_first_of('\\', pos+2);
|
||||
}
|
||||
}
|
||||
@@ -319,4 +319,4 @@ typename StringT::size_type pos = name.find_first_of('\\');
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
#endif // !defined(BOOST_VALIDATE_UNIVERSAL_CHAR_HPP_55F1B811_CD76_4C72_8344_CBC69CF3B339_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#define CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED
|
||||
#if !defined(BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#define BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED
|
||||
|
||||
#include <limits> // std::numeric_limits
|
||||
#include <climits> // CHAR_BIT
|
||||
@@ -166,7 +166,7 @@ struct chlit_grammar :
|
||||
|
||||
// the rule for a character literal
|
||||
ch_lit
|
||||
= eps_p[self.value = phx::val(0), self.long_lit = phx::val(false)]
|
||||
= eps_p[(self.value = phx::val(0), self.long_lit = phx::val(false))]
|
||||
>> !ch_p('L')[self.long_lit = phx::val(true)]
|
||||
>> ch_p('\'')
|
||||
>> +( (
|
||||
@@ -196,6 +196,11 @@ struct chlit_grammar :
|
||||
impl::compose(self.value, self.long_lit,
|
||||
phx::var(self.overflow), phx::val(0x0b))
|
||||
]
|
||||
| (ch_p('e') | ch_p('E')) // ESC
|
||||
[
|
||||
impl::compose(self.value, self.long_lit,
|
||||
phx::var(self.overflow), phx::val(0x1b))
|
||||
]
|
||||
| ch_p('f') // FF
|
||||
[
|
||||
impl::compose(self.value, self.long_lit,
|
||||
@@ -274,7 +279,7 @@ struct chlit_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ch_lit, TRACE_CHLIT_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return ch_lit; }
|
||||
};
|
||||
@@ -316,22 +321,22 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
token_val.c_str(), token.get_position());
|
||||
}
|
||||
else {
|
||||
// range check
|
||||
// range check
|
||||
if ('L' == token_val[0]) {
|
||||
// recognized wide character
|
||||
// recognized wide character
|
||||
if (g.overflow ||
|
||||
result > (IntegralResult)(std::numeric_limits<wchar_t>::max)())
|
||||
{
|
||||
// out of range
|
||||
// out of range
|
||||
status = error_character_overflow;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// recognized narrow ('normal') character
|
||||
// recognized narrow ('normal') character
|
||||
if (g.overflow ||
|
||||
result > (IntegralResult)(std::numeric_limits<unsigned char>::max)())
|
||||
{
|
||||
// out of range
|
||||
// out of range
|
||||
status = error_character_overflow;
|
||||
}
|
||||
}
|
||||
@@ -351,4 +356,4 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_CHLIT_GRAMMAR_HPP_9527D349_6592_449A_A409_42A001E6C64C_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
#if !defined(BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -104,7 +104,7 @@ struct defined_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(identifier, TRACE_CPP_DEFINED_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return defined_op; }
|
||||
};
|
||||
@@ -182,4 +182,4 @@ defined_grammar_gen<LexIteratorT>::parse_operator_defined (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_DEFINED_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
#if !defined(BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -43,12 +43,12 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
||||
token_sequence_type;
|
||||
|
||||
// The parse_operator_defined function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
// The parse_operator_defined function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
typename token_sequence_type::iterator, token_type, token_sequence_type>
|
||||
@@ -58,7 +58,7 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
LexIteratorT, token_type, token_sequence_type>
|
||||
iterator2_type;
|
||||
|
||||
// parse the operator defined and return the found qualified name
|
||||
// parse the operator defined and return the found qualified name
|
||||
static boost::spirit::classic::parse_info<iterator1_type>
|
||||
parse_operator_defined (iterator1_type const &first,
|
||||
iterator1_type const &last, token_sequence_type &found_qualified_name);
|
||||
@@ -82,4 +82,4 @@ struct BOOST_WAVE_DECL defined_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_DEFINED_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#define CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -573,6 +573,10 @@ struct expression_grammar :
|
||||
[
|
||||
constant.val = impl::as_intlit(arg1)
|
||||
]
|
||||
| ch_p(T_LONGINTLIT)
|
||||
[
|
||||
constant.val = impl::as_intlit(arg1)
|
||||
]
|
||||
| ch_p(T_CHARLIT)
|
||||
[
|
||||
constant.val = impl::as_chlit(arg1)
|
||||
@@ -694,6 +698,7 @@ struct expression_grammar :
|
||||
constant_nocalc
|
||||
= ch_p(T_PP_NUMBER)
|
||||
| ch_p(T_INTLIT)
|
||||
| ch_p(T_LONGINTLIT)
|
||||
| ch_p(T_CHARLIT)
|
||||
;
|
||||
|
||||
@@ -730,7 +735,7 @@ struct expression_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(constant_nocalc, TRACE_CPP_EXPR_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
simple_rule_t const& start() const
|
||||
{ return pp_expression; }
|
||||
};
|
||||
@@ -782,7 +787,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
ch_p(T_SPACE) | ch_p(T_CCOMMENT) | ch_p(T_CPPCOMMENT));
|
||||
|
||||
if (!hit.hit) {
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
string_type expression = as_string<string_type>(first, last);
|
||||
if (0 == expression.size())
|
||||
@@ -792,30 +797,30 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
catch (boost::wave::preprocess_exception const& e) {
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
boost::throw_exception(e);
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!hit.full) {
|
||||
// The token list starts with a valid expression, but there remains
|
||||
// something. If the remainder consists out of whitespace only, the
|
||||
// expression is still valid.
|
||||
iterator_type next = hit.stop;
|
||||
// The token list starts with a valid expression, but there remains
|
||||
// something. If the remainder consists out of whitespace only, the
|
||||
// expression is still valid.
|
||||
iterator_type next = hit.stop;
|
||||
|
||||
while (next != last) {
|
||||
switch (token_id(*next)) {
|
||||
@@ -830,7 +835,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return as_bool(result); // expression is valid
|
||||
|
||||
default:
|
||||
// expression is illformed
|
||||
// expression is illformed
|
||||
if (if_block_status) {
|
||||
string_type expression = as_string<string_type>(first, last);
|
||||
if (0 == expression.size())
|
||||
@@ -840,7 +845,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
// as the if_block_status is false no errors will be reported
|
||||
// as the if_block_status is false no errors will be reported
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -851,7 +856,7 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
if (error_noerror != result.is_valid()) // division or other error by zero occurred
|
||||
status = result.is_valid();
|
||||
|
||||
// token sequence is a valid expression
|
||||
// token sequence is a valid expression
|
||||
return as_bool(result);
|
||||
}
|
||||
|
||||
@@ -867,4 +872,4 @@ expression_grammar_gen<TokenT>::evaluate(
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_GRAMMAR_HPP_099CD1A4_A6C0_44BE_8F24_0B00F5BE5674_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#define CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpp_iteration_context.hpp>
|
||||
@@ -72,4 +72,4 @@ struct BOOST_WAVE_DECL expression_grammar_gen {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_GRAMMAR_GEN_HPP_42399258_6CDC_4101_863D_5C7D95B5A6CA_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#define CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED
|
||||
#if !defined(BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#define BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED
|
||||
|
||||
#if defined (BOOST_SPIRIT_DEBUG)
|
||||
#include <iostream>
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
value_type get_type() const { return type; }
|
||||
value_error is_valid() const { return valid; }
|
||||
|
||||
// explicit conversion
|
||||
// explicit conversion
|
||||
friend int_literal_type as_int(closure_value const& v)
|
||||
{
|
||||
switch (v.type) {
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
return v.value.i != 0.0;
|
||||
}
|
||||
|
||||
// assignment
|
||||
// assignment
|
||||
closure_value &operator= (closure_value const &rhs)
|
||||
{
|
||||
switch (rhs.get_type()) {
|
||||
@@ -177,7 +177,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
// arithmetics
|
||||
// arithmetics
|
||||
closure_value &operator+= (closure_value const &rhs)
|
||||
{
|
||||
switch (type) {
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
case is_int:
|
||||
if (as_long(rhs) != 0) {
|
||||
if (value.i == -value.i && -1 == rhs.value.i) {
|
||||
// LONG_MIN / -1 on two's complement
|
||||
// LONG_MIN / -1 on two's complement
|
||||
valid = error_integer_overflow;
|
||||
}
|
||||
else {
|
||||
@@ -494,7 +494,7 @@ public:
|
||||
case is_int:
|
||||
if (as_long(rhs) != 0) {
|
||||
if (value.i == -value.i && -1 == rhs.value.i) {
|
||||
// LONG_MIN % -1 on two's complement
|
||||
// LONG_MIN % -1 on two's complement
|
||||
valid = error_integer_overflow;
|
||||
}
|
||||
else {
|
||||
@@ -586,7 +586,7 @@ public:
|
||||
return closure_value(!as_ulong(rhs), rhs.valid);
|
||||
}
|
||||
|
||||
// comparison
|
||||
// comparison
|
||||
friend closure_value
|
||||
operator== (closure_value const &lhs, closure_value const &rhs)
|
||||
{
|
||||
@@ -880,4 +880,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_EXPRESSION_VALUE_HPP_452FE66D_8754_4107_AF1E_E42255A0C18A_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#define CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED
|
||||
#if !defined(BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#define BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
@@ -164,7 +164,7 @@ struct cpp_grammar :
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
// non-parse_tree generating rule type
|
||||
// non-parse_tree generating rule type
|
||||
typedef typename ScannerT::iteration_policy_t iteration_policy_t;
|
||||
typedef boost::spirit::classic::match_policy match_policy_t;
|
||||
typedef typename ScannerT::action_policy_t action_policy_t;
|
||||
@@ -180,7 +180,7 @@ struct cpp_grammar :
|
||||
non_tree_scanner_t, boost::spirit::classic::dynamic_parser_tag>
|
||||
no_tree_rule_type;
|
||||
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
typedef
|
||||
boost::spirit::classic::rule<
|
||||
ScannerT, boost::spirit::classic::dynamic_parser_tag>
|
||||
@@ -207,12 +207,12 @@ struct cpp_grammar :
|
||||
|
||||
definition(cpp_grammar const &self)
|
||||
{
|
||||
// import the spirit and cpplexer namespaces here
|
||||
// import the spirit and cpplexer namespaces here
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
// set the rule id's for later use
|
||||
// set the rule id's for later use
|
||||
pp_statement.set_id(BOOST_WAVE_PP_STATEMENT_ID);
|
||||
// include_file.set_id(BOOST_WAVE_INCLUDE_FILE_ID);
|
||||
// system_include_file.set_id(BOOST_WAVE_SYSINCLUDE_FILE_ID);
|
||||
@@ -593,8 +593,8 @@ struct cpp_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppifndef, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppif, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelse, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppendif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppelif, TRACE_CPP_GRAMMAR);
|
||||
// BOOST_SPIRIT_DEBUG_TRACE_RULE(ppendif, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppline, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(pperror, TRACE_CPP_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(ppwarning, TRACE_CPP_GRAMMAR);
|
||||
@@ -607,7 +607,7 @@ struct cpp_grammar :
|
||||
#endif
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_type const& start() const
|
||||
{ return pp_statement; }
|
||||
};
|
||||
@@ -627,7 +627,7 @@ struct cpp_grammar :
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_DUMP_PARSE_TREE != 0
|
||||
// helper function and data to get readable names of the rules known to us
|
||||
// helper function and data to get readable names of the rules known to us
|
||||
struct map_ruleid_to_name :
|
||||
public std::map<boost::spirit::classic::parser_id, std::string>
|
||||
{
|
||||
@@ -668,7 +668,7 @@ struct cpp_grammar :
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
// initialize parser_id to rule_name map
|
||||
// initialize parser_id to rule_name map
|
||||
for (int i = 0; 0 != init_ruleid_name_map[i].parser_id; ++i)
|
||||
base_type::insert(base_type::value_type(
|
||||
boost::spirit::classic::parser_id(init_ruleid_name_map[i].parser_id),
|
||||
@@ -762,4 +762,4 @@ cpp_grammar_gen<LexIteratorT, TokenContainerT>::parse_cpp_grammar (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_GRAMMAR_HPP_FEAEBC2E_2734_428B_A7CA_85E5A415E23E_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#define CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED
|
||||
#if !defined(BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#define BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
@@ -86,7 +86,7 @@ struct BOOST_WAVE_DECL cpp_grammar_gen
|
||||
// boost::pool_allocator<boost::spirit::nil_t>
|
||||
> node_factory_type;
|
||||
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
static boost::spirit::classic::tree_parse_info<iterator_type, node_factory_type>
|
||||
parse_cpp_grammar (iterator_type const &first, iterator_type const &last,
|
||||
position_type const &act_pos, bool &found_eof,
|
||||
@@ -107,4 +107,4 @@ struct BOOST_WAVE_DECL cpp_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_GRAMMAR_GEN_HPP_80CB8A59_5411_4E45_B406_62531A12FB99_INCLUDED)
|
||||
|
||||
232
linx64/include/boost/wave/grammars/cpp_has_include_grammar.hpp
Normal file
232
linx64/include/boost/wave/grammars/cpp_has_include_grammar.hpp
Normal file
@@ -0,0 +1,232 @@
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
|
||||
Copyright (c) 2020 Jeff Trull
|
||||
Copyright (c) 2001-2012 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_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
#define BOOST_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_closure.hpp>
|
||||
#include <boost/spirit/include/classic_assign_actor.hpp>
|
||||
#include <boost/spirit/include/classic_push_back_actor.hpp>
|
||||
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
#include <boost/wave/util/pattern_parser.hpp>
|
||||
#include <boost/wave/grammars/cpp_has_include_grammar_gen.hpp>
|
||||
|
||||
#if !defined(spirit_append_actor)
|
||||
#define spirit_append_actor(actor) boost::spirit::classic::push_back_a(actor)
|
||||
#endif // !has_include(spirit_append_actor)
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace boost {
|
||||
namespace wave {
|
||||
namespace grammars {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// define, whether the rule's should generate some debug output
|
||||
#define TRACE_CPP_HAS_INCLUDE_GRAMMAR \
|
||||
bool(BOOST_SPIRIT_DEBUG_FLAGS_CPP & BOOST_SPIRIT_DEBUG_FLAGS_HAS_INCLUDE_GRAMMAR) \
|
||||
/**/
|
||||
|
||||
template <typename ContainerT>
|
||||
struct has_include_grammar :
|
||||
public boost::spirit::classic::grammar<has_include_grammar<ContainerT> >
|
||||
{
|
||||
has_include_grammar(ContainerT &tokens_seq_,
|
||||
bool &is_quoted_filename_,
|
||||
bool &is_system_)
|
||||
: tokens_seq(tokens_seq_), is_quoted_filename(is_quoted_filename_),
|
||||
is_system(is_system_), true_(true)
|
||||
{
|
||||
BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(*this, "has_include_grammar",
|
||||
TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
is_quoted_filename = false;
|
||||
is_system = false;
|
||||
}
|
||||
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
typedef boost::spirit::classic::rule<ScannerT> rule_t;
|
||||
|
||||
rule_t has_include_op;
|
||||
rule_t system_include;
|
||||
rule_t nonsystem_include;
|
||||
|
||||
rule_t nonparen;
|
||||
rule_t parenthesized_exp;
|
||||
rule_t computed_include;
|
||||
|
||||
definition(has_include_grammar const & self)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
has_include_op
|
||||
= ch_p(T_IDENTIFIER) >> // token contains '__has_include'
|
||||
ch_p(T_LEFTPAREN) >>
|
||||
(system_include | nonsystem_include | computed_include) >>
|
||||
ch_p(T_RIGHTPAREN)
|
||||
;
|
||||
|
||||
system_include
|
||||
= ch_p(T_LESS)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
]
|
||||
>> * (~ch_p(T_GREATER))
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
]
|
||||
>> ch_p(T_GREATER)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
][
|
||||
assign_a(self.is_quoted_filename, self.true_)
|
||||
][
|
||||
assign_a(self.is_system, self.true_)
|
||||
]
|
||||
;
|
||||
|
||||
nonsystem_include = ch_p(T_STRINGLIT)
|
||||
[
|
||||
spirit_append_actor(self.tokens_seq)
|
||||
][
|
||||
assign_a(self.is_quoted_filename, self.true_)
|
||||
]
|
||||
;
|
||||
|
||||
// an action to store a sequence of parsed tokens
|
||||
auto append_seq = [&](typename ScannerT::iterator_t first,
|
||||
typename ScannerT::iterator_t last) {
|
||||
for (;first != last;++first) {
|
||||
self.tokens_seq.push_back(*first);
|
||||
};
|
||||
};
|
||||
|
||||
// if neither of the above match we take everything between
|
||||
// the parentheses and evaluate it ("computed include")
|
||||
// supported expressions are "implementation defined" per the gcc manual
|
||||
// we've tried to be fairly generous in Wave
|
||||
// here we accept any set of non-whitespace characters with
|
||||
// properly nested parentheses:
|
||||
nonparen = (anychar_p - ch_p(T_LEFTPAREN) - ch_p(T_RIGHTPAREN)) [ append_seq ] ;
|
||||
|
||||
parenthesized_exp =
|
||||
ch_p(T_LEFTPAREN)[ spirit_append_actor(self.tokens_seq) ] >>
|
||||
computed_include >>
|
||||
ch_p(T_RIGHTPAREN)[ spirit_append_actor(self.tokens_seq) ] ;
|
||||
computed_include = * (nonparen | parenthesized_exp) ;
|
||||
|
||||
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(has_include_op, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(system_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(nonsystem_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(computed_include, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(parenthesized_exp, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(nonparen, TRACE_CPP_HAS_INCLUDE_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return has_include_op; }
|
||||
};
|
||||
|
||||
ContainerT &tokens_seq;
|
||||
bool &is_quoted_filename;
|
||||
bool &is_system;
|
||||
const bool true_; // Spirit Classic actors operate on references, not values
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#undef TRACE_CPP_HAS_INCLUDE_GRAMMAR
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// The following parse function is has_include here, to allow the separation of
|
||||
// the compilation of the has_include_grammar from the function
|
||||
// using it.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0
|
||||
#define BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
#else
|
||||
#define BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE inline
|
||||
#endif
|
||||
|
||||
// The parse_operator_define function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer type) to correctly
|
||||
// formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
template <typename LexIteratorT>
|
||||
BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
boost::spirit::classic::parse_info<
|
||||
typename has_include_grammar_gen<LexIteratorT>::iterator1_type
|
||||
>
|
||||
has_include_grammar_gen<LexIteratorT>::parse_operator_has_include (
|
||||
iterator1_type const &first, iterator1_type const &last,
|
||||
token_sequence_type &tokens,
|
||||
bool &is_quoted_filename, bool &is_system)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
|
||||
has_include_grammar<token_sequence_type>
|
||||
g(tokens, is_quoted_filename, is_system);
|
||||
return boost::spirit::classic::parse (
|
||||
first, last, g, ch_p(T_SPACE) | ch_p(T_CCOMMENT));
|
||||
}
|
||||
|
||||
template <typename LexIteratorT>
|
||||
BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
boost::spirit::classic::parse_info<
|
||||
typename has_include_grammar_gen<LexIteratorT>::iterator2_type
|
||||
>
|
||||
has_include_grammar_gen<LexIteratorT>::parse_operator_has_include (
|
||||
iterator2_type const &first, iterator2_type const &last,
|
||||
token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
|
||||
has_include_grammar<token_sequence_type>
|
||||
g(found_qualified_name, is_quoted_filename, is_system);
|
||||
return boost::spirit::classic::parse (
|
||||
first, last, g, ch_p(T_SPACE) | ch_p(T_CCOMMENT));
|
||||
}
|
||||
|
||||
#undef BOOST_WAVE_HAS_INCLUDE_GRAMMAR_GEN_INLINE
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
} // namespace grammars
|
||||
} // namespace wave
|
||||
} // namespace boost
|
||||
|
||||
// the suffix header occurs after all of the code
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_HPP_F48287B2_DC67_40A8_B4A1_800EFBD67869_INCLUDED)
|
||||
@@ -0,0 +1,87 @@
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
|
||||
Copyright (c) 2001-2012 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_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
#define BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
#include <list>
|
||||
|
||||
#include <boost/spirit/include/classic_parser.hpp>
|
||||
#include <boost/pool/pool_alloc.hpp>
|
||||
|
||||
#include <boost/wave/util/unput_queue_iterator.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_PREFIX
|
||||
#endif
|
||||
|
||||
// suppress warnings about dependent classes not being exported from the dll
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4251 4231 4660)
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
namespace boost {
|
||||
namespace wave {
|
||||
namespace grammars {
|
||||
|
||||
template <typename LexIteratorT>
|
||||
struct BOOST_WAVE_DECL has_include_grammar_gen
|
||||
{
|
||||
typedef typename LexIteratorT::token_type token_type;
|
||||
typedef std::list<token_type, boost::fast_pool_allocator<token_type> >
|
||||
token_sequence_type;
|
||||
|
||||
// The parse_operator_has_include function is instantiated manually twice to
|
||||
// simplify the explicit specialization of this template. This way the user
|
||||
// has only to specify one template parameter (the lexer iterator type) to
|
||||
// correctly formulate the required explicit specialization.
|
||||
// This results in no code overhead, because otherwise the function would be
|
||||
// generated by the compiler twice anyway.
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
typename token_sequence_type::iterator, token_type, token_sequence_type>
|
||||
iterator1_type;
|
||||
|
||||
typedef boost::wave::util::unput_queue_iterator<
|
||||
LexIteratorT, token_type, token_sequence_type>
|
||||
iterator2_type;
|
||||
|
||||
// parse the operator has_include and return the found qualified name
|
||||
static boost::spirit::classic::parse_info<iterator1_type>
|
||||
parse_operator_has_include (iterator1_type const &first,
|
||||
iterator1_type const &last, token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system);
|
||||
|
||||
static boost::spirit::classic::parse_info<iterator2_type>
|
||||
parse_operator_has_include (iterator2_type const &first,
|
||||
iterator2_type const &last, token_sequence_type &found_qualified_name,
|
||||
bool &is_quoted_filename, bool &is_system);
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
} // namespace grammars
|
||||
} // namespace wave
|
||||
} // namespace boost
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// the suffix header occurs after all of the code
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(BOOST_CPP_HAS_INCLUDE_GRAMMAR_GEN_HPP_825BE9F5_98A3_400D_A97C_AD76B3B08632_INCLUDED)
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#define CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED
|
||||
#if !defined(BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#define BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -101,16 +101,16 @@ struct intlit_grammar :
|
||||
(ch_p('X') | ch_p('x'))
|
||||
>> uint_parser<uint_literal_type, 16>()
|
||||
[
|
||||
self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true
|
||||
(self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true)
|
||||
]
|
||||
,
|
||||
|
||||
oct_lit =
|
||||
!uint_parser<uint_literal_type, 8>()
|
||||
[
|
||||
self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true
|
||||
(self.val = phx::arg1,
|
||||
phx::var(self.is_unsigned) = true)
|
||||
]
|
||||
,
|
||||
|
||||
@@ -129,7 +129,7 @@ struct intlit_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(dec_lit, TRACE_INTLIT_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_t const& start() const
|
||||
{ return int_lit; }
|
||||
};
|
||||
@@ -158,13 +158,12 @@ uint_literal_type
|
||||
intlit_grammar_gen<TokenT>::evaluate(TokenT const &token,
|
||||
bool &is_unsigned)
|
||||
{
|
||||
using namespace boost::spirit::classic;
|
||||
|
||||
intlit_grammar g(is_unsigned);
|
||||
uint_literal_type result = 0;
|
||||
typename TokenT::string_type const &token_val = token.get_value();
|
||||
parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
parse(token_val.begin(), token_val.end(), g[spirit_assign_actor(result)]);
|
||||
intlit_grammar g(is_unsigned);
|
||||
uint_literal_type result = 0;
|
||||
typename TokenT::string_type const &token_val = token.get_value();
|
||||
using boost::spirit::classic::parse_info;
|
||||
parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
parse(token_val.begin(), token_val.end(), g[spirit_assign_actor(result)]);
|
||||
|
||||
if (!hit.hit) {
|
||||
BOOST_WAVE_THROW(preprocess_exception, ill_formed_integer_literal,
|
||||
@@ -185,4 +184,4 @@ parse_info<typename TokenT::string_type::const_iterator> hit =
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_INTLIT_GRAMMAR_HPP_2E1E70B1_F15C_4132_8554_10A231B0D91C_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#define CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED
|
||||
#if !defined(BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#define BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/grammars/cpp_value_error.hpp>
|
||||
@@ -74,4 +74,4 @@ struct BOOST_WAVE_DECL chlit_grammar_gen {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_LITERAL_GRAMMAR_GEN_HPP_67794A6C_468A_4AAB_A757_DEDDB182F5A0_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#define CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED
|
||||
#if !defined(BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#define BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
|
||||
@@ -58,7 +58,7 @@ struct BOOST_WAVE_DECL predefined_macros_grammar_gen
|
||||
{
|
||||
typedef LexIteratorT iterator_type;
|
||||
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
// parse the cpp_grammar and return the resulting parse tree
|
||||
static boost::spirit::classic::tree_parse_info<iterator_type>
|
||||
parse_predefined_macro (iterator_type const &first, iterator_type const &last);
|
||||
};
|
||||
@@ -77,4 +77,4 @@ struct BOOST_WAVE_DECL predefined_macros_grammar_gen
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_PREDEF_MACROS_GEN_HPP_CADB6D2C_76A4_4988_83E1_EFFC6902B9A2_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#define CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED
|
||||
#if !defined(BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#define BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED
|
||||
|
||||
#include <boost/spirit/include/classic_core.hpp>
|
||||
#include <boost/spirit/include/classic_parse_tree.hpp>
|
||||
@@ -45,7 +45,7 @@ struct predefined_macros_grammar :
|
||||
template <typename ScannerT>
|
||||
struct definition
|
||||
{
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
// 'normal' (parse_tree generating) rule type
|
||||
typedef boost::spirit::classic::rule<
|
||||
ScannerT, boost::spirit::classic::dynamic_parser_tag>
|
||||
rule_type;
|
||||
@@ -54,26 +54,26 @@ struct predefined_macros_grammar :
|
||||
|
||||
definition(predefined_macros_grammar const &/*self*/)
|
||||
{
|
||||
// import the spirit and cpplexer namespaces here
|
||||
// import the spirit and cpplexer namespaces here
|
||||
using namespace boost::spirit::classic;
|
||||
using namespace boost::wave;
|
||||
using namespace boost::wave::util;
|
||||
|
||||
// set the rule id's for later use
|
||||
// set the rule id's for later use
|
||||
plain_define.set_id(BOOST_WAVE_PLAIN_DEFINE_ID);
|
||||
macro_parameters.set_id(BOOST_WAVE_MACRO_PARAMETERS_ID);
|
||||
macro_definition.set_id(BOOST_WAVE_MACRO_DEFINITION_ID);
|
||||
|
||||
// recognizes command line defined macro syntax, i.e.
|
||||
// -DMACRO
|
||||
// -DMACRO=
|
||||
// -DMACRO=value
|
||||
// -DMACRO(x)
|
||||
// -DMACRO(x)=
|
||||
// -DMACRO(x)=value
|
||||
// recognizes command line defined macro syntax, i.e.
|
||||
// -DMACRO
|
||||
// -DMACRO=
|
||||
// -DMACRO=value
|
||||
// -DMACRO(x)
|
||||
// -DMACRO(x)=
|
||||
// -DMACRO(x)=value
|
||||
|
||||
// This grammar resembles the overall structure of the cpp_grammar to
|
||||
// make it possible to reuse the parse tree traversal code
|
||||
// This grammar resembles the overall structure of the cpp_grammar to
|
||||
// make it possible to reuse the parse tree traversal code
|
||||
plain_define
|
||||
= ( ch_p(T_IDENTIFIER)
|
||||
| pattern_p(KeywordTokenType,
|
||||
@@ -87,7 +87,7 @@ struct predefined_macros_grammar :
|
||||
>> !macro_definition
|
||||
;
|
||||
|
||||
// parameter list
|
||||
// parameter list
|
||||
macro_parameters
|
||||
= confix_p(
|
||||
no_node_d[ch_p(T_LEFTPAREN) >> *ch_p(T_SPACE)],
|
||||
@@ -99,6 +99,7 @@ struct predefined_macros_grammar :
|
||||
ExtTokenTypeMask|PPTokenFlag) // and, bit_and etc.
|
||||
| pattern_p(BoolLiteralTokenType,
|
||||
TokenTypeMask|PPTokenFlag) // true/false
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
| ch_p(T_ELLIPSIS)
|
||||
#endif
|
||||
@@ -112,7 +113,7 @@ struct predefined_macros_grammar :
|
||||
)
|
||||
;
|
||||
|
||||
// macro body (anything left until eol)
|
||||
// macro body (anything left until eol)
|
||||
macro_definition
|
||||
= no_node_d[ch_p(T_ASSIGN)]
|
||||
>> *anychar_p
|
||||
@@ -123,7 +124,7 @@ struct predefined_macros_grammar :
|
||||
BOOST_SPIRIT_DEBUG_TRACE_RULE(macro_parameters, TRACE_PREDEF_MACROS_GRAMMAR);
|
||||
}
|
||||
|
||||
// start rule of this grammar
|
||||
// start rule of this grammar
|
||||
rule_type const& start() const
|
||||
{ return plain_define; }
|
||||
};
|
||||
@@ -175,4 +176,4 @@ predefined_macros_grammar_gen<LexIteratorT>::parse_predefined_macro (
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_PREDEF_MACROS_GRAMMAR_HPP_53858C9A_C202_4D60_AD92_DC9CAE4DBB43_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
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(LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)
|
||||
#define LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED
|
||||
#if !defined(BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)
|
||||
#define BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -23,23 +23,42 @@ namespace boost {
|
||||
namespace wave {
|
||||
|
||||
enum language_support {
|
||||
// support flags for C++98
|
||||
// support flags for C++98
|
||||
support_normal = 0x01,
|
||||
support_cpp = support_normal,
|
||||
|
||||
support_option_long_long = 0x02,
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
// support flags for C99
|
||||
// support flags for C99
|
||||
support_option_variadics = 0x04,
|
||||
support_c99 = support_option_variadics | support_option_long_long | 0x08,
|
||||
#endif
|
||||
#if BOOST_WAVE_SUPPORT_CPP0X != 0
|
||||
// support flags for C++11
|
||||
support_option_no_newline_at_end_of_file = 0x20,
|
||||
|
||||
support_cpp0x = support_option_variadics | support_option_long_long |
|
||||
support_option_no_newline_at_end_of_file | 0x10,
|
||||
support_cpp11 = support_cpp0x,
|
||||
#if BOOST_WAVE_SUPPORT_CPP1Z != 0
|
||||
// support flags for C++17
|
||||
support_option_has_include = 0x10000,
|
||||
|
||||
support_cpp1z = support_option_variadics | support_option_long_long |
|
||||
support_option_no_newline_at_end_of_file | support_option_has_include |
|
||||
0x20000,
|
||||
support_cpp17 = support_cpp1z,
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
// support flags for C++20
|
||||
support_option_va_opt = 0x40000,
|
||||
|
||||
support_cpp2a = support_option_variadics | support_option_long_long |
|
||||
support_option_no_newline_at_end_of_file | support_option_has_include |
|
||||
support_option_va_opt | 0x80000,
|
||||
support_cpp20 = support_cpp2a,
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
support_option_mask = 0xFFC0,
|
||||
@@ -93,6 +112,31 @@ need_cpp0x(language_support language)
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// need_cpp2a
|
||||
//
|
||||
// Extract if the language to support is C++20
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
|
||||
inline bool
|
||||
need_cpp2a(language_support language)
|
||||
{
|
||||
return (language & ~support_option_mask) == support_cpp2a;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
inline bool
|
||||
need_cpp2a(language_support language)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -197,6 +241,9 @@ BOOST_WAVE_OPTION(include_guard_detection) // support_option_include_guard_det
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
BOOST_WAVE_OPTION(variadics) // support_option_variadics
|
||||
#endif
|
||||
#if BOOST_WAVE_SUPPORT_VA_OPT != 0
|
||||
BOOST_WAVE_OPTION(va_opt) // support_option_va_opt
|
||||
#endif
|
||||
#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0
|
||||
BOOST_WAVE_OPTION(emit_pragma_directives) // support_option_emit_pragma_directives
|
||||
#endif
|
||||
@@ -205,6 +252,9 @@ BOOST_WAVE_OPTION(emit_contnewlines) // support_option_emit_contnewlines
|
||||
#if BOOST_WAVE_SUPPORT_CPP0X != 0
|
||||
BOOST_WAVE_OPTION(no_newline_at_end_of_file) // support_no_newline_at_end_of_file
|
||||
#endif
|
||||
#if BOOST_WAVE_SUPPORT_HAS_INCLUDE != 0
|
||||
BOOST_WAVE_OPTION(has_include) // support_option_has_include
|
||||
#endif
|
||||
|
||||
#undef BOOST_WAVE_NEED_OPTION
|
||||
#undef BOOST_WAVE_ENABLE_OPTION
|
||||
@@ -219,4 +269,4 @@ BOOST_WAVE_OPTION(no_newline_at_end_of_file) // support_no_newline_at_end_of_fil
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)
|
||||
#endif // !defined(BOOST_LANGUAGE_SUPPORT_HPP_93EDD057_2DEF_44BC_BC9F_FDABB9F51AFA_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED)
|
||||
#define DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED
|
||||
#if !defined(BOOST_DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED)
|
||||
#define BOOST_DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/util/cpp_include_paths.hpp>
|
||||
@@ -66,16 +66,6 @@ struct default_preprocessing_hooks
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT, typename ContainerT>
|
||||
void expanding_function_like_macro(
|
||||
TokenT const& macrodef, std::vector<TokenT> const& formal_args,
|
||||
ContainerT const& definition,
|
||||
TokenT const& macrocall, std::vector<ContainerT> const& arguments)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT, typename ContainerT, typename IteratorT>
|
||||
bool
|
||||
expanding_function_like_macro(ContextT const& ctx,
|
||||
@@ -84,7 +74,6 @@ struct default_preprocessing_hooks
|
||||
TokenT const& macrocall, std::vector<ContainerT> const& arguments,
|
||||
IteratorT const& seqstart, IteratorT const& seqend)
|
||||
{ return false; } // default is to normally expand the macro
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -106,20 +95,11 @@ struct default_preprocessing_hooks
|
||||
// expanded (return false) or will be copied to the output (return true).
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT, typename ContainerT>
|
||||
void expanding_object_like_macro(TokenT const& macro,
|
||||
ContainerT const& definition, TokenT const& macrocall)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT, typename ContainerT>
|
||||
bool
|
||||
expanding_object_like_macro(ContextT const& ctx, TokenT const& macro,
|
||||
ContainerT const& definition, TokenT const& macrocall)
|
||||
{ return false; } // default is to normally expand the macro
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -133,17 +113,9 @@ struct default_preprocessing_hooks
|
||||
// result of the macro expansion.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename ContainerT>
|
||||
void expanded_macro(ContainerT const& result)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename ContainerT>
|
||||
void expanded_macro(ContextT const& ctx, ContainerT const& result)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -157,17 +129,9 @@ struct default_preprocessing_hooks
|
||||
// result of the rescanning.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename ContainerT>
|
||||
void rescanned_macro(ContainerT const& result)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename ContainerT>
|
||||
void rescanned_macro(ContextT const& ctx, ContainerT const& result)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -249,13 +213,6 @@ struct default_preprocessing_hooks
|
||||
// (return false) or will be skipped (return true).
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
void
|
||||
found_include_directive(std::string const& filename, bool include_next)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT>
|
||||
bool
|
||||
found_include_directive(ContextT const& ctx, std::string const& filename,
|
||||
@@ -263,7 +220,6 @@ struct default_preprocessing_hooks
|
||||
{
|
||||
return false; // ok to include this file
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -284,20 +240,11 @@ struct default_preprocessing_hooks
|
||||
// found as a result of a #include <...> directive.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
void
|
||||
opened_include_file(std::string const& relname, std::string const& absname,
|
||||
std::size_t include_depth, bool is_system_include)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT>
|
||||
void
|
||||
opened_include_file(ContextT const& ctx, std::string const& relname,
|
||||
std::string const& absname, bool is_system_include)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -308,18 +255,10 @@ struct default_preprocessing_hooks
|
||||
// instantiating the preprocessing iterators by the user.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
void
|
||||
returning_from_include_file()
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT>
|
||||
void
|
||||
returning_from_include_file(ContextT const& ctx)
|
||||
{}
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
@@ -486,16 +425,6 @@ struct default_preprocessing_hooks
|
||||
// during the initialization phase of the library.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT, typename ParametersT, typename DefinitionT>
|
||||
void
|
||||
defined_macro(TokenT const& macro_name, bool is_functionlike,
|
||||
ParametersT const& parameters, DefinitionT const& definition,
|
||||
bool is_predefined)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <
|
||||
typename ContextT, typename TokenT, typename ParametersT,
|
||||
typename DefinitionT
|
||||
@@ -505,7 +434,6 @@ struct default_preprocessing_hooks
|
||||
bool is_functionlike, ParametersT const& parameters,
|
||||
DefinitionT const& definition, bool is_predefined)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -519,19 +447,10 @@ struct default_preprocessing_hooks
|
||||
// removed.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT>
|
||||
void
|
||||
undefined_macro(TokenT const& macro_name)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT>
|
||||
void
|
||||
undefined_macro(ContextT const& ctx, TokenT const& macro_name)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -551,19 +470,10 @@ struct default_preprocessing_hooks
|
||||
// output by a single newline.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT>
|
||||
void
|
||||
found_directive(TokenT const& directive)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT>
|
||||
bool
|
||||
found_directive(ContextT const& ctx, TokenT const& directive)
|
||||
{ return false; } // by default we never skip any directives
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -617,22 +527,12 @@ struct default_preprocessing_hooks
|
||||
// to force the expression to be re-evaluated.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename ContainerT>
|
||||
void
|
||||
evaluated_conditional_expression(ContainerT const& expression,
|
||||
bool expression_value)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT, typename ContainerT>
|
||||
bool
|
||||
evaluated_conditional_expression(ContextT const& ctx,
|
||||
TokenT const& directive, ContainerT const& expression,
|
||||
bool expression_value)
|
||||
{ return false; } // ok to continue, do not re-evaluate expression
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -646,19 +546,10 @@ struct default_preprocessing_hooks
|
||||
// The parameter 'token' refers to the token to be skipped.
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
// old signature
|
||||
template <typename TokenT>
|
||||
void
|
||||
skipped_token(TokenT const& token)
|
||||
{}
|
||||
#else
|
||||
// new signature
|
||||
template <typename ContextT, typename TokenT>
|
||||
void
|
||||
skipped_token(ContextT const& ctx, TokenT const& token)
|
||||
{}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -816,4 +707,4 @@ struct default_preprocessing_hooks
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED)
|
||||
#endif // !defined(BOOST_DEFAULT_PREPROCESSING_HOOKS_HPP_INCLUDED)
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)
|
||||
#define TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED
|
||||
#if !defined(BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)
|
||||
#define BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
|
||||
@@ -43,10 +44,11 @@ namespace wave {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// the token_category helps to classify the different token types
|
||||
enum token_category {
|
||||
enum token_category : std::uint32_t {
|
||||
IdentifierTokenType = 0x08040000,
|
||||
ParameterTokenType = 0x08840000,
|
||||
ExtParameterTokenType = 0x088C0000,
|
||||
OptParameterTokenType = 0x08940000,
|
||||
KeywordTokenType = 0x10040000,
|
||||
OperatorTokenType = 0x18040000,
|
||||
LiteralTokenType = 0x20040000,
|
||||
@@ -77,7 +79,7 @@ enum token_category {
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// the token_id assigns unique numbers to the different C++ lexemes
|
||||
enum token_id {
|
||||
enum token_id : std::uint32_t {
|
||||
T_UNKNOWN = 0,
|
||||
T_FIRST_TOKEN = 256,
|
||||
T_AND = TOKEN_FROM_ID(T_FIRST_TOKEN, OperatorTokenType),
|
||||
@@ -300,6 +302,19 @@ enum token_id {
|
||||
T_THREADLOCAL = TOKEN_FROM_ID(431, KeywordTokenType),
|
||||
T_RAWSTRINGLIT = TOKEN_FROM_ID(432, StringLiteralTokenType),
|
||||
|
||||
// C++20 keywords
|
||||
T_CHAR8_T = TOKEN_FROM_ID(433, KeywordTokenType),
|
||||
T_CONCEPT = TOKEN_FROM_ID(434, KeywordTokenType),
|
||||
T_CONSTEVAL = TOKEN_FROM_ID(435, KeywordTokenType),
|
||||
T_CONSTINIT = TOKEN_FROM_ID(436, KeywordTokenType),
|
||||
T_CO_AWAIT = TOKEN_FROM_ID(437, KeywordTokenType),
|
||||
T_CO_RETURN = TOKEN_FROM_ID(438, KeywordTokenType),
|
||||
T_CO_YIELD = TOKEN_FROM_ID(439, KeywordTokenType),
|
||||
T_REQUIRES = TOKEN_FROM_ID(440, KeywordTokenType),
|
||||
|
||||
// C++20 operators
|
||||
T_SPACESHIP = TOKEN_FROM_ID(441, OperatorTokenType),
|
||||
|
||||
T_LAST_TOKEN_ID,
|
||||
T_LAST_TOKEN = ID_FROM_TOKEN(T_LAST_TOKEN_ID & ~PPTokenFlag),
|
||||
|
||||
@@ -311,9 +326,30 @@ enum token_id {
|
||||
T_PLACEHOLDER = TOKEN_FROM_ID(T_LAST_TOKEN+2, WhiteSpaceTokenType),
|
||||
T_PLACEMARKER = TOKEN_FROM_ID(T_LAST_TOKEN+3, InternalTokenType),
|
||||
T_PARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, ParameterTokenType),
|
||||
T_EXTPARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, ExtParameterTokenType)
|
||||
T_EXTPARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, ExtParameterTokenType),
|
||||
T_OPTPARAMETERBASE = TOKEN_FROM_ID(T_LAST_TOKEN+4, OptParameterTokenType)
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// token_category and token_id may be used together
|
||||
constexpr token_id operator&(token_id a, token_category b)
|
||||
{
|
||||
return static_cast<token_id>(
|
||||
static_cast<std::uint32_t>(a) & static_cast<std::uint32_t>(b));
|
||||
}
|
||||
|
||||
constexpr token_id operator|(token_id a, token_category b)
|
||||
{
|
||||
return static_cast<token_id>(
|
||||
static_cast<std::uint32_t>(a) | static_cast<std::uint32_t>(b));
|
||||
}
|
||||
|
||||
constexpr bool operator==(token_category a, token_id b)
|
||||
{
|
||||
return static_cast<std::uint32_t>(a) == static_cast<std::uint32_t>(b);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// redefine the TOKEN_FROM_ID macro to be more type safe
|
||||
#undef TOKEN_FROM_ID
|
||||
@@ -376,5 +412,5 @@ char const *get_token_value(token_id tokid);
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)
|
||||
#endif // !defined(BOOST_TOKEN_IDS_HPP_414E9A58_F079_4789_8AFF_513815CE475B_INCLUDED)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#define CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED
|
||||
#if !defined(BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#define BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED
|
||||
|
||||
#include <stack>
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
|
||||
void enter_if_block(bool new_status)
|
||||
{
|
||||
// If enclosing block is false, then this block is also false
|
||||
// If enclosing block is false, then this block is also false
|
||||
bool enclosing_status = get_status();
|
||||
this->push (value_type (new_status && enclosing_status, enclosing_status));
|
||||
}
|
||||
@@ -82,11 +82,11 @@ public:
|
||||
|
||||
if (get_enclosing_status()) {
|
||||
if (get_status()) {
|
||||
// entered a (false) #elif block from a true block
|
||||
// entered a (false) #elif block from a true block
|
||||
this->top().set_status(false);
|
||||
}
|
||||
else if (new_status && !this->top().get_some_part_status()) {
|
||||
// Entered true #elif block and no previous block was true
|
||||
// Entered true #elif block and no previous block was true
|
||||
this->top().set_status(new_status);
|
||||
}
|
||||
}
|
||||
@@ -99,15 +99,15 @@ public:
|
||||
|
||||
if (get_enclosing_status()) {
|
||||
if (!this->top().get_some_part_status()) {
|
||||
// Entered (true) #else block and no previous block was true
|
||||
// Entered (true) #else block and no previous block was true
|
||||
this->top().set_status(true);
|
||||
}
|
||||
else if (get_status()) {
|
||||
// Entered (false) #else block from true block
|
||||
// Entered (false) #else block from true block
|
||||
this->top().set_status(false);
|
||||
}
|
||||
|
||||
// Set else flag
|
||||
// Set else flag
|
||||
this->top().set_in_else();
|
||||
}
|
||||
return true;
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
// return, whether the top (innermost) condition is true or false
|
||||
// return, whether the top (innermost) condition is true or false
|
||||
bool get_status() const
|
||||
{
|
||||
return 0 == this->size() || this->top().get_status();
|
||||
@@ -158,4 +158,4 @@ protected:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_IFBLOCK_HPP_D4676B36_00C5_41F4_BC9F_9CBBAE3B8006_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#define CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED
|
||||
#if !defined(BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#define BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -273,11 +273,11 @@ bool include_paths::add_include_path (
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
if (path_) {
|
||||
fs::path newpath = util::complete_path(create_path(path_), current_dir);
|
||||
fs::path newpath = util::complete_path(create_path(path_), current_dir);
|
||||
|
||||
if (!fs::exists(newpath) || !fs::is_directory(newpath)) {
|
||||
// the given path does not form a name of a valid file system directory
|
||||
// item
|
||||
// the given path does not form a name of a valid file system directory
|
||||
// item
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -301,13 +301,13 @@ bool include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0
|
||||
if (0 != current_file) {
|
||||
// re-locate the directory of the current file (#include_next handling)
|
||||
// re-locate the directory of the current file (#include_next handling)
|
||||
|
||||
// #include_next does not distinguish between <file> and "file"
|
||||
// inclusion, nor does it check that the file you specify has the same
|
||||
// name as the current file. It simply looks for the file named, starting
|
||||
// with the directory in the search path after the one where the current
|
||||
// file was found.
|
||||
// #include_next does not distinguish between <file> and "file"
|
||||
// inclusion, nor does it check that the file you specify has the same
|
||||
// name as the current file. It simply looks for the file named, starting
|
||||
// with the directory in the search path after the one where the current
|
||||
// file was found.
|
||||
|
||||
fs::path file_path (create_path(current_file));
|
||||
for (/**/; it != include_paths_end; ++it) {
|
||||
@@ -352,20 +352,20 @@ include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
{
|
||||
namespace fs = boost::filesystem;
|
||||
|
||||
// if not system include (<...>), then search current directory first
|
||||
// if not system include (<...>), then search current directory first
|
||||
if (!is_system) {
|
||||
if (!was_sys_include_path) { // set_sys_include_delimiter() not called
|
||||
// first have a look at the current directory
|
||||
fs::path currpath (create_path(s));
|
||||
if (!was_sys_include_path) { // set_sys_include_delimiter() not called
|
||||
// first have a look at the current directory
|
||||
fs::path currpath(create_path(s));
|
||||
if (!currpath.has_root_directory()) {
|
||||
currpath = create_path(current_dir.string());
|
||||
currpath /= create_path(s);
|
||||
}
|
||||
|
||||
if (fs::exists(currpath) && 0 == current_file) {
|
||||
// if 0 != current_path (#include_next handling) it can't be
|
||||
// the file in the current directory
|
||||
fs::path dirpath (create_path(s));
|
||||
// if 0 != current_path (#include_next handling) it can't be
|
||||
// the file in the current directory
|
||||
fs::path dirpath(create_path(s));
|
||||
if (!dirpath.has_root_directory()) {
|
||||
dirpath = create_path(current_rel_dir.string());
|
||||
dirpath /= create_path(s);
|
||||
@@ -376,23 +376,23 @@ include_paths::find_include_file (std::string &s, std::string &dir,
|
||||
return true;
|
||||
}
|
||||
|
||||
// iterate all user include file directories to find the file
|
||||
// iterate all user include file directories to find the file
|
||||
if (find_include_file(s, dir, user_include_paths, current_file))
|
||||
return true;
|
||||
|
||||
// ... fall through
|
||||
// ... fall through
|
||||
}
|
||||
else {
|
||||
// if set_sys_include_delimiter() was called, then user include files
|
||||
// are searched in the user search path only
|
||||
// if set_sys_include_delimiter() was called, then user include files
|
||||
// are searched in the user search path only
|
||||
return find_include_file(s, dir, user_include_paths, current_file);
|
||||
}
|
||||
|
||||
// if nothing found, fall through
|
||||
// ...
|
||||
// if nothing found, fall through
|
||||
// ...
|
||||
}
|
||||
|
||||
// iterate all system include file directories to find the file
|
||||
// iterate all system include file directories to find the file
|
||||
return find_include_file (s, dir, system_include_paths, current_file);
|
||||
}
|
||||
|
||||
@@ -545,4 +545,4 @@ BOOST_CLASS_VERSION(boost::wave::util::include_paths,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
#endif // !defined(BOOST_CPP_INCLUDE_PATHS_HPP_AF620DA4_B3D2_4221_AD91_8A1ABFFB6944_INCLUDED)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -10,11 +10,12 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#define CPP_MACROMAP_PREDEF_HPP_HK041119
|
||||
#if !defined(BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#define BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119
|
||||
|
||||
#include <cstdio>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/format.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/wave_config_constant.hpp>
|
||||
@@ -47,14 +48,14 @@ namespace util {
|
||||
typedef BOOST_WAVE_STRINGTYPE string_type;
|
||||
|
||||
public:
|
||||
// list of static predefined macros
|
||||
// list of static predefined macros
|
||||
struct static_macros {
|
||||
char const *name;
|
||||
boost::wave::token_id token_id;
|
||||
char const *value;
|
||||
};
|
||||
|
||||
// list of dynamic predefined macros
|
||||
// list of dynamic predefined macros
|
||||
struct dynamic_macros {
|
||||
char const *name;
|
||||
boost::wave::token_id token_id;
|
||||
@@ -68,27 +69,31 @@ namespace util {
|
||||
string_type version_; // __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
string_type versionstr_; // __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
|
||||
static string_type strconv(std::string const & ss)
|
||||
{
|
||||
return string_type(ss.c_str());
|
||||
}
|
||||
|
||||
protected:
|
||||
void reset_datestr()
|
||||
{
|
||||
static const char *const monthnames[] = {
|
||||
static const char *const monthnames[] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
||||
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
|
||||
if (tt != (time_t)-1) {
|
||||
char buffer[sizeof("\"Oct 11 1347\"")+1];
|
||||
|
||||
tb = localtime (&tt);
|
||||
sprintf (buffer, "\"%s %2d %4d\"",
|
||||
monthnames[tb->tm_mon], tb->tm_mday, tb->tm_year + 1900);
|
||||
datestr_ = buffer;
|
||||
datestr_ = strconv((boost::format("\"%s %2d %4d\"")
|
||||
% monthnames[tb->tm_mon]
|
||||
% tb->tm_mday
|
||||
% (tb->tm_year + 1900)).str());
|
||||
}
|
||||
else {
|
||||
datestr_ = "\"??? ?? ????\"";
|
||||
@@ -97,19 +102,18 @@ namespace util {
|
||||
|
||||
void reset_timestr()
|
||||
{
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
time_t tt = time(0);
|
||||
struct tm *tb = 0;
|
||||
|
||||
if (tt != (time_t)-1) {
|
||||
char buffer[sizeof("\"12:34:56\"")+1];
|
||||
|
||||
tb = localtime (&tt);
|
||||
sprintf (buffer, "\"%02d:%02d:%02d\"", tb->tm_hour,
|
||||
tb->tm_min, tb->tm_sec);
|
||||
timestr_ = buffer;
|
||||
timestr_ = strconv((boost::format("\"%02d:%02d:%02d\"")
|
||||
% tb->tm_hour
|
||||
% tb->tm_min
|
||||
% tb->tm_sec).str());
|
||||
}
|
||||
else {
|
||||
timestr_ = "\"??:??:??\"";
|
||||
@@ -118,14 +122,12 @@ namespace util {
|
||||
|
||||
void reset_version()
|
||||
{
|
||||
char buffer[sizeof("0x00000000")+1];
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
|
||||
using namespace std; // for some systems memset is in namespace std
|
||||
memset (&first_day, 0, sizeof(tm));
|
||||
@@ -133,61 +135,57 @@ namespace util {
|
||||
first_day.tm_mday = 13; // 13
|
||||
first_day.tm_year = 101; // 2001
|
||||
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
|
||||
sprintf(buffer, "0x%02d%1d%1d%04ld", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR,
|
||||
seconds/(3600*24));
|
||||
version_ = buffer;
|
||||
version_ = strconv((boost::format("0x%02d%1d%1d%04ld")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR
|
||||
% (seconds/(3600*24))).str());
|
||||
}
|
||||
|
||||
void reset_versionstr()
|
||||
{
|
||||
char buffer[sizeof("\"00.00.00.0000 \"")+sizeof(BOOST_PLATFORM)+sizeof(BOOST_COMPILER)+4];
|
||||
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
// for some systems sprintf, time_t etc. is in namespace std
|
||||
using namespace std;
|
||||
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
// calculate the number of days since Dec 13 2001
|
||||
// (the day the Wave project was started)
|
||||
tm first_day;
|
||||
|
||||
memset (&first_day, 0, sizeof(tm));
|
||||
first_day.tm_mon = 11; // Dec
|
||||
first_day.tm_mday = 13; // 13
|
||||
first_day.tm_year = 101; // 2001
|
||||
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
long seconds = long(difftime(compilation_time_.get_time(), mktime(&first_day)));
|
||||
|
||||
sprintf(buffer, "\"%d.%d.%d.%ld [%s/%s]\"", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR,
|
||||
seconds/(3600*24), BOOST_PLATFORM, BOOST_COMPILER);
|
||||
versionstr_ = buffer;
|
||||
versionstr_ = strconv((boost::format("\"%d.%d.%d.%ld [%s/%s]\"")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR
|
||||
% (seconds/(3600*24))
|
||||
% BOOST_PLATFORM
|
||||
% BOOST_COMPILER).str());
|
||||
}
|
||||
|
||||
// dynamic predefined macros
|
||||
// dynamic predefined macros
|
||||
string_type get_date() const { return datestr_; } // __DATE__
|
||||
string_type get_time() const { return timestr_; } // __TIME__
|
||||
|
||||
// __SPIRIT_PP__/__WAVE__
|
||||
// __SPIRIT_PP__/__WAVE__
|
||||
string_type get_version() const
|
||||
{
|
||||
char buffer[sizeof("0x0000")+1];
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "0x%02d%1d%1d", BOOST_WAVE_VERSION_MAJOR,
|
||||
BOOST_WAVE_VERSION_MINOR, BOOST_WAVE_VERSION_SUBMINOR);
|
||||
return buffer;
|
||||
return strconv((boost::format("0x%02d%1d%1d")
|
||||
% BOOST_WAVE_VERSION_MAJOR
|
||||
% BOOST_WAVE_VERSION_MINOR
|
||||
% BOOST_WAVE_VERSION_SUBMINOR).str());
|
||||
}
|
||||
|
||||
// __WAVE_CONFIG__
|
||||
// __WAVE_CONFIG__
|
||||
string_type get_config() const
|
||||
{
|
||||
char buffer[sizeof("0x00000000")+1];
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "0x%08x", BOOST_WAVE_CONFIG);
|
||||
return buffer;
|
||||
return strconv((boost::format("0x%08x") % BOOST_WAVE_CONFIG).str());
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -205,13 +203,13 @@ namespace util {
|
||||
reset_timestr();
|
||||
}
|
||||
|
||||
// __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
// __SPIRIT_PP_VERSION__/__WAVE_VERSION__
|
||||
string_type get_fullversion() const { return version_; }
|
||||
|
||||
// __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
// __SPIRIT_PP_VERSION_STR__/__WAVE_VERSION_STR__
|
||||
string_type get_versionstr() const { return versionstr_; }
|
||||
|
||||
// C++ mode
|
||||
// C++ mode
|
||||
static_macros const& static_data_cpp(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -224,7 +222,7 @@ namespace util {
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP0X != 0
|
||||
// C++11 mode
|
||||
// C++11 mode
|
||||
static_macros const& static_data_cpp0x(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -240,8 +238,25 @@ namespace util {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_CPP2A != 0
|
||||
// C++20 mode
|
||||
static_macros const& static_data_cpp2a(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
{ "__STDC__", T_INTLIT, "1" },
|
||||
{ "__cplusplus", T_INTLIT, "202002L" },
|
||||
{ "__STDC_VERSION__", T_INTLIT, "199901L" },
|
||||
{ "__STDC_HOSTED__", T_INTLIT, "0" },
|
||||
{ "__WAVE_HAS_VARIADICS__", T_INTLIT, "1" },
|
||||
{ 0, T_EOF, 0 }
|
||||
};
|
||||
BOOST_ASSERT(i < sizeof(data)/sizeof(data[0]));
|
||||
return data[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
// C99 mode
|
||||
// C99 mode
|
||||
static_macros const& static_data_c99(std::size_t i) const
|
||||
{
|
||||
static static_macros data[] = {
|
||||
@@ -285,4 +300,4 @@ namespace util {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
#endif // !defined(BOOST_CPP_MACROMAP_PREDEF_HPP_HK041119)
|
||||
|
||||
@@ -10,14 +10,15 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#define CPP_MACROMAP_UTIL_HPP_HK041119
|
||||
#if !defined(BOOST_CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#define BOOST_CPP_MACROMAP_UTIL_HPP_HK041119
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
#include <boost/wave/util/unput_queue_iterator.hpp>
|
||||
#include <boost/wave/language_support.hpp>
|
||||
|
||||
// this must occur after all of the includes and before any code appears
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
@@ -135,9 +136,9 @@ namespace impl {
|
||||
// Test, whether a given identifier resolves to a predefined name
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename StringT>
|
||||
template <typename ContextT, typename StringT>
|
||||
inline bool
|
||||
is_special_macroname (StringT const &name)
|
||||
is_special_macroname (ContextT const & ctx, StringT const &name)
|
||||
{
|
||||
if (name.size() < 7)
|
||||
return false;
|
||||
@@ -145,8 +146,14 @@ is_special_macroname (StringT const &name)
|
||||
if ("defined" == name)
|
||||
return true;
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_HAS_INCLUDE != 0
|
||||
if (boost::wave::need_has_include(ctx.get_language()) &&
|
||||
("__has_include" == name))
|
||||
return true;
|
||||
#endif
|
||||
|
||||
if ('_' == name[0] && '_' == name[1]) {
|
||||
StringT str = name.substr(2);
|
||||
StringT str = name.substr(2);
|
||||
|
||||
if (str == "cplusplus" || str == "STDC__" ||
|
||||
str == "TIME__" || str == "DATE__" ||
|
||||
@@ -172,9 +179,9 @@ token_equals(TokenT const &left, TokenT const &right)
|
||||
using namespace boost::wave;
|
||||
|
||||
if (IS_CATEGORY(left, ParameterTokenType)) {
|
||||
// if the existing token is of type T_PARAMETERBASE, then the right token
|
||||
// must be of type T_IDENTIFIER or a keyword
|
||||
token_id id = token_id(right);
|
||||
// if the existing token is of type T_PARAMETERBASE, then the right token
|
||||
// must be of type T_IDENTIFIER or a keyword
|
||||
token_id id = token_id(right);
|
||||
|
||||
return (T_IDENTIFIER == id ||
|
||||
IS_CATEGORY(id, KeywordTokenType) ||
|
||||
@@ -202,22 +209,22 @@ definition_equals(ContainerT const &definition,
|
||||
{
|
||||
typedef typename ContainerT::const_iterator const_iterator_type;
|
||||
|
||||
const_iterator_type first1 = definition.begin();
|
||||
const_iterator_type last1 = definition.end();
|
||||
const_iterator_type first2 = new_definition.begin();
|
||||
const_iterator_type last2 = new_definition.end();
|
||||
const_iterator_type first1 = definition.begin();
|
||||
const_iterator_type last1 = definition.end();
|
||||
const_iterator_type first2 = new_definition.begin();
|
||||
const_iterator_type last2 = new_definition.end();
|
||||
|
||||
while (first1 != last1 && first2 != last2 && token_equals(*first1, *first2))
|
||||
{
|
||||
// skip whitespace, if both sequences have a whitespace next
|
||||
token_id id1 = next_token<const_iterator_type>::peek(first1, last1, false);
|
||||
token_id id2 = next_token<const_iterator_type>::peek(first2, last2, false);
|
||||
// skip whitespace, if both sequences have a whitespace next
|
||||
token_id id1 = next_token<const_iterator_type>::peek(first1, last1, false);
|
||||
token_id id2 = next_token<const_iterator_type>::peek(first2, last2, false);
|
||||
|
||||
if (IS_CATEGORY(id1, WhiteSpaceTokenType) &&
|
||||
IS_CATEGORY(id2, WhiteSpaceTokenType))
|
||||
{
|
||||
// all consecutive whitespace tokens count as one whitespace
|
||||
// adjust first1 and first2 accordingly
|
||||
// all consecutive whitespace tokens count as one whitespace
|
||||
// adjust first1 and first2 accordingly
|
||||
skip_whitespace(first1, last1);
|
||||
skip_whitespace(first2, last2);
|
||||
}
|
||||
@@ -228,7 +235,7 @@ const_iterator_type last2 = new_definition.end();
|
||||
++first2;
|
||||
}
|
||||
else {
|
||||
// the sequences differ
|
||||
// the sequences differ
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -249,13 +256,13 @@ parameters_equal(ContainerT const ¶meters, ContainerT const &new_parameters)
|
||||
|
||||
typedef typename ContainerT::const_iterator const_iterator_type;
|
||||
|
||||
const_iterator_type first1 = parameters.begin();
|
||||
const_iterator_type last1 = parameters.end();
|
||||
const_iterator_type first2 = new_parameters.begin();
|
||||
const_iterator_type last2 = new_parameters.end();
|
||||
const_iterator_type first1 = parameters.begin();
|
||||
const_iterator_type last1 = parameters.end();
|
||||
const_iterator_type first2 = new_parameters.begin();
|
||||
const_iterator_type last2 = new_parameters.end();
|
||||
|
||||
while (first1 != last1 && first2 != last2) {
|
||||
// parameters are different, if the corresponding tokens are different
|
||||
// parameters are different, if the corresponding tokens are different
|
||||
using namespace boost::wave;
|
||||
if (token_id(*first1) != token_id(*first2) ||
|
||||
(*first1).get_value() != (*first2).get_value())
|
||||
@@ -279,10 +286,10 @@ trim_replacement_list (ContainerT &replacement_list)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace
|
||||
// strip leading whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
|
||||
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
|
||||
token_id id(*it);
|
||||
@@ -298,16 +305,16 @@ trim_replacement_list (ContainerT &replacement_list)
|
||||
}
|
||||
}
|
||||
|
||||
// strip trailing whitespace
|
||||
// strip trailing whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::reverse_iterator rend = replacement_list.rend();
|
||||
typename ContainerT::reverse_iterator rit = replacement_list.rbegin();
|
||||
typename ContainerT::reverse_iterator rend = replacement_list.rend();
|
||||
typename ContainerT::reverse_iterator rit = replacement_list.rbegin();
|
||||
|
||||
while (rit != rend && IS_CATEGORY(*rit, WhiteSpaceTokenType))
|
||||
++rit;
|
||||
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = rit.base();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = rit.base();
|
||||
|
||||
while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) {
|
||||
token_id id(*it);
|
||||
@@ -343,6 +350,27 @@ is_whitespace_only (ContainerT const &argument)
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Tests whether the given token sequence consists only of whitespace
|
||||
// and placemarkers
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template <typename ContainerT>
|
||||
inline bool
|
||||
is_blank_only (ContainerT const &argument)
|
||||
{
|
||||
typename ContainerT::const_iterator end = argument.end();
|
||||
for (typename ContainerT::const_iterator it = argument.begin();
|
||||
it != end; ++it)
|
||||
{
|
||||
if (!IS_CATEGORY(*it, WhiteSpaceTokenType) &&
|
||||
(T_PLACEMARKER != token_id(*it)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Remove all placeholder tokens from the given token sequence
|
||||
@@ -354,10 +382,10 @@ remove_placeholders (ContainerT &replacement_list)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace
|
||||
// strip leading whitespace
|
||||
if (replacement_list.size() > 0) {
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
typename ContainerT::iterator end = replacement_list.end();
|
||||
typename ContainerT::iterator it = replacement_list.begin();
|
||||
|
||||
while (it != end) {
|
||||
token_id id(*it);
|
||||
@@ -372,7 +400,7 @@ remove_placeholders (ContainerT &replacement_list)
|
||||
}
|
||||
}
|
||||
|
||||
// remove all 'new' leading and trailing whitespace
|
||||
// remove all 'new' leading and trailing whitespace
|
||||
if (is_whitespace_only(replacement_list))
|
||||
trim_replacement_list(replacement_list);
|
||||
}
|
||||
@@ -389,7 +417,7 @@ trim_sequence_left (ContainerT &argument)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip leading whitespace (should be only one token)
|
||||
// strip leading whitespace (should be only one token)
|
||||
if (argument.size() > 0 &&
|
||||
IS_CATEGORY(argument.front(), WhiteSpaceTokenType))
|
||||
{
|
||||
@@ -408,7 +436,7 @@ trim_sequence_right (ContainerT &argument)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
// strip trailing whitespace (should be only one token)
|
||||
// strip trailing whitespace (should be only one token)
|
||||
if (argument.size() > 0 &&
|
||||
IS_CATEGORY(argument.back(), WhiteSpaceTokenType))
|
||||
{
|
||||
@@ -436,11 +464,7 @@ template <typename ContextT>
|
||||
void call_skipped_token_hook(ContextT& ctx,
|
||||
typename ContextT::token_type const& skipped)
|
||||
{
|
||||
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
ctx.get_hooks().skipped_token(skipped);
|
||||
#else
|
||||
ctx.get_hooks().skipped_token(ctx.derived(), skipped);
|
||||
#endif
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -572,4 +596,4 @@ to_string(Src const& src)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
#endif // !defined(BOOST_CPP_MACROMAP_UTIL_HPP_HK041119)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#define FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED
|
||||
#if !defined(BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#define BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <ostream>
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
: file(file_), line(line_), column(column_)
|
||||
{}
|
||||
|
||||
// accessors
|
||||
// accessors
|
||||
string_type const &get_file() const { return file; }
|
||||
std::size_t get_line() const { return line; }
|
||||
std::size_t get_column() const { return column; }
|
||||
@@ -192,4 +192,4 @@ namespace spirit { namespace classic {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
#endif // !defined(BOOST_FILE_POSITION_H_52BDEDF7_DAD3_4F24_802F_E66BB8098F68_INCLUDED)
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
// - Removed the getline implementation which was borrowed from the SGI
|
||||
// STL as the license for this code is not compatible with Boost.
|
||||
|
||||
#ifndef FLEX_STRING_INC_
|
||||
#define FLEX_STRING_INC_
|
||||
#ifndef BOOST_FLEX_STRING_INC_
|
||||
#define BOOST_FLEX_STRING_INC_
|
||||
|
||||
/*
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -87,6 +87,7 @@ class StoragePolicy
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/throw_exception.hpp>
|
||||
|
||||
#include <boost/core/allocator_access.hpp>
|
||||
#include <boost/iterator/reverse_iterator.hpp>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
@@ -100,7 +101,6 @@ class StoragePolicy
|
||||
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
@@ -287,29 +287,15 @@ inline bool operator!=(const mallocator<T>&,
|
||||
return false;
|
||||
}
|
||||
|
||||
template <class Allocator>
|
||||
typename Allocator::pointer Reallocate(
|
||||
Allocator& alloc,
|
||||
typename Allocator::pointer p,
|
||||
typename Allocator::size_type oldObjCount,
|
||||
typename Allocator::size_type newObjCount,
|
||||
void*)
|
||||
{
|
||||
// @@@ not implemented
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template <class Allocator>
|
||||
typename Allocator::pointer Reallocate(
|
||||
Allocator& alloc,
|
||||
typename Allocator::pointer p,
|
||||
typename Allocator::size_type oldObjCount,
|
||||
typename Allocator::size_type newObjCount,
|
||||
mallocator<void>*)
|
||||
{
|
||||
// @@@ not implemented
|
||||
return NULL;
|
||||
}
|
||||
#if defined(BOOST_GCC) && BOOST_GCC >= 40700
|
||||
// gcc 11.2 fails to deduce below that pData_ never points to emptyString_ if capacity() == 0 and emits warnings like these:
|
||||
// 'operator delete(void*, unsigned long)' called on unallocated object 'boost::wave::util::SimpleStringStorage<char, std::allocator<char> >::emptyString_' [-Wfree-nonheap-object]
|
||||
// Unfortunately, suppressing this warning doesn't work, so we have to use __builtin_unreachable() to assert that this never happens.
|
||||
// __builtin_unreachable is supported since gcc 4.6, -Wfree-nonheap-object is supported since 4.7.
|
||||
#define BOOST_WAVE_COMPILE_TIME_ASSERT(x) if (!(x)) __builtin_unreachable()
|
||||
#else
|
||||
#define BOOST_WAVE_COMPILE_TIME_ASSERT(x)
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// class template SimpleStringStorage
|
||||
@@ -331,7 +317,7 @@ public:
|
||||
};
|
||||
static const Data emptyString_;
|
||||
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
private:
|
||||
Data* pData_;
|
||||
@@ -408,7 +394,11 @@ public:
|
||||
~SimpleStringStorage()
|
||||
{
|
||||
BOOST_ASSERT(begin() <= end());
|
||||
if (pData_ != &emptyString_) free(pData_);
|
||||
if (capacity() > 0)
|
||||
{
|
||||
BOOST_WAVE_COMPILE_TIME_ASSERT(pData_ != &emptyString_);
|
||||
free(pData_);
|
||||
}
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
@@ -434,13 +424,14 @@ public:
|
||||
|
||||
void reserve(size_type res_arg)
|
||||
{
|
||||
if (res_arg <= capacity())
|
||||
size_type cap = capacity();
|
||||
if (res_arg <= cap)
|
||||
{
|
||||
// @@@ insert shrinkage here if you wish
|
||||
return;
|
||||
}
|
||||
|
||||
if (pData_ == &emptyString_)
|
||||
if (cap == 0)
|
||||
{
|
||||
Init(0, res_arg);
|
||||
}
|
||||
@@ -519,7 +510,7 @@ public:
|
||||
|
||||
const E* c_str() const
|
||||
{
|
||||
if (pData_ != &emptyString_) *pData_->pEnd_ = E();
|
||||
if (capacity() > 0) *pData_->pEnd_ = E();
|
||||
return pData_->buffer_;
|
||||
}
|
||||
|
||||
@@ -544,26 +535,18 @@ SimpleStringStorage<E, A>::emptyString_ =
|
||||
template <typename E, class A = std::allocator<E> >
|
||||
class AllocatorStringStorage : public A
|
||||
{
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
typedef typename SimpleStringStorage<E, A>::Data Data;
|
||||
|
||||
void* Alloc(size_type sz, const void* p = 0)
|
||||
{
|
||||
return A::allocate(1 + (sz - 1) / sizeof(E),
|
||||
return boost::allocator_allocate(static_cast<A&>(*this), 1 + (sz - 1) / sizeof(E),
|
||||
static_cast<const char*>(p));
|
||||
}
|
||||
|
||||
void* Realloc(void* p, size_type oldSz, size_type newSz)
|
||||
{
|
||||
void* r = Alloc(newSz);
|
||||
flex_string_details::pod_copy(p, p + Min(oldSz, newSz), r);
|
||||
Free(p, oldSz);
|
||||
return r;
|
||||
}
|
||||
|
||||
void Free(void* p, size_type sz)
|
||||
{
|
||||
A::deallocate(static_cast<E*>(p), sz);
|
||||
boost::allocator_deallocate(static_cast<A&>(*this), static_cast<E*>(p), sz);
|
||||
}
|
||||
|
||||
Data* pData_;
|
||||
@@ -645,6 +628,7 @@ public:
|
||||
{
|
||||
if (capacity())
|
||||
{
|
||||
BOOST_WAVE_COMPILE_TIME_ASSERT(pData_ != (&SimpleStringStorage<E, A>::emptyString_));
|
||||
Free(pData_,
|
||||
sizeof(Data) + capacity() * sizeof(E));
|
||||
}
|
||||
@@ -666,7 +650,7 @@ public:
|
||||
{ return size_type(end() - begin()); }
|
||||
|
||||
size_type max_size() const
|
||||
{ return A::max_size(); }
|
||||
{ return boost::allocator_max_size(static_cast<const A&>(*this)); }
|
||||
|
||||
size_type capacity() const
|
||||
{ return size_type(pData_->pEndOfMem_ - pData_->buffer_); }
|
||||
@@ -727,7 +711,7 @@ public:
|
||||
|
||||
const E* c_str() const
|
||||
{
|
||||
if (pData_ != &SimpleStringStorage<E, A>::emptyString_)
|
||||
if (capacity() > 0)
|
||||
{
|
||||
*pData_->pEnd_ = E();
|
||||
}
|
||||
@@ -757,7 +741,7 @@ public: // protected:
|
||||
typedef typename base::iterator iterator;
|
||||
typedef typename base::const_iterator const_iterator;
|
||||
typedef A allocator_type;
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
VectorStringStorage(const VectorStringStorage& s) : base(s)
|
||||
{ }
|
||||
@@ -874,7 +858,7 @@ public:
|
||||
typedef value_type* iterator;
|
||||
typedef const value_type* const_iterator;
|
||||
typedef typename Storage::allocator_type allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
typedef typename boost::allocator_size_type<allocator_type>::type size_type;
|
||||
|
||||
private:
|
||||
enum { temp1 = threshold * sizeof(value_type) > sizeof(Storage)
|
||||
@@ -1011,7 +995,7 @@ public:
|
||||
}
|
||||
|
||||
size_type max_size() const
|
||||
{ return get_allocator().max_size(); }
|
||||
{ return boost::allocator_max_size(get_allocator()); }
|
||||
|
||||
size_type capacity() const
|
||||
{ return Small() ? maxSmallString : GetStorage().capacity(); }
|
||||
@@ -1201,8 +1185,8 @@ public:
|
||||
typedef typename Storage::iterator iterator;
|
||||
typedef typename Storage::const_iterator const_iterator;
|
||||
typedef typename Storage::allocator_type allocator_type;
|
||||
typedef typename allocator_type::size_type size_type;
|
||||
typedef typename Storage::reference reference;
|
||||
typedef typename boost::allocator_size_type<allocator_type>::type size_type;
|
||||
typedef typename Storage::value_type& reference;
|
||||
|
||||
private:
|
||||
union
|
||||
@@ -1461,13 +1445,12 @@ public:
|
||||
typedef T traits_type;
|
||||
typedef typename traits_type::char_type value_type;
|
||||
typedef A allocator_type;
|
||||
typedef typename A::size_type size_type;
|
||||
typedef typename A::difference_type difference_type;
|
||||
|
||||
typedef typename A::reference reference;
|
||||
typedef typename A::const_reference const_reference;
|
||||
typedef typename A::pointer pointer;
|
||||
typedef typename A::const_pointer const_pointer;
|
||||
typedef typename boost::allocator_value_type<A>::type& reference;
|
||||
typedef typename boost::allocator_value_type<A>::type const& const_reference;
|
||||
typedef typename boost::allocator_pointer<A>::type pointer;
|
||||
typedef typename boost::allocator_const_pointer<A>::type const_pointer;
|
||||
typedef typename boost::allocator_size_type<A>::type size_type;
|
||||
|
||||
typedef typename Storage::iterator iterator;
|
||||
typedef typename Storage::const_iterator const_iterator;
|
||||
@@ -1802,13 +1785,13 @@ private:
|
||||
if(!empty() && beginIterator != endIterator)
|
||||
{
|
||||
typedef const typename std::iterator_traits<Iterator>::value_type *
|
||||
pointer;
|
||||
value_pointer;
|
||||
|
||||
pointer myBegin(&*begin());
|
||||
pointer myEnd(&*begin() + size());
|
||||
pointer rangeBegin(DereferenceValidIterator(beginIterator));
|
||||
value_pointer myBegin(&*begin());
|
||||
value_pointer myEnd(&*begin() + size());
|
||||
value_pointer rangeBegin(DereferenceValidIterator(beginIterator));
|
||||
|
||||
const std::less_equal<pointer> less_equal = std::less_equal<pointer>();
|
||||
const std::less_equal<value_pointer> less_equal = std::less_equal<value_pointer>();
|
||||
if(less_equal(myBegin, rangeBegin) && less_equal(rangeBegin, myEnd))
|
||||
return true;
|
||||
}
|
||||
@@ -2059,7 +2042,7 @@ private:
|
||||
i2 - i1;
|
||||
BOOST_ASSERT(n1 >= 0);
|
||||
const typename std::iterator_traits<FwdIterator>::difference_type n2 =
|
||||
std::distance(s1, s2);
|
||||
std::distance(s1, s2);
|
||||
BOOST_ASSERT(n2 >= 0);
|
||||
|
||||
if (IsAliasedRange(s1, s2))
|
||||
@@ -2601,4 +2584,4 @@ inline void serialize(Archive & ar, boost::wave::util::flex_string<E, T, A, S> &
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // FLEX_STRING_INC_
|
||||
#endif // BOOST_FLEX_STRING_INC_
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#define FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED
|
||||
#if !defined(BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#define BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/spirit/include/classic_multi_pass.hpp>
|
||||
@@ -63,11 +63,11 @@ struct functor_input {
|
||||
bool was_initialized;
|
||||
};
|
||||
|
||||
// Needed by compilers not implementing the resolution to DR45. For
|
||||
// reference, see
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45.
|
||||
// Needed by compilers not implementing the resolution to DR45. For
|
||||
// reference, see
|
||||
// http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45.
|
||||
|
||||
friend struct Data;
|
||||
friend struct Data;
|
||||
|
||||
public:
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
@@ -152,4 +152,4 @@ struct functor_input {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
#endif // !defined(BOOST_FUNCTOR_INPUT_HPP_ED3A4C21_8F8A_453F_B438_08214FAC106A_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
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(INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#define INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED
|
||||
#if !defined(BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#define BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
@@ -545,4 +545,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
#endif // !defined(BOOST_INSERT_WHITESPACE_DETECTION_HPP_765EF77B_0513_4967_BDD6_6A38148C4C96_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#define INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED
|
||||
#if !defined(BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#define BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
@@ -115,7 +115,7 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the falsely matched surrounding parenthesis's
|
||||
// remove the falsely matched surrounding parenthesis's
|
||||
if (values.size() >= 2) {
|
||||
BOOST_ASSERT(T_LEFTPAREN == values.front() && T_RIGHTPAREN == values.back());
|
||||
values.erase(values.begin());
|
||||
@@ -123,12 +123,12 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
values.erase((++rit).base());
|
||||
}
|
||||
|
||||
// decode the option (call the context_policy hook)
|
||||
// decode the option (call the context_policy hook)
|
||||
if (!ctx.get_hooks().interpret_pragma(
|
||||
ctx.derived(), pending, option, values, act_token))
|
||||
{
|
||||
// unknown #pragma option
|
||||
string_type option_str ((*it).get_value());
|
||||
// unknown #pragma option
|
||||
string_type option_str((*it).get_value());
|
||||
|
||||
option_str += option.get_value();
|
||||
if (values.size() > 0) {
|
||||
@@ -145,13 +145,13 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
|
||||
else if ((*it).get_value() == "once") {
|
||||
// #pragma once
|
||||
// #pragma once
|
||||
return ctx.add_pragma_once_header(act_token, ctx.get_current_filename());
|
||||
}
|
||||
#endif
|
||||
#if BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE != 0
|
||||
else if ((*it).get_value() == "message") {
|
||||
// #pragma message(...) or #pragma message ...
|
||||
// #pragma message(...) or #pragma message ...
|
||||
using namespace boost::spirit::classic;
|
||||
ContainerT values;
|
||||
|
||||
@@ -178,14 +178,14 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
return false;
|
||||
}
|
||||
|
||||
// remove the falsely matched closing parenthesis/newline
|
||||
// remove the falsely matched closing parenthesis/newline
|
||||
if (values.size() > 0) {
|
||||
BOOST_ASSERT(T_RIGHTPAREN == values.back() || T_NEWLINE == values.back());
|
||||
typename ContainerT::reverse_iterator rit = values.rbegin();
|
||||
values.erase((++rit).base());
|
||||
}
|
||||
|
||||
// output the message itself
|
||||
// output the message itself
|
||||
typename ContextT::string_type msg(impl::as_string(values));
|
||||
BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
|
||||
pragma_message_directive,
|
||||
@@ -207,4 +207,4 @@ interpret_pragma(ContextT &ctx, typename ContextT::token_type const &act_token,
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
#endif // !defined(BOOST_INTERPRET_PRAGMA_HPP_B1F2315E_C5CE_4ED1_A343_0EF548B7942A_INCLUDED)
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#define ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED
|
||||
#if !defined(BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#define BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <stack>
|
||||
#include <string>
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/cpp_exceptions.hpp>
|
||||
@@ -55,12 +55,9 @@ public:
|
||||
typename base_type::value_type const &val)
|
||||
{
|
||||
if (iter_ctx.size() == max_include_nesting_depth) {
|
||||
char buffer[22]; // 21 bytes holds all NUL-terminated unsigned 64-bit numbers
|
||||
|
||||
using namespace std; // for some systems sprintf is in namespace std
|
||||
sprintf(buffer, "%d", (int)max_include_nesting_depth);
|
||||
std::string buffer = std::to_string(max_include_nesting_depth);
|
||||
BOOST_WAVE_THROW_CTX(ctx, preprocess_exception,
|
||||
include_nesting_too_deep, buffer, pos);
|
||||
include_nesting_too_deep, buffer.c_str(), pos);
|
||||
}
|
||||
iter_ctx.push(val);
|
||||
}
|
||||
@@ -80,4 +77,4 @@ private:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
#endif // !defined(BOOST_ITERATION_CONTEXT_HPP_9556CD16_F11E_4ADC_AC8B_FB9A174BE664_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#define MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED
|
||||
#if !defined(BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#define BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
@@ -73,16 +73,17 @@ struct macro_definition {
|
||||
// with special parameter tokens to simplify later macro replacement.
|
||||
// Additionally mark all occurrences of the macro name itself throughout
|
||||
// the macro definition
|
||||
void replace_parameters()
|
||||
template<typename ContextT>
|
||||
void replace_parameters(ContextT const & ctx)
|
||||
{
|
||||
using namespace boost::wave;
|
||||
|
||||
if (!replaced_parameters) {
|
||||
typename definition_container_type::iterator end = macrodefinition.end();
|
||||
typename definition_container_type::iterator it = macrodefinition.begin();
|
||||
typename definition_container_type::iterator end = macrodefinition.end();
|
||||
typename definition_container_type::iterator it = macrodefinition.begin();
|
||||
|
||||
for (/**/; it != end; ++it) {
|
||||
token_id id = *it;
|
||||
token_id id = *it;
|
||||
|
||||
if (T_IDENTIFIER == id ||
|
||||
IS_CATEGORY(id, KeywordTokenType) ||
|
||||
@@ -100,20 +101,31 @@ struct macro_definition {
|
||||
break;
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
else if (T_ELLIPSIS == token_id(*cit) &&
|
||||
else if (need_variadics(ctx.get_language()) &&
|
||||
T_ELLIPSIS == token_id(*cit) &&
|
||||
"__VA_ARGS__" == (*it).get_value())
|
||||
{
|
||||
// __VA_ARGS__ requires special handling
|
||||
(*it).set_token_id(token_id(T_EXTPARAMETERBASE+i));
|
||||
break;
|
||||
}
|
||||
#if BOOST_WAVE_SUPPORT_VA_OPT != 0
|
||||
else if (need_va_opt(ctx.get_language()) &&
|
||||
T_ELLIPSIS == token_id(*cit) &&
|
||||
"__VA_OPT__" == (*it).get_value())
|
||||
{
|
||||
// __VA_OPT__ also requires related special handling
|
||||
(*it).set_token_id(token_id(T_OPTPARAMETERBASE+i));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
|
||||
// we need to know, if the last of the formal arguments is an ellipsis
|
||||
// we need to know, if the last of the formal arguments is an ellipsis
|
||||
if (macroparameters.size() > 0 &&
|
||||
T_ELLIPSIS == token_id(macroparameters.back()))
|
||||
{
|
||||
@@ -197,4 +209,4 @@ intrusive_ptr_release(macro_definition<TokenT, ContainerT>* p)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
#endif // !defined(BOOST_MACRO_DEFINITION_HPP_D68A639E_2DA5_4E9C_8ACD_CFE6B903831E_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#define MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED
|
||||
#if !defined(BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#define BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -252,6 +252,48 @@ namespace impl {
|
||||
expanded.push_back(comma);
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_WAVE_SUPPORT_VA_OPT != 0
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Finds the token range inside __VA_OPT__.
|
||||
// Updates mdit to the position of the final rparen.
|
||||
// If the parenthesis do not match up, or there are none, returns false
|
||||
// and leaves mdit unchanged.
|
||||
//
|
||||
template <typename MDefIterT>
|
||||
bool find_va_opt_args (
|
||||
MDefIterT & mdit, // VA_OPT
|
||||
MDefIterT mdend)
|
||||
{
|
||||
if ((std::distance(mdit, mdend) < 3) ||
|
||||
(T_LEFTPAREN != next_token<MDefIterT>::peek(mdit, mdend))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
MDefIterT mdstart_it = mdit;
|
||||
++mdit; // skip to lparen
|
||||
std::size_t scope = 0;
|
||||
// search for final rparen, leaving iterator there
|
||||
for (; (mdit != mdend) && !((scope == 1) && (T_RIGHTPAREN == token_id(*mdit)));
|
||||
++mdit) {
|
||||
// count balanced parens
|
||||
if (T_RIGHTPAREN == token_id(*mdit)) {
|
||||
scope--;
|
||||
} else if (T_LEFTPAREN == token_id(*mdit)) {
|
||||
scope++;
|
||||
}
|
||||
}
|
||||
if ((mdit == mdend) && ((scope != 1) || (T_RIGHTPAREN != token_id(*mdit)))) {
|
||||
// arrived at end without matching rparen
|
||||
mdit = mdstart_it;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Skip all whitespace characters and queue the skipped characters into the
|
||||
@@ -288,6 +330,20 @@ namespace impl {
|
||||
return id;
|
||||
}
|
||||
|
||||
// trim all whitespace from the beginning and the end of the given string
|
||||
template <typename StringT>
|
||||
inline StringT
|
||||
trim_whitespace(StringT const &s)
|
||||
{
|
||||
typedef typename StringT::size_type size_type;
|
||||
|
||||
size_type first = s.find_first_not_of(" \t\v\f");
|
||||
if (StringT::npos == first)
|
||||
return StringT();
|
||||
size_type last = s.find_last_not_of(" \t\v\f");
|
||||
return s.substr(first, last-first+1);
|
||||
}
|
||||
|
||||
} // namespace impl
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -300,4 +356,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
#endif // !defined(BOOST_MACRO_HELPERS_HPP_931BBC99_EBFA_4692_8FBE_B555998C2C39_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#define SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED
|
||||
#if !defined(BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#define BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED
|
||||
|
||||
#include <map>
|
||||
|
||||
@@ -117,4 +117,4 @@ public:
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
#endif // !defined(BOOST_SYMBOL_TABLE_HPP_32B0F7C6_3DD6_4113_95A5_E16516C6F45A_INCLUDED)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*=============================================================================
|
||||
/*=============================================================================
|
||||
Boost.Wave: A Standard compliant C++ preprocessor library
|
||||
|
||||
http://www.boost.org/
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#define TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED
|
||||
#if !defined(BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#define BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED
|
||||
|
||||
#include <ctime>
|
||||
#include <cstring>
|
||||
@@ -150,4 +150,4 @@ using namespace time_conversion;
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
#endif // !defined(BOOST_TIME_CONVERSION_HELPER_HPP_DA97E389_1797_43BA_82AE_B071064B3EF4_INCLUDED)
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#define TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED
|
||||
#if !defined(BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#define BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/iterator_adaptors.hpp>
|
||||
@@ -86,4 +86,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
#endif // !defined(BOOST_TRANSFORM_ITERATOR_HPP_D492C659_88C7_4258_8C42_192F9AE80EC0_INCLUDED)
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
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(UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#define UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED
|
||||
#if !defined(BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#define BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED
|
||||
|
||||
#include <list>
|
||||
|
||||
@@ -88,11 +88,11 @@ public:
|
||||
void increment()
|
||||
{
|
||||
if (!unput_queue.empty()) {
|
||||
// there exist pending tokens in the unput queue
|
||||
// there exist pending tokens in the unput queue
|
||||
unput_queue.pop_front();
|
||||
}
|
||||
else {
|
||||
// the unput_queue is empty, so advance the base iterator
|
||||
// the unput_queue is empty, so advance the base iterator
|
||||
++base_type::base_reference();
|
||||
}
|
||||
}
|
||||
@@ -292,4 +292,4 @@ namespace impl {
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
#endif // !defined(BOOST_UNPUT_QUEUE_ITERATOR_HPP_76DA23D0_4893_4AD5_ABCC_6CED7CFB89BC_INCLUDED)
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
|
||||
#define WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED
|
||||
#if !defined(BOOST_WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
|
||||
#define BOOST_WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/pragma_message.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/spirit/include/classic_version.hpp>
|
||||
@@ -40,6 +41,14 @@
|
||||
#define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Decide whether to support the C++20 __VA_OPT__ variadics feature
|
||||
//
|
||||
//
|
||||
#if !defined(BOOST_WAVE_SUPPORT_VA_OPT) && BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS
|
||||
#define BOOST_WAVE_SUPPORT_VA_OPT 1
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Decide, whether to implement a #warning directive as an extension to the
|
||||
// C++ Standard (same as #error, but emits a warning, not an error)
|
||||
@@ -94,6 +103,45 @@
|
||||
#define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Decide whether to support C++17
|
||||
//
|
||||
#if !defined(BOOST_WAVE_SUPPORT_CPP1Z)
|
||||
# define BOOST_WAVE_SUPPORT_CPP1Z 1
|
||||
# undef BOOST_WAVE_SUPPORT_CPP0X
|
||||
# define BOOST_WAVE_SUPPORT_CPP0X 1
|
||||
# undef BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS
|
||||
# define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
|
||||
# if !defined(BOOST_WAVE_SUPPORT_HAS_INCLUDE)
|
||||
# define BOOST_WAVE_SUPPORT_HAS_INCLUDE 1
|
||||
# endif
|
||||
#elif BOOST_WAVE_SUPPORT_CPP1Z == 0
|
||||
# undef BOOST_WAVE_SUPPORT_HAS_INCLUDE
|
||||
# define BOOST_WAVE_SUPPORT_HAS_INCLUDE 0
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Decide whether to support C++20
|
||||
//
|
||||
#if !defined(BOOST_WAVE_SUPPORT_CPP2A)
|
||||
# define BOOST_WAVE_SUPPORT_CPP2A 1
|
||||
# undef BOOST_WAVE_SUPPORT_CPP0X
|
||||
# define BOOST_WAVE_SUPPORT_CPP0X 1
|
||||
# undef BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS
|
||||
# define BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS 1
|
||||
# undef BOOST_WAVE_SUPPORT_CPP1Z
|
||||
# define BOOST_WAVE_SUPPORT_CPP1Z 1
|
||||
# if !defined(BOOST_WAVE_SUPPORT_HAS_INCLUDE)
|
||||
# define BOOST_WAVE_SUPPORT_HAS_INCLUDE 1
|
||||
# endif
|
||||
# if !defined(BOOST_WAVE_SUPPORT_VA_OPT)
|
||||
# define BOOST_WAVE_SUPPORT_VA_OPT 1
|
||||
# endif
|
||||
#elif BOOST_WAVE_SUPPORT_CPP2A == 0
|
||||
# undef BOOST_WAVE_SUPPORT_VA_OPT
|
||||
# define BOOST_WAVE_SUPPORT_VA_OPT 0
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Undefine the following, to enable some MS specific language extensions:
|
||||
// __int8, __int16, __int32, __int64, __based, __declspec, __cdecl,
|
||||
@@ -260,6 +308,7 @@
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_HAS_INCLUDE_GRAMMAR 0x0080
|
||||
|
||||
#if !defined(BOOST_SPIRIT_DEBUG_FLAGS_CPP)
|
||||
#define BOOST_SPIRIT_DEBUG_FLAGS_CPP 0 // default is no debugging
|
||||
@@ -467,6 +516,19 @@ namespace boost { namespace wave
|
||||
#endif // auto-linking disabled
|
||||
#endif // BOOST_VERSION
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Deprecate C++03
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
|
||||
|| defined(BOOST_NO_CXX11_HDR_THREAD) \
|
||||
|| defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_NO_CXX11_HDR_REGEX) \
|
||||
|| defined(BOOST_NO_CXX11_CONSTEXPR)
|
||||
|
||||
#error "C++03 support is deprecated in Boost.Wave 1.74 and was removed in Boost.Wave 1.79."
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Compatibility macros
|
||||
// (ensure interface compatibility to older Wave versions)
|
||||
@@ -475,18 +537,11 @@ namespace boost { namespace wave
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// The preprocessing hook signatures changed after the Boost V1.34.0 release
|
||||
//
|
||||
// To use the preprocessing hook signatures as released with Boost V1.34.0
|
||||
// you need to define the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS
|
||||
// constant to something not equal zero.
|
||||
// The old hook signatures are no longer available as of Boost 1.76.
|
||||
//
|
||||
// To force using the new interface define this constant to zero.
|
||||
//
|
||||
#if !defined(BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS)
|
||||
#if BOOST_VERSION < 103500 // before Boost V1.35.0
|
||||
#define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 1
|
||||
#else
|
||||
#define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 0
|
||||
#endif
|
||||
#if defined(BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS) && \
|
||||
BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
|
||||
#error "The old preprocessing hooks were deprecated in Boost 1.35 and removed in 1.76."
|
||||
#endif
|
||||
|
||||
#endif // !defined(WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
|
||||
#endif // !defined(BOOST_WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
|
||||
#define WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED
|
||||
#if !defined(BOOST_WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
|
||||
#define BOOST_WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED
|
||||
|
||||
// BOOST_WAVE_VERSION & 0x0000FF is the sub-minor version
|
||||
// BOOST_WAVE_VERSION & 0x00FF00 is the minor version
|
||||
@@ -23,4 +23,4 @@
|
||||
#define BOOST_WAVE_VERSION_MINOR 3
|
||||
#define BOOST_WAVE_VERSION_SUBMINOR 2
|
||||
|
||||
#endif // !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
|
||||
#endif // !defined(BOOST_WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
=============================================================================*/
|
||||
|
||||
#if !defined(WHITESPACE_HANDLING_HPP_INCLUDED)
|
||||
#define WHITESPACE_HANDLING_HPP_INCLUDED
|
||||
#if !defined(BOOST_WHITESPACE_HANDLING_HPP_INCLUDED)
|
||||
#define BOOST_WHITESPACE_HANDLING_HPP_INCLUDED
|
||||
|
||||
#include <boost/wave/wave_config.hpp>
|
||||
#include <boost/wave/token_ids.hpp>
|
||||
@@ -292,5 +292,5 @@ eat_whitespace<TokenT>::whitespace(TokenT &token, bool &skipped_newline)
|
||||
#include BOOST_ABI_SUFFIX
|
||||
#endif
|
||||
|
||||
#endif // !defined(WHITESPACE_HANDLING_HPP_INCLUDED)
|
||||
#endif // !defined(BOOST_WHITESPACE_HANDLING_HPP_INCLUDED)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user