From 82e5fb4dab466e5302e2109f14d18945a45fb4cf Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 14 Sep 2009 18:15:58 +0000 Subject: [PATCH] Merging Wave from trunk [SVN r56192] --- ChangeLog | 16 + doc/class_reference_ctxpolicy.html | 5 +- include/boost/wave/cpp_context.hpp | 37 +- include/boost/wave/cpp_iteration_context.hpp | 13 +- .../boost/wave/cpplexer/cpp_lex_interface.hpp | 6 +- .../cpplexer/cpp_lex_interface_generator.hpp | 13 +- .../boost/wave/cpplexer/cpp_lex_iterator.hpp | 26 +- include/boost/wave/cpplexer/cpp_lex_token.hpp | 63 ++- .../wave/cpplexer/detect_include_guards.hpp | 12 +- .../wave/cpplexer/re2clex/cpp_re2c_lexer.hpp | 105 ++-- .../boost/wave/cpplexer/re2clex/scanner.hpp | 2 +- include/boost/wave/cpplexer/token_cache.hpp | 2 +- .../wave/grammars/cpp_expression_grammar.hpp | 6 +- .../grammars/cpp_expression_grammar_gen.hpp | 2 +- .../boost/wave/grammars/cpp_grammar_gen.hpp | 2 +- include/boost/wave/token_ids.hpp | 6 +- include/boost/wave/util/cpp_ifblock.hpp | 6 +- include/boost/wave/util/cpp_include_paths.hpp | 6 +- include/boost/wave/util/cpp_iterator.hpp | 214 +++---- include/boost/wave/util/cpp_macromap.hpp | 70 +-- .../boost/wave/util/cpp_macromap_utils.hpp | 40 +- include/boost/wave/util/functor_input.hpp | 6 +- include/boost/wave/util/macro_definition.hpp | 8 +- include/boost/wave/util/symbol_table.hpp | 6 +- .../boost/wave/util/transform_iterator.hpp | 84 +-- .../boost/wave/util/unput_queue_iterator.hpp | 166 +----- include/boost/wave/wave_config.hpp | 4 +- include/boost/wave/wave_version.hpp | 6 +- include/boost/wave/whitespace_handling.hpp | 10 +- samples/advanced_hooks/advanced_hooks.cpp | 10 +- samples/advanced_hooks/build/Jamfile.v2 | 2 +- samples/cpp_tokens/build/Jamfile.v2 | 2 +- samples/cpp_tokens/cpp_tokens.cpp | 4 +- samples/cpp_tokens/instantiate_slex_lexer.cpp | 2 +- samples/cpp_tokens/slex/cpp_slex_lexer.hpp | 2 +- samples/cpp_tokens/slex_interface.hpp | 4 +- samples/cpp_tokens/slex_iterator.hpp | 22 +- samples/cpp_tokens/slex_token.hpp | 22 +- samples/hannibal/build/Jamfile.v2 | 2 +- samples/hannibal/hannibal.cpp | 9 +- samples/lexed_tokens/build/Jamfile.v2 | 2 +- samples/list_includes/build/Jamfile.v2 | 2 +- .../list_includes/lexertl/lexertl_lexer.hpp | 76 +-- .../lexertl/wave_lexertl_config.hpp | 2 +- samples/list_includes/lexertl_iterator.hpp | 22 +- samples/quick_start/build/Jamfile.v2 | 2 +- samples/real_positions/build/Jamfile.v2 | 2 +- .../correct_token_positions.hpp | 16 +- .../real_positions/instantiate_re2c_lexer.cpp | 6 +- .../real_positions/real_position_token.hpp | 56 +- samples/real_positions/real_positions.cpp | 30 +- samples/token_statistics/build/Jamfile.v2 | 2 +- samples/token_statistics/xlex/xlex_lexer.hpp | 29 +- .../token_statistics/xlex/xpressive_lexer.hpp | 6 +- samples/token_statistics/xlex_interface.hpp | 4 +- samples/token_statistics/xlex_iterator.hpp | 141 +++-- samples/waveidl/build/Jamfile.v2 | 2 +- samples/waveidl/idllexer/idl.re | 2 +- .../waveidl/idllexer/idl_lex_interface.hpp | 4 +- samples/waveidl/idllexer/idl_lex_iterator.hpp | 126 +++-- samples/waveidl/idllexer/idl_re.cpp | 466 ++++++++-------- samples/waveidl/idllexer/idl_re2c_lexer.hpp | 24 +- src/cpplexer/re2clex/cpp_re.cpp | 20 +- src/cpplexer/re2clex/cpp_re.inc | 524 +++++++++--------- src/cpplexer/re2clex/strict_cpp_re.inc | 524 +++++++++--------- test/build/Jamfile.v2 | 1 + test/testwave/testwave.cpp | 12 +- test/testwave/testwave_app.cpp | 22 +- tool/cpp.cpp | 81 ++- tool/cpp_version.hpp | 8 +- tool/trace_macro_expansion.hpp | 128 +++-- 71 files changed, 1719 insertions(+), 1646 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0bab21a..e49ba94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,22 @@ TODO (known issues): CHANGELOG +Boost V1.41.0 +- V2.0.3 +- Switched to Re2C V0.13.5 +- Fixed --list_includes/-l command line option of the wave driver tool to + correctly indent the generated list of included files. +- Finally fixed all remaining examples. Everything seems to work fine now. +- Specifying a custom token type now works as expected. The new lexer interface + introduced in V2.0 broke this part. +- Removed old code related to pre Boost V1.31 (related to V1 of iterator + library). +- Added a new commandline option --macrocounts/-c to the Wave driver application + which lists all macro invocation counts to an optionally specified file + (default is cout). +- Fixed compilation problems caused by recent changes to the multi_pass iterator + from Spirit V2.1. + Boost V1.40.0 - V2.0.2 - Fixed a long standing race condition inhibiting to use Wave in multi threaded diff --git a/doc/class_reference_ctxpolicy.html b/doc/class_reference_ctxpolicy.html index f6af694..6af63bc 100644 --- a/doc/class_reference_ctxpolicy.html +++ b/doc/class_reference_ctxpolicy.html @@ -52,7 +52,8 @@

This policy type is used as a template parameter to the boost::wave::context<> object, where the default policy provides empty hook functions only.

Header wave/preprocessing_hooks.hpp synopsis

namespace boost {
namespace wave {
namespace context_policies {

struct default_preprocessing_hooks {

// general hook functions - template <typename ContextT, typename TokenT>
bool found_directive(ContextT const &ctx,
TokenT const &directive);

template <typename ContextT, typename ExceptionT>
void throw_exception(ContextT const &ctx,
ExceptionT const& e);

// test, whether a given token may be skipped
template <typename ContextT>
bool may_skip_whitespace (ContextT const& ctx,
TokenT &token, bool &skipped_newline);
+ template <typename ContextT, typename TokenT>
bool found_directive(ContextT const &ctx,
TokenT const &directive);
+ template <typename ContextT, typename ExceptionT>
void throw_exception(ContextT const &ctx,
ExceptionT const& e);

// test, whether a given token may be skipped
template <typename ContextT>
bool may_skip_whitespace (ContextT const& ctx,
TokenT &token, bool &skipped_newline);
// Conditional compilation template <
typename ContextT, typename TokenT,
typename ContainerT
>
bool evaluated_conditional_expression(
ContextT const &ctx, TokenT const& directive,
ContainerT const& expression, bool expression_value);
template <typename ContextT, typename TokenT>
void skipped_token(ContextT const &ctx,
TokenT const& token);

template <typename ContextT, typename TokenT>
TokenT const& generated_token(ContextT const &ctx,
TokenT const& token);

// macro expansion tracing @@ -372,7 +373,7 @@ 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

diff --git a/include/boost/wave/cpp_context.hpp b/include/boost/wave/cpp_context.hpp index b4383db..4ecbf8d 100644 --- a/include/boost/wave/cpp_context.hpp +++ b/include/boost/wave/cpp_context.hpp @@ -117,7 +117,7 @@ public: token_sequence_type; // type of the policies typedef HooksT hook_policy_type; - + private: // stack of shared_ptr's to the pending iteration contexts typedef boost::shared_ptr > @@ -127,7 +127,7 @@ private: typedef typename iteration_context_stack_type::size_type iter_size_type; context *this_() { return this; } // avoid warning in constructor - + public: context(target_iterator_type const &first_, target_iterator_type const &last_, char const *fname = "", HooksT const &hooks_ = HooksT()) @@ -153,11 +153,11 @@ public: { macros.init_predefined_macros(fname); } - + // default copy constructor // default assignment operator // default destructor - + // iterator interface iterator_type begin() { @@ -246,7 +246,7 @@ public: typedef boost::wave::util::macromap macromap_type; typedef typename macromap_type::name_iterator name_iterator; typedef typename macromap_type::const_name_iterator const_name_iterator; - + name_iterator macro_names_begin() { return macros.begin(); } name_iterator macro_names_end() { return macros.end(); } const_name_iterator macro_names_begin() const { return macros.begin(); } @@ -261,7 +261,7 @@ public: return macros.add_macro(name, has_params, parameters, definition, is_predefined); } - + // get the Wave version information static std::string get_version() { @@ -269,7 +269,7 @@ public: return util::to_string(p.get_fullversion()); } static std::string get_version_string() - { + { boost::wave::util::predefined_macros p; return util::to_string(p.get_versionstr()); } @@ -283,7 +283,7 @@ public: reset_macro_definitions(); } boost::wave::language_support get_language() const { return language; } - + // 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); } @@ -292,6 +292,7 @@ public: // 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) actual_context_type& derived() @@ -323,7 +324,7 @@ protected: has_been_initialized = true; // execute once } } - + template bool is_defined_macro(IteratorT2 const &begin, IteratorT2 const &end) const { return macros.is_defined(begin, end); } @@ -334,7 +335,7 @@ protected: { return includes.find_include_file(s, d, is_system, current_file); } void set_current_directory(char const *path_) { includes.set_current_directory(path_); } - + // conditional compilation contexts bool get_if_block_status() const { return ifblocks.get_status(); } bool get_if_block_some_part_status() const @@ -357,7 +358,7 @@ protected: { iter_ctxs.push(*this, act_pos, iter_ctx); } position_type &get_main_pos() { return macros.get_main_pos(); } - + /////////////////////////////////////////////////////////////////////////////// // // expand_tokensequence(): @@ -417,14 +418,14 @@ private: void save(Archive & ar, const unsigned int version) const { using namespace boost::serialization; - + string_type cfg(BOOST_PP_STRINGIZE(BOOST_WAVE_CONFIG)); string_type kwd(BOOST_WAVE_PRAGMA_KEYWORD); string_type strtype(BOOST_PP_STRINGIZE((BOOST_WAVE_STRINGTYPE))); ar & make_nvp("config", cfg); ar & make_nvp("pragma_keyword", kwd); ar & make_nvp("string_type", strtype); - + ar & make_nvp("language_options", language); ar & make_nvp("macro_definitions", macros); ar & make_nvp("include_settings", includes); @@ -439,10 +440,10 @@ private: get_main_pos()); return; } - + // check compatibility of the stored information string_type config, pragma_keyword, string_type_str; - + // BOOST_PP_STRINGIZE(BOOST_WAVE_CONFIG) ar & make_nvp("config", config); if (config != BOOST_PP_STRINGIZE(BOOST_WAVE_CONFIG)) { @@ -450,7 +451,7 @@ private: incompatible_config, "BOOST_WAVE_CONFIG", get_main_pos()); return; } - + // BOOST_WAVE_PRAGMA_KEYWORD ar & make_nvp("pragma_keyword", pragma_keyword); if (pragma_keyword != BOOST_WAVE_PRAGMA_KEYWORD) { @@ -467,7 +468,7 @@ private: incompatible_config, "BOOST_WAVE_STRINGTYPE", get_main_pos()); return; } - + try { // read in the useful bits ar & make_nvp("language_options", language); @@ -491,7 +492,7 @@ private: #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 std::string current_filename; // real name of current preprocessed file #endif - + boost::wave::util::if_block_stack ifblocks; // conditional compilation contexts boost::wave::util::include_paths includes; // lists of include directories to search iteration_context_stack_type iter_ctxs; // iteration contexts diff --git a/include/boost/wave/cpp_iteration_context.hpp b/include/boost/wave/cpp_iteration_context.hpp index 9bde82e..0e047bf 100644 --- a/include/boost/wave/cpp_iteration_context.hpp +++ b/include/boost/wave/cpp_iteration_context.hpp @@ -58,12 +58,11 @@ namespace iteration_context_policies { { public: template - static - void init_iterators(IterContextT &iter_ctx, + static void init_iterators(IterContextT &iter_ctx, PositionT const &act_pos, language_support language) { typedef typename IterContextT::iterator_type iterator_type; - + // read in the file std::ifstream instream(iter_ctx.filename.c_str()); if (!instream.is_open()) { @@ -72,7 +71,7 @@ namespace iteration_context_policies { return; } instream.unsetf(std::ios::skipws); - + iter_ctx.instring.assign( std::istreambuf_iterator(instream.rdbuf()), std::istreambuf_iterator()); @@ -87,7 +86,7 @@ namespace iteration_context_policies { std::string instring; }; }; - + } // namespace iteration_context_policies /////////////////////////////////////////////////////////////////////////////// @@ -132,9 +131,9 @@ struct iteration_context { typedef IteratorT iterator_type; typedef typename IteratorT::token_type::position_type position_type; - + typedef iteration_context self_type; - + iteration_context(ContextT& ctx, BOOST_WAVE_STRINGTYPE const &fname, position_type const &act_pos, boost::wave::language_support language_) diff --git a/include/boost/wave/cpplexer/cpp_lex_interface.hpp b/include/boost/wave/cpplexer/cpp_lex_interface.hpp index 39e3be8..0ddc1bb 100644 --- a/include/boost/wave/cpplexer/cpp_lex_interface.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_interface.hpp @@ -45,15 +45,15 @@ template struct lex_input_interface { typedef typename TokenT::position_type position_type; - + lex_input_interface() {} virtual ~lex_input_interface() {} - + virtual TokenT& get(TokenT&) = 0; virtual void set_position(position_type const &pos) = 0; #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 virtual bool has_include_guards(std::string& guard_name) const = 0; -#endif +#endif }; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/boost/wave/cpplexer/cpp_lex_interface_generator.hpp b/include/boost/wave/cpplexer/cpp_lex_interface_generator.hpp index 614c396..c8b4aa7 100644 --- a/include/boost/wave/cpplexer/cpp_lex_interface_generator.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_interface_generator.hpp @@ -48,14 +48,15 @@ namespace cpplexer { /////////////////////////////////////////////////////////////////////////////// template < typename IteratorT, - typename PositionT = boost::wave::util::file_position_type + typename PositionT = boost::wave::util::file_position_type, + typename TokenT = lex_token > 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. - static lex_input_interface > * + static lex_input_interface * new_lexer(IteratorT const &first, IteratorT const &last, PositionT const &pos, boost::wave::language_support language); }; @@ -75,10 +76,10 @@ struct lex_input_interface_generator : lex_input_interface { typedef typename lex_input_interface::position_type position_type; - + 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. @@ -87,8 +88,8 @@ struct lex_input_interface_generator new_lexer(IteratorT const &first, IteratorT const &last, position_type const &pos, boost::wave::language_support language) { - return new_lexer_gen::new_lexer (first, last, - pos, language); + return new_lexer_gen::new_lexer ( + first, last, pos, language); } }; diff --git a/include/boost/wave/cpplexer/cpp_lex_iterator.hpp b/include/boost/wave/cpplexer/cpp_lex_iterator.hpp index 2957ffc..cf46261 100644 --- a/include/boost/wave/cpplexer/cpp_lex_iterator.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_iterator.hpp @@ -67,37 +67,37 @@ public: { return *this; } // nothing to do here #endif -// interface to the multi_pass_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* shared; BOOST_WAVE_EOF_PREFIX result_type const eof; - + template static result_type& get_next(MultiPass& mp, result_type& result) { - return mp.shared->ftor->get(result); + return mp.shared()->ftor->get(result); } - + // this will be called whenever the last reference to a multi_pass will // be released template static void destroy(MultiPass& mp) { - delete mp.shared->ftor; + delete mp.shared()->ftor; } template static void set_position(MultiPass& mp, position_type const &pos) { - mp.shared->ftor->set_position(pos); + mp.shared()->ftor->set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 template static bool has_include_guards(MultiPass& mp, std::string& guard_name) { - return mp.shared->ftor->has_include_guards(guard_name); + return mp.shared()->ftor->has_include_guards(guard_name); } #endif }; @@ -148,16 +148,16 @@ struct make_multi_pass functor_data_type; typedef typename FunctorData::result_type result_type; - typedef boost::spirit::multi_pass_policies::split_functor_input input_policy; - typedef boost::spirit::multi_pass_policies::ref_counted ownership_policy; + typedef boost::spirit::iterator_policies::split_functor_input input_policy; + typedef boost::spirit::iterator_policies::ref_counted ownership_policy; #if defined(BOOST_WAVE_DEBUG) - typedef boost::spirit::multi_pass_policies::buf_id_check check_policy; + typedef boost::spirit::iterator_policies::buf_id_check check_policy; #else - typedef boost::spirit::multi_pass_policies::no_check check_policy; + typedef boost::spirit::iterator_policies::no_check check_policy; #endif - typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy; + typedef boost::spirit::iterator_policies::split_std_deque storage_policy; - typedef boost::spirit::multi_pass_policies::default_policy< + typedef boost::spirit::iterator_policies::default_policy< ownership_policy, check_policy, input_policy, storage_policy> policy_type; typedef boost::spirit::multi_pass type; diff --git a/include/boost/wave/cpplexer/cpp_lex_token.hpp b/include/boost/wave/cpplexer/cpp_lex_token.hpp index b8c26ad..6f777b4 100644 --- a/include/boost/wave/cpplexer/cpp_lex_token.hpp +++ b/include/boost/wave/cpplexer/cpp_lex_token.hpp @@ -43,11 +43,17 @@ class token_data public: typedef StringTypeT string_type; typedef PositionT position_type; - + + // default constructed tokens correspond to EOI tokens token_data() : id(T_EOI), refcnt(1) {} - + + // construct an invalid token + explicit token_data(int) + : 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) {} @@ -55,14 +61,14 @@ public: token_data(token_data const& rhs) : id(rhs.id), value(rhs.value), pos(rhs.pos), refcnt(1) {} - + ~token_data() {} - + std::size_t addref() { return ++refcnt; } std::size_t release() { return --refcnt; } std::size_t get_refcnt() const { return refcnt; } - + // accessors operator token_id() const { return id; } string_type const &get_value() const { return value; } @@ -78,7 +84,7 @@ public: // positions return (lhs.id == rhs.id && lhs.value == rhs.value) ? true : false; } - + void init(token_id id_, string_type const &value_, position_type const &pos_) { BOOST_ASSERT(refcnt == 1); @@ -86,7 +92,7 @@ public: value = value_; pos = pos_; } - + void init(token_data const& rhs) { BOOST_ASSERT(refcnt == 1); @@ -94,10 +100,10 @@ public: value = rhs.value; pos = rhs.pos; } - + static void *operator new(std::size_t size); static void operator delete(void *p, std::size_t size); - + #if defined(BOOST_SPIRIT_DEBUG) // debug support void print (std::ostream &stream) const @@ -146,7 +152,7 @@ token_data::operator new(std::size_t size) typedef boost::singleton_pool< token_data_tag, sizeof(token_data) > pool_type; - + void *ret = pool_type::malloc(); if (0 == ret) boost::throw_exception(std::bad_alloc()); @@ -190,10 +196,16 @@ private: typedef impl::token_data data_type; public: + // default constructed tokens correspond to EOI tokens lex_token() : data(0) {} - + + // construct an invalid token + explicit lex_token(int) + : data(new data_type(0)) + {} + lex_token(lex_token const& rhs) : data(rhs.data) { @@ -211,7 +223,7 @@ public: delete data; data = 0; } - + lex_token& operator=(lex_token const& rhs) { if (&rhs != this) { @@ -224,13 +236,14 @@ public: } return *this; } - + // 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(); } 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_); } @@ -243,8 +256,8 @@ public: return false; return *(lhs.data) == *(rhs.data); } - -// debug support + +// debug support #if BOOST_WAVE_DUMP_PARSE_TREE != 0 // access functions for the tree_to_xml functionality static int get_token_id(lex_token const &t) @@ -252,7 +265,7 @@ public: static string_type get_token_value(lex_token const &t) { return t.get_value(); } #endif - + #if defined(BOOST_SPIRIT_DEBUG) // debug support void print (std::ostream &stream) const @@ -276,16 +289,28 @@ private: { if (1 == data->get_refcnt()) return; - + data_type* newdata = new data_type(*data) ; data->release(); // release this reference, can't get zero data = newdata; } - + data_type* data; }; +/////////////////////////////////////////////////////////////////////////////// +// This overload is needed by the multi_pass/functor_input_policy to +// validate a token instance. It has to be defined in the same namespace +// as the token class itself to allow ADL to find it. +/////////////////////////////////////////////////////////////////////////////// +template +inline bool +token_is_valid(lex_token const& t) +{ + return t.is_valid(); +} + /////////////////////////////////////////////////////////////////////////////// #if defined(BOOST_SPIRIT_DEBUG) template diff --git a/include/boost/wave/cpplexer/detect_include_guards.hpp b/include/boost/wave/cpplexer/detect_include_guards.hpp index f01e623..d272a73 100644 --- a/include/boost/wave/cpplexer/detect_include_guards.hpp +++ b/include/boost/wave/cpplexer/detect_include_guards.hpp @@ -5,14 +5,14 @@ State machine detecting include guards in an included file. This detects two forms of include guards: - + #ifndef INCLUDE_GUARD_MACRO #define INCLUDE_GUARD_MACRO ... #endif - + or - + if !defined(INCLUDE_GUARD_MACRO) #define INCLUDE_GUARD_MACRO ... @@ -21,7 +21,7 @@ note, that the parenthesis are optional (i.e. !defined INCLUDE_GUARD_MACRO will work as well). The code allows for any whitespace, newline and single '#' tokens before the #if/#ifndef and after the final #endif. - + Copyright (c) 2001-2009 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) @@ -61,7 +61,7 @@ public: } return false; } - + private: typedef Token& state_type(Token& t); state_type include_guards::* state; @@ -70,7 +70,7 @@ private: bool current_state; typename Token::string_type guard_name; int if_depth; - + state_type state_0, state_1, state_2, state_3, state_4, state_5; state_type state_1a, state_1b, state_1c, state_1d, state_1e; diff --git a/include/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp b/include/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp index ca7fbc5..5c20838 100644 --- a/include/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp +++ b/include/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library Re2C based C++ lexer - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -59,18 +59,20 @@ namespace re2clex { // /////////////////////////////////////////////////////////////////////////////// -template +template > class lexer { public: - typedef lex_token token_type; + typedef TokenT token_type; typedef typename token_type::string_type string_type; - + lexer(IteratorT const &first, IteratorT const &last, PositionT const &pos, boost::wave::language_support language_); ~lexer(); - lex_token& get(lex_token&); + token_type& get(token_type&); void set_position(PositionT const &pos) { // set position has to change the file name and line number only @@ -85,13 +87,13 @@ public: return guards.detected(guard_name); } #endif - + // error reporting from the re2c generated lexer static int report_error(Scanner const* s, int code, char const *, ...); private: static char const *tok_names[]; - + Scanner scanner; string_type filename; string_type value; @@ -100,7 +102,7 @@ private: #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 include_guards guards; #endif - + #if BOOST_WAVE_SUPPORT_THREADING == 0 static token_cache const cache; #else @@ -110,12 +112,15 @@ private: /////////////////////////////////////////////////////////////////////////////// // initialize cpp lexer -template +template inline -lexer::lexer(IteratorT const &first, +lexer::lexer(IteratorT const &first, IteratorT const &last, PositionT const &pos, boost::wave::language_support language_) -: filename(pos.get_file()), at_eof(false), language(language_) + : filename(pos.get_file()), at_eof(false), language(language_) +#if BOOST_WAVE_SUPPORT_THREADING != 0 + , cache() +#endif { using namespace std; // some systems have memset in std memset(&scanner, '\0', sizeof(Scanner)); @@ -128,7 +133,7 @@ lexer::lexer(IteratorT const &first, scanner.column = scanner.curr_column = pos.get_column(); scanner.error_proc = report_error; scanner.file_name = filename.c_str(); - + #if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 scanner.enable_ms_extensions = true; #else @@ -149,9 +154,9 @@ lexer::lexer(IteratorT const &first, scanner.single_line_only = boost::wave::need_single_line(language_); } -template +template inline -lexer::~lexer() +lexer::~lexer() { using namespace std; // some systems have free in std aq_terminate(scanner.eol_offsets); @@ -160,16 +165,16 @@ lexer::~lexer() /////////////////////////////////////////////////////////////////////////////// // get the next token from the input stream -template -inline lex_token& -lexer::get(lex_token& result) +template +inline TokenT& +lexer::get(TokenT& result) { if (at_eof) - return result = lex_token(); // return T_EOI + return result = token_type(); // return T_EOI unsigned int actline = scanner.line; token_id id = token_id(scan(&scanner)); - + switch (static_cast(id)) { case T_IDENTIFIER: // test identifier characters for validity (throws if invalid chars found) @@ -178,7 +183,7 @@ lexer::get(lex_token& result) if (!boost::wave::need_no_character_validation(language)) impl::validate_identifier_name(value, actline, scanner.column, filename); break; - + case T_STRINGLIT: case T_CHARLIT: // test literal characters for validity (throws if invalid chars found) @@ -232,14 +237,14 @@ lexer::get(lex_token& result) value = string_type((char const *)scanner.tok, scanner.cur-scanner.tok); 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 at_eof = true; value.clear(); break; - + case T_OR_TRIGRAPH: case T_XOR_TRIGRAPH: case T_LEFTBRACE_TRIGRAPH: @@ -256,7 +261,7 @@ lexer::get(lex_token& result) scanner.cur-scanner.tok); } break; - + case T_ANY_TRIGRAPH: if (boost::wave::need_convert_trigraphs(language)) { value = impl::convert_trigraph( @@ -267,7 +272,7 @@ lexer::get(lex_token& result) scanner.cur-scanner.tok); } break; - + default: if (CATEGORY_FROM_TOKEN(id) != EXTCATEGORY_FROM_TOKEN(id) || IS_CATEGORY(id, UnknownTokenType)) @@ -280,7 +285,7 @@ lexer::get(lex_token& result) } break; } - + // std::cerr << boost::wave::get_token_name(id) << ": " << value << std::endl; // the re2c lexer reports the new line number for newline tokens @@ -293,22 +298,22 @@ lexer::get(lex_token& result) #endif } -template +template inline int -lexer::report_error(Scanner const *s, int errcode, +lexer::report_error(Scanner const *s, int errcode, char const *msg, ...) { BOOST_ASSERT(0 != s); BOOST_ASSERT(0 != msg); using namespace std; // some system have vsprintf in namespace std - + char buffer[200]; // should be large enough va_list params; va_start(params, msg); vsprintf(buffer, msg, params); va_end(params); - + BOOST_WAVE_LEXER_THROW_VAR(lexing_exception, errcode, buffer, s->line, s->column, s->file_name); // BOOST_UNREACHABLE_RETURN(0); @@ -320,42 +325,42 @@ lexer::report_error(Scanner const *s, int errcode, // lex_functor // /////////////////////////////////////////////////////////////////////////////// - -template + +template ::token_type> class lex_functor -: public lex_input_interface_generator< - typename lexer::token_type - > -{ +: public lex_input_interface_generator +{ public: - typedef typename lexer::token_type token_type; - + typedef TokenT token_type; + lex_functor(IteratorT const &first, IteratorT const &last, PositionT const &pos, boost::wave::language_support language) : re2c_lexer(first, last, pos, language) {} 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); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 bool has_include_guards(std::string& guard_name) const { return re2c_lexer.has_include_guards(guard_name); } -#endif +#endif private: - lexer re2c_lexer; + lexer re2c_lexer; }; #if BOOST_WAVE_SUPPORT_THREADING == 0 /////////////////////////////////////////////////////////////////////////////// -template -token_cache::string_type> const - lexer::cache = - token_cache::string_type>(); +template +token_cache::string_type> const + lexer::cache = + token_cache::string_type>(); #endif - + } // namespace re2clex /////////////////////////////////////////////////////////////////////////////// @@ -391,15 +396,15 @@ token_cache::string_type> const // /////////////////////////////////////////////////////////////////////////////// -template +template BOOST_WAVE_RE2C_NEW_LEXER_INLINE -lex_input_interface > * -new_lexer_gen::new_lexer(IteratorT const &first, +lex_input_interface * +new_lexer_gen::new_lexer(IteratorT const &first, IteratorT const &last, PositionT const &pos, boost::wave::language_support language) { using re2clex::lex_functor; - return new lex_functor(first, last, pos, language); + return new lex_functor(first, last, pos, language); } #undef BOOST_WAVE_RE2C_NEW_LEXER_INLINE @@ -408,7 +413,7 @@ new_lexer_gen::new_lexer(IteratorT const &first, } // namespace cpplexer } // namespace wave } // namespace boost - + // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS #include BOOST_ABI_SUFFIX diff --git a/include/boost/wave/cpplexer/re2clex/scanner.hpp b/include/boost/wave/cpplexer/re2clex/scanner.hpp index 6627043..959eca6 100644 --- a/include/boost/wave/cpplexer/re2clex/scanner.hpp +++ b/include/boost/wave/cpplexer/re2clex/scanner.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library http://www.boost.org/ - + Copyright (c) 2001 Daniel C. Nuffer. Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost Software License, Version 1.0. (See accompanying diff --git a/include/boost/wave/cpplexer/token_cache.hpp b/include/boost/wave/cpplexer/token_cache.hpp index aaf4cdb..4912921 100644 --- a/include/boost/wave/cpplexer/token_cache.hpp +++ b/include/boost/wave/cpplexer/token_cache.hpp @@ -54,7 +54,7 @@ public: { return cache[BASEID_FROM_TOKEN(id) - T_FIRST_TOKEN]; } - + private: std::vector cache; }; diff --git a/include/boost/wave/grammars/cpp_expression_grammar.hpp b/include/boost/wave/grammars/cpp_expression_grammar.hpp index 9fe30a3..e2078cb 100644 --- a/include/boost/wave/grammars/cpp_expression_grammar.hpp +++ b/include/boost/wave/grammars/cpp_expression_grammar.hpp @@ -798,19 +798,19 @@ expression_grammar_gen::evaluate( // something. If the remainder consists out of whitespace only, the // expression is still valid. iterator_type next = hit.stop; - + while (next != last) { switch (static_cast(token_id(*next))) { case T_SPACE: case T_SPACE2: case T_CCOMMENT: break; // ok continue - + case T_NEWLINE: case T_EOF: case T_CPPCOMMENT: // contains newline return as_bool(result); // expression is valid - + default: // expression is illformed if (if_block_status) { diff --git a/include/boost/wave/grammars/cpp_expression_grammar_gen.hpp b/include/boost/wave/grammars/cpp_expression_grammar_gen.hpp index 60271aa..c4d751a 100644 --- a/include/boost/wave/grammars/cpp_expression_grammar_gen.hpp +++ b/include/boost/wave/grammars/cpp_expression_grammar_gen.hpp @@ -50,7 +50,7 @@ struct BOOST_WAVE_DECL expression_grammar_gen { typedef TokenT token_type; typedef std::list > token_sequence_type; - + static bool evaluate( typename token_sequence_type::const_iterator const &first, typename token_sequence_type::const_iterator const &last, diff --git a/include/boost/wave/grammars/cpp_grammar_gen.hpp b/include/boost/wave/grammars/cpp_grammar_gen.hpp index d4f0c26..41f7c7b 100644 --- a/include/boost/wave/grammars/cpp_grammar_gen.hpp +++ b/include/boost/wave/grammars/cpp_grammar_gen.hpp @@ -85,7 +85,7 @@ struct BOOST_WAVE_DECL cpp_grammar_gen // boost::spirit::nil_t, // boost::pool_allocator > node_factory_type; - + // parse the cpp_grammar and return the resulting parse tree static boost::spirit::classic::tree_parse_info parse_cpp_grammar (iterator_type const &first, iterator_type const &last, diff --git a/include/boost/wave/token_ids.hpp b/include/boost/wave/token_ids.hpp index 1082092..4057474 100644 --- a/include/boost/wave/token_ids.hpp +++ b/include/boost/wave/token_ids.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library The definition of a default set of token identifiers and related functions. - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -36,7 +36,7 @@ namespace boost { namespace wave { /////////////////////////////////////////////////////////////////////////////// -// assemble tokenid's +// assemble tokenids #define TOKEN_FROM_ID(id, cat) ((id) | (cat)) #define ID_FROM_TOKEN(tok) ((tok) & ~TokenTypeMask) #define BASEID_FROM_TOKEN(tok) ((tok) & ~ExtTokenTypeMask) @@ -288,7 +288,7 @@ enum token_id { T_LAST_TOKEN_ID, T_LAST_TOKEN = ID_FROM_TOKEN(T_LAST_TOKEN_ID), - + // pseudo tokens to help streamlining macro replacement, these should not // returned from the lexer nor should these be returned from the pp-iterator T_NONREPLACABLE_IDENTIFIER = TOKEN_FROM_ID(T_LAST_TOKEN+1, IdentifierTokenType), diff --git a/include/boost/wave/util/cpp_ifblock.hpp b/include/boost/wave/util/cpp_ifblock.hpp index 24fcc80..e24c5f2 100644 --- a/include/boost/wave/util/cpp_ifblock.hpp +++ b/include/boost/wave/util/cpp_ifblock.hpp @@ -68,7 +68,7 @@ class if_block_stack { public: typedef std::stack::size_type size_type; - + void enter_if_block(bool new_status) { // If enclosing block is false, then this block is also false @@ -76,7 +76,7 @@ public: this->push (value_type (new_status && enclosing_status, enclosing_status)); } bool enter_elif_block(bool new_status) - { + { if (!is_inside_ifpart()) return false; // #elif without matching #if @@ -136,7 +136,7 @@ public: } size_type get_if_block_depth() const { return this->size(); } - + protected: bool is_inside_ifpart() const { diff --git a/include/boost/wave/util/cpp_include_paths.hpp b/include/boost/wave/util/cpp_include_paths.hpp index fe35d46..db56e4e 100644 --- a/include/boost/wave/util/cpp_include_paths.hpp +++ b/include/boost/wave/util/cpp_include_paths.hpp @@ -140,7 +140,7 @@ private: typedef std::list > include_list_type; typedef include_list_type::value_type include_value_type; - + #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 typedef bidirectional_map::type pragma_once_set_type; @@ -350,7 +350,7 @@ include_paths::find_include_file (std::string &s, std::string &dir, bool is_system, char const *current_file) const { namespace fs = boost::filesystem; - + // if not system include (<...>), then search current directory first if (!is_system) { if (!was_sys_include_path) { // set_sys_include_delimiter() not called @@ -369,7 +369,7 @@ include_paths::find_include_file (std::string &s, std::string &dir, dirpath = create_path(current_rel_dir.string()); dirpath /= create_path(s); } - + dir = dirpath.string(); s = normalize(currpath).string(); // found in local directory return true; diff --git a/include/boost/wave/util/cpp_iterator.hpp b/include/boost/wave/util/cpp_iterator.hpp index f80b9a0..9b7e589 100644 --- a/include/boost/wave/util/cpp_iterator.hpp +++ b/include/boost/wave/util/cpp_iterator.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library Definition of the preprocessor iterator - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -79,7 +79,7 @@ ParseNodeT const *name_node = 0; "bad parse tree (unexpected)", act_pos); return false; } - + typename ParseNodeT::children_t const &children = name_node->children; if (0 == children.size() || @@ -119,19 +119,19 @@ std::pair nodes; // copy all parameters to the supplied container typename ContainerT::iterator last_nonwhite = macrodefinition.end(); const_tree_iterator end = nodes.second; - + for (const_tree_iterator cit = nodes.first; cit != end; ++cit) { if ((*cit).value.begin() != (*cit).value.end()) { typename ContainerT::iterator inserted = macrodefinition.insert( macrodefinition.end(), *(*cit).value.begin()); - + if (!IS_CATEGORY(macrodefinition.back(), WhiteSpaceTokenType) && T_NEWLINE != token_id(macrodefinition.back()) && T_EOF != token_id(macrodefinition.back())) { last_nonwhite = inserted; } - + if (update_position) { (*inserted).set_position(act_pos); act_pos.set_column( @@ -139,7 +139,7 @@ std::pair nodes; } } } - + // trim trailing whitespace (leading whitespace is trimmed by the grammar) if (last_nonwhite != macrodefinition.end()) { if (update_position) { @@ -168,14 +168,14 @@ bool add_macro_definition(ContextT &ctx, std::string macrostring, using namespace boost::wave; using namespace std; // isspace is in std namespace for some systems - + // skip leading whitespace std::string::iterator begin = macrostring.begin(); std::string::iterator end = macrostring.end(); while(begin != end && isspace(*begin)) ++begin; - + // parse the macro definition position_type act_pos(""); boost::spirit::classic::tree_parse_info hit = @@ -209,7 +209,7 @@ bool has_parameters = false; { macrodefinition.push_back(token_type(T_INTLIT, "1", act_pos)); } - + // add the new macro to the macromap return ctx.add_macro_definition(macroname, has_parameters, macroparameters, macrodefinition, is_predefined); @@ -234,7 +234,7 @@ template class pp_iterator_functor { public: -// interface to the boost::spirit::classic::multi_pass_policies::functor_input policy +// interface to the boost::spirit::classic::iterator_policies::functor_input policy typedef typename ContextT::token_type result_type; // eof token @@ -286,7 +286,7 @@ public: ctx_.set_current_filename(pos_.get_file().c_str()); #endif } - + // get the next preprocessed token result_type const &operator()(); @@ -297,7 +297,7 @@ protected: friend class pp_iterator; bool on_include_helper(char const *t, char const *s, bool is_system, bool include_next); - + protected: result_type const &get_next_token(); result_type const &pp_token(); @@ -323,7 +323,7 @@ protected: void on_define(parse_node_type const &node); void on_undefine(lexer_type const &it); - + void on_ifdef(result_type const& found_directive, lexer_type const &it); // typename parse_tree_type::const_iterator const &end); void on_ifndef(result_type const& found_directive, lexer_type const& it); @@ -331,7 +331,7 @@ protected: void on_else(); void on_endif(); void on_illformed(typename result_type::string_type s); - + void on_line(typename parse_tree_type::const_iterator const &begin, typename parse_tree_type::const_iterator const &end); void on_if(result_type const& found_directive, @@ -359,16 +359,16 @@ protected: private: ContextT &ctx; // context, this iterator is associated with boost::shared_ptr iter_ctx; - + bool seen_newline; // needed for recognizing begin of line bool skipped_newline; // a newline has been skipped since last one bool must_emit_line_directive; // must emit a line directive result_type act_token; // current token typename result_type::position_type &act_pos; // current fileposition (references the macromap) - + token_sequence_type unput_queue; // tokens to be preprocessed again token_sequence_type pending_queue; // tokens already preprocessed - + // detect whether to insert additional whitespace in between two adjacent // tokens, which otherwise would form a different token type, if // re-tokenized @@ -406,7 +406,7 @@ pp_iterator_functor::returned_from_include() // of the included file BOOST_WAVE_STRINGTYPE oldfile = iter_ctx->real_filename; position_type old_pos (act_pos); - + // if this file has include guards handle it as if it had a #pragma once #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 if (need_include_guard_detection(ctx.get_language())) { @@ -424,7 +424,7 @@ pp_iterator_functor::returned_from_include() act_pos.set_file(iter_ctx->filename); act_pos.set_line(iter_ctx->line); act_pos.set_column(0); - + // restore the actual current file and directory #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 ctx.set_current_filename(iter_ctx->real_filename.c_str()); @@ -483,11 +483,11 @@ pp_iterator_functor::operator()() // make sure the cwd has been initialized ctx.init_context(); - + // loop over skip able whitespace until something significant is found bool was_seen_newline = seen_newline; token_id id = T_UNKNOWN; - + try { // catch lexer exceptions do { // get_next_token assigns result to act_token member @@ -503,7 +503,7 @@ pp_iterator_functor::operator()() act_token.set_token_id(id = T_NEWLINE); act_token.set_value("\n"); } - + } while (ctx.get_hooks().may_skip_whitespace(ctx.derived(), act_token, skipped_newline)); } catch (boost::wave::cpplexer::lexing_exception const& e) { @@ -511,7 +511,7 @@ pp_iterator_functor::operator()() ctx.get_hooks().throw_exception(ctx.derived(), e); return act_token; } - + // if there were skipped any newlines, we must emit a #line directive if ((must_emit_line_directive || (was_seen_newline && skipped_newline)) && impl::consider_emitting_line_directive(ctx, id)) @@ -524,7 +524,7 @@ pp_iterator_functor::operator()() id = token_id(act_token); } } - + // cleanup of certain tokens required seen_newline = false; switch (static_cast(id)) { @@ -537,7 +537,7 @@ pp_iterator_functor::operator()() ++iter_ctx->emitted_lines; seen_newline = true; break; - + case T_NEWLINE: case T_CPPCOMMENT: seen_newline = true; @@ -548,11 +548,11 @@ pp_iterator_functor::operator()() iter_ctx->emitted_lines += context_policies::util::ccomment_count_newlines(act_token); break; - + case T_PP_NUMBER: // re-tokenize the pp-number { token_sequence_type rescanned; - + std::string pp_number( util::to_string(act_token.get_value())); @@ -560,10 +560,10 @@ pp_iterator_functor::operator()() pp_number.end(), act_token.get_position(), ctx.get_language()); lexer_type end = lexer_type(); - + for (/**/; it != end && T_EOF != token_id(*it); ++it) rescanned.push_back(*it); - + pending_queue.splice(pending_queue.begin(), rescanned); act_token = pending_queue.front(); id = token_id(act_token); @@ -600,16 +600,16 @@ inline typename pp_iterator_functor::result_type const & pp_iterator_functor::get_next_token() { using namespace boost::wave; - + // if there is something in the unput_queue, then return the next token from // there (all tokens in the queue are preprocessed already) if (!pending_queue.empty() || !unput_queue.empty()) return pp_token(); // return next token - + // test for EOF, if there is a pending input context, pop it back and continue // parsing with it bool returned_from_include_file = returned_from_include(); - + // try to generate the next token if (iter_ctx->first != iter_ctx->last) { do { @@ -622,17 +622,17 @@ bool returned_from_include_file = returned_from_include(); return act_token = pending_queue.front(); } - + // adjust the current position (line and column) bool was_seen_newline = seen_newline || returned_from_include_file; - // fetch the current token + // fetch the current token act_token = *iter_ctx->first; act_pos = act_token.get_position(); - + // act accordingly on the current token token_id id = token_id(act_token); - + if (T_EOF == id) { // returned from an include file, continue with the next token whitespace.shift_tokens(T_EOF); @@ -653,7 +653,7 @@ bool returned_from_include_file = returned_from_include(); // (the C++ comment token includes the trailing newline) seen_newline = true; ++iter_ctx->first; - + if (!ctx.get_if_block_status()) { // skip this token because of the disabled #if block whitespace.shift_tokens(id); // whitespace controller @@ -699,7 +699,7 @@ bool returned_from_include_file = returned_from_include(); #endif ++iter_ctx->first; } - + } while ((iter_ctx->first != iter_ctx->last) || (returned_from_include_file = returned_from_include())); @@ -714,7 +714,7 @@ bool returned_from_include_file = returned_from_include(); else { act_token = eof; // this is the last token } - + // whitespace.shift_tokens(T_EOF); // whitespace controller return act_token; // return eof token } @@ -729,7 +729,7 @@ inline bool pp_iterator_functor::emit_line_directive() { using namespace boost::wave; - + typename ContextT::position_type pos = act_token.get_position(); if (must_emit_line_directive || @@ -750,7 +750,7 @@ typename ContextT::position_type pos = act_token.get_position(); // account for the newline emitted here act_pos.set_line(act_pos.get_line()-1); iter_ctx->emitted_lines = act_pos.get_line(); - + // the #line directive has to be pushed back into the pending queue in // reverse order @@ -758,7 +758,7 @@ typename ContextT::position_type pos = act_token.get_position(); std::string file("\""); boost::filesystem::path filename( wave::util::create_path(act_pos.get_file().c_str())); - + using wave::util::impl::escape_lit; file += escape_lit(wave::util::native_file_string(filename)) + "\""; @@ -775,7 +775,7 @@ typename ContextT::position_type pos = act_token.get_position(); unsigned int column = 7 + (unsigned int)strlen(buffer) + filenamelen; pos.set_line(pos.get_line() - 1); // adjust line number - + pos.set_column(column); pending_queue.push_front(result_type(T_GENERATEDNEWLINE, "\n", pos)); pos.set_column(column -= filenamelen); // account for filename @@ -786,13 +786,13 @@ typename ContextT::position_type pos = act_token.get_position(); pending_queue.push_front(result_type(T_INTLIT, buffer, pos)); pos.set_column(--column); // account for ' ' pending_queue.push_front(result_type(T_SPACE, " ", pos)); - + // return the #line token itself // whitespace.shift_tokens(T_PP_LINE); pos.set_column(1); act_token = result_type(T_PP_LINE, "#line", pos); } - + must_emit_line_directive = false; // we are now in sync return true; } @@ -840,7 +840,7 @@ token_id id = token_id(*iter_ctx->first); ++iter_ctx->first; } id = token_id(act_token); - + } while (T_PLACEHOLDER == id); return act_token; } @@ -856,7 +856,7 @@ namespace impl { bool next_token_is_pp_directive(ContextT &ctx, IteratorT &it, IteratorT const &end) { using namespace boost::wave; - + token_id id = T_UNKNOWN; for (/**/; it != end; ++it) { id = token_id(*it); @@ -875,7 +875,7 @@ namespace impl { BOOST_ASSERT(it == end || id != T_UNKNOWN); return it != end && IS_CATEGORY(id, PPTokenType); } - + // call 'found_directive' preprocessing hook template bool call_found_directive_hook(ContextT& ctx, @@ -908,7 +908,7 @@ namespace impl { bool call_hook = true) { using namespace boost::wave; - + // this token get's skipped if (call_hook) call_skipped_token_hook(ctx, *it); @@ -940,10 +940,10 @@ namespace impl { bool skip_to_eol(ContextT &ctx, IteratorT &it, IteratorT const &end) { using namespace boost::wave; - + for (/**/; it != end; ++it) { token_id id = token_id(*it); - + call_skipped_token_hook(ctx, *it); if (T_CPPCOMMENT == id || T_NEWLINE == id || context_policies::util::ccomment_has_newline(*it)) @@ -954,7 +954,7 @@ namespace impl { } return false; } - + } /////////////////////////////////////////////////////////////////////////////// @@ -977,7 +977,7 @@ pp_iterator_functor::extract_identifier(IteratorT &it) impl::skip_to_eol(ctx, it, iter_ctx->last); string_type str(util::impl::as_string(iter_ctx->first, it)); - + seen_newline = true; iter_ctx->first = it; on_illformed(str); @@ -994,29 +994,29 @@ pp_iterator_functor::ensure_is_last_on_line(IteratorT& it) { // enable error recovery (start over with the next line) impl::skip_to_eol(ctx, it, iter_ctx->last); - + string_type str(util::impl::as_string( iter_ctx->first, it)); seen_newline = true; iter_ctx->first = it; - + // report an invalid directive on_illformed(str); return false; } - + if (it == iter_ctx->last && !need_single_line(ctx.get_language())) { // The line doesn't end with an eol but eof token. seen_newline = true; // allow to resume after warning iter_ctx->first = it; - + // Trigger a warning that the last line was not terminated with a // newline. BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, last_line_not_terminated, "", act_pos); - + return false; } return true; @@ -1034,7 +1034,7 @@ pp_iterator_functor::skip_to_eol_with_check(IteratorT &it) // The line doesn't end with an eol but eof token. seen_newline = true; // allow to resume after warning iter_ctx->first = it; - + // Trigger a warning, that the last line was not terminated with a // newline. BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, @@ -1047,7 +1047,7 @@ pp_iterator_functor::skip_to_eol_with_check(IteratorT &it) iter_ctx->first = it; return true; } - + /////////////////////////////////////////////////////////////////////////////// // handle_pp_directive: handle certain pp_directives template @@ -1131,7 +1131,7 @@ pp_iterator_functor::handle_pp_directive(IteratorT &it) return true; } break; - + case T_PP_HHEADER: // #include <...> #if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 case T_PP_HHEADER_NEXT: @@ -1237,7 +1237,7 @@ inline bool pp_iterator_functor::pp_directive() { using namespace cpplexer; - + // test, if the next non-whitespace token is a pp directive lexer_type it = iter_ctx->first; @@ -1255,7 +1255,7 @@ lexer_type it = iter_ctx->first; on_illformed((*it).get_value()); } } - + // this line does not contain a pp directive, so simply return return false; } @@ -1271,7 +1271,7 @@ lexer_type it = iter_ctx->first; // false or if it was a #include directive we could handle directly return true; // the pp directive has been handled/skipped } - + // found a pp directive, so try to identify it, start with the pp_token bool found_eof = false; result_type found_directive; @@ -1290,7 +1290,7 @@ tree_parse_info_type hit = cpp_grammar_type::parse_cpp_grammar( // found a valid pp directive, dispatch to the correct function to handle // the found pp directive bool result = dispatch_directive (hit, found_directive, found_eoltokens); - + if (found_eof && !need_single_line(ctx.get_language())) { // The line was terminated with an end of file token. // So trigger a warning, that the last line was not terminated with a @@ -1304,7 +1304,7 @@ tree_parse_info_type hit = cpp_grammar_type::parse_cpp_grammar( // recognized invalid directive impl::skip_to_eol(ctx, it, iter_ctx->last); seen_newline = true; - + string_type str(boost::wave::util::impl::as_string( iter_ctx->first, it)); iter_ctx->first = it; @@ -1327,9 +1327,9 @@ pp_iterator_functor::dispatch_directive( token_sequence_type const& found_eoltokens) { using namespace cpplexer; - + typedef typename parse_tree_type::const_iterator const_child_iterator_t; - + // this iterator points to the root node of the parse tree const_child_iterator_t begin = hit.trees.begin(); @@ -1406,7 +1406,7 @@ token_id id = token_id(found_directive); case T_PP_LINE: // #line on_line(begin_child_it, end_child_it); break; - + case T_PP_ERROR: // #error on_error(begin_child_it, end_child_it); break; @@ -1482,7 +1482,7 @@ std::string file_path(s.substr(pos_begin+1, pos_end-pos_begin-1).c_str()); on_include_helper(file_token.c_str(), file_path.c_str(), is_system, include_next); } - + template inline bool pp_iterator_functor::on_include_helper (char const *f, char const *s, @@ -1530,7 +1530,7 @@ fs::path native_path(wave::util::create_path(file_path)); // the new include file determines the actual current directory ctx.set_current_directory( wave::util::native_file_string(native_path).c_str()); - + // preprocess the opened file boost::shared_ptr new_iter_ctx ( new iteration_context_type(ctx, @@ -1550,13 +1550,13 @@ fs::path native_path(wave::util::create_path(file_path)); iter_ctx->filename = act_pos.get_file(); iter_ctx->line = act_pos.get_line(); iter_ctx->if_block_depth = ctx.get_if_block_depth(); - + // push the old iteration context onto the stack and continue with the new ctx.push_iteration_context(act_pos, iter_ctx); iter_ctx = new_iter_ctx; seen_newline = true; // fake a newline to trigger pp_directive must_emit_line_directive = true; - + act_pos.set_file(iter_ctx->filename); // initialize file position #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 ctx.set_current_filename(iter_ctx->real_filename.c_str()); @@ -1582,7 +1582,7 @@ namespace impl { 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(); @@ -1660,7 +1660,7 @@ position_type pos(act_token.get_position()); using namespace cpplexer; typedef typename std::vector::iterator parameter_iterator_t; - + bool seen_ellipses = false; parameter_iterator_t end = macroparameters.end(); for (parameter_iterator_t pit = macroparameters.begin(); @@ -1684,7 +1684,7 @@ position_type pos(act_token.get_position()); return; } } - + // if there wasn't an ellipsis, then there shouldn't be a __VA_ARGS__ // placeholder in the definition too [C99 Standard 6.10.3.5] if (!seen_ellipses) { @@ -1717,7 +1717,7 @@ position_type pos(act_token.get_position()); using namespace cpplexer; typedef typename std::vector::iterator parameter_iterator_t; - + parameter_iterator_t end = macroparameters.end(); for (parameter_iterator_t pit = macroparameters.begin(); pit != end; ++pit) @@ -1732,7 +1732,7 @@ position_type pos(act_token.get_position()); } } } - + // add the new macro to the macromap ctx.add_macro_definition(macroname, has_parameters, macroparameters, macrodefinition); @@ -1906,13 +1906,13 @@ token_sequence_type expanded; do { expanded.clear(); - + typename token_sequence_type::iterator begin2 = toexpand.begin(); ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded); // replace all remaining (== undefined) identifiers with an integer literal '0' replace_undefined_identifiers(expanded); - + #if BOOST_WAVE_DUMP_CONDITIONAL_EXPRESSIONS != 0 { string_type outstr(boost::wave::util::impl::as_string(toexpand)); @@ -1932,7 +1932,7 @@ token_sequence_type expanded; ctx.get_hooks().throw_exception(ctx.derived(), e); break; } - + #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 ctx.get_hooks().evaluated_conditional_expression(toexpand, if_status); } while (false); @@ -1948,7 +1948,7 @@ token_sequence_type expanded; string_type expression = util::impl::as_string(expanded); if (0 == expression.size()) expression = ""; - + if (grammars::error_division_by_zero & status) { BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, division_by_zero, expression.c_str(), act_pos); @@ -2002,7 +2002,7 @@ token_sequence_type toexpand; impl::skip_to_eol(ctx, begin3, found_eoltokens.end()); return; // one of previous #if/#elif was true, so don't enter this #elif } - + // preprocess the given sequence into the provided list bool if_status = false; grammars::value_error status = grammars::error_noerror; @@ -2013,7 +2013,7 @@ token_sequence_type expanded; typename token_sequence_type::iterator begin2 = toexpand.begin(); ctx.expand_whole_tokensequence(begin2, toexpand.end(), expanded); - + // replace all remaining (== undefined) identifiers with an integer literal '0' replace_undefined_identifiers(expanded); @@ -2035,7 +2035,7 @@ token_sequence_type expanded; // any errors occurred have to be dispatched to the context hooks ctx.get_hooks().throw_exception(ctx.derived(), e); } - + #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 ctx.get_hooks().evaluated_conditional_expression(toexpand, if_status); } while (false); @@ -2044,7 +2044,7 @@ token_sequence_type expanded; found_directive, toexpand, if_status) && status == grammars::error_noerror); #endif - + if (!ctx.enter_elif_block(if_status)) { // #elif without matching #if BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, missing_matching_if, @@ -2121,24 +2121,24 @@ namespace impl { using namespace boost::spirit::classic; if (!parse((*first).get_value().c_str(), int_p).full) error = preprocess_exception::bad_line_number; - + // extract file name (if it is given) while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType)) /**/; // skip whitespace - + if (first != last) { if (T_STRINGLIT != token_id(*first)) { error = preprocess_exception::bad_line_filename; return false; } - + StringT const &file_lit = (*first).get_value(); - + if ('L' == file_lit[0]) { error = preprocess_exception::bad_line_filename; return false; // shouldn't be a wide character string } - + file = file_lit.substr(1, file_lit.size()-2); // test if there is other junk on this line @@ -2170,10 +2170,10 @@ get_token_value get_value; get_token_value, typename parse_tree_type::const_iterator >::type const_tree_iterator_t; - + const_tree_iterator_t first = make_ref_transform_iterator(begin, get_value); const_tree_iterator_t last = make_ref_transform_iterator(end, get_value); - + // try to interpret the #line body as a number followed by an optional // string literal unsigned int line = 0; @@ -2206,14 +2206,14 @@ token_sequence_type toexpand; ctx.get_hooks().found_line_directive(ctx.derived(), toexpand, line, file_name.c_str()); } - + // the queues should be empty at this point BOOST_ASSERT(unput_queue.empty()); BOOST_ASSERT(pending_queue.empty()); // make sure error recovery starts on the next line must_emit_line_directive = true; - + // diagnose possible error in detected line directive if (error != preprocess_exception::no_error) { BOOST_WAVE_THROW_VAR_CTX(ctx, preprocess_exception, error, @@ -2251,7 +2251,7 @@ typename ref_transform_iterator_generator< get_token_value, typename parse_tree_type::const_iterator >::type first = make_ref_transform_iterator(begin, get_value); - + #if BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY != 0 // preprocess the body of this #error message token_sequence_type toexpand; @@ -2299,7 +2299,7 @@ typename ref_transform_iterator_generator< get_token_value, typename parse_tree_type::const_iterator >::type first = make_ref_transform_iterator(begin, get_value); - + #if BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY != 0 // preprocess the body of this #warning message token_sequence_type toexpand; @@ -2338,7 +2338,7 @@ pp_iterator_functor::on_pragma( typename parse_tree_type::const_iterator const &end) { using namespace boost::wave; - + BOOST_ASSERT(ctx.get_if_block_status()); // Look at the pragma token sequence and decide, if the first token is STDC @@ -2351,13 +2351,13 @@ get_token_value get_value; get_token_value, typename parse_tree_type::const_iterator >::type const_tree_iterator_t; - + const_tree_iterator_t first = make_ref_transform_iterator(begin, get_value); const_tree_iterator_t last = make_ref_transform_iterator(end, get_value); expanded.push_back(result_type(T_PP_PRAGMA, "#pragma", act_token.get_position())); expanded.push_back(result_type(T_SPACE, " ", act_token.get_position())); - + while (++first != last && IS_CATEGORY(*first, WhiteSpaceTokenType)) expanded.push_back(*first); // skip whitespace @@ -2386,7 +2386,7 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value); } } expanded.push_back(result_type(T_NEWLINE, "\n", act_token.get_position())); - + // the queues should be empty at this point BOOST_ASSERT(unput_queue.empty()); BOOST_ASSERT(pending_queue.empty()); @@ -2399,7 +2399,7 @@ const_tree_iterator_t last = make_ref_transform_iterator(end, get_value); pending_queue.splice(pending_queue.begin(), pending); return true; // this #pragma was successfully recognized } - + #if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0 // Move the resulting token sequence into the pending_queue, so it will be // returned to the caller. @@ -2417,12 +2417,12 @@ pp_iterator_functor::interpret_pragma( token_sequence_type const &pragma_body, token_sequence_type &result) { using namespace cpplexer; - + typename token_sequence_type::const_iterator end = pragma_body.end(); typename token_sequence_type::const_iterator it = pragma_body.begin(); for (++it; it != end && IS_CATEGORY(*it, WhiteSpaceTokenType); ++it) /**/; // skip whitespace - + if (it == end) // eof reached return false; @@ -2458,17 +2458,17 @@ private: base_type; typedef pp_iterator self_type; typedef boost::wave::util::functor_input functor_input_type; - + public: pp_iterator() {} - + template pp_iterator(ContextT &ctx, IteratorT const &first, IteratorT const &last, typename ContextT::position_type const &pos) : base_type(input_policy_type(ctx, first, last, pos)) {} - + bool force_include(char const *path_, bool is_last) { bool result = this->get_functor().on_include_helper(path_, path_, diff --git a/include/boost/wave/util/cpp_macromap.hpp b/include/boost/wave/util/cpp_macromap.hpp index 1a52697..b6d9edb 100644 --- a/include/boost/wave/util/cpp_macromap.hpp +++ b/include/boost/wave/util/cpp_macromap.hpp @@ -70,10 +70,10 @@ class macromap { typedef typename ContextT::token_type token_type; typedef typename token_type::string_type string_type; typedef typename token_type::position_type position_type; - + typedef typename ContextT::token_sequence_type definition_container_type; typedef std::vector parameter_container_type; - + typedef macro_definition macro_definition_type; typedef symbol_table @@ -100,11 +100,11 @@ public: bool is_defined(string_type const &name, typename defined_macros_type::iterator &it, defined_macros_type *scope = 0) const; - + // expects a token sequence as its parameters template bool is_defined(IteratorT const &begin, IteratorT const &end) const; - + // expects an arbitrary string as its parameter bool is_defined(string_type const &str) const; @@ -114,11 +114,11 @@ public: parameter_container_type ¶meters, definition_container_type &definition, defined_macros_type *scope = 0) const; - + // Remove a macro name from the given macro scope bool remove_macro(string_type const &name, position_type const& pos, bool even_predefined = false); - + template token_type const &expand_tokensequence(IteratorT &first, IteratorT const &last, ContainerT &pending, ContainerT &expanded, @@ -135,7 +135,7 @@ public: defined_macros_type *scope = 0, bool at_global_scope = true); void predefine_macro(defined_macros_type *scope, string_type const &name, token_type const &t); - + // Init the internal macro symbol namespace void reset_macromap(); @@ -144,7 +144,7 @@ public: // interface for macro name introspection typedef typename defined_macros_type::name_iterator name_iterator; typedef typename defined_macros_type::const_name_iterator const_name_iterator; - + name_iterator begin() { return defined_macros_type::make_iterator(current_macros->begin()); } name_iterator end() @@ -153,7 +153,7 @@ public: { return defined_macros_type::make_iterator(current_macros->begin()); } const_name_iterator end() const { return defined_macros_type::make_iterator(current_macros->end()); } - + protected: // Helper functions for expanding all macros in token sequences template @@ -215,7 +215,7 @@ protected: template token_type const &resolve_defined(IteratorT &first, IteratorT const &last, ContainerT &expanded); - + // Resolve operator _Pragma or the #pragma directive template bool resolve_operator_pragma(IteratorT &first, @@ -228,7 +228,7 @@ protected: template bool is_valid_concat(string_type new_value, position_type const &pos, ContainerT &rescanned); - + #if BOOST_WAVE_SERIALIZATION != 0 public: BOOST_STATIC_CONSTANT(unsigned int, version = 0x10); @@ -303,7 +303,7 @@ macromap::add_macro(token_type const &name, bool has_parameters, name.get_value().c_str()); return false; } - + // try to define the new macro defined_macros_type *current_scope = scope ? scope : current_macros; typename defined_macros_type::iterator it = current_scope->find(name.get_value()); @@ -325,17 +325,17 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value() // test the validity of the parameter names if (has_parameters) { std::set names; - + typedef typename parameter_container_type::iterator parameter_iterator_type; typedef typename std::set::iterator name_iterator_type; - + parameter_iterator_type end = parameters.end(); for (parameter_iterator_type itp = parameters.begin(); itp != end; ++itp) { name_iterator_type pit = names.find((*itp).get_value()); - + if (pit != names.end()) { // duplicate parameter name BOOST_WAVE_THROW_NAME_CTX(ctx, macro_handling_exception, @@ -346,7 +346,7 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value() names.insert((*itp).get_value()); } } - + // insert a new macro node std::pair p = current_scope->insert( @@ -368,7 +368,7 @@ typename defined_macros_type::iterator it = current_scope->find(name.get_value() // add the parameters and the definition std::swap((*p.first).second->macroparameters, parameters); std::swap((*p.first).second->macrodefinition, definition); - + // call the context supplied preprocessing hook #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 ctx.get_hooks().defined_macro(name, has_parameters, @@ -394,7 +394,7 @@ macromap::is_defined(typename token_type::string_type const &name, defined_macros_type *scope) const { if (0 == scope) scope = current_macros; - + if ((it = scope->find(name)) != scope->end()) return true; // found in symbol table @@ -465,7 +465,7 @@ macromap::get_macro(string_type const &name, bool &has_parameters, typename defined_macros_type::iterator it; if (!is_defined(name, it, scope)) return false; - + macro_definition_type ¯o_def = *(*it).second.get(); has_parameters = macro_def.is_functionlike; @@ -497,7 +497,7 @@ macromap::remove_macro(string_type const &name, } } current_macros->erase(it); - + // call the context supplied preprocessing hook function token_type tok(T_IDENTIFIER, name, pos); @@ -869,7 +869,7 @@ macromap::expand_whole_tokensequence(ContainerT &expanded, on_exit::assign on_exit(first, first_it); ContainerT pending_queue; bool seen_newline; - + while (!pending_queue.empty() || first_it != last_it) { expanded.push_back( expand_tokensequence_worker(pending_queue, first_it, @@ -1625,13 +1625,13 @@ macromap::is_valid_concat(string_type new_value, { // re-tokenize the newly generated string typedef typename ContextT::lexer_type lexer_type; - + std::string value_to_test(new_value.c_str()); boost::wave::language_support lang = boost::wave::enable_prefer_pp_numbers(ctx.get_language()); lang = boost::wave::enable_single_line(lang); - + lexer_type it = lexer_type(value_to_test.begin(), value_to_test.end(), pos, lang); lexer_type end = lexer_type(); @@ -1642,7 +1642,7 @@ macromap::is_valid_concat(string_type new_value, if (boost::wave::need_variadics(ctx.get_language())) return true; // in variadics mode token pasting is well defined #endif - + // test if the newly generated token sequence contains more than 1 token // the second one is the T_EOF token // BOOST_ASSERT(T_EOF == token_id(rescanned.back())); @@ -1662,14 +1662,14 @@ macromap::concat_tokensequence(ContainerT &expanded) { using namespace boost::wave; typedef typename ContainerT::iterator iterator_type; - + iterator_type end = expanded.end(); iterator_type prev = end; for (iterator_type it = expanded.begin(); it != end; /**/) { if (T_POUND_POUND == BASE_TOKEN(token_id(*it))) { iterator_type next = it; - + ++next; if (prev == end || next == end) { // error, '##' should be in between two tokens @@ -1726,7 +1726,7 @@ macromap::concat_tokensequence(ContainerT &expanded) !IS_CATEGORY(*next, WhiteSpaceTokenType)) { string_type error_string("\""); - + error_string += (*prev).get_value(); error_string += "\" and \""; error_string += (*next).get_value(); @@ -1740,13 +1740,13 @@ macromap::concat_tokensequence(ContainerT &expanded) if (boost::wave::need_variadics(ctx.get_language())) { // remove the prev, '##' and the next tokens from the sequence expanded.erase(prev, ++next); // remove not needed tokens - + // some stl implementations clear() the container if we erased all // the elements, which orphans all iterators. we re-initialize these // here if (expanded.empty()) end = next = expanded.end(); - + // replace the old token (pointed to by *prev) with the re-tokenized // sequence expanded.splice(next, rescanned); @@ -1764,7 +1764,7 @@ macromap::concat_tokensequence(ContainerT &expanded) (*prev).set_value(concat_result); if (T_NONREPLACABLE_IDENTIFIER == token_id(*prev)) (*prev).set_token_id(T_IDENTIFIER); - + // remove the '##' and the next tokens from the sequence iterator_type first_to_delete = prev; @@ -1775,7 +1775,7 @@ macromap::concat_tokensequence(ContainerT &expanded) } // save last non-whitespace token position - if (!IS_CATEGORY(*it, WhiteSpaceTokenType)) + if (!IS_CATEGORY(*it, WhiteSpaceTokenType)) prev = it; ++it; // next token, please @@ -1835,7 +1835,7 @@ position_type pos(""); predefine_macro(current_scope, m.name, token_type(m.token_id, m.value, pos)); } - + #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 // define __WAVE_HAS_VARIADICS__, if appropriate if (boost::wave::need_variadics(ctx.get_language())) { @@ -1849,7 +1849,7 @@ position_type pos(""); namespace fs = boost::filesystem; if (string_type(fname) != "") { fs::path filename(create_path(fname)); - + using boost::wave::util::impl::escape_lit; predefine_macro(current_scope, "__BASE_FILE__", token_type(T_STRINGLIT, string_type("\"") + @@ -1858,13 +1858,13 @@ position_type pos(""); } else if (!base_name.empty()) { fs::path filename(create_path(base_name.c_str())); - + using boost::wave::util::impl::escape_lit; predefine_macro(current_scope, "__BASE_FILE__", token_type(T_STRINGLIT, string_type("\"") + escape_lit(native_file_string(filename)).c_str() + "\"", pos)); } - + // now add the dynamic macros for (int j = 0; 0 != predef.dynamic_data(j).name; ++j) { predefined_macros::dynamic_macros const& m = predef.dynamic_data(j); diff --git a/include/boost/wave/util/cpp_macromap_utils.hpp b/include/boost/wave/util/cpp_macromap_utils.hpp index 4b110f8..a9592b3 100644 --- a/include/boost/wave/util/cpp_macromap_utils.hpp +++ b/include/boost/wave/util/cpp_macromap_utils.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library Token sequence analysis and transformation helper functions - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -49,7 +49,7 @@ namespace on_exit { public: pop_front(ContainerT &list_) : list(list_) {} ~pop_front() { list.pop_front(); } - + private: ContainerT &list; }; @@ -141,13 +141,13 @@ is_special_macroname (StringT const &name) { if (name.size() < 7) return false; - + if ("defined" == name) return true; - + if ('_' == name[0] && '_' == name[1]) { StringT str = name.substr(2); - + if (str == "cplusplus" || str == "STDC__" || str == "TIME__" || str == "DATE__" || str == "LINE__" || str == "FILE__" || @@ -170,12 +170,12 @@ inline bool 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); - + return (T_IDENTIFIER == id || IS_CATEGORY(id, KeywordTokenType) || IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) || @@ -201,12 +201,12 @@ definition_equals(ContainerT const &definition, ContainerT const &new_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(); - + while (first1 != last1 && first2 != last2 && token_equals(*first1, *first2)) { // skip whitespace, if both sequences have a whitespace next @@ -248,7 +248,7 @@ parameters_equal(ContainerT const ¶meters, ContainerT const &new_parameters) return false; // different parameter count 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(); @@ -283,7 +283,7 @@ trim_replacement_list (ContainerT &replacement_list) if (replacement_list.size() > 0) { typename ContainerT::iterator end = replacement_list.end(); typename ContainerT::iterator it = replacement_list.begin(); - + while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) { if (T_PLACEHOLDER != token_id(*it)) { typename ContainerT::iterator next = it; @@ -296,18 +296,18 @@ trim_replacement_list (ContainerT &replacement_list) } } } - + // strip trailing whitespace if (replacement_list.size() > 0) { 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(); - + while (it != end && IS_CATEGORY(*it, WhiteSpaceTokenType)) { if (T_PLACEHOLDER != token_id(*it)) { typename ContainerT::iterator next = it; @@ -337,7 +337,7 @@ remove_placeholders (ContainerT &replacement_list) if (replacement_list.size() > 0) { typename ContainerT::iterator end = replacement_list.end(); typename ContainerT::iterator it = replacement_list.begin(); - + while (it != end) { if (T_PLACEHOLDER == token_id(*it)) { typename ContainerT::iterator next = it; @@ -349,7 +349,7 @@ remove_placeholders (ContainerT &replacement_list) ++it; } } - + // remove all 'new' leading and trailing whitespace trim_replacement_list(replacement_list); } @@ -365,7 +365,7 @@ inline void trim_sequence_left (ContainerT &argument) { using namespace boost::wave; - + // strip leading whitespace (should be only one token) if (argument.size() > 0 && IS_CATEGORY(argument.front(), WhiteSpaceTokenType)) @@ -384,7 +384,7 @@ inline void trim_sequence_right (ContainerT &argument) { using namespace boost::wave; - + // strip trailing whitespace (should be only one token) if (argument.size() > 0 && IS_CATEGORY(argument.back(), WhiteSpaceTokenType)) @@ -480,7 +480,7 @@ get_full_name(IteratorT const &begin, IteratorT const &end) class find_concat_operator { public: find_concat_operator(bool &found_) : found_concat(found_) {} - + template bool operator()(TokenT const &tok) { @@ -501,7 +501,7 @@ template struct to_string_helper { typedef Target type; - + static Target call(Src const& str) { return Target(str.c_str()); diff --git a/include/boost/wave/util/functor_input.hpp b/include/boost/wave/util/functor_input.hpp index de42508..b72dca5 100644 --- a/include/boost/wave/util/functor_input.hpp +++ b/include/boost/wave/util/functor_input.hpp @@ -62,7 +62,7 @@ struct functor_input { value_type curtok; 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. @@ -102,7 +102,7 @@ struct functor_input { { boost::spirit::classic::impl::mp_swap(data, x.data); } - + void ensure_initialized() const { if (data && !data->was_initialized) { @@ -110,7 +110,7 @@ struct functor_input { data->was_initialized = true; } } - + public: reference get_input() const { diff --git a/include/boost/wave/util/macro_definition.hpp b/include/boost/wave/util/macro_definition.hpp index 78e5cdf..0d0033f 100644 --- a/include/boost/wave/util/macro_definition.hpp +++ b/include/boost/wave/util/macro_definition.hpp @@ -48,7 +48,7 @@ struct macro_definition { typedef std::vector parameter_container_type; typedef ContainerT definition_container_type; - + typedef typename parameter_container_type::const_iterator const_parameter_iterator_t; typedef typename definition_container_type::const_iterator @@ -76,14 +76,14 @@ struct macro_definition { void replace_parameters() { using namespace boost::wave; - + if (!replaced_parameters) { typename definition_container_type::iterator end = macrodefinition.end(); typename definition_container_type::iterator it = macrodefinition.begin(); for (/**/; it != end; ++it) { token_id id = *it; - + if (T_IDENTIFIER == id || IS_CATEGORY(id, KeywordTokenType) || IS_EXTCATEGORY(id, OperatorTokenType|AltExtTokenType) || @@ -111,7 +111,7 @@ struct macro_definition { } } } - + #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 // we need to know, if the last of the formal arguments is an ellipsis if (macroparameters.size() > 0 && diff --git a/include/boost/wave/util/symbol_table.hpp b/include/boost/wave/util/symbol_table.hpp index b76dea2..b405272 100644 --- a/include/boost/wave/util/symbol_table.hpp +++ b/include/boost/wave/util/symbol_table.hpp @@ -57,11 +57,11 @@ struct symbol_table #endif typedef typename base_type::iterator iterator_type; typedef typename base_type::const_iterator const_iterator_type; - + symbol_table(long uid_ = 0) {} - -#if BOOST_WAVE_SERIALIZATION != 0 + +#if BOOST_WAVE_SERIALIZATION != 0 private: friend class boost::serialization::access; template diff --git a/include/boost/wave/util/transform_iterator.hpp b/include/boost/wave/util/transform_iterator.hpp index 6a4f06c..612071f 100644 --- a/include/boost/wave/util/transform_iterator.hpp +++ b/include/boost/wave/util/transform_iterator.hpp @@ -13,9 +13,7 @@ #include #include -#if BOOST_ITERATOR_ADAPTORS_VERSION >= 0x0200 #include -#endif // BOOST_ITERATOR_ADAPTORS_VERSION >= 0x0200 #include @@ -29,82 +27,6 @@ namespace boost { namespace wave { namespace impl { -#if BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - -/////////////////////////////////////////////////////////////////////////////// -// -// Transform Iterator Adaptor -// -// Upon deference, apply some unary function object and return the -// result by reference. -// -// This class is adapted from the Boost.Iterator library, where a similar -// class exists, which returns the next item by value -// -/////////////////////////////////////////////////////////////////////////////// - template - struct ref_transform_iterator_policies - : public boost::default_iterator_policies - { - ref_transform_iterator_policies() - {} - ref_transform_iterator_policies(const AdaptableUnaryFunctionT &f) - : m_f(f) {} - - template - typename IteratorAdaptorT::reference - dereference(const IteratorAdaptorT &iter) const - { return m_f(*iter.base()); } - - AdaptableUnaryFunctionT m_f; - }; - - template - class ref_transform_iterator_generator - { - typedef typename AdaptableUnaryFunctionT::result_type value_type; - - public: - typedef boost::iterator_adaptor< - IteratorT, - ref_transform_iterator_policies, - value_type, value_type const &, value_type const *, - std::input_iterator_tag> - type; - }; - - template - inline - typename ref_transform_iterator_generator< - AdaptableUnaryFunctionT, IteratorT>::type - make_ref_transform_iterator( - IteratorT base, - const AdaptableUnaryFunctionT &f = AdaptableUnaryFunctionT()) - { - typedef typename ref_transform_iterator_generator< - AdaptableUnaryFunctionT, IteratorT>::type - result_t; - return result_t(base, f); - } - - // Retrieve the token value given a parse node - // This is used in conjunction with the ref_transform_iterator above, to - // get the token values while iterating directly over the parse tree. - template - struct get_token_value { - - typedef TokenT result_type; - - TokenT const &operator()(ParseTreeNodeT const &node) const - { - BOOST_ASSERT(1 == std::distance(node.value.begin(), - node.value.end())); - return *node.value.begin(); - } - }; - -#else // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - /////////////////////////////////////////////////////////////////////////////// // // The new Boost.Iterator library already conatins a transform_iterator usable @@ -116,7 +38,7 @@ namespace impl { { typedef typename AdaptableUnaryFunctionT::result_type return_type; typedef typename AdaptableUnaryFunctionT::argument_type argument_type; - + public: typedef boost::transform_iterator< return_type (*)(argument_type), IteratorT, return_type> @@ -144,7 +66,7 @@ namespace impl { typedef TokenT const &result_type; typedef ParseTreeNodeT const &argument_type; - + static result_type transform (argument_type node) { @@ -154,8 +76,6 @@ namespace impl { } }; -#endif // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - /////////////////////////////////////////////////////////////////////////////// } // namespace impl } // namespace wave diff --git a/include/boost/wave/util/unput_queue_iterator.hpp b/include/boost/wave/util/unput_queue_iterator.hpp index 7c85570..d6519be 100644 --- a/include/boost/wave/util/unput_queue_iterator.hpp +++ b/include/boost/wave/util/unput_queue_iterator.hpp @@ -30,116 +30,6 @@ namespace boost { namespace wave { namespace util { -#if !defined(BOOST_ITERATOR_ADAPTORS_VERSION) || \ - BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - -template -class unput_queue_policies : public boost::default_iterator_policies -{ -public: - unput_queue_policies(ContainerT &unput_queue_) - : unput_queue(unput_queue_) - {} - - unput_queue_policies &operator= (unput_queue_policies const &rhs) - { - unput_queue = rhs.unput_queue; - return *this; - } - - template - void initialize(BaseT &) - {} - - template - typename IteratorAdaptorT::reference - dereference(const IteratorAdaptorT &x) const - { - if (x.policies().unput_queue.size() > 0) - return x.policies().unput_queue.front(); - return *x.base(); - } - - template - void - increment(IteratorAdaptorT &x) - { - if (x.policies().unput_queue.size() > 0) { - // there exist pending tokens in the unput queue - x.policies().unput_queue.pop_front(); - } - else { - // the unput_queue is empty, so advance the base iterator - ++x.base(); - } - } - - template - bool - equal(const IteratorAdaptorT1 &x, const IteratorAdaptorT2 &y) const - { - // two iterators are equal, if both begin() iterators of the queue objects - // are equal and the base iterators are equal as well - return - (x.policies().unput_queue.begin() == y.policies().unput_queue.begin() || - (0 == x.policies().queuesize() && 0 == y.policies().queuesize())) && - x.base() == y.base(); - } - - typename ContainerT::size_type queuesize() const - { return unput_queue.size(); } - - ContainerT &get_unput_queue() { return unput_queue; } - ContainerT const &get_unput_queue() const { return unput_queue; } - -private: - ContainerT &unput_queue; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// unput_queue_iterator -// -// The unput_queue_iterator templates encapsulates an unput_queue together -// with the direct input to be read after the unput queue is emptied -// -// This version is for the old iterator_adaptors (Boost V1.30.x) -// -/////////////////////////////////////////////////////////////////////////////// -template -class unput_queue_iterator -: public boost::iterator_adaptor< - IteratorT, unput_queue_policies, TokenT, - TokenT const &, TokenT const *> -{ - typedef - boost::iterator_adaptor< - IteratorT, unput_queue_policies, TokenT, - TokenT const &, TokenT const * - > - base_type; - typedef unput_queue_policies policies_type; - -public: - typedef ContainerT container_type; - typedef IteratorT iterator_type; - - unput_queue_iterator(IteratorT const &it, ContainerT &queue) - : base_type(it, policies_type(queue)) - {} - - ContainerT &get_unput_queue() - { return policies().get_unput_queue(); } - ContainerT const &get_unput_queue() const - { return policies().get_unput_queue(); } - IteratorT &get_base_iterator() - { return base(); } - IteratorT const &get_base_iterator() const - { return base(); } -}; - -#else // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - /////////////////////////////////////////////////////////////////////////////// // // unput_queue_iterator @@ -161,7 +51,7 @@ class unput_queue_iterator unput_queue_iterator, IteratorT, TokenT const, std::forward_iterator_tag> base_type; - + public: typedef ContainerT container_type; typedef IteratorT iterator_type; @@ -231,8 +121,6 @@ private: ContainerT &unput_queue; }; -#endif // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - namespace impl { /////////////////////////////////////////////////////////////////////////// @@ -243,9 +131,9 @@ namespace impl { typedef IteratorT iterator_type; typedef unput_queue_iterator return_type; - + static container_type last; - + static return_type generate(iterator_type const &it) { @@ -258,7 +146,7 @@ namespace impl { return return_type(it, queue); } }; - + template typename gen_unput_queue_iterator:: container_type @@ -277,9 +165,9 @@ namespace impl { iterator_type; typedef unput_queue_iterator return_type; - + static container_type last; - + static return_type generate(iterator_type &it) { @@ -292,37 +180,17 @@ namespace impl { return return_type(it.base(), queue); } }; - + /////////////////////////////////////////////////////////////////////////// template - struct assign_iterator { - + struct assign_iterator + { static void do_ (IteratorT &dest, IteratorT const &src) { dest = src; } }; - -#if !defined(BOOST_ITERATOR_ADAPTORS_VERSION) || \ - BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - - template - struct assign_iterator< - unput_queue_iterator > - { - typedef unput_queue_iterator - iterator_type; - - static void - do_ (iterator_type &dest, iterator_type const &src) - { - dest.base() = src.base(); - dest.policies() = src.policies(); - } - }; - -#endif // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 /////////////////////////////////////////////////////////////////////////// // @@ -330,8 +198,8 @@ namespace impl { // Note though, that the embedded unput_queues are not touched in any way! // template - struct next_token { - + struct next_token + { static boost::wave::token_id peek(IteratorT it, IteratorT end, bool skip_whitespace = true) { @@ -353,20 +221,20 @@ namespace impl { return T_EOI; } }; - + template struct next_token< unput_queue_iterator > { - + typedef unput_queue_iterator iterator_type; - + static boost::wave::token_id peek(iterator_type it, iterator_type end, bool skip_whitespace = true) { using namespace boost::wave; - + typename iterator_type::container_type &queue = it.get_unput_queue(); - + // first try to find it in the unput_queue if (0 != queue.size()) { typename iterator_type::container_type::iterator cit = queue.begin(); @@ -387,7 +255,7 @@ namespace impl { if (cit != cend) return token_id(*cit); } - + // second try to move on into the base iterator stream typename iterator_type::iterator_type base_it = it.get_base_iterator(); typename iterator_type::iterator_type base_end = end.get_base_iterator(); diff --git a/include/boost/wave/wave_config.hpp b/include/boost/wave/wave_config.hpp index 30fbda4..56f0ab9 100644 --- a/include/boost/wave/wave_config.hpp +++ b/include/boost/wave/wave_config.hpp @@ -193,8 +193,8 @@ #if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || \ BOOST_WORKAROUND(__MWERKS__, < 0x3200) || \ (defined(__DECCXX) && defined(__alpha)) || \ - defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) - + defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) + #define BOOST_WAVE_STRINGTYPE std::string #if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) diff --git a/include/boost/wave/wave_version.hpp b/include/boost/wave/wave_version.hpp index 7fdb0fb..7d10bec 100644 --- a/include/boost/wave/wave_version.hpp +++ b/include/boost/wave/wave_version.hpp @@ -2,7 +2,7 @@ Boost.Wave: A Standard compliant C++ preprocessor library This is the current version of the Wave library - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -16,11 +16,11 @@ // BOOST_WAVE_VERSION & 0x0000FF is the sub-minor version // BOOST_WAVE_VERSION & 0x00FF00 is the minor version // BOOST_WAVE_VERSION & 0xFF0000 is the major version -#define BOOST_WAVE_VERSION 0x020002 +#define BOOST_WAVE_VERSION 0x020003 // The following defines contain the same information as above #define BOOST_WAVE_VERSION_MAJOR 2 #define BOOST_WAVE_VERSION_MINOR 0 -#define BOOST_WAVE_VERSION_SUBMINOR 2 +#define BOOST_WAVE_VERSION_SUBMINOR 3 #endif // !defined(WAVE_VERSION_H_9D79ABDB_AC54_4C0A_89B1_F70A2DCFE21E_INCLUDED) diff --git a/include/boost/wave/whitespace_handling.hpp b/include/boost/wave/whitespace_handling.hpp index 9c2487b..637a1fe 100644 --- a/include/boost/wave/whitespace_handling.hpp +++ b/include/boost/wave/whitespace_handling.hpp @@ -73,7 +73,7 @@ class eat_whitespace { public: eat_whitespace(); - + template bool may_skip_whitespace(ContextT const& ctx, TokenT &token, bool &skipped_newline); @@ -83,7 +83,7 @@ protected: { return !preserve_comments && T_CPPCOMMENT == id; } - + private: typedef bool state_t(TokenT &token, bool &skipped_newline); state_t eat_whitespace::* state; @@ -172,7 +172,7 @@ inline bool eat_whitespace::newline_2nd(TokenT &token, bool &skipped_newline) { using namespace boost::wave; - + token_id id = token_id(token); if (T_SPACE == id || T_SPACE2 == id) return true; @@ -198,14 +198,14 @@ inline bool eat_whitespace::whitespace(TokenT &token, bool &skipped_newline) { using namespace boost::wave; - + token_id id = token_id(token); if (T_SPACE != id && T_SPACE2 != id && T_CCOMMENT != id && T_CPPCOMMENT != id) { return general(token, skipped_newline); } - + if (T_CCOMMENT == id) { if (util::ccomment_has_newline(token)) skipped_newline = true; diff --git a/samples/advanced_hooks/advanced_hooks.cpp b/samples/advanced_hooks/advanced_hooks.cpp index dcb4f77..2547946 100644 --- a/samples/advanced_hooks/advanced_hooks.cpp +++ b/samples/advanced_hooks/advanced_hooks.cpp @@ -40,7 +40,7 @@ int main(int argc, char *argv[]) std::cerr << "Usage: advanced_hooks infile" << std::endl; return -1; } - + // current file position is saved for exception handling boost::wave::util::file_position_type current_position; @@ -56,15 +56,15 @@ boost::wave::util::file_position_type current_position; instream.unsetf(std::ios::skipws); instring = std::string(std::istreambuf_iterator(instream.rdbuf()), std::istreambuf_iterator()); - + // The template boost::wave::cpplexer::lex_token<> is the token type to be // used by the Wave library. typedef boost::wave::cpplexer::lex_token<> token_type; - + // The template boost::wave::cpplexer::lex_iterator<> is the lexer type to // be used by the Wave library. typedef boost::wave::cpplexer::lex_iterator lex_iterator_type; - + // This is the resulting context type to use. The first template parameter // should match the iterator type to be used during construction of the // corresponding context object (see below). @@ -89,7 +89,7 @@ boost::wave::util::file_position_type current_position; // analyze the input file, print out the preprocessed tokens context_type::iterator_type first = ctx.begin(); context_type::iterator_type last = ctx.end(); - + while (first != last) { current_position = (*first).get_position(); std::cout << (*first).get_value(); diff --git a/samples/advanced_hooks/build/Jamfile.v2 b/samples/advanced_hooks/build/Jamfile.v2 index ed68c19..6c068b2 100644 --- a/samples/advanced_hooks/build/Jamfile.v2 +++ b/samples/advanced_hooks/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/cpp_tokens/build/Jamfile.v2 b/samples/cpp_tokens/build/Jamfile.v2 index e1a274f..6d9a023 100644 --- a/samples/cpp_tokens/build/Jamfile.v2 +++ b/samples/cpp_tokens/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/cpp_tokens/cpp_tokens.cpp b/samples/cpp_tokens/cpp_tokens.cpp index ec6d234..ad18b96 100644 --- a/samples/cpp_tokens/cpp_tokens.cpp +++ b/samples/cpp_tokens/cpp_tokens.cpp @@ -5,7 +5,7 @@ This sample shows, how it is possible to use a custom lexer type and a custom token type with the Wave library. - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost @@ -101,7 +101,7 @@ main(int argc, char *argv[]) while (first != last) { // retrieve next token current_token = *first; - + // output token info cout << "matched " << current_token << endl; ++first; diff --git a/samples/cpp_tokens/instantiate_slex_lexer.cpp b/samples/cpp_tokens/instantiate_slex_lexer.cpp index 72cbd91..829470f 100644 --- a/samples/cpp_tokens/instantiate_slex_lexer.cpp +++ b/samples/cpp_tokens/instantiate_slex_lexer.cpp @@ -3,7 +3,7 @@ Sample: Print out the preprocessed tokens returned by the Wave iterator Explicit instantiation of the lex_functor generation function - + http://www.boost.org/ Copyright (c) 2001-2009 Hartmut Kaiser. Distributed under the Boost diff --git a/samples/cpp_tokens/slex/cpp_slex_lexer.hpp b/samples/cpp_tokens/slex/cpp_slex_lexer.hpp index abbfd4b..202f87b 100644 --- a/samples/cpp_tokens/slex/cpp_slex_lexer.hpp +++ b/samples/cpp_tokens/slex/cpp_slex_lexer.hpp @@ -79,7 +79,7 @@ protected: typedef boost::spirit::classic::lexer base_type; lexer_base(); - + // initialization data (regular expressions for the token definitions) struct lexer_data { token_id tokenid; // token data diff --git a/samples/cpp_tokens/slex_interface.hpp b/samples/cpp_tokens/slex_interface.hpp index 28a9488..9a9a839 100644 --- a/samples/cpp_tokens/slex_interface.hpp +++ b/samples/cpp_tokens/slex_interface.hpp @@ -63,9 +63,9 @@ struct slex_input_interface : lex_input_interface { typedef typename lex_input_interface::position_type position_type; - + ~slex_input_interface() {} - + // 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. diff --git a/samples/cpp_tokens/slex_iterator.hpp b/samples/cpp_tokens/slex_iterator.hpp index 60446e9..e500b62 100644 --- a/samples/cpp_tokens/slex_iterator.hpp +++ b/samples/cpp_tokens/slex_iterator.hpp @@ -57,7 +57,7 @@ public: #endif // 0 != __DECCXX_VER {} -// interface to the boost::spirit::classic::multi_pass_policies::functor_input +// interface to the boost::spirit::classic::iterator_policies::functor_input // policy typedef TokenT result_type; typedef slex_iterator_functor_shim unique; @@ -68,7 +68,7 @@ public: template static result_type& get_next(MultiPass& mp, result_type& result) { - return mp.shared->ftor->get(result); + return mp.shared()->ftor->get(result); } // this will be called whenever the last reference to a multi_pass will @@ -76,20 +76,20 @@ public: template static void destroy(MultiPass& mp) { - delete mp.shared->ftor; + delete mp.shared()->ftor; } template static void set_position(MultiPass& mp, position_type const &pos) { - mp.shared->ftor->set_position(pos); + mp.shared()->ftor->set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 template static bool has_include_guards(MultiPass& mp, std::string& guard_name) { - return mp.shared->ftor->has_include_guards(guard_name); + return mp.shared()->ftor->has_include_guards(guard_name); } #endif @@ -141,16 +141,16 @@ struct make_multi_pass functor_data_type; typedef typename FunctorData::result_type result_type; - typedef boost::spirit::multi_pass_policies::split_functor_input input_policy; - typedef boost::spirit::multi_pass_policies::ref_counted ownership_policy; + typedef boost::spirit::iterator_policies::split_functor_input input_policy; + typedef boost::spirit::iterator_policies::ref_counted ownership_policy; #if defined(BOOST_WAVE_DEBUG) - typedef boost::spirit::multi_pass_policies::buf_id_check check_policy; + typedef boost::spirit::iterator_policies::buf_id_check check_policy; #else - typedef boost::spirit::multi_pass_policies::no_check check_policy; + typedef boost::spirit::iterator_policies::no_check check_policy; #endif - typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy; + typedef boost::spirit::iterator_policies::split_std_deque storage_policy; - typedef boost::spirit::multi_pass_policies::default_policy< + typedef boost::spirit::iterator_policies::default_policy< ownership_policy, check_policy, input_policy, storage_policy> policy_type; typedef boost::spirit::multi_pass type; diff --git a/samples/cpp_tokens/slex_token.hpp b/samples/cpp_tokens/slex_token.hpp index edf6940..1031a0c 100644 --- a/samples/cpp_tokens/slex_token.hpp +++ b/samples/cpp_tokens/slex_token.hpp @@ -43,11 +43,16 @@ class slex_token public: typedef BOOST_WAVE_STRINGTYPE string_type; typedef PositionT position_type; - + slex_token() : id(T_EOI) {} - + + // construct an invalid token + explicit slex_token(int) + : id(T_UNKNOWN) + {} + slex_token(token_id id_, string_type const &value_, PositionT const &pos_) : id(id_), value(value_), pos(pos_) {} @@ -57,6 +62,7 @@ public: string_type const &get_value() const { return value; } position_type const &get_position() const { return pos; } bool is_eoi() const { return id == T_EOI; } + bool is_valid() const { return id != T_UNKNOWN; } void set_token_id (token_id id_) { id = id_; } void set_value (string_type const &newval) { value = newval; } @@ -119,6 +125,18 @@ operator<< (std::ostream &stream, slex_token const &object) return stream; } +/////////////////////////////////////////////////////////////////////////////// +// This overload is needed by the multi_pass/functor_input_policy to +// validate a token instance. It has to be defined in the same namespace +// as the token class itself to allow ADL to find it. +/////////////////////////////////////////////////////////////////////////////// +template +inline bool +token_is_valid(slex_token const& t) +{ + return t.is_valid(); +} + /////////////////////////////////////////////////////////////////////////////// } // namespace cpplexer } // namespace wave diff --git a/samples/hannibal/build/Jamfile.v2 b/samples/hannibal/build/Jamfile.v2 index 169690e..827ade6 100644 --- a/samples/hannibal/build/Jamfile.v2 +++ b/samples/hannibal/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/hannibal/hannibal.cpp b/samples/hannibal/hannibal.cpp index 9d852ed..1bde630 100644 --- a/samples/hannibal/hannibal.cpp +++ b/samples/hannibal/hannibal.cpp @@ -117,7 +117,7 @@ namespace { return true; } } - + /////////////////////////////////////////////////////////////////////////////// } // unnamed namespace @@ -125,7 +125,6 @@ namespace { // main entry point int main(int argc, char *argv[]) { - po::variables_map vm; if (!parse_command_line( argc, argv, vm)) @@ -151,7 +150,7 @@ boost::wave::util::file_position_type current_position; instream.unsetf(std::ios::skipws); instring = std::string(std::istreambuf_iterator(instream.rdbuf()), std::istreambuf_iterator()); - + // The template boost::wave::cpplexer::lex_token<> is the token type to be // used by the Wave library. typedef boost::wave::cpplexer::lex_token<> token_type; @@ -159,7 +158,7 @@ boost::wave::util::file_position_type current_position; // The template boost::wave::cpplexer::lex_iterator<> is the lexer type to // be used by the Wave library. typedef boost::wave::cpplexer::lex_iterator lex_iterator_type; - + // This is the resulting context type to use. The first template parameter // should match the iterator type to be used during construction of the // corresponding context object (see below). @@ -240,7 +239,7 @@ boost::wave::util::file_position_type current_position; // analyze the input file context_type::iterator_type first = ctx.begin(); context_type::iterator_type last = ctx.end(); - + translation_unit_skipper s; #if HANNIBAL_DUMP_PARSE_TREE != 0 diff --git a/samples/lexed_tokens/build/Jamfile.v2 b/samples/lexed_tokens/build/Jamfile.v2 index 7c509da..21d12b1 100644 --- a/samples/lexed_tokens/build/Jamfile.v2 +++ b/samples/lexed_tokens/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/list_includes/build/Jamfile.v2 b/samples/list_includes/build/Jamfile.v2 index 4c0db28..eac312b 100644 --- a/samples/list_includes/build/Jamfile.v2 +++ b/samples/list_includes/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/list_includes/lexertl/lexertl_lexer.hpp b/samples/list_includes/lexertl/lexertl_lexer.hpp index 6a28baf..91e358c 100644 --- a/samples/list_includes/lexertl/lexertl_lexer.hpp +++ b/samples/list_includes/lexertl/lexertl_lexer.hpp @@ -32,14 +32,14 @@ #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES != 0 #include "wave_lexertl_tables.hpp" #else -#include "lexertl/generator.hpp" -#include "lexertl/rules.hpp" -#include "lexertl/state_machine.hpp" -#include "lexertl/consts.h" -#include "lexertl/examples/serialise.hpp" -#if BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE != 0 -#include "lexertl/examples/cpp_code.hpp" -#endif +#include +#include +#include +#include +//#include "lexertl/examples/serialise.hpp> +// #if BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE != 0 +// #include "lexertl/examples/cpp_code.hpp" +// #endif #endif /////////////////////////////////////////////////////////////////////////////// @@ -96,13 +96,13 @@ public: static std::time_t get_compilation_time() { return compilation_time.get_time(); } - bool load (istream& instrm); - bool save (ostream& outstrm); - + bool load (std::istream& instrm); + bool save (std::ostream& outstrm); + private: - ::lexertl::state_machine state_machine_; + boost::lexer::state_machine state_machine_; bool has_compiled_dfa_; - + // initialization data (regular expressions for the token definitions) struct lexer_macro_data { char_type const *name; // macro name @@ -438,7 +438,7 @@ std::ifstream dfa_in("wave_lexertl_lexer.dfa", std::ios::in|std::ios::binary); state_machine_.clear(); // register macro definitions - ::lexertl::rules rules; + boost::lexer::rules rules; for (int k = 0; NULL != init_macro_data[k].name; ++k) { rules.add_macro(init_macro_data[k].name, init_macro_data[k].macro); } @@ -458,15 +458,15 @@ std::ifstream dfa_in("wave_lexertl_lexer.dfa", std::ios::in|std::ios::binary); init_data_cpp[j].tokenid); } } - + for (int i = 0; 0 != init_data[i].tokenid; ++i) { rules.add(init_data[i].tokenregex, init_data[i].tokenid); } // generate minimized DFA try { - ::lexertl::generator::build (rules, state_machine_); - ::lexertl::generator::minimise_dfa (state_machine_); + boost::lexer::generator::build (rules, state_machine_); + boost::lexer::generator::minimise (state_machine_); } catch (std::runtime_error const& e) { string_type msg("lexertl initialization error: "); @@ -483,7 +483,7 @@ std::ifstream dfa_in("wave_lexertl_lexer.dfa", std::ios::in|std::ios::binary); if (dfa_out.is_open()) save (dfa_out); } - + has_compiled_dfa_ = true; return true; } @@ -497,11 +497,11 @@ lexertl::next_token(Iterator &first, Iterator const &last, string_type& token_value) { #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 - size_t const* const lookup = &state_machine_._lookup[0]->front (); - size_t const dfa_alphabet = state_machine_._dfa_alphabet[0]; + size_t const* const lookup = &state_machine_.data()._lookup[0]->front (); + size_t const dfa_alphabet = state_machine_.data()._dfa_alphabet[0]; - size_t const* dfa = &state_machine_._dfa[0]->front(); - size_t const* ptr = dfa + dfa_alphabet + ::lexertl::dfa_offset; + size_t const* dfa = &state_machine_.data()._dfa[0]->front(); + size_t const* ptr = dfa + dfa_alphabet + boost::lexer::dfa_offset; #else const std::size_t *ptr = dfa + dfa_offset; #endif // BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 @@ -512,13 +512,13 @@ lexertl::next_token(Iterator &first, Iterator const &last, size_t id = *(ptr + 1); while (curr != last) { - size_t const state = ptr[lookup[*curr]]; + size_t const state = ptr[lookup[int(*curr)]]; if (0 == state) break; ++curr; #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 - ptr = &dfa[state * (dfa_alphabet + ::lexertl::dfa_offset)]; + ptr = &dfa[state * (dfa_alphabet + boost::lexer::dfa_offset)]; #else ptr = &dfa[state * dfa_offset]; #endif // BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 @@ -551,15 +551,15 @@ template inline bool lexertl::load (std::istream& instrm) { -#if !defined(BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE) - std::size_t version = 0; - ::lexertl::serialise::load_as_binary(instrm, state_machine_, version); - if (version != (std::size_t)get_compilation_time()) - return false; // too new for us - return instrm.good(); -#else +// #if !defined(BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE) +// std::size_t version = 0; +// boost::lexer::serialise::load_as_binary(instrm, state_machine_, version); +// if (version != (std::size_t)get_compilation_time()) +// return false; // too new for us +// return instrm.good(); +// #else return false; // always create the dfa when generating the C++ code -#endif +// #endif } /////////////////////////////////////////////////////////////////////////////// @@ -568,12 +568,12 @@ template inline bool lexertl::save (std::ostream& outstrm) { -#if defined(BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE) - cpp_code::generate(state_machine_, outstrm); -#else - ::lexertl::serialise::save_as_binary(state_machine_, outstrm, - (std::size_t)get_compilation_time()); -#endif +// #if defined(BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE) +// cpp_code::generate(state_machine_, outstrm); +// #else +// boost::lexer::serialise::save_as_binary(state_machine_, outstrm, +// (std::size_t)get_compilation_time()); +// #endif return outstrm.good(); } #endif // #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 diff --git a/samples/list_includes/lexertl/wave_lexertl_config.hpp b/samples/list_includes/lexertl/wave_lexertl_config.hpp index 0317525..96d1ca0 100644 --- a/samples/list_includes/lexertl/wave_lexertl_config.hpp +++ b/samples/list_includes/lexertl/wave_lexertl_config.hpp @@ -17,7 +17,7 @@ // makes the code compilable even without having the lexertl library // available. #if !defined(BOOST_WAVE_LEXERTL_USE_STATIC_TABLES) -#define BOOST_WAVE_LEXERTL_USE_STATIC_TABLES 1 +#define BOOST_WAVE_LEXERTL_USE_STATIC_TABLES 0 #endif /////////////////////////////////////////////////////////////////////////////// diff --git a/samples/list_includes/lexertl_iterator.hpp b/samples/list_includes/lexertl_iterator.hpp index 5ba1145..5194af5 100644 --- a/samples/list_includes/lexertl_iterator.hpp +++ b/samples/list_includes/lexertl_iterator.hpp @@ -56,7 +56,7 @@ public: #endif // 0 != __DECCXX_VER {} -// interface to the boost::spirit::classic::multi_pass_policies::functor_input +// interface to the boost::spirit::classic::iterator_policies::functor_input // policy typedef TokenT result_type; typedef iterator_functor_shim unique; @@ -67,7 +67,7 @@ public: template static result_type& get_next(MultiPass& mp, result_type& result) { - return mp.shared->ftor->get(result); + return mp.shared()->ftor->get(result); } // this will be called whenever the last reference to a multi_pass will @@ -75,20 +75,20 @@ public: template static void destroy(MultiPass& mp) { - delete mp.shared->ftor; + delete mp.shared()->ftor; } template static void set_position(MultiPass& mp, position_type const &pos) { - mp.shared->ftor->set_position(pos); + mp.shared()->ftor->set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 template static bool has_include_guards(MultiPass& mp, std::string& guard_name) { - return mp.shared->ftor->has_include_guards(guard_name); + return mp.shared()->ftor->has_include_guards(guard_name); } #endif @@ -140,16 +140,16 @@ struct make_multi_pass functor_data_type; typedef typename FunctorData::result_type result_type; - typedef boost::spirit::multi_pass_policies::split_functor_input input_policy; - typedef boost::spirit::multi_pass_policies::ref_counted ownership_policy; + typedef boost::spirit::iterator_policies::split_functor_input input_policy; + typedef boost::spirit::iterator_policies::ref_counted ownership_policy; #if defined(BOOST_WAVE_DEBUG) - typedef boost::spirit::multi_pass_policies::buf_id_check check_policy; + typedef boost::spirit::iterator_policies::buf_id_check check_policy; #else - typedef boost::spirit::multi_pass_policies::no_check check_policy; + typedef boost::spirit::iterator_policies::no_check check_policy; #endif - typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy; + typedef boost::spirit::iterator_policies::split_std_deque storage_policy; - typedef boost::spirit::multi_pass_policies::default_policy< + typedef boost::spirit::iterator_policies::default_policy< ownership_policy, check_policy, input_policy, storage_policy> policy_type; typedef boost::spirit::multi_pass type; diff --git a/samples/quick_start/build/Jamfile.v2 b/samples/quick_start/build/Jamfile.v2 index 997b5d0..7ae4797 100644 --- a/samples/quick_start/build/Jamfile.v2 +++ b/samples/quick_start/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/real_positions/build/Jamfile.v2 b/samples/real_positions/build/Jamfile.v2 index 08d7f40..3da7c86 100644 --- a/samples/real_positions/build/Jamfile.v2 +++ b/samples/real_positions/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/real_positions/correct_token_positions.hpp b/samples/real_positions/correct_token_positions.hpp index 50e3059..2905b34 100644 --- a/samples/real_positions/correct_token_positions.hpp +++ b/samples/real_positions/correct_token_positions.hpp @@ -29,7 +29,7 @@ namespace detail } return newlines; } - + // return the length of the last line in a C style comment template unsigned last_line_length(String const& str) @@ -50,7 +50,7 @@ struct correct_token_position { correct_token_position(typename Token::string_type filename) : pos(filename) {} - + /////////////////////////////////////////////////////////////////////////// // // The function 'generated_token' will be called by the library whenever a @@ -78,15 +78,15 @@ struct correct_token_position { typedef typename Token::string_type string_type; typedef typename Token::position_type position_type; - + using namespace boost::wave; - + // adjust the current position position_type current_pos(pos); token_id id = token_id(token); string_type const& v (token.get_value()); - + switch (id) { case T_NEWLINE: case T_CPPCOMMENT: @@ -107,17 +107,17 @@ struct correct_token_position } } break; - + default: pos.set_column(current_pos.get_column() + v.size()); break; } - + // set the new position in the token to be returned token.set_corrected_position(current_pos); return token; } - + typename Token::position_type pos; }; diff --git a/samples/real_positions/instantiate_re2c_lexer.cpp b/samples/real_positions/instantiate_re2c_lexer.cpp index f4199ea..bed581c 100644 --- a/samples/real_positions/instantiate_re2c_lexer.cpp +++ b/samples/real_positions/instantiate_re2c_lexer.cpp @@ -48,9 +48,11 @@ /////////////////////////////////////////////////////////////////////////////// template struct boost::wave::cpplexer::new_lexer_gen< - BOOST_WAVE_STRINGTYPE::iterator>; + BOOST_WAVE_STRINGTYPE::iterator, boost::wave::util::file_position_type, + lex_token >; template struct boost::wave::cpplexer::new_lexer_gen< - BOOST_WAVE_STRINGTYPE::const_iterator>; + BOOST_WAVE_STRINGTYPE::const_iterator, boost::wave::util::file_position_type, + lex_token >; // the suffix header occurs after all of the code #ifdef BOOST_HAS_ABI_HEADERS diff --git a/samples/real_positions/real_position_token.hpp b/samples/real_positions/real_position_token.hpp index b9a7f5c..55941b2 100644 --- a/samples/real_positions/real_position_token.hpp +++ b/samples/real_positions/real_position_token.hpp @@ -17,6 +17,7 @@ #include #include #include +#include /////////////////////////////////////////////////////////////////////////////// namespace impl { @@ -27,11 +28,16 @@ class token_data public: typedef StringTypeT string_type; typedef PositionT position_type; - + token_data() : id(boost::wave::T_EOI), refcnt(1) {} - + + // construct an invalid token + explicit token_data(int) + : id(T_UNKNOWN), refcnt(1) + {} + token_data(boost::wave::token_id id_, string_type const &value_, position_type const &pos_) : id(id_), value(value_), pos(pos_), corrected_pos(pos_), refcnt(1) @@ -41,14 +47,14 @@ public: : id(rhs.id), value(rhs.value), pos(rhs.pos), corrected_pos(rhs.corrected_pos), refcnt(1) {} - + ~token_data() {} - + std::size_t addref() { return ++refcnt; } std::size_t release() { return --refcnt; } std::size_t get_refcnt() const { return refcnt; } - + // accessors operator boost::wave::token_id() const { return id; } string_type const &get_value() const { return value; } @@ -69,13 +75,13 @@ public: // positions return (lhs.id == rhs.id && lhs.value == rhs.value) ? true : false; } - + private: boost::wave::token_id id; // the token id string_type value; // the text, which was parsed into this token position_type pos; // the original file position position_type corrected_pos; // the original file position - std::size_t refcnt; + boost::detail::atomic_count refcnt; }; /////////////////////////////////////////////////////////////////////////////// @@ -98,11 +104,16 @@ class lex_token public: typedef BOOST_WAVE_STRINGTYPE string_type; typedef PositionT position_type; - + lex_token() : data(new impl::token_data()) {} - + + // construct an invalid token + explicit lex_token(int) + : data(new data_type(0)) + {} + lex_token(lex_token const& rhs) : data(rhs.data) { @@ -120,7 +131,7 @@ public: delete data; data = 0; } - + lex_token& operator=(lex_token const& rhs) { if (&rhs != this) { @@ -132,7 +143,7 @@ public: } return *this; } - + // accessors operator boost::wave::token_id() const { return boost::wave::token_id(*data); } @@ -142,6 +153,7 @@ public: { return data->get_position(); } position_type const &get_corrected_position() const { return data->get_corrected_position(); } + bool is_valid() const { return 0 != data && token_id(*data) != T_UNKNOWN; } void set_token_id (boost::wave::token_id id_) { make_unique(); data->set_token_id(id_); } @@ -156,8 +168,8 @@ public: { return *(lhs.data) == *(rhs.data); } - -// debug support + +// debug support #if BOOST_WAVE_DUMP_PARSE_TREE != 0 // access functions for the tree_to_xml functionality static int get_token_id(lex_token const &t) @@ -165,22 +177,34 @@ public: static string_type get_token_value(lex_token const &t) { return t.get_value(); } #endif - + private: // make a unique copy of the current object void make_unique() { if (1 == data->get_refcnt()) return; - + impl::token_data *newdata = new impl::token_data(*data); data->release(); // release this reference, can't get zero data = newdata; } - + impl::token_data *data; }; +/////////////////////////////////////////////////////////////////////////////// +// This overload is needed by the multi_pass/functor_input_policy to +// validate a token instance. It has to be defined in the same namespace +// as the token class itself to allow ADL to find it. +/////////////////////////////////////////////////////////////////////////////// +template +inline bool +token_is_valid(lex_token const& t) +{ + return t.is_valid(); +} + #endif // !defined(REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED) diff --git a/samples/real_positions/real_positions.cpp b/samples/real_positions/real_positions.cpp index e3acefb..f702d83 100644 --- a/samples/real_positions/real_positions.cpp +++ b/samples/real_positions/real_positions.cpp @@ -42,7 +42,7 @@ operator<< (std::ostream &stream, lex_token const &t) { using namespace std; using namespace boost::wave; - + token_id id = token_id(t); stream << setw(16) << left << boost::wave::get_token_name(id) << " (" @@ -60,11 +60,11 @@ operator<< (std::ostream &stream, lex_token const &t) stream << ", AltExtTokenType"; } } - + stream << "): >"; - + typedef typename lex_token::string_type string_type; - + string_type const& value = t.get_value(); for (std::size_t i = 0; i < value.size(); ++i) { switch (value[i]) { @@ -85,7 +85,7 @@ operator<< (std::ostream &stream, lex_token const &t) << setw(3) << right << t.get_corrected_position().get_line() << "/" << setw(2) << right << t.get_corrected_position().get_column() << ")"; - + return stream; } @@ -97,7 +97,7 @@ int main(int argc, char *argv[]) std::cerr << "Usage: real_positions infile" << std::endl; return -1; } - + // current file position is saved for exception handling boost::wave::util::file_position_type current_position; @@ -113,29 +113,29 @@ boost::wave::util::file_position_type current_position; instream.unsetf(std::ios::skipws); instring = std::string(std::istreambuf_iterator(instream.rdbuf()), std::istreambuf_iterator()); - + // The template real_positions::lex_token<> is the token type to be // used by the Wave library. typedef lex_token<> token_type; - + // The template boost::wave::cpplexer::lex_iterator<> is the lexer type to // be used by the Wave library. typedef boost::wave::cpplexer::lex_iterator lex_iterator_type; - + // This is the resulting context type to use. The first template parameter // should match the iterator type to be used during construction of the // corresponding context object (see below). - typedef boost::wave::context< - std::string::iterator, lex_iterator_type, - boost::wave::iteration_context_policies::load_file_to_string, - correct_token_position > - context_type; + typedef boost::wave::context< + std::string::iterator, lex_iterator_type, + boost::wave::iteration_context_policies::load_file_to_string, + correct_token_position > + context_type; // This preprocessor hooks are used to correct the file positions inside // the tokens returned from the library correct_token_position hooks(argv[1]); - + // The preprocessor iterator shouldn't be constructed directly. It is // to be generated through a wave::context<> object. This wave:context<> // object is to be used additionally to initialize and define different diff --git a/samples/token_statistics/build/Jamfile.v2 b/samples/token_statistics/build/Jamfile.v2 index 9e5a3d3..42588ea 100644 --- a/samples/token_statistics/build/Jamfile.v2 +++ b/samples/token_statistics/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/token_statistics/xlex/xlex_lexer.hpp b/samples/token_statistics/xlex/xlex_lexer.hpp index fcd90e6..459d13b 100644 --- a/samples/token_statistics/xlex/xlex_lexer.hpp +++ b/samples/token_statistics/xlex/xlex_lexer.hpp @@ -68,7 +68,7 @@ public: Position const &pos, boost::wave::language_support language); ~lexer() {} - boost::wave::cpplexer::lex_token get(); + token_type& get(token_type& t); void set_position(Position const &pos) { // set position has to change the file name and line number only @@ -453,18 +453,18 @@ lexer::lexer(Iterator const &first, /////////////////////////////////////////////////////////////////////////////// // get the next token from the input stream template -inline boost::wave::cpplexer::lex_token -lexer::get() +inline boost::wave::cpplexer::lex_token& +lexer::get(boost::wave::cpplexer::lex_token& t) { using namespace boost::wave; // to import token ids to this scope if (at_eof) - return cpplexer::lex_token(); // return T_EOI + return t = cpplexer::lex_token(); // return T_EOI std::string tokval; token_id id = xlexer.next_token(first, last, tokval); string_type value = tokval.c_str(); - + if ((token_id)(-1) == id) id = T_EOF; // end of input reached @@ -486,12 +486,13 @@ lexer::get() at_eof = true; value.clear(); } - + #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 - return guards.detect_guard(cpplexer::lex_token(id, value, - Position(filename, line, -1))); + cpplexer::lex_token tok(id, value, Position(filename, line, -1)); + return t = guards.detect_guard(tok); #else - return cpplexer::lex_token(id, value, Position(filename, line, -1)); + return t = cpplexer::lex_token(id, value, + Position(filename, line, -1)); #endif } @@ -513,21 +514,21 @@ public: xlex_functor(Iterator const &first, Iterator const &last, Position const &pos, boost::wave::language_support language) - : lexer(first, last, pos, language) + : lexer_(first, last, pos, language) {} virtual ~xlex_functor() {} // get the next token from the input stream - token_type get() { return lexer.get(); } - void set_position(Position const &pos) { lexer.set_position(pos); } + token_type& get(token_type& t) { return lexer_.get(t); } + void set_position(Position const &pos) { lexer_.set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 bool has_include_guards(std::string& guard_name) const - { return lexer.has_include_guards(guard_name); } + { return lexer_.has_include_guards(guard_name); } #endif private: - lexer lexer; + lexer lexer_; }; } // namespace lexer diff --git a/samples/token_statistics/xlex/xpressive_lexer.hpp b/samples/token_statistics/xlex/xpressive_lexer.hpp index c34413f..420f766 100644 --- a/samples/token_statistics/xlex/xpressive_lexer.hpp +++ b/samples/token_statistics/xlex/xpressive_lexer.hpp @@ -103,9 +103,9 @@ xpressive_lexer::next_token( for (iterator it = regex_list.begin(), end = regex_list.end(); it != end; ++it) { namespace xpressive = boost::xpressive; - - regex_info const& curr_regex = *it; -// xpressive::match_results regex_result; + +// regex_info const& curr_regex = *it; +// xpressive::match_results regex_result; if (xpressive::regex_search(first, last, regex_result, (*it).regex, xpressive::regex_constants::match_continuous)) { diff --git a/samples/token_statistics/xlex_interface.hpp b/samples/token_statistics/xlex_interface.hpp index 4d97656..c2eb97f 100644 --- a/samples/token_statistics/xlex_interface.hpp +++ b/samples/token_statistics/xlex_interface.hpp @@ -64,9 +64,9 @@ struct xlex_input_interface { typedef typename wave::cpplexer::lex_input_interface::position_type position_type; - + ~xlex_input_interface() {} - + // 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. diff --git a/samples/token_statistics/xlex_iterator.hpp b/samples/token_statistics/xlex_iterator.hpp index b212eab..6cf0383 100644 --- a/samples/token_statistics/xlex_iterator.hpp +++ b/samples/token_statistics/xlex_iterator.hpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include @@ -26,6 +26,12 @@ #include "xlex_interface.hpp" +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +#define BOOST_WAVE_EOF_PREFIX static +#else +#define BOOST_WAVE_EOF_PREFIX +#endif + /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace wave { @@ -42,36 +48,48 @@ namespace impl { template class xlex_iterator_functor_shim { + typedef typename TokenT::position_type position_type; + public: - template - xlex_iterator_functor_shim(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : functor_ptr(xlex_input_interface - ::new_lexer(first, last, pos, language)) + xlex_iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + : eof() +#endif // 0 != __DECCXX_VER {} -// interface to the boost::spirit::classic::multi_pass_policies::functor_input +// interface to the boost::spirit::classic::iterator_policies::functor_input // policy typedef TokenT result_type; - /*static*/ result_type const eof; - - result_type operator()() + BOOST_WAVE_EOF_PREFIX result_type const eof; + typedef xlex_iterator_functor_shim unique; + typedef lex_input_interface* shared; + + template + static result_type& get_next(MultiPass& mp, result_type& result) { - BOOST_ASSERT(0 != functor_ptr.get()); - return functor_ptr->get(); + return mp.shared()->ftor->get(result); } - void set_position(typename TokenT::position_type const &pos) + + // this will be called whenever the last reference to a multi_pass will + // be released + template + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template + static void set_position(MultiPass& mp, position_type const &pos) { - BOOST_ASSERT(0 != functor_ptr.get()); - functor_ptr->set_position(pos); + mp.shared()->ftor->set_position(pos); } - + #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 - bool has_include_guards(std::string& guard_name) const + template + static bool has_include_guards(MultiPass& mp, std::string& guard_name) { - return functor_ptr->has_include_guards(guard_name); + return mp.shared()->ftor->has_include_guards(guard_name); } #endif @@ -79,12 +97,14 @@ private: boost::shared_ptr > functor_ptr; }; +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) /////////////////////////////////////////////////////////////////////////////// // eof token -//template -//typename xlex_iterator_functor_shim::result_type const -// xlex_iterator_functor_shim::eof = -// typename xlex_iterator_functor_shim::result_type(); +template +typename xlex_iterator_functor_shim::result_type const + xlex_iterator_functor_shim::eof = + typename xlex_iterator_functor_shim::result_type(); +#endif // 0 != __COMO_VERSION__ /////////////////////////////////////////////////////////////////////////////// } // namespace impl @@ -110,51 +130,84 @@ private: // /////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template +struct make_multi_pass +{ + typedef + std::pair + functor_data_type; + typedef typename FunctorData::result_type result_type; + + typedef boost::spirit::iterator_policies::split_functor_input input_policy; + typedef boost::spirit::iterator_policies::ref_counted ownership_policy; +#if defined(BOOST_WAVE_DEBUG) + typedef boost::spirit::iterator_policies::buf_id_check check_policy; +#else + typedef boost::spirit::iterator_policies::no_check check_policy; +#endif + typedef boost::spirit::iterator_policies::split_std_deque storage_policy; + + typedef boost::spirit::iterator_policies::default_policy< + ownership_policy, check_policy, input_policy, storage_policy> + policy_type; + typedef boost::spirit::multi_pass type; +}; + +/////////////////////////////////////////////////////////////////////////////// template class xlex_iterator -: public boost::spirit::classic::multi_pass< - impl::xlex_iterator_functor_shim, - boost::wave::util::functor_input - > +: public make_multi_pass >::type { typedef impl::xlex_iterator_functor_shim input_policy_type; - typedef - boost::spirit::classic::multi_pass - base_type; - + + typedef typename make_multi_pass::type base_type; + typedef typename make_multi_pass::functor_data_type + functor_data_type; + + typedef typename input_policy_type::unique unique_functor_type; + typedef typename input_policy_type::shared shared_functor_type; + public: typedef TokenT token_type; - + xlex_iterator() {} - + template xlex_iterator(IteratorT const &first, IteratorT const &last, typename TokenT::position_type const &pos, boost::wave::language_support language) - : base_type(input_policy_type(first, last, pos, language)) + : base_type( + functor_data_type( + unique_functor_type(), + xlex_input_interface + ::new_lexer(first, last, pos, language) + ) + ) {} void set_position(typename TokenT::position_type const &pos) { typedef typename token_type::position_type position_type; - + // set the new position in the current token - token_type const& currtoken = base_type::get_input(); + token_type& currtoken = this->base_type::dereference(*this); position_type currpos = currtoken.get_position(); - + currpos.set_file(pos.get_file()); currpos.set_line(pos.get_line()); - base_type::get_input().set_position(currpos); - + currtoken.set_position(currpos); + // set the new position for future tokens as well if (token_type::string_type::npos != currtoken.get_value().find_first_of('\n')) { currpos.set_line(pos.get_line() + 1); } - base_type::get_functor().set_position(currpos); + unique_functor_type::set_position(*this, currpos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 @@ -163,9 +216,9 @@ public: // completely bool has_include_guards(std::string& guard_name) const { - return base_type::get_functor().has_include_guards(guard_name); + return unique_functor_type::has_include_guards(*this, guard_name); } -#endif +#endif }; /////////////////////////////////////////////////////////////////////////////// @@ -174,4 +227,6 @@ public: } // namespace wave } // namespace boost +#undef BOOST_WAVE_EOF_PREFIX + #endif // !defined(XLEX_ITERATOR_HPP) diff --git a/samples/waveidl/build/Jamfile.v2 b/samples/waveidl/build/Jamfile.v2 index a33462c..be6cd83 100644 --- a/samples/waveidl/build/Jamfile.v2 +++ b/samples/waveidl/build/Jamfile.v2 @@ -4,7 +4,7 @@ # # http://www.boost.org/ # -# Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost +# Copyright (c) 2001-2009 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) diff --git a/samples/waveidl/idllexer/idl.re b/samples/waveidl/idllexer/idl.re index e9aaec3..677f81c 100644 --- a/samples/waveidl/idllexer/idl.re +++ b/samples/waveidl/idllexer/idl.re @@ -5,7 +5,7 @@ http://www.boost.org/ - Copyright (c) 2001-2008 Hartmut Kaiser. Distributed under the Boost + Copyright (c) 2001-2009 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) =============================================================================*/ diff --git a/samples/waveidl/idllexer/idl_lex_interface.hpp b/samples/waveidl/idllexer/idl_lex_interface.hpp index b437a62..138a8df 100644 --- a/samples/waveidl/idllexer/idl_lex_interface.hpp +++ b/samples/waveidl/idllexer/idl_lex_interface.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include /////////////////////////////////////////////////////////////////////////////// namespace boost { @@ -56,7 +56,7 @@ struct lex_input_interface_generator : cpplexer::lex_input_interface { typedef typename cpplexer::lex_input_interface::position_type position_type; - + // 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. diff --git a/samples/waveidl/idllexer/idl_lex_iterator.hpp b/samples/waveidl/idllexer/idl_lex_iterator.hpp index c89646c..0188d27 100644 --- a/samples/waveidl/idllexer/idl_lex_iterator.hpp +++ b/samples/waveidl/idllexer/idl_lex_iterator.hpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include @@ -27,7 +27,7 @@ #include "idl_lex_interface.hpp" -#if 0 != __COMO_VERSION__ +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) #define BOOST_WAVE_EOF_PREFIX static #else #define BOOST_WAVE_EOF_PREFIX @@ -48,43 +48,54 @@ namespace impl { template class lex_iterator_functor_shim { - typedef lex_input_interface_generator lex_input_interface_type; - + typedef typename TokenT::position_type position_type; + public: - template - lex_iterator_functor_shim(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : functor_ptr(lex_input_interface_type::new_lexer(first, last, pos, language)) + lex_iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + : eof() +#endif // 0 != __DECCXX_VER {} -// interface to the boost::spirit::classic::multi_pass_policies::functor_input +// interface to the boost::spirit::classic::iterator_policies::functor_input // policy typedef TokenT result_type; BOOST_WAVE_EOF_PREFIX result_type const eof; - - result_type operator()() + typedef lex_iterator_functor_shim unique; + typedef cpplexer::lex_input_interface* shared; + + template + static result_type& get_next(MultiPass& mp, result_type& result) { - BOOST_ASSERT(0 != functor_ptr.get()); - return functor_ptr->get(); + return mp.shared()->ftor->get(result); } - void set_position(typename TokenT::position_type const &pos) + + // this will be called whenever the last reference to a multi_pass will + // be released + template + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template + static void set_position(MultiPass& mp, position_type const &pos) { - BOOST_ASSERT(0 != functor_ptr.get()); - functor_ptr->set_position(pos); + mp.shared()->ftor->set_position(pos); } - + private: boost::shared_ptr > functor_ptr; }; -#if 0 != __COMO_VERSION__ +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) /////////////////////////////////////////////////////////////////////////////// // eof token -template -typename lex_iterator_functor_shim::result_type const - lex_iterator_functor_shim::eof; +template +typename lex_iterator_functor_shim::result_type const + lex_iterator_functor_shim::eof = + typename lex_iterator_functor_shim::result_type(); #endif // 0 != __COMO_VERSION__ /////////////////////////////////////////////////////////////////////////////// @@ -109,45 +120,78 @@ typename lex_iterator_functor_shim::result_type const // /////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template +struct make_multi_pass +{ + typedef + std::pair + functor_data_type; + typedef typename FunctorData::result_type result_type; + + typedef boost::spirit::iterator_policies::split_functor_input input_policy; + typedef boost::spirit::iterator_policies::ref_counted ownership_policy; +#if defined(BOOST_WAVE_DEBUG) + typedef boost::spirit::iterator_policies::buf_id_check check_policy; +#else + typedef boost::spirit::iterator_policies::no_check check_policy; +#endif + typedef boost::spirit::iterator_policies::split_std_deque storage_policy; + + typedef boost::spirit::iterator_policies::default_policy< + ownership_policy, check_policy, input_policy, storage_policy> + policy_type; + typedef boost::spirit::multi_pass type; +}; + +/////////////////////////////////////////////////////////////////////////////// template class lex_iterator -: public boost::spirit::classic::multi_pass< - impl::lex_iterator_functor_shim, - boost::wave::util::functor_input - > +: public make_multi_pass >::type { typedef impl::lex_iterator_functor_shim input_policy_type; - typedef - boost::spirit::classic::multi_pass - base_type; - typedef lex_iterator self_type; - + + typedef typename make_multi_pass::type base_type; + typedef typename make_multi_pass::functor_data_type + functor_data_type; + + typedef typename input_policy_type::unique unique_functor_type; + typedef typename input_policy_type::shared shared_functor_type; + public: typedef TokenT token_type; - + lex_iterator() {} - + template lex_iterator(IteratorT const &first, IteratorT const &last, typename TokenT::position_type const &pos, boost::wave::language_support language) - : base_type(input_policy_type(first, last, pos, language)) + : base_type( + functor_data_type( + unique_functor_type(), + cpplexer::lex_input_interface_generator + ::new_lexer(first, last, pos, language) + ) + ) {} void set_position(typename TokenT::position_type const &pos) { typedef typename TokenT::position_type position_type; - + // set the new position in the current token - position_type currpos = base_type::get_input().get_position(); + token_type& currtoken = this->base_type::dereference(*this); + position_type currpos = currtoken.get_position(); currpos.set_file(pos.get_file()); currpos.set_line(pos.get_line()); - base_type::get_input().set_position(currpos); - + currtoken.set_position(currpos); + // set the new position for future tokens as well - base_type::get_functor().set_position(pos); + unique_functor_type::set_position(*this, currpos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 @@ -161,4 +205,6 @@ public: } // namespace wave } // namespace boost +#undef BOOST_WAVE_EOF_PREFIX + #endif // !defined(IDL_LEX_ITERATOR_HPP_7926F865_E02F_4950_9EB5_5F453C9FF953_INCLUDED) diff --git a/samples/waveidl/idllexer/idl_re.cpp b/samples/waveidl/idllexer/idl_re.cpp index 444eb7e..2c7264c 100644 --- a/samples/waveidl/idllexer/idl_re.cpp +++ b/samples/waveidl/idllexer/idl_re.cpp @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.2 on Thu Oct 09 21:18:08 2008 */ +/* Generated by re2c 0.13.5 on Fri May 22 17:28:34 2009 */ #line 1 "idl.re" /*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library @@ -439,12 +439,12 @@ scan(boost::wave::cpplexer::re2clex::Scanner *s) yych = *YYCURSOR; switch (yych) { case 0x00: goto yy69; - case 0x09: - case 0x0B: - case 0x0C: + case '\t': + case '\v': + case '\f': case ' ': goto yy64; - case 0x0A: goto yy66; - case 0x0D: goto yy68; + case '\n': goto yy66; + case '\r': goto yy68; case '!': goto yy45; case '"': goto yy63; case '#': goto yy15; @@ -584,8 +584,8 @@ yy15: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'e') { if (yych <= '"') { - if (yych <= 0x09) { - if (yych >= 0x09) goto yy239; + if (yych <= '\t') { + if (yych >= '\t') goto yy239; } else { if (yych == ' ') goto yy239; } @@ -848,9 +848,9 @@ yy61: yy62: yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0C) { - if (yych == 0x09) goto yy121; - if (yych <= 0x0A) goto yy58; + if (yych <= '\f') { + if (yych == '\t') goto yy121; + if (yych <= '\n') goto yy58; goto yy121; } else { if (yych <= 0x1F) goto yy58; @@ -860,11 +860,11 @@ yy62: yy63: yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0A) { - if (yych == 0x09) goto yy76; + if (yych <= '\n') { + if (yych == '\t') goto yy76; goto yy58; } else { - if (yych <= 0x0C) goto yy76; + if (yych <= '\f') goto yy76; if (yych <= 0x1F) goto yy58; goto yy76; } @@ -887,7 +887,7 @@ yy67: #line 888 "idl_re.cpp" yy68: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy72; + if (yych == '\n') goto yy72; goto yy67; yy69: ++YYCURSOR; @@ -915,7 +915,7 @@ yy72: goto yy67; yy73: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy74: if (yybm[256+yych] & 2) { @@ -924,7 +924,7 @@ yy74: goto yy65; yy75: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy76: if (yybm[256+yych] & 4) { @@ -987,7 +987,7 @@ yy77: } yy78: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -997,7 +997,7 @@ yy78: if (yych <= '[') goto yy91; yy79: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -1050,7 +1050,7 @@ yy81: #line 1051 "idl_re.cpp" yy82: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1064,7 +1064,7 @@ yy82: } yy83: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1078,7 +1078,7 @@ yy83: } yy84: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1089,7 +1089,7 @@ yy84: goto yy79; yy85: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 8) { goto yy88; @@ -1097,14 +1097,14 @@ yy85: goto yy77; yy86: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '"') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy75; + if (yych <= '\n') { + if (yych == '\t') goto yy75; goto yy77; } else { - if (yych <= 0x0C) goto yy75; + if (yych <= '\f') goto yy75; if (yych <= 0x1F) goto yy77; if (yych <= '!') goto yy75; goto yy80; @@ -1120,7 +1120,7 @@ yy86: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1131,17 +1131,17 @@ yy86: goto yy79; yy88: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 8) { goto yy88; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy75; + if (yych <= '\n') { + if (yych == '\t') goto yy75; goto yy77; } else { - if (yych <= 0x0C) goto yy75; + if (yych <= '\f') goto yy75; if (yych <= 0x1F) goto yy77; goto yy75; } @@ -1157,7 +1157,7 @@ yy88: } yy90: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1167,17 +1167,17 @@ yy90: if (yych >= '\\') goto yy79; yy91: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 16) { goto yy91; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy75; + if (yych <= '\n') { + if (yych == '\t') goto yy75; goto yy77; } else { - if (yych <= 0x0C) goto yy75; + if (yych <= '\f') goto yy75; if (yych <= 0x1F) goto yy77; goto yy75; } @@ -1192,15 +1192,15 @@ yy91: } yy93: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy93; } if (yych <= '7') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1227,12 +1227,12 @@ yy93: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1262,12 +1262,12 @@ yy93: } yy96: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1298,7 +1298,7 @@ yy96: yy97: yyaccept = 6; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1309,7 +1309,7 @@ yy97: goto yy79; yy98: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1318,17 +1318,17 @@ yy98: if (yych <= '"') goto yy80; if (yych >= '\\') goto yy79; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 16) { goto yy91; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy75; + if (yych <= '\n') { + if (yych == '\t') goto yy75; goto yy77; } else { - if (yych <= 0x0C) goto yy75; + if (yych <= '\f') goto yy75; if (yych <= 0x1F) goto yy77; goto yy75; } @@ -1344,12 +1344,12 @@ yy98: } yy100: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1375,12 +1375,12 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1406,12 +1406,12 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1437,12 +1437,12 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1468,12 +1468,12 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1499,12 +1499,12 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1530,7 +1530,7 @@ yy100: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1541,12 +1541,12 @@ yy100: goto yy79; yy107: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1572,12 +1572,12 @@ yy107: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy75; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; goto yy75; } else { if (yych <= '!') { @@ -1603,7 +1603,7 @@ yy107: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 4) { goto yy75; @@ -1614,7 +1614,7 @@ yy107: goto yy79; yy110: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1626,7 +1626,7 @@ yy110: } yy111: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1638,7 +1638,7 @@ yy111: } yy112: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1650,7 +1650,7 @@ yy112: } yy113: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1662,7 +1662,7 @@ yy113: } yy114: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1674,7 +1674,7 @@ yy114: } yy115: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1686,7 +1686,7 @@ yy115: } yy116: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1700,7 +1700,7 @@ yy116: } yy117: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1712,7 +1712,7 @@ yy117: } yy118: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1724,7 +1724,7 @@ yy118: } yy119: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1738,7 +1738,7 @@ yy119: } yy120: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy121: if (yybm[256+yych] & 64) { @@ -1749,7 +1749,7 @@ yy121: if (yych >= '\\') goto yy123; yy122: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -1759,7 +1759,7 @@ yy122: if (yych <= '[') goto yy135; yy123: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -1804,7 +1804,7 @@ yy123: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1818,7 +1818,7 @@ yy123: } yy125: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1832,7 +1832,7 @@ yy125: } yy126: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -1843,7 +1843,7 @@ yy126: goto yy123; yy127: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -1857,14 +1857,14 @@ yy127: } yy128: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy120; + if (yych <= '\n') { + if (yych == '\t') goto yy120; goto yy77; } else { - if (yych <= 0x0C) goto yy120; + if (yych <= '\f') goto yy120; if (yych <= 0x1F) goto yy77; if (yych <= '&') goto yy120; goto yy130; @@ -1880,7 +1880,7 @@ yy128: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -1897,12 +1897,12 @@ yy131: #line 1898 "idl_re.cpp" yy132: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -1932,7 +1932,7 @@ yy132: } yy134: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -1942,14 +1942,14 @@ yy134: if (yych >= '\\') goto yy123; yy135: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy120; + if (yych <= '\n') { + if (yych == '\t') goto yy120; goto yy77; } else { - if (yych <= 0x0C) goto yy120; + if (yych <= '\f') goto yy120; if (yych <= 0x1F) goto yy77; if (yych <= '&') goto yy120; goto yy130; @@ -1965,16 +1965,16 @@ yy135: } yy137: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '>') { if (yych <= 0x1F) { - if (yych <= 0x09) { + if (yych <= '\t') { if (yych <= 0x08) goto yy77; goto yy120; } else { - if (yych <= 0x0A) goto yy77; - if (yych <= 0x0C) goto yy120; + if (yych <= '\n') goto yy77; + if (yych <= '\f') goto yy120; goto yy77; } } else { @@ -2007,12 +2007,12 @@ yy137: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2042,12 +2042,12 @@ yy137: } yy140: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2078,7 +2078,7 @@ yy140: yy141: yyaccept = 7; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -2089,7 +2089,7 @@ yy141: goto yy123; yy142: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -2098,14 +2098,14 @@ yy142: if (yych <= '\'') goto yy130; if (yych >= '\\') goto yy123; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy120; + if (yych <= '\n') { + if (yych == '\t') goto yy120; goto yy77; } else { - if (yych <= 0x0C) goto yy120; + if (yych <= '\f') goto yy120; if (yych <= 0x1F) goto yy77; if (yych <= '&') goto yy120; goto yy130; @@ -2122,12 +2122,12 @@ yy142: } yy144: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2153,12 +2153,12 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2184,12 +2184,12 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2215,12 +2215,12 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2246,12 +2246,12 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2277,12 +2277,12 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2308,7 +2308,7 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -2319,12 +2319,12 @@ yy144: goto yy123; yy151: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2350,12 +2350,12 @@ yy151: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy120; - if (yych <= 0x0A) goto yy77; + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; goto yy120; } else { if (yych <= '&') { @@ -2381,7 +2381,7 @@ yy151: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy120; @@ -2392,7 +2392,7 @@ yy151: goto yy123; yy154: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2404,7 +2404,7 @@ yy154: } yy155: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2416,7 +2416,7 @@ yy155: } yy156: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2428,7 +2428,7 @@ yy156: } yy157: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2440,7 +2440,7 @@ yy157: } yy158: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2452,7 +2452,7 @@ yy158: } yy159: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2464,7 +2464,7 @@ yy159: } yy160: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2478,7 +2478,7 @@ yy160: } yy161: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2490,7 +2490,7 @@ yy161: } yy162: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2502,7 +2502,7 @@ yy162: } yy163: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2874,7 +2874,7 @@ yy200: yy201: yyaccept = 0; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy202: if (yybm[0+yych] & 2) { @@ -2884,24 +2884,24 @@ yy202: if (yych != '\\') goto yy5; yy203: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == 'U') goto yy207; if (yych == 'u') goto yy206; goto yy77; yy204: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych != '?') goto yy77; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '/') goto yy203; goto yy77; yy206: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2915,7 +2915,7 @@ yy206: } yy207: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2927,7 +2927,7 @@ yy207: } yy208: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2939,7 +2939,7 @@ yy208: } yy209: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2951,7 +2951,7 @@ yy209: } yy210: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2963,7 +2963,7 @@ yy210: } yy211: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2975,7 +2975,7 @@ yy211: } yy212: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2987,7 +2987,7 @@ yy212: } yy213: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -2999,7 +2999,7 @@ yy213: } yy214: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -3013,7 +3013,7 @@ yy214: } yy215: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -3025,7 +3025,7 @@ yy215: } yy216: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -3037,7 +3037,7 @@ yy216: } yy217: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy77; @@ -3156,7 +3156,7 @@ yy239: } yy240: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy330; goto yy77; @@ -3325,8 +3325,8 @@ yy300: if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; if (yych <= '!') { - if (yych <= 0x09) { - if (yych >= 0x09) goto yy300; + if (yych <= '\t') { + if (yych >= '\t') goto yy300; } else { if (yych == ' ') goto yy300; } @@ -3344,7 +3344,7 @@ yy302: #line 3345 "idl_re.cpp" yy303: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy314; goto yy77; @@ -3358,7 +3358,7 @@ yy305: goto yy307; yy306: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy307: if (yybm[0+yych] & 8) { @@ -3371,7 +3371,7 @@ yy307: #line 3372 "idl_re.cpp" yy310: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy311: if (yybm[0+yych] & 16) { @@ -3384,45 +3384,45 @@ yy311: #line 3385 "idl_re.cpp" yy314: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy314; } - if (yych == 0x0D) goto yy316; + if (yych == '\r') goto yy316; if (yych <= ')') goto yy77; goto yy318; yy316: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy314; } - if (yych == 0x0D) goto yy316; + if (yych == '\r') goto yy316; if (yych <= ')') goto yy77; yy318: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy318; } - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy77; - if (yych <= 0x0C) goto yy314; + if (yych <= '\f') goto yy314; } else { if (yych <= 0x1F) goto yy77; if (yych == '/') goto yy300; goto yy314; } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy314; } - if (yych == 0x0D) goto yy316; + if (yych == '\r') goto yy316; if (yych <= ')') goto yy77; goto yy318; yy321: @@ -3449,11 +3449,11 @@ yy327: #line 3450 "idl_re.cpp" yy330: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy77; - if (yych <= 0x0C) goto yy330; + if (yych <= '\f') goto yy330; } else { if (yych <= 0x1F) goto yy77; if (yych == '*') goto yy334; @@ -3461,11 +3461,11 @@ yy330: } yy332: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy77; - if (yych <= 0x0C) goto yy330; + if (yych <= '\f') goto yy330; goto yy332; } else { if (yych <= 0x1F) goto yy77; @@ -3473,11 +3473,11 @@ yy332: } yy334: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x08) goto yy77; - if (yych <= 0x0C) goto yy330; + if (yych <= '\f') goto yy330; if (yych >= 0x0E) goto yy77; } else { if (yych <= '*') { @@ -3489,11 +3489,11 @@ yy334: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy77; - if (yych <= 0x0C) goto yy330; + if (yych <= '\f') goto yy330; goto yy332; } else { if (yych <= 0x1F) goto yy77; @@ -3585,17 +3585,17 @@ ccomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0C) { + if (yych <= '\f') { if (yych <= 0x08) { if (yych <= 0x00) goto yy366; goto yy368; } else { - if (yych == 0x0A) goto yy362; + if (yych == '\n') goto yy362; goto yy365; } } else { if (yych <= 0x1F) { - if (yych <= 0x0D) goto yy364; + if (yych <= '\r') goto yy364; goto yy368; } else { if (yych != '*') goto yy365; @@ -3620,7 +3620,7 @@ yy363: #line 3621 "idl_re.cpp" yy364: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy370; + if (yych == '\n') goto yy370; goto yy363; yy365: yych = *++YYCURSOR; @@ -3685,14 +3685,14 @@ cppcomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0A) { + if (yych <= '\n') { if (yych <= 0x00) goto yy381; if (yych <= 0x08) goto yy375; - if (yych <= 0x09) goto yy379; + if (yych <= '\t') goto yy379; goto yy376; } else { - if (yych <= 0x0C) goto yy379; - if (yych <= 0x0D) goto yy378; + if (yych <= '\f') goto yy379; + if (yych <= '\r') goto yy378; if (yych >= ' ') goto yy379; } yy375: @@ -3709,7 +3709,7 @@ yy377: #line 3710 "idl_re.cpp" yy378: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy383; + if (yych == '\n') goto yy383; goto yy377; yy379: ++YYCURSOR; diff --git a/samples/waveidl/idllexer/idl_re2c_lexer.hpp b/samples/waveidl/idllexer/idl_re2c_lexer.hpp index aad995a..9e571b2 100644 --- a/samples/waveidl/idllexer/idl_re2c_lexer.hpp +++ b/samples/waveidl/idllexer/idl_re2c_lexer.hpp @@ -56,7 +56,7 @@ template < class lexer { typedef boost::wave::cpplexer::re2clex::Scanner scanner_t; - + public: typedef char char_t; @@ -68,7 +68,7 @@ public: PositionT const &pos, boost::wave::language_support language); ~lexer(); - boost::wave::cpplexer::lex_token get(); + token_type& get(token_type& t); void set_position(PositionT const &pos) { // set position has to change the file name and line number only @@ -82,7 +82,7 @@ public: private: static char const *tok_names[]; - + scanner_t scanner; string_type filename; bool at_eof; @@ -100,7 +100,7 @@ lexer::lexer(IteratorT const &first, { using namespace std; // some systems have memset in std using namespace boost::wave::cpplexer::re2clex; - + memset(&scanner, '\0', sizeof(scanner_t)); scanner.eol_offsets = aq_create(); scanner.first = scanner.act = (uchar *)&(*first); @@ -127,17 +127,17 @@ lexer::~lexer() /////////////////////////////////////////////////////////////////////////////// // get the next token from the input stream template -inline boost::wave::cpplexer::lex_token -lexer::get() +inline boost::wave::cpplexer::lex_token& +lexer::get(boost::wave::cpplexer::lex_token& t) { using namespace boost::wave; // to import token ids to this scope if (at_eof) - return boost::wave::cpplexer::lex_token(); // return T_EOI + return t = boost::wave::cpplexer::lex_token(); // return T_EOI token_id id = token_id(scan(&scanner)); string_type value((char const *)scanner.tok, scanner.cur-scanner.tok); - + if (T_IDENTIFIER == id) { // test identifier characters for validity (throws if invalid chars found) if (!boost::wave::need_no_character_validation(language)) { @@ -158,7 +158,7 @@ lexer::get() at_eof = true; value.clear(); } - return boost::wave::cpplexer::lex_token(id, value, + return t = boost::wave::cpplexer::lex_token(id, value, PositionT(filename, scanner.line, -1)); } @@ -197,7 +197,7 @@ class lex_functor : public lex_input_interface_generator< typename lexer::token_type > -{ +{ public: typedef typename lexer::token_type token_type; @@ -207,9 +207,9 @@ public: : lexer(first, last, pos, language) {} virtual ~lex_functor() {} - + // get the next token from the input stream - token_type get() { return lexer.get(); } + token_type& get(token_type& t) { return lexer.get(t); } void set_position(PositionT const &pos) { lexer.set_position(pos); } #if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 diff --git a/src/cpplexer/re2clex/cpp_re.cpp b/src/cpplexer/re2clex/cpp_re.cpp index b4024de..4a18214 100644 --- a/src/cpplexer/re2clex/cpp_re.cpp +++ b/src/cpplexer/re2clex/cpp_re.cpp @@ -162,7 +162,7 @@ int count_backslash_newlines(Scanner *s, uchar *cursor) { std::size_t diff, offset; int skipped = 0; - + /* figure out how many backslash-newlines skipped over unknowingly. */ diff = cursor - s->bot; offset = get_first_eol_offset(s); @@ -219,7 +219,7 @@ uchar *fill(Scanner *s, uchar *cursor) } else printf("Out of memory!\n"); - + /* get the scanner to stop */ *cursor = 0; return cursor; @@ -346,7 +346,7 @@ uchar *fill(Scanner *s, uchar *cursor) aq_enqueue(s->eol_offsets, cnt + (s->lim - s->bot)); } } - + s->lim += cnt; if (s->eof) /* eof needs adjusting if we erased backslash-newlines */ { @@ -364,37 +364,37 @@ struct uchar_wrapper uchar_wrapper (uchar *base_cursor, unsigned int column = 1) : base_cursor(base_cursor), column(column) {} - + uchar_wrapper& operator++() { ++base_cursor; ++column; return *this; } - + uchar_wrapper& operator--() { --base_cursor; --column; return *this; } - + uchar operator* () const { return *base_cursor; } - + operator uchar *() const { return base_cursor; } - + friend std::ptrdiff_t operator- (uchar_wrapper const& lhs, uchar_wrapper const& rhs) { return lhs.base_cursor - rhs.base_cursor; } - + uchar *base_cursor; unsigned int column; }; @@ -403,7 +403,7 @@ struct uchar_wrapper boost::wave::token_id scan(Scanner *s) { BOOST_ASSERT(0 != s->error_proc); // error handler must be given - + uchar_wrapper cursor (s->tok = s->cur, s->column = s->curr_column); uchar_wrapper marker (s->ptr); uchar_wrapper limit (s->lim); diff --git a/src/cpplexer/re2clex/cpp_re.inc b/src/cpplexer/re2clex/cpp_re.inc index d2c5956..3fd8db8 100644 --- a/src/cpplexer/re2clex/cpp_re.inc +++ b/src/cpplexer/re2clex/cpp_re.inc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.2 on Fri Apr 04 14:19:15 2008 */ +/* Generated by re2c 0.13.5 on Fri May 22 14:32:01 2009 */ #line 1 "cpp.re" /*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library @@ -124,11 +124,11 @@ case 0x1D: case 0x1E: case 0x1F: goto yy91; - case 0x09: - case 0x0B: - case 0x0C: goto yy82; - case 0x0A: goto yy85; - case 0x0D: goto yy87; + case '\t': + case '\v': + case '\f': goto yy82; + case '\n': goto yy85; + case '\r': goto yy87; case ' ': goto yy84; case '!': goto yy68; case '"': goto yy81; @@ -503,10 +503,10 @@ yy45: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'c') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -675,9 +675,9 @@ yy79: yy80: yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0C) { - if (yych == 0x09) goto yy142; - if (yych <= 0x0A) goto yy79; + if (yych <= '\f') { + if (yych == '\t') goto yy142; + if (yych <= '\n') goto yy79; goto yy142; } else { if (yych <= 0x1F) goto yy79; @@ -687,11 +687,11 @@ yy80: yy81: yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0A) { - if (yych == 0x09) goto yy97; + if (yych <= '\n') { + if (yych == '\t') goto yy97; goto yy79; } else { - if (yych <= 0x0C) goto yy97; + if (yych <= '\f') goto yy97; if (yych <= 0x1F) goto yy79; goto yy97; } @@ -718,7 +718,7 @@ yy86: #line 719 "cpp_re.inc" yy87: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy93; + if (yych == '\n') goto yy93; goto yy86; yy88: ++YYCURSOR; @@ -751,7 +751,7 @@ yy93: goto yy86; yy94: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy95: if (yybm[256+yych] & 16) { @@ -760,7 +760,7 @@ yy95: goto yy83; yy96: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy97: if (yybm[256+yych] & 32) { @@ -1187,7 +1187,7 @@ yy98: } yy99: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1197,7 +1197,7 @@ yy99: if (yych <= '[') goto yy112; yy100: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -1250,7 +1250,7 @@ yy102: #line 1251 "cpp_re.inc" yy103: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1264,7 +1264,7 @@ yy103: } yy104: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1278,7 +1278,7 @@ yy104: } yy105: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1289,7 +1289,7 @@ yy105: goto yy100; yy106: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy109; @@ -1297,14 +1297,14 @@ yy106: goto yy98; yy107: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '"') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; if (yych <= '!') goto yy96; goto yy101; @@ -1320,7 +1320,7 @@ yy107: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1331,17 +1331,17 @@ yy107: goto yy100; yy109: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy109; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1357,7 +1357,7 @@ yy109: } yy111: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1367,17 +1367,17 @@ yy111: if (yych >= '\\') goto yy100; yy112: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 128) { goto yy112; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1392,15 +1392,15 @@ yy112: } yy114: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 1) { goto yy114; } if (yych <= '7') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1427,12 +1427,12 @@ yy114: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1462,12 +1462,12 @@ yy114: } yy117: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1498,7 +1498,7 @@ yy117: yy118: yyaccept = 6; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1509,7 +1509,7 @@ yy118: goto yy100; yy119: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1518,17 +1518,17 @@ yy119: if (yych <= '"') goto yy101; if (yych >= '\\') goto yy100; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 128) { goto yy112; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1544,12 +1544,12 @@ yy119: } yy121: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1575,12 +1575,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1606,12 +1606,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1637,12 +1637,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1668,12 +1668,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1699,12 +1699,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1730,7 +1730,7 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1741,12 +1741,12 @@ yy121: goto yy100; yy128: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1772,12 +1772,12 @@ yy128: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1803,7 +1803,7 @@ yy128: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1814,7 +1814,7 @@ yy128: goto yy100; yy131: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1826,7 +1826,7 @@ yy131: } yy132: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1838,7 +1838,7 @@ yy132: } yy133: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1850,7 +1850,7 @@ yy133: } yy134: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1862,7 +1862,7 @@ yy134: } yy135: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1874,7 +1874,7 @@ yy135: } yy136: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1886,7 +1886,7 @@ yy136: } yy137: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1900,7 +1900,7 @@ yy137: } yy138: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1912,7 +1912,7 @@ yy138: } yy139: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1924,7 +1924,7 @@ yy139: } yy140: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1938,7 +1938,7 @@ yy140: } yy141: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy142: if (yybm[0+yych] & 2) { @@ -1949,7 +1949,7 @@ yy142: if (yych >= '\\') goto yy144; yy143: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -1959,7 +1959,7 @@ yy143: if (yych <= '[') goto yy156; yy144: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -2004,7 +2004,7 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2018,7 +2018,7 @@ yy144: } yy146: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2032,7 +2032,7 @@ yy146: } yy147: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2043,7 +2043,7 @@ yy147: goto yy144; yy148: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2057,14 +2057,14 @@ yy148: } yy149: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2080,7 +2080,7 @@ yy149: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2097,12 +2097,12 @@ yy152: #line 2098 "cpp_re.inc" yy153: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2132,7 +2132,7 @@ yy153: } yy155: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2142,14 +2142,14 @@ yy155: if (yych >= '\\') goto yy144; yy156: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2165,16 +2165,16 @@ yy156: } yy158: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '>') { if (yych <= 0x1F) { - if (yych <= 0x09) { + if (yych <= '\t') { if (yych <= 0x08) goto yy98; goto yy141; } else { - if (yych <= 0x0A) goto yy98; - if (yych <= 0x0C) goto yy141; + if (yych <= '\n') goto yy98; + if (yych <= '\f') goto yy141; goto yy98; } } else { @@ -2207,12 +2207,12 @@ yy158: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2242,12 +2242,12 @@ yy158: } yy161: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2278,7 +2278,7 @@ yy161: yy162: yyaccept = 7; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2289,7 +2289,7 @@ yy162: goto yy144; yy163: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2298,14 +2298,14 @@ yy163: if (yych <= '\'') goto yy151; if (yych >= '\\') goto yy144; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2322,12 +2322,12 @@ yy163: } yy165: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2353,12 +2353,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2384,12 +2384,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2415,12 +2415,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2446,12 +2446,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2477,12 +2477,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2508,7 +2508,7 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2519,12 +2519,12 @@ yy165: goto yy144; yy172: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2550,12 +2550,12 @@ yy172: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2581,7 +2581,7 @@ yy172: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2592,7 +2592,7 @@ yy172: goto yy144; yy175: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2604,7 +2604,7 @@ yy175: } yy176: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2616,7 +2616,7 @@ yy176: } yy177: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2628,7 +2628,7 @@ yy177: } yy178: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2640,7 +2640,7 @@ yy178: } yy179: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2652,7 +2652,7 @@ yy179: } yy180: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2664,7 +2664,7 @@ yy180: } yy181: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2678,7 +2678,7 @@ yy181: } yy182: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2690,7 +2690,7 @@ yy182: } yy183: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2702,7 +2702,7 @@ yy183: } yy184: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2809,7 +2809,7 @@ yy193: yy194: yyaccept = 1; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy195: if (yybm[0+yych] & 4) { @@ -2819,24 +2819,24 @@ yy195: if (yych != '\\') goto yy9; yy196: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == 'U') goto yy200; if (yych == 'u') goto yy199; goto yy98; yy197: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych != '?') goto yy98; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '/') goto yy196; goto yy98; yy199: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2850,7 +2850,7 @@ yy199: } yy200: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2862,7 +2862,7 @@ yy200: } yy201: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2874,7 +2874,7 @@ yy201: } yy202: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2886,7 +2886,7 @@ yy202: } yy203: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2898,7 +2898,7 @@ yy203: } yy204: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2910,7 +2910,7 @@ yy204: } yy205: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2922,7 +2922,7 @@ yy205: } yy206: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2934,7 +2934,7 @@ yy206: } yy207: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2948,7 +2948,7 @@ yy207: } yy208: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2960,7 +2960,7 @@ yy208: } yy209: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2972,7 +2972,7 @@ yy209: } yy210: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -3178,11 +3178,11 @@ yy260: yy261: if (yych <= 'h') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy260; + if (yych <= '\n') { + if (yych == '\t') goto yy260; goto yy98; } else { - if (yych <= 0x0C) goto yy260; + if (yych <= '\f') goto yy260; if (yych <= 0x1F) goto yy98; goto yy260; } @@ -3217,7 +3217,7 @@ yy261: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy377; goto yy98; @@ -3339,11 +3339,11 @@ yy296: yych = *YYCURSOR; yy297: if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy296; + if (yych <= '\n') { + if (yych == '\t') goto yy296; goto yy294; } else { - if (yych <= 0x0C) goto yy296; + if (yych <= '\f') goto yy296; if (yych <= 0x1F) goto yy294; goto yy296; } @@ -3359,7 +3359,7 @@ yy297: } yy298: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy309; goto yy98; @@ -3373,7 +3373,7 @@ yy300: goto yy302; yy301: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy302: if (yybm[0+yych] & 8) { @@ -3386,7 +3386,7 @@ yy302: #line 3387 "cpp_re.inc" yy305: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy306: if (yybm[0+yych] & 16) { @@ -3399,45 +3399,45 @@ yy306: #line 3400 "cpp_re.inc" yy309: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; goto yy313; yy311: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; yy313: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy313; } - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy309; + if (yych <= '\f') goto yy309; } else { if (yych <= 0x1F) goto yy98; if (yych == '/') goto yy296; goto yy309; } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; goto yy313; yy316: @@ -3589,11 +3589,11 @@ yy375: #line 3590 "cpp_re.inc" yy377: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; } else { if (yych <= 0x1F) goto yy98; if (yych == '*') goto yy381; @@ -3601,11 +3601,11 @@ yy377: } yy379: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; goto yy379; } else { if (yych <= 0x1F) goto yy98; @@ -3613,11 +3613,11 @@ yy379: } yy381: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; if (yych >= 0x0E) goto yy98; } else { if (yych <= '*') { @@ -3629,11 +3629,11 @@ yy381: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; goto yy379; } else { if (yych <= 0x1F) goto yy98; @@ -3663,10 +3663,10 @@ yy388: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'e') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -3780,10 +3780,10 @@ yy416: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'c') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -6135,17 +6135,17 @@ ccomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0C) { + if (yych <= '\f') { if (yych <= 0x08) { if (yych <= 0x00) goto yy933; goto yy935; } else { - if (yych == 0x0A) goto yy928; + if (yych == '\n') goto yy928; goto yy931; } } else { if (yych <= 0x1F) { - if (yych <= 0x0D) goto yy930; + if (yych <= '\r') goto yy930; goto yy935; } else { if (yych != '*') goto yy932; @@ -6171,7 +6171,7 @@ yy929: #line 6172 "cpp_re.inc" yy930: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy937; + if (yych == '\n') goto yy937; goto yy929; yy931: yych = *++YYCURSOR; @@ -6227,13 +6227,13 @@ cppcomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0A) { + if (yych <= '\n') { if (yych <= 0x00) goto yy948; if (yych <= 0x08) goto yy950; - if (yych <= 0x09) goto yy945; + if (yych <= '\t') goto yy945; } else { - if (yych <= 0x0C) goto yy945; - if (yych <= 0x0D) goto yy944; + if (yych <= '\f') goto yy945; + if (yych <= '\r') goto yy944; if (yych <= 0x1F) goto yy950; goto yy947; } @@ -6250,7 +6250,7 @@ yy943: #line 6251 "cpp_re.inc" yy944: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy952; + if (yych == '\n') goto yy952; goto yy943; yy945: ++YYCURSOR; @@ -6361,7 +6361,7 @@ yy956: if (yych >= ':') goto yy955; yy957: YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 64) { goto yy957; @@ -6382,7 +6382,7 @@ yy959: #line 6383 "cpp_re.inc" yy960: YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy960; @@ -6424,24 +6424,24 @@ yy960: } yy962: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == 'U') goto yy966; if (yych == 'u') goto yy965; goto yy955; yy963: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych != '?') goto yy955; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '/') goto yy962; goto yy955; yy965: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6455,7 +6455,7 @@ yy965: } yy966: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6467,7 +6467,7 @@ yy966: } yy967: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6479,7 +6479,7 @@ yy967: } yy968: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6491,7 +6491,7 @@ yy968: } yy969: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6503,7 +6503,7 @@ yy969: } yy970: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6515,7 +6515,7 @@ yy970: } yy971: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6527,7 +6527,7 @@ yy971: } yy972: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6539,7 +6539,7 @@ yy972: } yy973: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6553,7 +6553,7 @@ yy973: } yy974: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6565,7 +6565,7 @@ yy974: } yy975: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6577,7 +6577,7 @@ yy975: } yy976: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6850,7 +6850,7 @@ yy1002: } yy1004: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy1004; diff --git a/src/cpplexer/re2clex/strict_cpp_re.inc b/src/cpplexer/re2clex/strict_cpp_re.inc index fb60bb3..425b58b 100644 --- a/src/cpplexer/re2clex/strict_cpp_re.inc +++ b/src/cpplexer/re2clex/strict_cpp_re.inc @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.2 on Fri Apr 04 14:19:15 2008 */ +/* Generated by re2c 0.13.5 on Fri May 22 14:32:21 2009 */ #line 1 "strict_cpp.re" /*============================================================================= Boost.Wave: A Standard compliant C++ preprocessor library @@ -124,11 +124,11 @@ case 0x1D: case 0x1E: case 0x1F: goto yy91; - case 0x09: - case 0x0B: - case 0x0C: goto yy82; - case 0x0A: goto yy85; - case 0x0D: goto yy87; + case '\t': + case '\v': + case '\f': goto yy82; + case '\n': goto yy85; + case '\r': goto yy87; case ' ': goto yy84; case '!': goto yy68; case '"': goto yy81; @@ -502,10 +502,10 @@ yy45: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'c') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -674,9 +674,9 @@ yy79: yy80: yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0C) { - if (yych == 0x09) goto yy142; - if (yych <= 0x0A) goto yy79; + if (yych <= '\f') { + if (yych == '\t') goto yy142; + if (yych <= '\n') goto yy79; goto yy142; } else { if (yych <= 0x1F) goto yy79; @@ -686,11 +686,11 @@ yy80: yy81: yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); - if (yych <= 0x0A) { - if (yych == 0x09) goto yy97; + if (yych <= '\n') { + if (yych == '\t') goto yy97; goto yy79; } else { - if (yych <= 0x0C) goto yy97; + if (yych <= '\f') goto yy97; if (yych <= 0x1F) goto yy79; goto yy97; } @@ -717,7 +717,7 @@ yy86: #line 718 "strict_cpp_re.inc" yy87: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy93; + if (yych == '\n') goto yy93; goto yy86; yy88: ++YYCURSOR; @@ -750,7 +750,7 @@ yy93: goto yy86; yy94: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy95: if (yybm[256+yych] & 16) { @@ -759,7 +759,7 @@ yy95: goto yy83; yy96: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy97: if (yybm[256+yych] & 32) { @@ -1186,7 +1186,7 @@ yy98: } yy99: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1196,7 +1196,7 @@ yy99: if (yych <= '[') goto yy112; yy100: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -1249,7 +1249,7 @@ yy102: #line 1250 "strict_cpp_re.inc" yy103: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1263,7 +1263,7 @@ yy103: } yy104: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1277,7 +1277,7 @@ yy104: } yy105: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1288,7 +1288,7 @@ yy105: goto yy100; yy106: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy109; @@ -1296,14 +1296,14 @@ yy106: goto yy98; yy107: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '"') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; if (yych <= '!') goto yy96; goto yy101; @@ -1319,7 +1319,7 @@ yy107: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1330,17 +1330,17 @@ yy107: goto yy100; yy109: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 64) { goto yy109; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1356,7 +1356,7 @@ yy109: } yy111: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1366,17 +1366,17 @@ yy111: if (yych >= '\\') goto yy100; yy112: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 128) { goto yy112; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1391,15 +1391,15 @@ yy112: } yy114: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 1) { goto yy114; } if (yych <= '7') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1426,12 +1426,12 @@ yy114: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1461,12 +1461,12 @@ yy114: } yy117: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1497,7 +1497,7 @@ yy117: yy118: yyaccept = 6; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1508,7 +1508,7 @@ yy118: goto yy100; yy119: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1517,17 +1517,17 @@ yy119: if (yych <= '"') goto yy101; if (yych >= '\\') goto yy100; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 128) { goto yy112; } if (yych <= '!') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy96; + if (yych <= '\n') { + if (yych == '\t') goto yy96; goto yy98; } else { - if (yych <= 0x0C) goto yy96; + if (yych <= '\f') goto yy96; if (yych <= 0x1F) goto yy98; goto yy96; } @@ -1543,12 +1543,12 @@ yy119: } yy121: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1574,12 +1574,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1605,12 +1605,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1636,12 +1636,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1667,12 +1667,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1698,12 +1698,12 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1729,7 +1729,7 @@ yy121: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1740,12 +1740,12 @@ yy121: goto yy100; yy128: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1771,12 +1771,12 @@ yy128: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy96; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy96; + if (yych <= '\n') goto yy98; goto yy96; } else { if (yych <= '!') { @@ -1802,7 +1802,7 @@ yy128: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[256+yych] & 32) { goto yy96; @@ -1813,7 +1813,7 @@ yy128: goto yy100; yy131: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1825,7 +1825,7 @@ yy131: } yy132: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1837,7 +1837,7 @@ yy132: } yy133: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1849,7 +1849,7 @@ yy133: } yy134: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1861,7 +1861,7 @@ yy134: } yy135: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1873,7 +1873,7 @@ yy135: } yy136: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1885,7 +1885,7 @@ yy136: } yy137: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1899,7 +1899,7 @@ yy137: } yy138: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1911,7 +1911,7 @@ yy138: } yy139: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1923,7 +1923,7 @@ yy139: } yy140: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -1937,7 +1937,7 @@ yy140: } yy141: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy142: if (yybm[0+yych] & 2) { @@ -1948,7 +1948,7 @@ yy142: if (yych >= '\\') goto yy144; yy143: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -1958,7 +1958,7 @@ yy143: if (yych <= '[') goto yy156; yy144: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '`') { if (yych <= '7') { @@ -2003,7 +2003,7 @@ yy144: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2017,7 +2017,7 @@ yy144: } yy146: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2031,7 +2031,7 @@ yy146: } yy147: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2042,7 +2042,7 @@ yy147: goto yy144; yy148: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2056,14 +2056,14 @@ yy148: } yy149: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2079,7 +2079,7 @@ yy149: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2096,12 +2096,12 @@ yy152: #line 2097 "strict_cpp_re.inc" yy153: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2131,7 +2131,7 @@ yy153: } yy155: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2141,14 +2141,14 @@ yy155: if (yych >= '\\') goto yy144; yy156: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2164,16 +2164,16 @@ yy156: } yy158: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '>') { if (yych <= 0x1F) { - if (yych <= 0x09) { + if (yych <= '\t') { if (yych <= 0x08) goto yy98; goto yy141; } else { - if (yych <= 0x0A) goto yy98; - if (yych <= 0x0C) goto yy141; + if (yych <= '\n') goto yy98; + if (yych <= '\f') goto yy141; goto yy98; } } else { @@ -2206,12 +2206,12 @@ yy158: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2241,12 +2241,12 @@ yy158: } yy161: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2277,7 +2277,7 @@ yy161: yy162: yyaccept = 7; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2288,7 +2288,7 @@ yy162: goto yy144; yy163: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2297,14 +2297,14 @@ yy163: if (yych <= '\'') goto yy151; if (yych >= '\\') goto yy144; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '\'') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy141; + if (yych <= '\n') { + if (yych == '\t') goto yy141; goto yy98; } else { - if (yych <= 0x0C) goto yy141; + if (yych <= '\f') goto yy141; if (yych <= 0x1F) goto yy98; if (yych <= '&') goto yy141; goto yy151; @@ -2321,12 +2321,12 @@ yy163: } yy165: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2352,12 +2352,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2383,12 +2383,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2414,12 +2414,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2445,12 +2445,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2476,12 +2476,12 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2507,7 +2507,7 @@ yy165: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2518,12 +2518,12 @@ yy165: goto yy144; yy172: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2549,12 +2549,12 @@ yy172: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '9') { - if (yych <= 0x0C) { - if (yych == 0x09) goto yy141; - if (yych <= 0x0A) goto yy98; + if (yych <= '\f') { + if (yych == '\t') goto yy141; + if (yych <= '\n') goto yy98; goto yy141; } else { if (yych <= '&') { @@ -2580,7 +2580,7 @@ yy172: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 2) { goto yy141; @@ -2591,7 +2591,7 @@ yy172: goto yy144; yy175: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2603,7 +2603,7 @@ yy175: } yy176: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2615,7 +2615,7 @@ yy176: } yy177: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2627,7 +2627,7 @@ yy177: } yy178: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2639,7 +2639,7 @@ yy178: } yy179: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2651,7 +2651,7 @@ yy179: } yy180: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2663,7 +2663,7 @@ yy180: } yy181: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2677,7 +2677,7 @@ yy181: } yy182: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2689,7 +2689,7 @@ yy182: } yy183: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2701,7 +2701,7 @@ yy183: } yy184: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2808,7 +2808,7 @@ yy193: yy194: yyaccept = 1; YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy195: if (yybm[0+yych] & 4) { @@ -2818,24 +2818,24 @@ yy195: if (yych != '\\') goto yy9; yy196: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == 'U') goto yy200; if (yych == 'u') goto yy199; goto yy98; yy197: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych != '?') goto yy98; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '/') goto yy196; goto yy98; yy199: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2849,7 +2849,7 @@ yy199: } yy200: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2861,7 +2861,7 @@ yy200: } yy201: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2873,7 +2873,7 @@ yy201: } yy202: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2885,7 +2885,7 @@ yy202: } yy203: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2897,7 +2897,7 @@ yy203: } yy204: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2909,7 +2909,7 @@ yy204: } yy205: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2921,7 +2921,7 @@ yy205: } yy206: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2933,7 +2933,7 @@ yy206: } yy207: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2947,7 +2947,7 @@ yy207: } yy208: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2959,7 +2959,7 @@ yy208: } yy209: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -2971,7 +2971,7 @@ yy209: } yy210: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy98; @@ -3177,11 +3177,11 @@ yy260: yy261: if (yych <= 'h') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy260; + if (yych <= '\n') { + if (yych == '\t') goto yy260; goto yy98; } else { - if (yych <= 0x0C) goto yy260; + if (yych <= '\f') goto yy260; if (yych <= 0x1F) goto yy98; goto yy260; } @@ -3216,7 +3216,7 @@ yy261: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy377; goto yy98; @@ -3338,11 +3338,11 @@ yy296: yych = *YYCURSOR; yy297: if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy296; + if (yych <= '\n') { + if (yych == '\t') goto yy296; goto yy294; } else { - if (yych <= 0x0C) goto yy296; + if (yych <= '\f') goto yy296; if (yych <= 0x1F) goto yy294; goto yy296; } @@ -3358,7 +3358,7 @@ yy297: } yy298: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '*') goto yy309; goto yy98; @@ -3372,7 +3372,7 @@ yy300: goto yy302; yy301: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy302: if (yybm[0+yych] & 8) { @@ -3385,7 +3385,7 @@ yy302: #line 3386 "strict_cpp_re.inc" yy305: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy306: if (yybm[0+yych] & 16) { @@ -3398,45 +3398,45 @@ yy306: #line 3399 "strict_cpp_re.inc" yy309: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; goto yy313; yy311: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; yy313: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy313; } - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy309; + if (yych <= '\f') goto yy309; } else { if (yych <= 0x1F) goto yy98; if (yych == '/') goto yy296; goto yy309; } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 32) { goto yy309; } - if (yych == 0x0D) goto yy311; + if (yych == '\r') goto yy311; if (yych <= ')') goto yy98; goto yy313; yy316: @@ -3588,11 +3588,11 @@ yy375: #line 3589 "strict_cpp_re.inc" yy377: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; } else { if (yych <= 0x1F) goto yy98; if (yych == '*') goto yy381; @@ -3600,11 +3600,11 @@ yy377: } yy379: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; goto yy379; } else { if (yych <= 0x1F) goto yy98; @@ -3612,11 +3612,11 @@ yy379: } yy381: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; if (yych >= 0x0E) goto yy98; } else { if (yych <= '*') { @@ -3628,11 +3628,11 @@ yy381: } } ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - if (yych <= 0x0D) { + if (yych <= '\r') { if (yych <= 0x08) goto yy98; - if (yych <= 0x0C) goto yy377; + if (yych <= '\f') goto yy377; goto yy379; } else { if (yych <= 0x1F) goto yy98; @@ -3662,10 +3662,10 @@ yy388: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'e') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -3779,10 +3779,10 @@ yy416: yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'c') { if (yych <= ' ') { - if (yych <= 0x0A) { - if (yych == 0x09) goto yy261; + if (yych <= '\n') { + if (yych == '\t') goto yy261; } else { - if (yych <= 0x0C) goto yy261; + if (yych <= '\f') goto yy261; if (yych >= ' ') goto yy261; } } else { @@ -6131,17 +6131,17 @@ ccomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0C) { + if (yych <= '\f') { if (yych <= 0x08) { if (yych <= 0x00) goto yy933; goto yy935; } else { - if (yych == 0x0A) goto yy928; + if (yych == '\n') goto yy928; goto yy931; } } else { if (yych <= 0x1F) { - if (yych <= 0x0D) goto yy930; + if (yych <= '\r') goto yy930; goto yy935; } else { if (yych != '*') goto yy932; @@ -6167,7 +6167,7 @@ yy929: #line 6168 "strict_cpp_re.inc" yy930: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy937; + if (yych == '\n') goto yy937; goto yy929; yy931: yych = *++YYCURSOR; @@ -6223,13 +6223,13 @@ cppcomment: YYCTYPE yych; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - if (yych <= 0x0A) { + if (yych <= '\n') { if (yych <= 0x00) goto yy948; if (yych <= 0x08) goto yy950; - if (yych <= 0x09) goto yy945; + if (yych <= '\t') goto yy945; } else { - if (yych <= 0x0C) goto yy945; - if (yych <= 0x0D) goto yy944; + if (yych <= '\f') goto yy945; + if (yych <= '\r') goto yy944; if (yych <= 0x1F) goto yy950; goto yy947; } @@ -6246,7 +6246,7 @@ yy943: #line 6247 "strict_cpp_re.inc" yy944: yych = *++YYCURSOR; - if (yych == 0x0A) goto yy952; + if (yych == '\n') goto yy952; goto yy943; yy945: ++YYCURSOR; @@ -6357,7 +6357,7 @@ yy956: if (yych >= ':') goto yy955; yy957: YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 64) { goto yy957; @@ -6378,7 +6378,7 @@ yy959: #line 6379 "strict_cpp_re.inc" yy960: YYMARKER = ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy960; @@ -6412,24 +6412,24 @@ yy960: } yy962: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == 'U') goto yy966; if (yych == 'u') goto yy965; goto yy955; yy963: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych != '?') goto yy955; ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych == '/') goto yy962; goto yy955; yy965: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6443,7 +6443,7 @@ yy965: } yy966: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6455,7 +6455,7 @@ yy966: } yy967: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6467,7 +6467,7 @@ yy967: } yy968: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6479,7 +6479,7 @@ yy968: } yy969: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6491,7 +6491,7 @@ yy969: } yy970: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6503,7 +6503,7 @@ yy970: } yy971: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6515,7 +6515,7 @@ yy971: } yy972: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6527,7 +6527,7 @@ yy972: } yy973: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6541,7 +6541,7 @@ yy973: } yy974: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6553,7 +6553,7 @@ yy974: } yy975: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6565,7 +6565,7 @@ yy975: } yy976: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yych <= '@') { if (yych <= '/') goto yy955; @@ -6838,7 +6838,7 @@ yy1002: } yy1004: ++YYCURSOR; - if (YYLIMIT == YYCURSOR) YYFILL(1); + if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; if (yybm[0+yych] & 128) { goto yy1004; diff --git a/test/build/Jamfile.v2 b/test/build/Jamfile.v2 index eabfeca..81cd566 100644 --- a/test/build/Jamfile.v2 +++ b/test/build/Jamfile.v2 @@ -29,6 +29,7 @@ path-constant TESTWAVE_DIR : $(BOOST_ROOT)/libs/wave/test/testwave/testfiles # TESTWAVE_ARGUMENTS = -d4 # use -d4 for verbose results + --hooks=1 # test hooks as well -S$(TESTWAVE_DIR) -S$(BOOST_ROOT) -I$(BOOST_ROOT) ; diff --git a/test/testwave/testwave.cpp b/test/testwave/testwave.cpp index 8f9ed4d..5dd1ee6 100644 --- a/test/testwave/testwave.cpp +++ b/test/testwave/testwave.cpp @@ -167,12 +167,12 @@ main(int argc, char *argv[]) if (cvm.count("input")) { std::vector const &infiles = cvm["input"].as >(); - + if (9 == app.get_debuglevel()) { std::cerr << "found " << (unsigned)infiles.size() << " entries" << std::endl; } - + std::vector::const_iterator iend = infiles.end(); for (std::vector::const_iterator iit = infiles.begin(); iit != iend; ++iit) @@ -184,14 +184,14 @@ main(int argc, char *argv[]) fs::path filepath = boost::wave::util::branch_path(cfgpath) / boost::wave::util::create_path(*iit); - + if (9 == app.get_debuglevel()) { std::cerr << std::string(79, '-') << std::endl; std::cerr << "executing test: " << boost::wave::util::native_file_string(filepath) << std::endl; } - + // execute this unit test case if (!app.test_a_file( boost::wave::util::native_file_string(filepath))) @@ -209,7 +209,7 @@ main(int argc, char *argv[]) << std::endl; } ++input_count; - + if (9 == app.get_debuglevel()) { std::cerr << std::string(79, '-') << std::endl; } @@ -244,7 +244,7 @@ main(int argc, char *argv[]) << boost::wave::util::native_file_string(filepath) << std::endl; } - + if (!app.test_a_file(boost::wave::util::native_file_string(filepath))) { if (9 == app.get_debuglevel()) { diff --git a/test/testwave/testwave_app.cpp b/test/testwave/testwave_app.cpp index 070b8b4..5afc394 100644 --- a/test/testwave/testwave_app.cpp +++ b/test/testwave/testwave_app.cpp @@ -53,8 +53,8 @@ namespace { std::string &result) { typedef typename Iterator::value_type token_type; - - token_type tok = *it++; + + token_type tok = *it++; result = result + tok.get_value().c_str(); return (it == end) ? false : true; } @@ -64,7 +64,7 @@ namespace { String const& handle_quoted_filepath(String &name) { using boost::wave::util::impl::unescape_lit; - + String unesc_name = unescape_lit(name.substr(1, name.size()-2)); fs::path p (boost::wave::util::create_path(unesc_name.c_str())); @@ -79,7 +79,7 @@ namespace { { typedef typename Iterator::value_type token_type; typedef typename token_type::string_type string_type; - + if (!handle_next_token(it, end, result) || // #line !handle_next_token(it, end, result) || // whitespace !handle_next_token(it, end, result) || // number @@ -87,7 +87,7 @@ namespace { { return false; } - + using boost::wave::util::impl::unescape_lit; token_type filename = *it; @@ -133,11 +133,11 @@ testwave_app::got_expected_result(std::string const& filename, std::string const& result, std::string& expected) { using boost::wave::util::impl::escape_lit; - + std::string full_result; std::string::size_type pos = 0; std::string::size_type pos1 = expected.find_first_of("$"); - + if (pos1 != std::string::npos) { do { switch(expected[pos1+1]) { @@ -168,7 +168,7 @@ testwave_app::got_expected_result(std::string const& filename, } } break; - + case 'F': // insert base file name full_result = full_result + expected.substr(pos, pos1-pos) + escape_lit(filename); @@ -183,7 +183,7 @@ testwave_app::got_expected_result(std::string const& filename, boost::wave::util::create_path(filename), boost::wave::util::current_path()) ); - + if ('(' == expected[pos1+2]) { // the $P(basename) syntax is used std::size_t p = expected.find_first_of(")", pos1+1); @@ -224,7 +224,7 @@ testwave_app::got_expected_result(std::string const& filename, } } break; - + case 'V': // insert Boost version full_result = full_result + expected.substr(pos, pos1-pos) + BOOST_LIB_VERSION; @@ -244,7 +244,7 @@ testwave_app::got_expected_result(std::string const& filename, else { full_result = expected; } - + expected = full_result; return full_result == result; } diff --git a/tool/cpp.cpp b/tool/cpp.cpp index 40f131d..b15fb33 100644 --- a/tool/cpp.cpp +++ b/tool/cpp.cpp @@ -468,7 +468,7 @@ namespace { using namespace boost::serialization; iarchive ia(ifs); std::string version; - + ia >> make_nvp("version", version); // load version if (version == CPP_VERSION_FULL_STR) ia >> make_nvp("state", ctx); // load the internal tables from disc @@ -599,6 +599,42 @@ namespace { return true; } + /////////////////////////////////////////////////////////////////////////// + // list macro invocation counts + bool list_macro_counts(context_type const& ctx, std::string filename) + { + // open file for macro invocation count listing + std::ofstream macrocounts_out; + fs::path macrocounts_file (boost::wave::util::create_path(filename)); + + if (macrocounts_file != "-") { + macrocounts_file = fs::complete(macrocounts_file); + fs::create_directories(boost::wave::util::branch_path(macrocounts_file)); + macrocounts_out.open(macrocounts_file.string().c_str()); + if (!macrocounts_out.is_open()) { + cerr << "wave: could not open file for macro invocation count listing: " + << macrocounts_file.string() << endl; + return false; + } + } + else { + macrocounts_out.copyfmt(cout); + macrocounts_out.clear(cout.rdstate()); + static_cast &>(macrocounts_out).rdbuf(cout.rdbuf()); + } + + // list all expanded macro names and their counts in alphabetical order + std::map const& counts = + ctx.get_hooks().get_macro_counts(); + + typedef std::map::const_iterator iterator; + iterator end = counts.end(); + for (iterator it = counts.begin(); it != end; ++it) + macrocounts_out << (*it).first << "," << (*it).second << std::endl; + + return true; + } + /////////////////////////////////////////////////////////////////////////////// } // anonymous namespace @@ -636,14 +672,14 @@ int error_count = 0; std::ofstream output; std::ofstream traceout; std::ofstream includelistout; - + trace_flags enable_trace = trace_nothing; - + if (vm.count("traceto")) { // try to open the file, where to put the trace output fs::path trace_file (boost::wave::util::create_path( vm["traceto"].as())); - + if (trace_file != "-") { fs::create_directories(boost::wave::util::branch_path(trace_file)); traceout.open(trace_file.string().c_str()); @@ -667,7 +703,7 @@ int error_count = 0; // try to open the file, where to put the include list fs::path includes_file(boost::wave::util::create_path( vm["listincludes"].as())); - + if (includes_file != "-") { fs::create_directories(boost::wave::util::branch_path(includes_file)); includelistout.open(includes_file.string().c_str()); @@ -677,7 +713,7 @@ int error_count = 0; return -1; } } - enable_trace = trace_includes; + enable_trace = trace_flags(enable_trace | trace_includes); } if ((enable_trace & trace_includes) && !includelistout.is_open()) { // by default list included names to std::cout @@ -686,14 +722,14 @@ int error_count = 0; static_cast &>(includelistout). rdbuf(cout.rdbuf()); } - + // enable preserving comments mode bool preserve_comments = false; bool preserve_whitespace = false; - + if (vm.count("preserve")) { int preserve = vm["preserve"].as(); - + switch(preserve) { case 0: break; case 2: @@ -702,7 +738,7 @@ int error_count = 0; case 1: preserve_comments = true; break; - + default: cerr << "wave: bogus preserve whitespace option value: " << preserve << ", should be 0, 1, or 2" << endl; @@ -713,18 +749,23 @@ int error_count = 0; // Since the #pragma wave system() directive may cause a potential security // threat, it has to be enabled explicitly by --extended or -x bool enable_system_command = false; - + if (vm.count("extended")) enable_system_command = true; // This this the central piece of the Wave library, it provides you with // the iterators to get the preprocessed tokens and allows to configure // the preprocessing stage in advance. - bool allow_output = true; // will be manipulated from inside the hooks object + bool allow_output = true; // will be manipulated from inside the hooks object std::string default_outfile; // will be used from inside the hooks object trace_macro_expansion hooks(preserve_whitespace, output, traceout, includelistout, enable_trace, enable_system_command, allow_output, default_outfile); + + // enable macro invocation count, if appropriate + if (vm.count("macrocounts")) + hooks.enable_macro_counting(); + context_type ctx (instring.begin(), instring.end(), file_name.c_str(), hooks); #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 @@ -800,7 +841,7 @@ int error_count = 0; // add include directories to the system include search paths if (vm.count("sysinclude")) { vector syspaths = vm["sysinclude"].as >(); - + vector::const_iterator end = syspaths.end(); for (vector::const_iterator cit = syspaths.begin(); cit != end; ++cit) @@ -1046,6 +1087,10 @@ int error_count = 0; if (!list_macro_names(ctx, vm["macronames"].as())) return -1; } + if (vm.count("macrocounts")) { + if (!list_macro_counts(ctx, vm["macrocounts"].as())) + return -1; + } } catch (boost::wave::cpp_exception const &e) { // some preprocessing error @@ -1096,7 +1141,7 @@ main (int argc, char *argv[]) desc_cmdline.add_options() ("help,h", "print out program usage (this message)") ("version,v", "print the version number") - ("copyright,c", "print out the copyright statement") + ("copyright", "print out the copyright statement") ("config-file", po::value >()->composing(), "specify a config file (alternatively: @filepath)") ; @@ -1142,6 +1187,8 @@ main (int argc, char *argv[]) "list names of included files to a file [arg] or to stdout [-]") ("macronames,m", po::value(), "list all defined macros to a file [arg] or to stdout [-]") + ("macrocounts,c", po::value(), + "list macro invocation counts to a file [arg] or to stdout [-]") ("preserve,p", po::value()->default_value(0), "preserve whitespace\n" "0: no whitespace is preserved (default),\n" @@ -1194,10 +1241,10 @@ main (int argc, char *argv[]) // extract the arguments from the parsed command line vector arguments; - + std::remove_copy_if(opts.options.begin(), opts.options.end(), back_inserter(arguments), cmd_line_utils::is_argument()); - + // try to find a config file somewhere up the filesystem hierarchy // starting with the input file path. This allows to use a general wave.cfg // file for all files in a certain project. @@ -1221,7 +1268,7 @@ main (int argc, char *argv[]) input_dir = boost::wave::util::branch_path(input_dir); } } - + // if there is specified at least one config file, parse it and add the // options to the main variables_map if (vm.count("config-file")) { diff --git a/tool/cpp_version.hpp b/tool/cpp_version.hpp index d34d213..3be1fb7 100644 --- a/tool/cpp_version.hpp +++ b/tool/cpp_version.hpp @@ -10,7 +10,7 @@ #if !defined(CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED) #define CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED -#include +#include #define CPP_VERSION_MAJOR BOOST_WAVE_VERSION_MAJOR #define CPP_VERSION_MINOR BOOST_WAVE_VERSION_MINOR @@ -18,8 +18,8 @@ #define CPP_VERSION_FULL BOOST_WAVE_VERSION #define CPP_VERSION_FULL_STR BOOST_PP_STRINGIZE(CPP_VERSION_FULL) - -#define CPP_VERSION_DATE 20090309L -#define CPP_VERSION_DATE_STR "20090309" + +#define CPP_VERSION_DATE 20090602L +#define CPP_VERSION_DATE_STR "20090602" #endif // !defined(CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED) diff --git a/tool/trace_macro_expansion.hpp b/tool/trace_macro_expansion.hpp index 0b60775..877c49d 100644 --- a/tool/trace_macro_expansion.hpp +++ b/tool/trace_macro_expansion.hpp @@ -53,7 +53,8 @@ std::string BOOST_WAVE_GETSTRING(std::ostrstream& ss) enum trace_flags { trace_nothing = 0, // disable tracing trace_macros = 1, // enable macro tracing - trace_includes = 2 // enable include file tracing + trace_macro_counts = 2, // enable invocation counting + trace_includes = 4 // enable include file tracing }; /////////////////////////////////////////////////////////////////////////////// @@ -70,7 +71,7 @@ public: pragma_system_not_enabled = boost::wave::preprocess_exception::last_error_number + 1, pragma_mismatched_push_pop, }; - + bad_pragma_exception(char const *what_, error_code code, int line_, int column_, char const *filename_) throw() : boost::wave::preprocess_exception(what_, @@ -79,8 +80,7 @@ public: { } ~bad_pragma_exception() throw() {} - - + virtual char const *what() const throw() { return "boost::wave::bad_pragma_exception"; @@ -93,14 +93,14 @@ public: { return boost::wave::util::severity_remark; } - + static char const *error_text(int code) { switch(code) { case pragma_system_not_enabled: return "the directive '#pragma wave system()' was not enabled, use the " "-x command line argument to enable the execution of"; - + case pragma_mismatched_push_pop: return "unbalanced #pragma push/pop in input file(s) for option"; } @@ -111,7 +111,7 @@ public: switch(code) { case pragma_system_not_enabled: return boost::wave::util::severity_remark; - + case pragma_mismatched_push_pop: return boost::wave::util::severity_error; } @@ -140,7 +140,7 @@ class trace_macro_expansion : public boost::wave::context_policies::eat_whitespace { typedef boost::wave::context_policies::eat_whitespace base_type; - + public: trace_macro_expansion(bool preserve_whitespace_, std::ofstream &output_, std::ostream &tracestrm_, @@ -160,7 +160,16 @@ public: ~trace_macro_expansion() { } - + + void enable_macro_counting() + { + logging_flags = trace_flags(logging_flags | trace_macro_counts); + } + std::map const& get_macro_counts() const + { + return counts; + } + /////////////////////////////////////////////////////////////////////////// // // The function 'expanding_function_like_macro' is called whenever a @@ -197,6 +206,9 @@ public: ContainerT const &definition, TokenT const ¯ocall, std::vector const &arguments) { + if (enabled_macro_counting()) + count_invocation(macrodef.get_value().c_str()); + if (!enabled_macro_tracing()) return; #else @@ -209,6 +221,9 @@ public: TokenT const ¯ocall, std::vector const &arguments, IteratorT const& seqstart, IteratorT const& seqend) { + if (enabled_macro_counting()) + count_invocation(macrodef.get_value().c_str()); + if (!enabled_macro_tracing()) return false; #endif @@ -229,8 +244,8 @@ public: stream << ")" << std::endl; output(BOOST_WAVE_GETSTRING(stream)); increment_level(); - } - + } + // output definition reference { BOOST_WAVE_OSSTREAM stream; @@ -283,7 +298,7 @@ public: close_trace_body(); } open_trace_body(); - + #if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 return false; #endif @@ -312,6 +327,9 @@ public: void expanding_object_like_macro(TokenT const ¯odef, ContainerT const &definition, TokenT const ¯ocall) { + if (enabled_macro_counting()) + count_invocation(macrodef.get_value().c_str()); + if (!enabled_macro_tracing()) return; #else @@ -322,6 +340,9 @@ public: TokenT const ¯odef, ContainerT const &definition, TokenT const ¯ocall) { + if (enabled_macro_counting()) + count_invocation(macrodef.get_value().c_str()); + if (!enabled_macro_tracing()) return false; #endif @@ -335,7 +356,7 @@ public: output(BOOST_WAVE_GETSTRING(stream)); increment_level(); } - + // output definition reference { BOOST_WAVE_OSSTREAM stream; @@ -351,7 +372,7 @@ public: return false; #endif } - + /////////////////////////////////////////////////////////////////////////// // // The function 'expanded_macro' is called whenever the expansion of a @@ -375,7 +396,7 @@ public: #endif { if (!enabled_macro_tracing()) return; - + BOOST_WAVE_OSSTREAM stream; stream << boost::wave::util::impl::as_string(result) << std::endl; output(BOOST_WAVE_GETSTRING(stream)); @@ -413,7 +434,7 @@ public: output(BOOST_WAVE_GETSTRING(stream)); close_trace_body(); close_trace_body(); - + if (1 == get_level()) decrement_level(); } @@ -483,7 +504,7 @@ public: act_token.get_position()); return false; } - + // try to spawn the given argument as a system command and return the // std::cout of this process as the replacement of this _Pragma return interpret_pragma_system(ctx, pending, values, act_token); @@ -501,7 +522,7 @@ public: } return false; } - + /////////////////////////////////////////////////////////////////////////// // // The function 'opened_include_file' is called whenever a file referred @@ -534,13 +555,13 @@ public: opened_include_file(ContextT const& ctx, std::string const &relname, std::string const &absname, bool is_system_include) { - std::size_t include_depth = ctx.get_max_include_nesting_depth(); + std::size_t include_depth = ctx.get_iteration_depth(); #endif if (enabled_include_tracing()) { // print indented filename for (std::size_t i = 0; i < include_depth; ++i) includestrm << " "; - + if (is_system_include) includestrm << "<" << relname << "> (" << absname << ")"; else @@ -609,7 +630,7 @@ public: #endif } using base_type::throw_exception; - + protected: #if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 /////////////////////////////////////////////////////////////////////////// @@ -641,7 +662,7 @@ protected: if (1 == values.size()) { token_type const &value = values.front(); - + if (value.get_value() == "enable" || value.get_value() == "on" || value.get_value() == "1") @@ -718,7 +739,7 @@ protected: token_id id = util::impl::skip_whitespace(it, end); if (T_COLON == id) id = util::impl::skip_whitespace(it, end); - + // implement push/pop if (T_IDENTIFIER == id) { if ((*it).get_value() == "push") { @@ -753,12 +774,12 @@ protected: if (T_PP_NUMBER != id) return false; - + using namespace std; // some platforms have atoi in namespace std return interpret_pragma_option_preserve_set( atoi((*it).get_value().c_str()), preserve_whitespace, ctx); } - + // interpret the pragma wave option(line: [0|1|push|pop]) directive template bool @@ -785,7 +806,7 @@ protected: pragma_mismatched_push_pop, "line", act_token.get_position()); } - + // pop output line from the internal option stack ctx.set_language( enable_emit_line_directives(ctx.get_language(), line_options.top()), @@ -798,7 +819,7 @@ protected: if (T_PP_NUMBER != id) return false; - + using namespace std; // some platforms have atoi in namespace std int emit_lines = atoi((*it).get_value().c_str()); if (0 == emit_lines || 1 == emit_lines) { @@ -819,7 +840,7 @@ protected: ContextT& ctx, typename ContextT::token_type const &act_token) { namespace fs = boost::filesystem; - + // ensure all directories for this file do exist fs::create_directories(boost::wave::util::branch_path(fpath)); @@ -861,14 +882,14 @@ protected: { using namespace boost::wave; namespace fs = boost::filesystem; - + typedef typename ContextT::token_type token_type; typedef typename token_type::string_type string_type; token_id id = util::impl::skip_whitespace(it, end); if (T_COLON == id) id = util::impl::skip_whitespace(it, end); - + bool result = false; if (T_STRINGLIT == id) { namespace fs = boost::filesystem; @@ -906,7 +927,7 @@ protected: act_token.get_position()); return false; } - + // pop output option from the internal option stack output_option_type const& opts = output_options.top(); generate_output = opts.first; @@ -942,7 +963,7 @@ protected: result = interpret_pragma_option_output_close(true); } } - return result; + return result; } /////////////////////////////////////////////////////////////////////////// @@ -953,15 +974,15 @@ protected: typename ContextT::token_type const &act_token) { using namespace boost::wave; - + typedef typename ContextT::token_type token_type; typedef typename token_type::string_type string_type; typedef typename ContainerT::const_iterator const_iterator; - + const_iterator end = values.end(); for (const_iterator it = values.begin(); it != end; /**/) { bool valid_option = false; - + token_type const &value = *it; if (value.get_value() == "preserve") { // #pragma wave option(preserve: [0|1|2|push|pop]) @@ -1013,7 +1034,7 @@ protected: typedef typename token_type::string_type string_type; if (0 == values.size()) return false; // ill_formed_pragma_option - + string_type stdout_file(std::tmpnam(0)); string_type stderr_file(std::tmpnam(0)); string_type system_str(boost::wave::util::impl::as_string(values)); @@ -1023,14 +1044,14 @@ protected: if (0 != std::system(system_str.c_str())) { // unable to spawn the command string_type error_str("unable to spawn command: "); - + error_str += native_cmd; BOOST_WAVE_THROW_CTX(ctx, preprocess_exception, ill_formed_pragma_option, error_str.c_str(), act_token.get_position()); return false; } - + // rescan the content of the stdout_file and insert it as the // _Pragma replacement typedef typename ContextT::lexer_type lexer_type; @@ -1099,7 +1120,7 @@ protected: int increment_level() { return ++level; } int decrement_level() { BOOST_ASSERT(level > 0); return --level; } int get_level() const { return level; } - + bool enabled_macro_tracing() const { return (flags & trace_macros) && (logging_flags & trace_macros); @@ -1108,7 +1129,28 @@ protected: { return (flags & trace_includes); } - + bool enabled_macro_counting() const + { + return logging_flags & trace_macro_counts; + } + + void count_invocation(std::string const& name) + { + typedef std::map::iterator iterator; + typedef std::map::value_type value_type; + + iterator it = counts.find(name); + if (it == counts.end()) + { + std::pair p = counts.insert(value_type(name, 0)); + if (p.second) + it = p.first; + } + + if (it != counts.end()) + ++(*it).second; + } + void timer(TokenT const &value) { if (value.get_value() == "0" || value.get_value() == "restart") { @@ -1144,14 +1186,16 @@ private: bool& generate_output; // allow generated tokens to be streamed to output std::string const& default_outfile; // name of the output file given on command line boost::filesystem::path current_outfile; // name of the current output file - + stop_watch elapsed_time; // trace timings std::time_t started_at; // time, this process was started at - + typedef std::pair output_option_type; std::stack output_options; // output option stack std::stack line_options; // line option stack std::stack preserve_options; // preserve option stack + + std::map counts; // macro invocation counts }; #undef BOOST_WAVE_GETSTRING