Boost.Wave: A Standard compliant C++ preprocessor library http://www.boost.org/ Copyright (c) 2001-2013 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) ------------------------------------------------------------------------------- TODO (known issues): - Fix expansion of macros, which replacement-list terminates in a partial macro expansion. - Try to remove the second parameter from the pp_iterator<>::force_include function. - Fix the trigraph backslash problem in the re2c (C/C++ and IDL) scanners, if there is the end of the (internal) buffer just in between a '??/' and a '\n'. ------------------------------------------------------------------------------- CHANGELOG Boost V1.73: - Fixed TRAC #7822: waveidl sample does not use the IDL lexer - Fixed TRAC #9874: Turning off 'include_next' support breaks include - Fixed a typedef shadowing a class (MSVC warning 4458) - Conrad Poelman - Updated waveidl to match recent changes in the RE2C lexer - Samples now build cleanly - Ensured samples and wave driver are covered by continuous integration Boost V1.55: - Fixed #8848: Wave driver improperly processes 0xFFFFui64 token - Fixed #9098: Wave driver option --c++0x invalid Boost V1.54: - Fixed #8478: Make Boost.wave compatible with Clang's -Wimplicit-fallthrough diagnostic. Boost V1.53: - Fixed a problem with context<>::add_macro_definition which sometimes appended a superfluous T_EOF to the macro replacement list. Boost V1.52.0: - Added util::create_directories() wrapper to account for new behavior of boost::filesystem::create_directories(). - Fixed an obscure problem when preprocessing directives wouldn't be recognized if the previous line contained nothing but an empty macro invocation (see new test case t_9_023.cpp) - Added a new command line option --license= to the Wave driver tool which allows to pre-pend the content of a (license) file to every newly created file. This option simplifies the implementation of partial preprocessing as done on Phoenix, Fusion, etc. - Changed the effect of the -N command line option to simply not expand the macro by pretending it was not defined. Earlier the whole invocation sequence was skipped, now we skip only the macro itself, which still expands the arguments for the macro invocation. - Fixed a couple of compilation warnings Boost V1.51.0 - Fixed #7050: Invalid memory write bug in lexing_exception - Fixed #7159: Text-lines are processed as if they were preprocessing directives - Changed --c++0x command line option to --c++11. Boost V1.50.0 - V2.3.2 - Fixed #6758: not all members are initialized by base_iteration_context constructor. - Fixed #6838: Adding include file with force_include makes Wave fail to emit #line directive - Added support for test of --forceinclude option to testwave executable, added test case verifying #6838 is fixed. - Fixed #6870: build wave driver failed Boost V1.48.0 - V2.3.1 - Added the flag support_option_emit_contnewlines allowing to control whether backslash newline sequences are emitted by the Wave library. The default is as before: these tokens will be silently ignored (after the token positions have been properly updated). Note: this option is supported by the SLex lexer module only. - Fixed #5887: flex_string.hpp needs to include Boost V1.47.0 - V2.3.0 - After preprocessing the body of any #pragma wave option() the wave tool now concatenates all adjacent string literals into a single string literal. - Fixed whitespace handling, added a corresponding set of test cases (t_9_020.cpp) - Added a new preprocessing hook: locate_include_file allowing to customize the way include files are located. - Added new command line option --noexpand/-N to the Wave driver allowing to suppress macro expansion for a given macro name (works for both, object like and function like macros). This option has to be used very carefully as it not only leaves the whole macro invocation untouched in the generated output but also removes this macro from consideration for Wave itself. This can cause unexpected results if the suppressed macro would influence #ifdef's later on. - Fixed Wave driver to retain all macros defined on the command line in interactive mode. - Fixed problem #5554: wave slex parser eof without eol skips the last line. - Added the compile time configuartion option BOOST_WAVE_WCHAR_T_SIGNEDNESS, which can be set to BOOST_WAVE_WCHAR_T_AUTOSELECT, BOOST_WAVE_WCHAR_T_FORCE_SIGNED, or BOOST_WAVE_WCHAR_T_FORCE_UNSIGNED), it defaults to autoßselect. - Fixed a problem in teh wave driver tool related to #pragma option(output). If wave was invoked in rapid succession this erroneously appended to an existing file instead of overwriting that file. - Fixed #5569: slex CONTLINE token works only for LF line endings Boost V1.46.0 - V2.2.0 - Added recognition of C++0x keywords to Re2C lexers. - Added --c++0x command line option to Wave to enabling the recognition of C++0x keywords, converting those to C++0x tokens. - Adapted all of the library to play well with Boost.Filesystem V3 (which is the default from now on). - Added support for extended character and string literals, added test case (which required to add C++0x support to the test application). - Added proper predefined macros fro --c++0x mode. __cplusplus is currently defined to 201101L, but this will change when the Standard is finalized. - Fixed a problem with object like macros, which when being adjacent to a parenthesis, caused the parenthesis to disappear when the macro expansion was suppressed by the expanding_object_like_macro() hook function. - Fixed a bug in pragma option(preserve), missing to set to preserve=1 if after the previous value was preserve=2. - Changed the --preserve option of the wave tool to interprete the integer argument in a slightly different way: 0: no whitespace is preserved, 1: only begin of line whitespace is preserved, 2: only begin of line whitespace and comments are preserved, 3: all whitespace is preserved The #pragma wave option(preserve) now supports these arguments: [0|1|2|3|push|pop]. Boost V1.45.0 - V2.1.0 - Token pasting is well formed only as long as the formed token(s) are pp_tokens as defined by the C++0x Standard. Until now, Wave allowed for non-pp_tokens to be formed in --variadics mode. - Fixed a problem, which prevented reporting /##/ in a macro definition as invalid token pasting. - Fixed problem preventing the skipped_token hook to be called for 'inactive' conditional preprocessing directive tokens. Improved overall consistency in reporting skipped tokens to the hooks function when processing conditional preprocessing directives. Added a new test case verifying the skipped_token hook gets called reproducibly (t_2_020.cpp). - Fixed a problem with the pp hooks 'expanding_object_like_macro' and 'expanding_function_like_macro', which when returning true were stopping all preprocessing instead of just inhibiting the expansion of the macro. - Fixed a duplicated call to the pp hook skipped_token for preprocessing directives inside inactive conditional branches. - Changing exception handling to fix clang++ regression errors. - Replaced assert() with BOOST_ASSERT to pacify the Boost inspect tool. Boost V1.44.0 - V2.0.6 - Added information about the file type to iteration context. This can be either main_file, system_header, or user_header depending whether the handled file is the main file to preprocess, a include file opened from `#include <>`, or a include file opened from `#include ""`. - Added support for new Boost visibility macros. Properly exported all exceptions, etc. Boost V1.43.0 - V2.0.5 - Fixed the wave driver application to strip leading and trailing whitespace from macro names specified on the command line using -U. - Fixed line number counting for lines containing nothing but whitespace followed by a C++ comment if the next line is a pp directive. - Fixed emitting of a #line directive after returned from an include file. - A couple of fixes allowing to properly report the current line number in #line directives for different whitespace preserve modes (see --preserve/-p). - Added new preprocessing hook: emit_line_directive, allowing to customize the format of the generated #line directive. - Changed --line/-l command line option of the wave driver application to accept 0, 1, and 2 as options. The option values 0 and 1 behave as before (disable/enable the generation of #line directives), while the option value 2 will generate the #line directive using the relative filename (instead of the absolute filename emitted from option 1). The default option is value 1. - Added new example: emit_custom_line_directives, demonstrating the use of the new preprocessing hook. - Added new preprocessing hook: found_unknown_directive, which is being invoked whenever an unknown preprocessor directive (i.e. '#' followed by some identifier) is detected. It allows to interpret the directive and to provide some replacement text. - Added new example: custom_directives demonstrating the usage of the new preprocessing hook. - Fixed #4113: cpp_lexer does not handle qualified backslashes correctly. - Fixed #3106: wave on VS2010 beta compiler generates error. Boost V1.42.0 - V2.0.4 - Fixed Wave for latest changes in multi_pass iterator. 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. - Added the new preprocessing hooks detected_pragma_once() and detected_include_guard() which are getting called whenever either a #pragma once has been detected or if the include guard heuristics detected an include guard for a particular include file. - Added a new command line option to the wave driver tool: --listguards/-g allowing to trace all include files which are either contain a #pragma once or contain include guards. - Started to elminate g++ struct aliasing warnings (more to fix, mostly in flex_string). Boost V1.40.0 - V2.0.2 - Fixed a long standing race condition inhibiting to use Wave in multi threaded environments. - Incorporated the changes from latest version of the flex_string class (#2946). - Fixed another race condition triggering problems using Wave in multi-threaded environments. Boost V1.39.0 - V2.0.1 - Fixed Wave to compile with BOOST_FILESYSTEM_NO_DEPRECATED defined (i.e. the library doesn't use the deprecated filesystem interface anymore). Boost V1.37.0 - Updated examples to reflect the recent changes in the used multi_pass iterator. - Fixed documentation links still pointing to the old Boost CVS (thanks to Jürgen Hunold for providing the patch). Boost V1.36.0 - Wave Version 2.0 is a new major release introducing some breaking API changes, preventing it to be used with Boost versions earlier than V1.36.0. The API and hook interface have been streamlined for more consistency. See the documentation for more details. - Added an additional template parameter to the context object, allowing to specify any possibly derived type. This change propagates to the preprocessing hooks, which now get passed the most derived context type as its first argument allowing to access protected members in the original context type. This fixes ticket #1752. - Fixed a problem during parsing of #pragma wave directive, where the value sequence contained a closing parenthesis. This caused a premature end of the pragma value parsing. - Fixed handling of support_option_single_line, which was ignored under certain circumstances. - Fixed ticket #1766: Wrong evaluation of conditional preprocessor directives with predefined macros __FILE__, __LINE__ and __INCLUDE_LEVEL__. This bug triggered an error in constructs like #ifndef __FILE__. Thanks to Daniel Wadehn for reporting and supplying a patch. Added corresponding regression test: t_2_018.cpp. - Fixed a bug which reported a valid macro redefinition as invalid if the macro replacement text referred to a second or higher parameter of this macro. - Fixed a problem in the wave tool to allow two errors to occur while preprocessing two consecutive tokens. - Adjusted Spirit header includes to point to conform to the new directory structure, removed support for Spirit versions earlier than V1.7. - Started to migrate to new multi_pass iterators from Spirit V2.0. Boost V1.35.0 - Wave Version 1.3 - Changed the return value of the 'evaluated_conditional_expression()' pp hook to 'bool' allowing to force Wave to re-evaluate the current conditional expression. This was suggested by Felipe Magno de Almeida. - Added a wave::context object as first parameter to all pp hook functions. This is an interface compatibility breaking change. The new pp-hooks can be disabled by defining the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS compile time constant to something not equal to zero. By default this constant will be defined to zero for Boost V1.35.0 and newer, switching to the new interface by default. - Added optional support for the import keyword (needed for the C++ module proposal). The identifier import will be recognized as a keyword, if the compile time constant BOOST_WAVE_SUPPORT_IMPORT_KEYWORD is defined to something not equal zero. - Added new preprocessing hook functions: found_error_directive() and found_warning_directive() to be called when #error/#warning directives are encountered. This was suggested by Andreas Sæbjørnsen. - Added a new sample to Wave: hannibal, a partial C++ parser implementation initially written by Danny Havenith (http://havenith-verlinden.nl/hannibal/) who agreed to add this here. Thanks! - Added new preprocessing hook function: found_line_directive() to be called when a #line directive is encountered. This was suggested by Andreas Sæbjørnsen. - Improved command line handling for the wave applet. - Incorporated latest bug fixes for the Hannibal sample provided by Danny Havenith. - Added loading of a wave.cfg file from anywhere up the filesystem hierarchy starting from the main input file for the wave driver applet up to the root of the file system. - Added support_option_emit_pragma_directive to allow to control at runtime, whether unknown #pragma directives should be emitted or not. To maintain compatibility with earlier versions this option is by default on if the compile time constant BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES was defined to be not equal to zero and it is off otherwise. - Enabled XML serialization support. - Added the throw_exception preprocessing hook, which gets called for every occurring error (whenever an exception would have been thrown). The default of this new hook function is to throw the corresponding exception, which reproduces the old behavior. - Implemented a new preprocessing hook: generated_token(), which get's called whenever a token is about to be returned form the library. This function may be used to alter the token before it gets returned to the calling application. - Added a new sample 'real_positions' demonstrating the new generated_token() preprocessing hook and showing how to use Wave with a new token type without using a new lexer type. - Factored out the pure lex_input_interface to simplify writing different lexer types for Wave. - Added the token_statistics sample showing how to use Xpressive to build a lexer for Wave. - Changed the list_includes sample to use a lexer which is based on the lexertl library written by Ben Hanson (http://www.benhanson.net/lexertl.html). - Added a new support_option: insert_whitespace, allowing to switch off whitespace insertion which is normally (by default) in place to disambiugate C++ tokens, which would otherwise form different tokens in the output. - Added a new commandline option to the Wave applet: --disambiguate, allowing to control whitespace insertion. The default value for this option is --disambiguate=1, resembling the previous behaviour. Specifying the option --disambiguate=0 allows to suppress whitespace insertion alltogether. - Added pragma option values push and pop to the line, preserve and output options allowing to store and restore the current option. The syntax is: #pragma wave options(