diff --git a/ChangeLog b/ChangeLog
index 9fc4360..5dc9f52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,41 @@ TODO (known issues):
- Do a sourceforge release.
+- Moved all of the #pragma wave option(value) operators out of the wavelib into
+ the wave driver program. Removed enable_trace() and trace_flags() policy
+ functions. Renamed trace_policy into context_policy.
+- Added the defined_macro() and undefined_macro() preprocessing hooks to allow
+ easily to build macro cross referencers and such.
+
+Version 1.1.8
+- Replaced the usage of the string::erase() and string::insert() functions,
+ which were the only non-const string member functions used.
+- Token pasting is now well defined in variadics mode (was in C++0x mode only).
+- Changed the timing code in the wave driver to include the parsing of
+ files included by the --forceinclude command line switch.
+- Performance measurements (very informal) [sec], the files are some of the
+ preprocessor specific test cases from Paul Mensonides chaos_pp library.
+
+ std::string flex_string const_string const_string
+ 12 Byte 28 Byte
+ arithmetic.cpp 2.543 1.742 0.951 1.001
+ array.cpp 2.453 1.762 0.951 1.011
+ comparison.cpp 0.560 0.340 0.270 0.280
+ control.cpp 0.590 0.340 0.290 0.300
+ debug.cpp 0.370 0.310 0.190 0.190
+ detection.cpp 0.050 0.060 0.030 0.030
+ extended.cpp 0.370 0.260 0.190 0.190
+ facilities.cpp 0.610 0.340 0.290 0.300
+ iteration.cpp 1.081 0.550 0.410 0.450
+ list.cpp 1.742 1.141 0.811 0.851
+ logical.cpp 0.070 0.200 0.040 0.040
+ punctuation.cpp 0.030 0.080 0.020 0.020
+ repetition.cpp 1.392 0.851 0.650 0.690
+ selection.cpp 0.440 0.270 0.210 0.220
+ slot.cpp 0.680 0.350 0.240 0.270
+ tuple.cpp 0.420 0.240 0.190 0.210
+
+
Wed Aug 25 13:23:27 WEDT 2004
Version 1.1.7
- Branched for Boost Release.
diff --git a/build/Jamfile b/build/Jamfile
index 625faa3..1fc8bb4 100644
--- a/build/Jamfile
+++ b/build/Jamfile
@@ -36,7 +36,7 @@ lib boost_wave
# : ../src/$(SOURCES).cpp
# : # build requirements
# [ common-names ] # magic for install and auto-link features
-#
If the template parameter TracePolicyT is omitted, the wave::macro_trace_policies::no_tracing policy type is used, i.e. by default there is no tracing performed. For further - information about the tracing policy, please refer to the topic The + information about the tracing policy, please refer to the topic The Tracing Policy.
The boost::wave::context template defines the following public typedefs, which may be useful while using this class:
diff --git a/doc/class_reference_tracepolicy.html b/doc/class_reference_contextpolicy.html similarity index 68% rename from doc/class_reference_tracepolicy.html rename to doc/class_reference_contextpolicy.html index 04236bc..02cee53 100644 --- a/doc/class_reference_tracepolicy.html +++ b/doc/class_reference_contextpolicy.html @@ -1,7 +1,7 @@ -
Introduction
- Header 'wave/trace_policies.hpp' + Header 'wave/preprocessing_hooks.hpp' synopsis
Member functions
There is implemented an unique tracing facility as a part of the Wave - library, which allows to selectively trace all stages of the macro expansion - process, involving the argument expansion and the rescanning of the replacement - results. This tracing facility greatly helps to understand foreign code or to - debug your own macros.
-The tracing policy is used to trace the macro expansion of macros whenever - it is requested from inside the input stream to preprocess through the #pragma wave_option(trace: enable) - (or _Pragma("wave trace(enable)")) directive. The macro - tracing may be disabled again with the help of a #pragma wave_option(trace: - disable) (or _Pragma("wave trace(disable)")) directive. - Note though, that the Wave driver executable requires additionally - to specify the -t (--trace) command line option, which defines - the stream, where the trace output goes.
+The context policy is used to provide callback hooks, which are called from inside the library into the user code, whenever
+This policy type is used as a template parameter to the wave::context<> - object, where the default policy does no tracing at all.
-namespace boost { namespace wave { -namespace trace_policies { +namespace context_policies { - enum trace_flags { - trace_nothing = 0, // disable tracing - trace_macros = 1, // enable macro tracing - trace_includes = 2 // enable include file tracing - }; - - struct default_tracing { + struct default_preprocessing_hooks { // general control function - void enable_tracing(trace_flags enable); - trace_flags tracing_enabled(); - - // macro tracing functions - template <typename TokenT, typename ContainerT> + template <typename TokenT, typename ContainerT> void expanding_function_like_macro(TokenT const ¯odef, std::vector<TokenT> const &formal_args, ContainerT const &definition, TokenT const ¯ocall, @@ -88,32 +72,29 @@ void returning_from_include_file(); - // interpretation of unknown #pragma's - template <typename TokenT, typename ContainerT> - bool interpret_pragma(ContainerT &pending, - TokenT const &option, ContainerT const &values, - TokenT const &pragma_token, language_support language); + // interpretation of #pragma's of the form + // 'wave option[(value)]' + template <typename ContextT, typename ContainerT> + bool interpret_pragma(ContextT const &ctx, ContainerT &pending, + typename ContextT::token_type const &option, + ContainerT const &values, + typename ContextT::token_type const &pragma_token); + + // macro definition hooks + template < + typename TokenT, typename ParametersT, typename DefinitionT + > + void defined_macro(TokenT const &name, bool is_functionlike, + ParametersT const ¶meters, DefinitionT const &definition, + bool is_predefined); + + template <typename StringT> + void undefined_macro(StringT const &name); }; -} // namespace macro_trace_policy -} -+}}} // namespace boost::wave::context_policies
void enable_tracing(trace_flags enable);-
-- -The function enable_tracing is called, whenever the status of the - tracing was changed from inside the stream to preprocess.
-The parameter enable is to be used as the new tracing status.
-
trace_flags tracing_enabled();
---The function tracing_enabled should return the current tracing status.
-
template <typename TokenT, typename ContainerT> void expanding_function_like_macro(TokenT const ¯odef, @@ -181,7 +162,7 @@ expansion. This is a standard STL container containing the generated token sequence. -Include file tracing functions
+Include file tracing functions
void opened_include_file(std::string const &filename, std::size_t include_depth, bool is_system_include); @@ -203,16 +184,19 @@The function returning_from_include_file is called, whenever an included file is about to be closed after it's processing is complete.
+Interpretation of #pragma's
-template <typename TokenT, typename ContainerT> - bool interpret_pragma(ContainerT &pending, - TokenT const &option, ContainerT const &values, - TokenT const &pragma_token, language_support language); +template <typename Context, typename ContainerT> + bool interpret_pragma(ContextT const &ctx, ContainerT &pending, + typename ContextT::token_type const &option, + ContainerT const &values, + typename ContextT::token_type const &pragma_token);+The function interpret_pragma is called, whenever an unrecognized #pragma wave ... or operator _Pragma("wave ...") is found in the input stream.
+The ctx parameter provides a reference to the context_type used during instatiation of the preprocessing iterators by the user.
The pending parameter may be used to push tokens back into the input stream, which are to be used as the replacement text for the whole #pragma wave() directive. If this sequence is left empty, no replacement takes place, i.e. @@ -222,13 +206,43 @@ the pragma operator.
The pragma_token parameter contains the actual #pragma token, which may be used for extraction of the location information for some error output.
-The language parameter contains the current language mode, in which - the Wave library operates.
If the return value is 'false', the whole #pragma directive is interpreted as unknown and a corresponding error message is issued. A return value of 'true' signs a successful interpretation of the given #pragma.
Macro definition
+ +template < + typename TokenT, typename ParametersT, typename DefinitionT + > + void defined_macro(TokenT const &name, bool is_functionlike, + ParametersT const ¶meters, DefinitionT const &definition, + bool is_predefined); +++ +The function defined_macro is called, whenever a macro was defined successfully.
+The parameter name is a reference to the token holding the macro name.
+The parameter is_functionlike is set to true, whenever the newly + defined macro is defined as a function like macro.
+The parameter parameters holds the parameter tokens for the macro + definition. If the macro has no parameters or if it is a object like + macro, then this container is empty.
+The parameter definition contains the token sequence given as the + replacement sequence (definition part) of the newly defined macro.
+The parameter is_predefined is set to true for all macros predefined + during the initialisation pahase of the library.
+
+template <typename StringT> + void undefined_macro(StringT const &name); +++The function undefined_macro is called, whenever a macro definition + was removed successfully.
+The parameter name holds the name of the macro, which definition was removed.
+
+
| @@ -243,7 +257,7 @@ 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) |