diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/boost/libs/wave | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/wave')
367 files changed, 47293 insertions, 0 deletions
diff --git a/src/boost/libs/wave/ChangeLog b/src/boost/libs/wave/ChangeLog new file mode 100644 index 000000000..9706e5f53 --- /dev/null +++ b/src/boost/libs/wave/ChangeLog @@ -0,0 +1,1967 @@ +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=<file> 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 <ios> + +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(<option>: push) and + #pragma wave options(<option>: pop) + where <option> may be line, preserve or output. Thanks to Eric Niebler for + suggesting this feature. +- Added the possibility to use static pre-compiled DFA tables for the lexertl + based lexer. +- Incorporated the changes from Andrei's latest version of the flex_string + class. +- Added the is_macro_defined(name) function to the context object as described + in the documentation. This function is usable with any string type compatible + with std::string. +- Changed behavior of the --force_include functionality, which now looks for + the file to be (force-)included in the current directory first. +- Switched to Re2C V0.11.2 +- Added const specifiers to some of the context member functions. +- Fixed a problem in the SLex C++ lexer (cpp_tokens example). +- Fixed a runtime problem in the Re2C generated lexers when feeded with + empty input files (thanks to Leo Davis for reporting and providing a patch). +- Added the is_eoi() function to token classes, returning true if the token + has been initialized to be the end of input token (T_EOI) (thanks to Ovanes + Markarian for suggesting this). +- Added missing #includes <cstring>, <cstdlib>, and <new> to flex_string.hpp. +- Added missing #include <climits> to cpp_chlit_grammar.hpp. +- Changed found_include_directive hook function to return a bool indicating, + whether the file should be included (true) or skipped (false). Thanks to + Felipe Magno de Almeida for suggesting this feature. +- Added code to the wave driver applet ignoring a #import directive (the whole + directive is passed through to the output) whenever the pp constant + BOOST_WAVE_SUPPORT_MS_EXTENSIONS is defined to something not equal to zero. +- Fixed the wave driver applet to correctly continue after a error or warning. +- Added a macro introspection facility allowing to iterate on all defined macro + names. +- Added a new commandline option --macronames/-m to the Wave driver application + which lists all defined macros and their definitions to an optionally + specified file (default is cout). +- Fixed configuration to take into account thread related build settings. +- Added the BOOST_WAVE_SUPPORT_LONGLONG_INTEGER_LITERALS pp constant allowing + to recognize large integer literals (larger in size than long/unsigned long) + even if these do not have a 'll' suffix. This pp constant is effective only, + if the target platform supports long long integers (BOOST_HAS_LONG_LONG is + defined). +- The following preprocessing hooks now return a boolean value, which when + returning 'true' cause the Wave library to skip the execution of the related + preprocessing action: + . found_directive: allows to skip the whole directive it is called for + . expanding_object_like_macro: allows to skip expansion of the given object + like macro, the macro symbol is copied to the output + . expanding_function_like_macro: allows to skip the expansion of the given + function like macro, the whole macro invocation (including all + macro invocation parameters) are copied to the output without any + further processing. +- Changed the interpretation of the return value of the found_include_directive + preprocessing hook: a return value of 'false' now processes the file + to be included normally and a return value of 'true' now skips the processing + of the include file directive (the file doesn't get included). + This change was necessary to make the return values of the preprocessing + hooks consistent. Now return 'false' generally means: normal execution and + return 'true' generally means: skip execution of the corresponding + preprocessor action. +- Fixed compilation problems on gcc, fixed ambiguity with boost code (detail + namespace was ambigious). +- Fixed predefined macro support to be thread safe. +- Added missing file to real_positions example. Thanks to Ludovic Aubert for + spotting the problem. +- Unterminated C++/C comment diagnostics are now a warning and not an error + anymore. +- Applied patch provided by Jens Seidel making sure every header compiles on + its own. +- Updates to the documentation. +- Fixed a problem in flex_string::compare() (#include_next was non-functional). +- Fixed a bug in the pp hook expanding_function_like_macro(), where the seqend + parameter was set to the first token after the closing parenthesis instead of + pointing at it. +- Added the BOOST_WAVE_SUPPORT_THREADING allowing to explicitely control + whether the Wave library is built with threading support enabled. If not + defined the build settings will be picked up from the Boost build environment + (BOOST_HAS_THREADS). +- Fixed a whitespace insertion glitch, where whitespace got inserted + unconditionally between two operators even if one of these was a comma. +- Fixed #line directive after a macro invocation containing newlines to + correctly reference the line number. +- Positions of macros defined on the command line now get properly reported as + "<command line>":1:... +- Added testing of the preprocessor hooks. + +Boost V1.34.0 +- Wave Version 1.2.4 +- Added the possibility to explicitly enable/disable the generation of #line + directives. Added a corresponding commandline argument to the Wave driver + tool (--line/-L) which takes either 0 or 1 as its parameter. +- Added support for #pragma wave option(command: value) directives, which + supports the following commands: + . #pragma wave option(line: [0|1]) + Enable/disable generation of #line directives + . #pragma wave option(preserve: [0|1|2]) + Control whitespace preservation + . #pragma wave option(output: ["filename" | null | default]) + Redirect output to the given file (or no output, if 'null' is specified, + or output to the file as given on the command line, if 'default' is + specified). + The filename is resolved relative to the directory of the processed + file. + These new #pragma directives are implemented in the Wave driver tool only. + It is possible to combine several options in one #pragma directive, i.e. + #pragma wave option(line: 0, preserve: 2). +- Changed the signature of the may_skip_whitespace() preprocessing hook to + additionally take the preprocessing context as its first parameter. +- Added the possibility to the Wave tool to disable initial output by + specifying a '-' as the output file. This is useful for syntax checks only or + in conjunction with the #pragma wave option(output: ...) to restrict the + generated output. +- Improved error reporting in the Wave tool on bad output file stream state. +- Switched to Re2C V0.10.0 +- Fixed some of the VC7.1 /W4 warnings. +- The Wave tool now creates the directory hierarchy of output files as needed. +- Applied some optimization, which causes skipping of the parsing for almost + all preprocessor directives when the if block status is false. This gains + upto 10-20% in speed for average applications. +- Added error diagnostic for #elif without matching #if, which was missing + under certain circumstances. +- Avoided the evaluation of #elif expressions if one of the previous #if/#elif + blocks of the same level was true. This gains upto another 5% of speed for + average applications. +- The MS specific integer suffix 'i64' is now correctly supported by the Re2C + and SLex lexer components (only when BOOST_WAVE_SUPPORT_MS_EXTENSIONS is + defined during compilation). +- Changed the Wave tool to print the column number of an error/warning along + with the line number. The new format is: 'filename:line:column: error text'. +- It is now possible to recover from the unbalanced #if/#endif statement + warning in a proper way. +- The Wave library now automaticaly recognizes include guards in headers files + and uses this information to avoid opening these header files more than once. + This speeds up things by upto 10-20% depending on the concrete include files. +- Fixed the failing test t_6_023.cpp. Error reporting for illformed #else + directives was broken (because of some recent changes). +- Fixed the failing test t_5_007.cpp. This was caused by the automatic include + guard detection, which prevented the second inclusion of the specified + include file the test was relying on. +- Added the possibility to switch off the automatic include guard detection. +- Added a new command line option to the Wave tool: --noguard/-G, which + disables the automatic include guard detection. +- Now a header with include guards will be included correctly for a second time + after its include guard symbol gets undefined. +- Added the generating platform to Wave's full version string. +- Made the Wave tool fully interactive when started with input from stdin and + and output to stdout. In this mode the Wave tool preprocesses the input + line by line and not only after receiving the full input as normally. +- Added serialization support for the wave::context object, which stores + all information about defined macros and all #pragma once header information. +- Added the command line option --state (-s) to the Wave tool, which tries to + load the serialized information from the file given as the argument to + --state and save the state information at the end to the same file. + This option is available in interactive mode only. +- Added possibility to verify the compatibility of the configuration used + during compilation of the Wave library with the config info used for the + application. Added a corresponding test to the Wave tool. +- Added a new predefined macro __WAVE_CONFIG__ which expands to an integer + literal containg the configuration information the library was compiled + with. +- Added proper versioning support to the serialization of state. +- Fixed the macro tracing information to contain the column numbers of the macro + definitions as well (the format used is the same as for error messages). +- Fixed a memory leak in the flex_string copy on write code (thanks to Tobias + Schwinger for reporting this bug). +- Fixed a memory corruption bug in the Re2C scanner buffer management code + (thanks to Andreas Sæbjørnsen for spotting the bug). +- Fixed a major performance bottleneck in the lex_token class. This speeds up + Wave for upto another 20-40% depending on the amount of macro expansions to + perform. +- Added the BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES and the + BOOST_SPIRIT_USE_LIST_FOR_TREES Spirit configration constants to the + wave_config.hpp to allow to fine tune the generated Spirit tree code. VC7.1 + gives best results when both are defined. +- Fixed a memory corruption bug triggered by a possible dangling reference. +- Fixed Wave tools startup crash when compiled with VC8. +- Added the name of the generating compiler (BOOST_COMPILER) to the full + Wave version info. +- Fixed all Jamfile.v2 to correctly disable RTTI for VC7.1. +- Added #pragma message("...") to be optionally supported by the Wave library. + This may be enabled by defining the BOOST_WAVE_SUPPORT_PRAGMA_MESSAGE pp + constant to some value different from zero. +- Fixed a couple of typos in the file cpp.cpp preventing it to compile on + gcc 4.1.0 (thanks to Richard Guenther for reporting these). +- Richard Guenther fixed another buffer overrun problem in the Re2C scanner. +- Fixed Jamfile.v2 files for all sample applications. +- Fixed a bug which lead to reporting of an illegal preprocessing directive + inside not-evaluated conditional blocks under certain circumstances (thanks + to Tobias Schwinger for reporting). +- Fixed '#define true ...', '#define false ...' and other constructs, i.e. the + usage of the boolean keywords as identifiers during the preprocessing. Added + a corresponding test case (t_9_017.cpp). Thanks to Andreas Sæbjørnsen for + reporting. +- Corrected the Jamfile[.v2] of the waveidl sample to refer to correct file + names (thanks to Juergen Hunold for submitting a patch). +- Fixed a bug which prevented the main iterator from returning a T_EOF token + at the overall end of the input. +- Fixed a problem, where non-evaluated #elif directives never got passed to the + skippen_token() pp hook (thanks to Andreas Sæbjørnsen for reporting). +- Fixed a problem in the get_tokenname() function. +- Added a missing #define BOOST_WAVE_SOURCE 1 to the wave_config_constant.cpp + file. +- Fixed exception specifications to catch all exceptions by const&. +- Fixed predefined macros to appear to be defined at a position referring to + a file named "<built-in>". Thanks to Andreas Sæbjørnsen for reporting. +- Fixed the Re2C lexer not to segfault on empty files anymore. +- Stripped leading and trailing whitespace for all lines in a config file (Wave + driver tool). +- Fixed RTTI build issue for VC7.1/bjam --v2 (thanks to Rene Rivera for + submitting a patch for the Wave Jamfile.v2). +- Fixed certain problems reported by the Boost inspection tool. +- Fixed a couple of SunPro5.8 warnings. +- Fixed a bug resulting in a crash if a macro was redefined with a shorter + expansion list as it was defined initially. Added a corresponding test case. +- Fixed a bug causing an infinite loop when there was a missing endif in the + main preprocessed file. +- Improved error recovery for illegal preprocessing directive errors. +- Improved error handling and error recovery for conditional expressions + (#if/#elif expressions). +- Wave now passes 160 out of 161 tests from the MCPP V2.6.1 validation + testsuite! +- Added new warning for invalid #line number and filename arguments +- Improved error diagnostics for invalid #line directives containing arbitrary + tokens after at the end of the line. +- Improved error handling wrt the misuse of the __VA_ARG__ token in macro + definitions. +- The warning, that a file is not terminated by a newline is now issued for all + files, not only for the main file (as previous). +- Added a couple of new test cases to verify various diagnostics. +- Fixed wave applet not to report missing #endif's when in interactive mode. +- Cleaned up the Re2C lexer code. +- Fixed a bug, where a empty line followed by an arbitrary token and followed + by a preprocessing directive interpreted the preprcessing directive as if it + were the first non-whitespace token on the line. This error occurred only + if the #line directive generation was suppressed. Thanks to Joan Grant for + reporting this problem. +- Fixed a problem in the Wave applet which prevented the correct recognition of + Windows file paths in a configuration file, if this path was enclosed in + quotes. +- Extended the copyright notice to include the year 2007. +- Fixed a problem in preserve=1 mode, when a C style comment triggered the + generation of a #line directive. +- Worked around a linker issue for the True64/CXX compiler, complaining about + multiple defined symbols when using the flex_string class. +- Added missing documentation for the context::get_macro_definition function. + +Sat Feb 18 2005 +- Version 1.2.3 +- Added a missing throw() specification to the function + cpp_exception::get_related_name(). +- Fix Boost bug ([ boost-Bugs-1395857 ] wave redefines BSIZE). +- Added missing calls to the skipped_token() preprocessing hook which wasn't + called for pp directives inside disabled #if blocks. +- Made the context<> type noncopyable. +- Introduced the --extended/-x command line option to the wave driver + executable, which enables the #pragma wave system() directive. This directive + is now disabled by default because it may cause a potential security threat. +- Changed the what() function of the macro_handling_exception class, which now + correctly returns the name of the exception type itself. +- Added a diagnostic message to the wave driver executable, which is issued + whenever a #pragma wave system() directive is found, but the -x (--extended) + command line argument was not given. +- Fixed long integer suffix to be allowed to be mixed case (1Ll or 2lL). +- Fixed the BOOST_PP_CAT(1e, -1) pp-token bug. Wave now correctly recognizes + pp-number tokens, which are converted to C++ tokens right before they are + returned from the library. +- Moved the implementation of the token_id query functions (get_token_name(), + get_token_value()) to a separate source file. +- Fixed a bug, which prevented to prefer pp-numbers in files preprocessed as + a result of #include directives. +- Fixed a bug, which prevented to open #include'd files specified by an + absolute path. +- Fixed a problem in the expression parser value type. +- Fixed a dynaload compilation problem with VC7.1 of the re2c lexer tests. + +Sat Dec 24 13:33:53 CST 2005 +- Version 1.2.2 +- Added three new preprocessing hooks: 'found_directive', 'skipped_token' and + 'evaluated_conditional_expression' (thanks to Andreas Sæbjørnsen for the + suggestions). +- Removed hook forwarding functions in the context_type. +- Added missing include_next case branches for get_directivename() function. +- Added new sample: advanced_hooks. +- Fixed a possible buffer overflow in the cpplexer and cpp exception classes. +- Made the cpp_grammar thread safe. +- Removed the need for the get_directivename() function. Fixed typos in the + predefined token table. +- Removed assertions from get_token_name() and get_token_value() and replaced + these with more meaningful code. +- Added the BOOST_WAVE_USE_STRICT_LEXER configuration constant which allows to + decide, whether the '$' character will be recognized as a part of identifiers + or not (the default is BOOST_WAVE_USE_STRICT_LEXER == 0, i.e. '$' will be + recognized as part of identifiers). +- Added the possibility to testwave to extract a tagged comment based on a + preprocessor constant (testwave V0.4.0). +- Made the predefined_macros_grammar thread safe. +- Added dll support for the generated Wave libraries. +- Added the const_iterator based exlicit instantiations for the Re2C lexer to + the built Wave library and dll. +- Added the whitespace handling policy to the context object. This actually is + no separate policy, it's a new preprocessing hook allowing to decide, whether + a concrete token has to be skipped. +- Changed the --preserve option of the wave tool to take a single integer + argument (0: no whitespace is preserved, 1: only comments are preserved, + 2: all whitespace is preserved) +- Edited the command line option descriptions of the wave driver. +- Fixed broken tags in documentation (magically inserted by DreamWeaver). +- Merged the new whitespace_handling policy with the existing preprocessing + hooks. The name of the new preprocessing hook ist may_skip_whitespace(). +- Fixed compatibility issues for CW9.4 in the Wave test aplication. +- Added get_errorcode() member to the wave exception classes allowing to + get back the reason for the exception. +- Added boost::wave::is_recoverable(cpp_exception const&) alowing to decide, + whether it is possible to continue after a cpp_exception has been thrown. + This is a temporary hack to overcome the current limitation of the library + not allowing to do generic error recovery. It allows to recover from 75% of + the generated errors types. +- The --timer command line option for the Wave driver now prints the elapsed + time correctly even if a preprcessing error occurred. +- Fixed an error recovery problem which skipped one token after continuing in + case this was a pp directive. +- Added the --autooutput (-E) option to the Wave driver applet which redirects + the generated output to a file named after the input file changing the file + extension to '.i'. +- Changed all throw's to boost::throw_exception. +- Added the possibility to configure the command keyword for the wave specific + #pragma directives. It is now possible to define a string literal via + BOOST_WAVE_PRAGMA_COMMAND, which will be recognized and all corresponding + #pragma's are dispatched to the interpret_pragma() preprocessing hook. + The default value for BOOST_WAVE_PRAGMA_COMMAND is "wave", just to ensure + complete backward compatibility. +- Added missing #pragma warning(pop) directives. +- Fixed a bug wrt error propagation in the expression parser. +- Fixed an assertion fired when cpp_token is used to process the quick_start + sample. +- Fixed a (Windows specific) bug which triggered a boost::file_system exception + under certain conditions. +- Switched to Re2C V0.9.11 +- Fixed a problem with the new '-E' (--autooutput) option. +- Added better error reporting for duplicate macro definitions to the Wave + tool. Added the macro_handling_exception type containing the corresponding + macro name via the new (virtual) get_related_name() function. +- Added the get_severity() function to the exceptions thrown by the Wave + library. +- Extended the copyright notice to include the year 2006. + +Mon Dec 5 22:05:22 CST 2005 +Boost V1.33.1 +- Version 1.2.1 +- Fixed bug reported as Sourceforge bug 1274584. +- Switched to Re2C V0.9.9. +- Fixed a bug where the 'parameters' and 'definition' parameters to the + defined_macro callback of the preprocessing hooks were always empty (thanks + to Stefan Seefeld for reporting). +- Fixed missing namespace specifiers in token definition macros (thanks to + Jozsef Mihalicza for reporting). +- Enabled --preserved and --long_long modes by default for the cpp_tokens + sample. +- Newline tokens reported a wrong line number (offset by one) when using the + Re2C generated lexer (thanks to Jozsef Mihalicza for pointing this out). +- Changed file positions to carry 'unsigned int' line and column numbers. +- Fixed tokens of a generated #line directive to carry the correct column + numbers. +- Tokens now contain the correct filename, line and column numbers even if + a #line directive was encountered. +- Fixed wrong line numbering in reference comments of the tests t_5_002.cpp and + t_5_035.cpp. +- Made sure, that preprocessor expression errors get ignored for 'passive' + #elif branches. +- Fixed an issue reported by the gcc debug stl. +- Added the <vc-7_1-stlport><*><rtti>off directive to all of the V1 Jamfiles. + +Wed Aug 17 20:21:00 CST 2005 +Boost V1.33.0 +Version 1.2 +- Fixed name clash wrt T_DIVIDE on FreeBSD. +- Fixed documentation of the different language_support flags. +- The support for long long suffixes is no longer bound to the variadics mode, + it has to be enabled by the new long_long mode (default in C99). +- Fixed compilation if BOOST_WAVE_DUMP_PARSE_TREE is defined. +- Fixed lexer error message wrt long_long mode. +- Stefan Seefeld fixed a bug in the lexer, where include_next was assumed for + included files containg a "include_" in their name. +- Fixed some trigraph token id's in the lexers. +- Added column information to the re2c generated lexer. +- Added tests for the different lexers. +- Fixed the found_include_directive preprocessing hook to carry the information + about #include_next directives as well. +- Separated the different lexer tests. +- Fixed a bug in the whitespace eater. +- Fixed a bug where Wave emitted the found C++ comments in --preserve mode even + if these were found inside of disabled #if/#endif blocks. +- Removed the function local static grammars to avoid possible raise conditions + and to make CW8.3 happy. +- Unified lexer interface, adjusted namespaces. +- Added lexer testcases to the regression tests. +- Fixed test cases to scale to 64 bit platforms. +- Disabled the MS specific extensions in the lexer tests in a platform related + way. +- Added special handling of the eof tokens inside the lexer iterator classes + for Comeau. +- Applied a workaround proposed by David Abrahams to make the slex lexer work + on the CodeWarrior platforms. + +Sun May 8 17:22:59 WEDT 2005 +Version 1.1.17 +- Added ill_formed_character_literal and ill_formed_integer_literal errors. +- Improved error handling and diagnostics for integer overflow in #if/#elif + expressions. +- Fixed a bug in the testwave application which prevented the correct + recognition of expected errors under certain circumstances. +- Fixed a portability problem (for gcc 3.3.x) in the testwave application. +- Enforced that #if/#endif are balanced file wise. +- Changed the command line arguments for the Wave testrun to use absolute + directories. +- Changed the test application to return a value != zero if one of the given + config files were not found. +- Fixed a command line parsing problem caused by a change in the parameter + handling inside in the program_options library. +- Switched to the most recent version of re2c (V0.9.7.dev). +- Fixed a como compilation error and several como --a warnings. +- The T_EOF token doesn't carry the value of the previous token anymore. +- Added operator==() to the token classes to fix the ambiguity error reported + by the True64 compiler. +- Improved the error message, when empty arguments are used in pure C++ mode. +- Added character literal out of range testing and an additional corresponding + error message. +- Fixed parsing of long character literals (such as '\x1234'). +- Fixed almost all problems diagnosed by the Boost inspection report. +- Several fixes to make the True64 compiler happy. +- Added the long long suffix handling to the C99 mode (LL/ll). +- Fixed a bug in the slex regex specifications. + +Thu Apr 7 10:07:45 WEDT 2005 +Version 1.1.16 +- Fixed a bug in the white space eating component, which prevented a C++ + comment to be suppressed if it followed after another whitespace. +- Fixed the inconsistencies between the documentation and the behaviour wrt the + different include search paths. See the Wave driver docs for details of how + the '-I', '-I-', and '-S' options work. +- Allowed to specify more than one config file ('@' syntax) on the command line + of the wave driver executable. +- Changed copyrights in all files to reflect the acceptance of Wave into Boost. +- Unknown preprocessing directives were not recognised as such anymore. +- If comments shouldn't be preserved all C++ comments are replaced by newline + tokens (instead of beeing igored completely). +- Fixed a bug in the white space eater component. +- Fixed a bug which reported wrong line numbers for error encountered during + retokenisation (concatination). +- Fixed a bug in the unescaping code. +- Fixed a compilation error of the testwave executable (added a missing + namespace specifier). +- Added a missing header to make cpp.re.cpp compile on CW. +- The predefined macro __BASE_FILE__ now returns a properly escaped file name + string. +- Fixed the function boost::wave::util::impl::unescape_lit(). +- Added the Wave unit test framework. For now it contains about 60 unit tests + executed by a special test driver (testwave). +- Added the '$F' replacement string to the testwave application. This allows + to handle file paths sensitive comparison of the expected and real results. +- Fixed a minor problem in the whitespace eating component. +- Added optional trigraph conversion. +- Changed all size_t, time_t etc. to std::size_t, std::time_t etc (for CW). +- If the comments should not be preserved every C comment containing at minimum + one newline is now converted to a newline token. +- Added the lexed_tokens sample. +- Fixed warnings and errors reported by the CodeWarrior compiler. +- Added the '$V' replacement string to the testwave application. It expands to + the current BOOST_LIB_VERSION. +- Diagnosed the attempt to redefine the alternative operators as and, or etc. +- Improved error handling. +- Disabled the flex_string class for VC7, enabled to fallback to std::string + for this compiler. +- Renamed files to comply with the Boost rules. +- Added the first part of the MCPP validation suite to the Wave unit tests. +- Added even more missing "using namespace std;" statements for functions from + the C runtime library. The Wave test suite now contains more than 100 unit + tests. +- Added the $P/$P(basename) replacement string to the testwave application + which expands to the full path of the current file ($P) or to the current + directory/basename ($P(basename)). +- Fixed a bunch of portability problmes revealed by the regression tests on + different platforms. Thanks to Stefan Slapeda for his support to make it work + on the cw-9_4 toolset (win32). + +Tue Mar 22 14:52:45 WEST 2005 +Version 1.1.15 +- Fixed a bug where the complete set of C99 predefined macros were pre-defined + when in C++ mode and variadics were enabled. +- When in variadics or C99 mode the __BASE_FILE__ predefined macro expanded to + <Unknown>. +- Added the --listincludes option to the Wave driver executable which allows to + log the file names of the include files opened. +- Fixed a gcc warning in token_cache.hpp (unused variable end). +- Changed the logic behind #include_next. It now starts searching with the + next directory after the directory the current file (the file containing the + #include_next directive) is located in. +- Changed the signature of the undefined_macro preprocessing hook to take the + token itself and not the macro name only. This is important to pass the full + context information about the position of the #undef directive to the + user provided hook (thanks to Stefan Seefeld for pointing that out). +- Fixed several broken links in the Context Policy topic. +- Fixed a bug in the handling of the #include_next directive inside of + non-evaluated #if blocks. +- Fixed a bug in the #include_next handling code (thanks to Stefan Seefeld). +- Changed the signature of the opened_include_file() preprocessing hook which + now receives not only the absolute file name of the openend include file but + additionally gets passed the (possibly) relative path of the openend include + file. This concrete format of the relative path depends on the format of the + include search directory given to the library. +- Added a new preprocessing hook 'found_include_directive()' which gets called + for every #include directive (even for those where the file to include + doesn't exist) and which gets passed the (expanded) token sequence found + after the #include directive token. +- The file names passed to the preprocessing hooks are now normalised. +- Changed the opened_include_file() preprocessing hook to receive the correct + relative path even if the included file was found in the current directory. +- Fixed a bug which reported 'defined(or)' as invalid (similarly all the other + alternative bit operation token types). +- Fixed a bug which prevented to define variadic macros from the command line. +- Added a 'preserve comments' mode to preserve the comments in the input stream + not inserted into macro definitions. +- Added a new --preserve (-p) command line switch to the wave driver + application to allow comments to be preserved in the generated output stream. + +Mon Feb 21 09:30:04 WEST 2005 +Version 1.1.14 (Fixes in response to the Boost review) + +Wave was accepted into Boost! + +With special thanks to Tom Brinkman, who volunteered to be the review manager. + +With thanks to David Abrahams, Beman Dewes, Reece Dunn, Larry Evans, +Doug Gregor, Joel de Guzman, Baptiste Lepilleur, Andy Little, Paul Mensonides, +Dan Nuffer, Andreas Pokorny, Vladimir Prus, Gennadiy Rozental, Michiel Salters, +Jonathan Turkanis, Chris Uzdavinis, Pavel Vozenilek, Michael Walter for bug +reports, fixes and hints. + +- Added support for the MS extensions #region and #endregion, which simply get + ignored by Wave. The support for these is enabled only, when the pp constant + BOOST_WAVE_SUPPORT_MS_EXTENSIONS is defined. Otherwise these get flagged as + an illegal preprocessor directive (as before). +- Fixed a problem, where the replacement text for a #pragma directive got lost + if this directive was on the last line of a processed (include-)file. +- Changed the default value for BOOST_WAVE_SUPPORT_MS_EXTENSIONS for non- + Windows systems to zero. +- Updated outdated external links in the documentation. +- Fixed certain grammatical and stylistic quirks in the documentation. +- Fixed a problem in libs/wave/build/Jamfile.v2 (as reported by Larry Evans). + Fixed the Jamfile.v2 in the samples directories accordingly. +- Added the '<toolset>vc-7_1:<rtti>off' to all Jamfile.v2 files to adjust for + the internal buffer overflow bug in the VC7.1 compiler (reported by Joel de + Guzman). +- Changed the '<toolset>vc-7_1:<rtti>off' to '<toolset>vc-7.1:<rtti>off' as + required by the Boost.Build.v2 library (suggested by Vladimir Prus). +- Finally fixed the Jamfile.v2 file (after a suggestion from Reece Dunn) +- Fixed the column number reported for tokens for Slex lexer based + configurations (reported by Baptiste Lepilleur). +- Added the __BASE_FILE__ predefined macro, which contains a string literal + of the main file name to preprocess (the one the context<> template was + created with). (suggested by Pavel Vozenilek) +- Used the boost::reverse_iterator instead of the std::reverse_iterator + for the flex_string class to allow compilation of Wave with VC7.0 + (as suggested by Reece Dunn). +- Fixed a problem in the include_path template, which throwed a + boost::filesystem exception whenever a character was used in a file name + to include, which is marked as illegal by the default name checker of the + boost::filesystem::path. + +Version 1.1.13 (Boost review candidate 2, bug fixed version) +- Fixed a problem, where the context<> template referenced temporary iterator + objects from the underlying stream (thanks to Michiel Salters for reporting + this). +- Fixed a bug in the re2c lexer, which allowed to dereference the end iterator + of the underlying input stream (thanks to Doug Gregor for pointing this out). +- Fixed several assertions fired by the iterator checking code of the VC8 stl. + +Version 1.1.12 (Boost review candidate) +- A rough performance analysis showed, that 30% of the time is spent parsing + the input for pp directives (cpp_grammar), 35% of the time is spent inside + the flex_string code, mainly in the copy constructor and assignment + operator, 15% of the time is spent inside the list and vector member + functions, 10% is spent for memory allocation but only 1% of the time is + spent in the re2c lexer. +- Identified a performance problem, where the token_cache was instantiated + for every created lexer object, but needed to be initialised only once. +- Added #include <wave_version.hpp> to wave_config.hpp +- Fixed problems reported by the gcc 3.4.1 compiler. +- Adjusted Jamfiles for the new toolset names introduced in Boost V1.32. + +Version 1.1.11 +- Updated copyrights. +- Fixed some bugs introduced by the latest refactoring. +- Tried to fix the expansion of macros, which replacement-list terminates in a + partial macro expansion. No success so far. + +Version 1.1.10 +- Refactored some of the macro map (macro namespace) code (added comments, + splitted into separate files), +- Fixed some typename errors in cpp_macromap.hpp (thanks to Vladimir Prus). +- Fixed the BoostBuild V2 Jamfiles (thanks to Vladimir Prus). + +Version 1.1.9 +- 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. +- Removed several features from the code base: + . removed C++0x support + . removed TST support +- Fixed the program_option validator syntax, which has changed since the last + update. +- Removed misleading configuration options from the cpp_config.hpp file, + because the application will have to use the same config options as were used + during the compilation of the library. +- Changed the naming convention of typedef'd types in the library. Removed the + _t suffix, wherever possible. +- Updated the documentation to reflect the removal of the C++0x features. + +- Changed the licensing scheme to: +// Copyright 2004 Joe Coder. 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) + +Mon May 24 10:02:47 WEDT 2004 +Version 1.1.6 +- Fixed a incompatibility with the new program_options version. + +Version 1.1.5 +Version 1.0.6 +- Fixed a bug, which reported an #include statement as ill formed, if it was + followed by an empty C comment only. This was an error in the cpp.re regular + expression for C comments. Additionally, since this change simplified the + Re2C generated lexer a lot it was possible to remove the compiler workaround + for the VC7.1 compiler which prevented the optimization of this lexer. + +Mon Mar 29 09:36:59 WEDT 2004 +- Corrected the signature of the main() functions (was main(int, char const*[])). + +Sun Mar 28 12:55:59 WEDT 2004 +Version 1.1.4 +- Fixed a problem, where the first returned token was lost, whenever a + --forceinclude file was given. +- Adjusted the Wave driver and the other samples to use the new program_options + library syntax (V1.1.x only). + +Mon Mar 1 19:14:21 WEST 2004 +Version 1.1.2 +Version 1.0.4 +- Fixed a problem, which does not report an error, if in a #define statement in + between a macro name and its replacement list were no whitespace given. +- Fixed a bug, which generated an unexpected exception of the $ character in the + input. +- Macro definitions, which differ by whitespace only (one definition contains + whitespace at a certain position, the other definition does not) are correctly + reported as a warning now. +- Fixed a problem, where different formal argument names during macro + redefinition were not flagged as a warning. +- A wide character string used in a #line directive wasn't flagged as an error. + +Sun Feb 29 19:10:14 WEST 2004 +Used the test suite distributed with the mcpp V2.4 preprocessor to fix a bunch +of mostly minor issues: +- Fixed trigraph backslash followed by a newline handling (??/ \n) in the + re2c (C/C++ and IDL) scanners. +- Fixed a digraph/trigraph token type handling problem during macro expansion. +- Fixed a digraph/trigraph token type problem during handling of the null + preprocessor directive. +- Fixed several signed/unsigned conversion bugs in the expression evaluator. +- Fixed the || and && operators in the expression evaluator to stop evaluation, + as only the outcome of the overall expression is determined. +- Fixed the expression evaluation engine to detect divide by zero errors. +- Fixed a bug with operator || and && arithmetic (the deduced type was wrong). +- Fixed a bug with the unary operators ! and - which IN conjunction with an + arithmetic operation yielded A wrong result type. +- Fixed a bug, which reported a macro definition as an invalid redefinition, if + it was different from the original definition only by different whitespaces. +- Fixed a bug, which reported the redefinition of one of the alternative tokens + as 'and', 'bit_and' etc. as invalid. +- Fixed a bug in the character literal parser, which prevented the recognition + of multibyte character literals. + +- Moved the cpp_token_ids.hpp header into the main wave.hpp header, because the + values defined therein aren't changeable by the user anyway. +- Fixed some spelling errors in the documentation (thanks to Rob Stewart). + +Tue Feb 3 20:20:16 WEST 2004 +- Fixed the problem, that macro definitions in a config file were flagged as + an error, if there was any whitespace in between the -D and the macro name + (same problem existed for -P). + +Fri Jan 30 20:28:27 WEST 2004 +- Fixed a missing boostification in the trace support header. +- Added a missing std:: namespace qualification to the list_includes.cpp sample + file. +- Fixed line ending problems with the cpp.re and idl.re files. +- Added quick_start sample. + +Sun Jan 25 20:26:45 WEST 2004 +This version was submitted to Boost as the review candidate (V1.1.0) +- Fixed invalid explicit instantiation syntax as reported by the Comeau + compiler. +- Added a missing header to flex_string.hpp. + +Sat Jan 24 19:47:44 WEST 2004 +- Completely decoupled the used lexer from the preprocessor. +- Unfortunately had to change the template interface of the context class. It + now instead of the token type takes the type of the lexer to use. +- Reintroduced the cpp_tokens, list_includes and waveidl samples. + . cpp_tokens is based on the SLex lexer + . list_includes shows the usage of the include file tracing capability + . waveidl uses the Re2C based IDL lexer in conjunction with the default token + type + +Tue Jan 13 20:43:04 WEST 2004 +- Fixed several compilation issues under linux (gcc 3.2.3, gcc 3.3, gcc 3.3.2, + gcc 3.4, Intel V7.1) +- Fixed a compatibility problem with Spirit versions older than V1.7. + +Mon Jan 12 20:39:50 WEST 2004 +- Boostified the code base: + . Moved code into namespace boost. + . Prefixed all pp constants with "BOOST_". + . Refactured the directory structure. +- Removed IDL mode and SLex lexer from the code base. These will be re-added as + samples. +- Changed the Wave configuration system to be more flexible (all + #if defined(BOOST_WAVE_...) changed to #if BOOST_WAVE_... != 0), + which allows to configure the library without changing the code base itself + +Sat Jan 10 18:17:50 WEST 2004 +- Incorporated Andrei Alexandrescu's latest changes to the flex_string class, + which resulted in an overall spedd gain of about 5-10%. + +Wed Jan 7 17:46:45 WEST 2004 +- Found a major performance hole! The achieved general speedup is about 50-70%. +- Added missing old MS specific extensions to the re2c lexer (_based, + _declspec, _cdecl, _fastcall, _stdcall, _inline and _asm). +- Added support for #include_next (as implemented by gcc). +- Fixed compilation problems with gcc 3.3.1 +- Avoid to look up in symbol table of a potential macro name twice. +- Added the Spirit SLex lexer sample to the Wave source tree, because it was + removed from the Spirit distribution. +- Removed the configuration option, which allowed to reverse the names stored + in the symbol tables. +- Implemented experimental support for using a TST (ternary search tree) as the + container for the symbol tables. + +Sun Jan 5 12:30:50 2004 +- Released V1.0.0 + +Sun Jan 4 00:11:50 2004 +- Removed tabs from the flex_string.hpp file. +- Modified the input_functor.hpp file to sqeeze out some milliseconds at + runtime. +- The --timer option now prints the overall elapsed time even if an error + occurred. +- Added support for #pragma once. + +Fri Jan 2 22:58:54 2004 +- Fixed a bug in the code, which predefines the preprocessor constants. +- Fixed a bug in intlit_grammar<> initialisation code. + +Thu Jan 1 21:15:03 2004 +- Fixed a bug while predefining a macro with a value through the commmand line. +- Fixed a bug, which reported a macro definition as illegal, if the redefined + macro was a function like macro with parameters. +- Fixed a bug, if concatenation of two tokens resulted in a C++ comment start + token. + +Thu Jan 1 15:01:54 2004 +- Finished license migration. + +Wed Dec 31 12:23:55 2003 +- Changed the copyright and licensing policiy to be Boost compatible. + +Wed Dec 31 12:01:14 2003 +- Fixed a problem while compiling certain headers from the Microsoft Windows + SDK: + #define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\ + nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\ + CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\ + nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) + where essentially is no whitespace between the parameter list and the macro + replacement list. +- Fixed a problem with the MS extension __declspec, which now is recognized + correctly. + +Sat Dec 27 14:48:29 2003 +- Fixed remaining problems with assign/assign_a. +- Fixed some gcc warnings about signed/unsigned comparision mismatch. + +Tue Nov 11 20:51:41 WEST 2003 +- Changed the IDL mode to recognize identifiers only. All keywords (except + 'true' and 'false') are returned as identifiers. This allows for easy + extension of the IDL language. The drawback is, that after preprocessing + there needs to be just another lexing stage, which recognizes the keywords. +- Fixed a possible problem, when in between a #if/#elif directive and a + subsequent opening parenthesis Wave finds no whitespace: + #if(_WIN_VER >= 0x0500) + is now recognized correctly. + (This problem was pointed out by Porter Schermerhorn). + +Sun Nov 9 21:05:23 WEST 2003 +- Started to work on implementation of an IDL lexer for the TAO idl compiler. + . Branched off the Re2C C++ lexer and related files as a starting point for + the new IDL lexer. Added connfiguration means to allow compile time + decision, in which mode to operatoe (C++ or IDL). + . Implemented the Re2C based IDL lexing component. + . Fixed all occurrences of non-IDL tokens (as T_COLON_COLON and T_ELLIPSIS) + +Sat Nov 8 20:05:52 WEST 2003 +- Version 1.0.0 +- Munged the email addresses embedded within the source files. +- Adjusted for the new actor names in Spirit (assign_a and append_a). + +Thu Aug 21 16:54:20 2003 +- Removed the internally used macro 'countof()' to avoid possible nameclashes + with user code. +- Fixed a bug, which prevented the execution of the concatination operator '##' + while expanding object-like macros. + +Tue Aug 5 10:04:00 2003 +- Fixed a false assertion, if a #pragma directive started with some whitespace + on the line. +- Added the #pragma wave timer() directive to allow rough timings during + processing. This is done on top of a new callback hook for unrecognized + #pragma's, which allows to easily add new pragma commands without changing + the Wave library. +- Fixed a bug in the whitespace insertion engine, which prevented the insertion + of a whitespace token in between two consecutive identifier tokens or a + integer literal token followed by an identifier token. +- Fixed a bug during macro concatenation, which allowed to concatenate + unrelated tokens from the input stream: + #define CAT(a, b) PRIMITIVE_CAT(a, b) + #define PRIMITIVE_CAT(a, b) a ## b + #define X() B + #define ABC 1 + CAT(A, X() C) // AB C + CAT(A, X()C) // correct: AB C, was 1 +- Fixed a 64 bit portability problem. +- Added pragma wave timer(suspend) and wave timer(resume) +- Fixed a ODR problem with static initialization data for predefined macros. +- Ported the iterators to the new iterator_adaptors. +- Updated the documentation to reflect the recent changes + +Sun Jun 29 12:35:00 2003 +- Fixed 64 bit compatibility warnings. +- Fixed a bug, which prevented the correct recognition of a #line directive, if + only the filename part of this directive was generated by a macro expansion. +- Fixed a bug during macro expansion of conditional expressions, which + prevented the correct expansion of certain scoped macros. + +Fri Jun 27 09:50:14 2003 +- Changed the output of the overall elapsed time (option --timer) to cerr. +- Added a configuration constant WAVE_REVERSE_MACRONAMES_FOR_SYMBOLTABLE, which + reverses the macro names while storing them into the symbol table, which + allows to speed up name lookup especially, if the macro names are very long + and if these share a common prefix. +- Fixed a very subtle bug, which prevented the recognition of fully qualified + macro names during the macro expansion of conditionals expressions (for + #if/#elif). +- Improved the error output for the illformed pp expression error. + +Thu Jun 26 08:20:30 2003 +- Done a complete spell check of the source code comments. + +Wed Jun 25 20:33:52 2003 +- Changed the conditional expression engine to work with integer numeric + literals only. Distinguished signed and unsigned literals. +- Importing a region twice is allowed now. +- Fixed a bug, which does not removed all placeholder tokens from a expanded + token sequence while evaluating conditional expressions (C++0x mode only). + +Wed Jun 25 15:01:51 2003 +- Changed the conditional expression engine to respect the type of numeric + literals, now expressions like '#if 1 / 10 == 0' evaluate correctly (to true + :-) +- Fixed a bug, where macro names referring to global macros (as ::A::B) were + not correctly recognized under certain circumstances. +- Empty parameter lists for macros with ellipses only sometimes generated a + placemarker token in the output: + #define STR(...) #__VA_ARGS__ + STR() // resulted in "§" instead of "" . + +Wed Jun 25 08:35:06 2003 +- Fixed several gcc compilation errors (missing typename's etc.) +- Fixed a compilation problem, if Wave is built on top of the SLEX scanner. +- Reformatted the --timer output from pure seconds to a more reasonable format. + +Fri Jun 20 19:33:30 2003 +- Changed the enable_tracing function of the tracing_policies to take a + trace_flags variable instead of a bool, to allow to control tracing with more + granulation. +- Added the tracing_enabled function to the tracing_policies, which returns the + current tracing status. +- Updated the documentation of the tracing policies. + +Thu Jun 19 21:45:39 2003 +- Reactivated the list_includes sample with the help of the new include file + tracing facility. + +Thu Jun 19 17:55:35 2003 +- Eliminated the TraceT template parameter from the macromap<> template. +- Added two hooks to the trace policy to allow to trace the opening and + closing of include files. + +Thu Jun 19 14:08:10 2003 +- Added the command line option --timer, which enables the output to std::cout + of the overall elapsed time during the preprocessing of the given file. + +Fri Jun 13 09:11:29 2003 +- Emitted an error message, if an ellipses was found as a formal macro + parameter and variadics were disabled. +- Fixed a false error message, that the last line was not terminated with a + newline, which occurred, if no output was generated by the last line of the + source file. + +Thu Jun 12 15:20:22 2003 +- Fixed the recent change in argument expansion for the variadics/C99/C++0x + mode. +- Fixed a problem, where an additional whitespace between _Pragma and the + opening parenthesis resulted in a false error message. +- Used a pool allocator for the token sequence containers (std::list<>'s), + which gives a speed gain of more than 60% (while profiling the Order + library). + +Wed Jun 11 22:18:54 2003 +- Fixed a macro scoping/expansion problem, when a macro returned a full scope + which is continued on the call site to form a full qualified name, the name + wasn't recognized correctly: + # region A + # define MACRO 1 + # region B + # define MACRO 2 + # endregion + # endregion + # define ID(x) x + ID(A)::MACRO // 1 + ID(A::B)::MACRO // 2, was expanded to A::B::MACRO +- Changed the expansion of macro arguments such, that these will be expanded + only, if the result is to be used for substitution during the expansion + of the replacement list. + +Wed Jun 11 14:40:29 2003 +- Included a whitespace eating finite state machine (FSM) for minimal + whitespace in the generated output. This was suggested by Paul Mensonides. +- Updated the acknowledgement section + +Wed Jun 4 08:03:04 2003 +- Fixed a bug reported by Faisal Vali, which prevented the correct evaluation + of conditional expressions, if these referenced macro names, which expanded + to a sequence containing non-expandable tokens. +- Fixed the above bug for #elif directives too (in the first place this was + fixed for #if directives only) + +Mon May 26 22:15:40 2003 +- Added missing copyrights in several files. +- Fixed false output, if a unknown _Pragma were encountered. +- Fixed a macro expansion problem with qualified names, were constructs like + the following were not expanded correctly: + #define ID(x) x + #region SCOPE + # define TEST 1 + #endregion + ID(SCOPE::) TEST // should expand to 1 +- Changed #import semantics for macros from copy semantics to reference + semantics, i.e. macros are now considered to be implicitly imported into the + scope, where they are defined. If a macro is imported into another scope and + the original macro is undefined, the imported macro still exists. Further, + if the imported macro is expanded, then while rescanning the original macro + is disabled too: + #region A + # define B(x) x + #endregion + #import A + B (A::B) (*) // A::B(*) + A::B (B) (*) // B(*) + B (B) (*) // B(*) + A::B (A::B) (*) // A::B(*) +- Fixed a recently introduced problem, where placemarker tokens slipped through + to the output under certain conditions (in variadics/C99/C++0x modes only). + +Mon May 19 16:30:49 2003 +- Fixed a bug, which prevented the recognition of the __lparen__, __rparen__ or + __comma__ alternative tokens, if these were the first token after an emitted + #line directive (reported by Vesa Karvonen). +- Added an optimization, that only those tokens are considered for a macro + expansion, which may result in an expansion. + +Tue May 13 18:16:26 2003 +- Fixed a newly introduced problem, where a omitted argument consisting out + of whitespace only were failed to be replaced by a placemarker token. This + lead to problems with constructs like the following: + #define paste(a, b, c) a ## b ## c + paste(1, , 3) // should expand to 13, but expanded to 1## 3 +- Fixed a problem with the tracing support, which throwed an unexpected + exception if there were too few arguments given while expanding a macro. +- Allowed to open and to import the global scope ('#region ::' and + '#import ::'). +- Fixed a bug, if more than one file was given with a --forceinclude command + line option. + +Sat May 10 21:30:29 2003 +- Added __STDC_FULL_REGION__ and __STDC_CURRENT_REGION__ to the list of not + undefinable macros. +- In normal C++ mode and C99 mode the #ifdef/#ifndef and the operator defined() + should not support qualified names. This is fixed now. +- Updated the documentation. +- Fixed minor gcc -Wall compilation warnings. +- Added better error support for qualified names used as arguments for #ifdef, + #ifndef and operator defined(). + +Sat May 10 09:51:18 2003 +- Removed the feature, that the comma before the ellipsis parameter in a macro + definition may be omitted. +- Resolved an issue with the expansion of qualified macros, when these + qualified names were partially generated by a previous macro expansion +- Allowed to specify fully qualified names as arguments to the #region directive + +Wed May 7 22:44:21 2003 +- Changed the names of __SCOPE__ and __FULL_SCOPE__ predefined macros to + __STDC_CURRENT_REGION__ and __STDC_FULL_REGION__ resp. The names are subject + to change if the #region keyword actually will be renamed to #scope/#module + or whatever. +- In C++0x mode it is now possible to omit the last comma before a variadics + ellipsis in a macro definition: + #define cat_i(a, b, c, d, e ...) a ## b ## c ## d ## e +- Fixed a bug in the stringize code, where an ellipsis to stringize resulted in + stringizing of the first ellipsis parameter only. Preserved the original + whitespace delimiting in between the ellipsis arguments. +- Introduced the wave::language_support enum for convenient switching of the + supported language features throughout the library. +- Fixed a bug, which prevented the definition of the predefined macro + __WAVE_HAS_VARRIADICS__, if --variadics were given on the command line. + +Tue May 6 15:49:45 2003 +- Made predefined macros available at every macro scope without qualification. +- Predefined a new macro in C++0x mode: __STDC_GLOBAL__, which is defined at + global macro scope only and equals to '1' (integer literal). +- In C++0x mode there are two new predefined macros: + __SCOPE__: expands to the last part of the qualified name of the + current macro scope + __FULL_SCOPE__: expands to the full qualified name of the current macro + scope + +Mon May 5 23:02:48 2003 +- Fixed a problem in the new well defined token pasting code, which occurred for + constructs like the following: + #define is_empty(...) is_empty_ ## __VA_ARGS__ ## _other + i.e. where two or more '##' operators were contained in the replacement text. +- Implemented __comma__, __lparen__ and __rparen__ alternative pp-tokens, which + may be used as the ',', '(' and ')' tokens during preprocessing. These are + only converted to there respective string representation in a special + translation phase after preprocessing. This was proposed by Vesa Karvonen. +- Changed the macro scoping rules to: "If a qualified name does not find a + nested name, it is not a qualified name to the preprocessor." This seems to + be the simplest usable solution for the possible ambiguities. +- Fixed a bug in the macro expansion engine in C++0x mode, where the skipping + of whitespace inside of a qualified name wasn't consistent. + +Sun May 4 10:48:53 2003 +- Fixed a bug in the expression grammar, which prevented 'not' to be recognized + as a valid operator. +- Qualified names are now supported as parameters to #ifdef and #ifndef too. +- Remove one specialization of the macro expansion engine. It gets instantiated + only twice now (for the main input iterator and for list<>'s of tokens. +- Simplified the required explicit specialization of the defined_grammar + template. It has to be explicitely instantiated by providing the token type + only (just as for the explicit instantiations of the other grammars). + +Fri May 2 22:44:27 2003 +- Qualified names are now allowed as parameters to the operator defined() in + C++0x mode. +- Separated the defined() functionality into a separate translation unit to + work around a VC7.1 ICE. + +Fri May 2 15:38:26 2003 +- The C++0x mode now has a special set of predefined macros. +- The predefined macro __WAVE_HAS_VARIADICS__ is now defined in C99 and C++0x + modes too (--variadics is implied for these modes). +- Updated the documentation to reflect the recent changes and additions. +- In C++0x mode Wave now supports macro scopes: + - new keywords #region/#endregion/#import + - qualified macro names +- In C++0x mode Wave now supports token pasting of unrelated tokens. These are + concatenated, the result is re-tokenized and inserted into the output stream. +- Fixed a minor bug in the macro expansion engine, if a qualified function-like + macro was found in an object-like context. +- Fixed an issue with well defined token pasting of unrelated tokens. + +Tue Apr 29 08:47:37 2003 +- Fixed a bug in the macro expansion engine, which prevented the expansion + of a certain macro under specific conditions (if the left of two tokens to + concatenate were a disabled one (T_NONREPLACABLE_IDENTIFIER), then the + resulting token was disabled too). +- Added additional diagnostics to the Wave driver to disambiguate the C99 and + C++0x modes. +- Implemented a new API function and a corresponding Wave driver command line + option, which allows to specify one or more include files to be preprocessed + before the regular file is preprocessed (the files are processed as normal + input and all the resulting output is included, before processing the regular + input file). The Wave driver command line option is --forceinclude (-F). +- Wave now compiles the Order library from Vesa Karvonen. + +Mon Apr 28 07:57:10 2003 +- Fixed a bug in the macro expansion engine. +- Removed a lot of (not needed) whitespace in the generated output (but still + not optimal). + +Sat Apr 26 20:30:53 2003 +- Fixed a bug in the initialization code of the Slex lexer while working in + C99 mode (reported by Reece Dunn). + +Fri Apr 18 08:37:35 2003 +- Fixed the handling of option_value's inside of pragma directives: + _Pragma("wave option(option_value)") + inside which all all whitespaces were deleted. +- Started to implement experimental macro scoping. + +Thu Apr 10 10:20:07 2003 +- Fixed a problem with the #pragma wave stop(), where only the first token + inside the stop directive was output, when the preprocessor stops in result + of this pragma. +- Implemented a new #pragma wave system(command), which spawns a new operation + system command exactly as specified inside the system directive, intercepts + the stdout output of this process, retokenizes this output and inserts the + generated token sequence in place of the original #pragma or operator _Pragma. + Please note that the generated output is _not_ subject to any macro expansion + before its insertion as the replacement of the pragma itself. If you need to + macro expand the replacement text, you always may force this by writing: + #define SCAN(x) x + SCAN(_Pragma("wave system(...)")) + which re-scans the replacement once. +- Replaced the Wave position_iterator with the boost::spirit::position_iterator + (without any problems!). + +Mon Apr 7 10:45:30 2003 +- Fixed macro_trace_policies::expand_object_like_macro not to be called with + the formal arguments as one of its parameters. +- Updated the documentation to reflect the changes needed for the tracing + stuff. + +Mon Mar 31 19:07:05 2003 +- Fixed variadics support in the trace output. +- Fixed preprocessing of operator _Pragma() before it's execution. +- Added _Pragma("wave stop(errmsg)") (#pragma wave stop(errmsg)) to allow + diagnostics output from inside macro expansion. +- Fixed operator _Pragma for unknown pragmas (these are simply put through to + the output). +- Implemented a maximal possible include nesting depth to avoid an out of + memory error. The initial value for this is configurable through the compile + time constant WAVE_MAX_INCLUDE_LEVEL_DEPTH, which defaults to 1024, if not + given. + Additionally this may be enlarged through a new command line option: + -n/--nesting (Wave driver only). + +Sun Mar 30 20:40:17 2003 +- Implemented the predefined macro __INCLUDE_LEVEL__, which expands to a + decimal integer constant that represents the depth of nesting in include + files. The value of this macro is incremented on every '#include' directive + and decremented at every end of file. +- Implemented the operator _Pragma(). It is recognized in C99 mode and whenever + variadics are enabled. + +Sun Mar 30 08:30:12 2003 +- Changed the tracing format to be more readable. +- Changed the tracing #pragma's to + enable tracing: #pragma wave trace(enable) + disable tracing: #pragma wave trace(disable) + or + enable tracing: #pragma wave trace(1) + disable tracing: #pragma wave trace(0) +- Changed the semantics of the -t (--traceto) switch. Without any -t switch + there isn't generated any trace output at all, even, if the corresponding + #pragma directives are found. To output the trace info to a file, the + '-t file' syntax may be used, to output to std::cerr, the '-t-' (or '-t -') + syntax may be used. + +Fri Mar 28 17:27:25 2003 +- Added a new template parameter to the wave::context<> object, which allows + to specify a policy for controlling the macro expansion tracing. The default + macro_trace_policy does no tracing at all. This way one can add specific + macro expansion tracing facilities to the library. +- #pragma directives starting with a STDC identifier are no longer not macro + expanded in C++ mode, in C++ mode these are now expanded as usual, in C99 + mode not. +- The tracing can be enabled/disabled from inside the preprocessed stream by + inserting a special #pragma directive: + enable tracing: #pragma wave_option(trace: enable) + disable tracing: #pragma wave_option(trace: disable) +- The Wave driver now allows to specify a destination for the macro expansion + tracing trough a new command line switch: '-t path' or '--traceto path'. If + this option isn't given, the trace output goes to stderr. +- The Wave driver now allows to specify the name of the file, where the + preprocessed result stream is to be saved: '-o path' or '--output path'. If + this option is not given, the output goes to stdout. + +Wed Mar 26 20:39:11 2003 +- Fixed a problem with alternative tokens (as 'and', 'or' etc.) and trigraph + tokens, which were not correctly recognized inside #if/#elif expressions. +- Alternative tokens ('and', 'or' etc.) are no longer subject to a possible + macro redefinition. +- Fixed the special handling of 'true' and 'false' during the macro expansion + of #if/#elif expressions. + +Tue Mar 25 12:12:35 2003 +- Released Wave V0.9.1 + +Mon Mar 24 13:34:27 2003 +- Implemented placemarkers, i.e. Wave now supports empty arguments during macro + invocations. This must be enabled by means of a new pp constant: + WAVE_SUPPORT_VARIADICS_PLACEMARKERS which must be defined to enable the + placemarker and variadics code and by defining the command line option + '--variadics' (Wave driver only). +- Implemented variadics, i.e. Wave now supports macros with variable parameter + counts. This must be enabled by means of the pp constant: + WAVE_SUPPORT_VARIADICS_PLACEMARKERS which must be defined to enable the + placemarker and variadics code and by defining the command line option + '--variadics' (Wave driver only). +- Implemented a C99 mode. This mode enables variadics and placemarkers by + default and rejects some specific C++ tokens (as the alternate keywords and + '::', '->*', '.*'). This mode must be enabled by the means of the pp constant + WAVE_SUPPORT_VARIADICS_PLACEMARKERS (see above). The C99 mode is enabled by + the command line switch '--c99' (Wave driver only). + This involved some changes in the C99/C++ lexers. + +Fri Mar 21 16:02:10 2003 +- Fixed a bug in the macro expansion engine, which prevented the expansion of + macros, which name was concatenated out of a identifier and a integer + followed directly by another identifier: + #define X() X_ ## 0R() // note: _zero_ followed by 'R' + #define X_0R() ... + X() // expanded to: X_0R(), but should expand to ... + This is a problem resulting from the fact, that the Standard requires the + preprocessor to act on so called pp-tokens, but Wave acts on C++ tokens. + +Thu Mar 20 21:39:21 2003 +- Fixed a problem with expression parsing (#if/#elif constant expressions), + which failed to produce an error message for expressions like + #if 1 2 3 4 5 + i.e. where the token sequence starts with a valid constant expression, but + the remainder of the line contained other tokens than whitespace. +- Integrated the flex_string class from Andrei Alexandrescu (published on the + CUJ site) to get COW-string behaviour for the token values and position + filename strings. This resulted in a major overall speedup (about 2-3 times + faster in dependency of the complexity of pp usage in the input stream). +- Fixed a bug, which reported ill formed #if/#else expressions as errors, even + if the current if block status (conditional compilation status) is false. +- Added a warning, if the last line of a file does not end with a newline. +- Improved error recognition and handling for malformed preprocessor directives + +Mon Mar 17 19:53:29 2003 +- Fixed a concatenation problem: constructs like a##b##c where expanded + incorrectly. +- Optimized the recognition of pp directives: + - the parser is used only, if the next non-whitespace token starts a pp + directive + - null directives now are recognized without calling the parser + - the parser isn't called anymore, if the if_block_status is false and no + conditional pp directive (#if etc.) is to be recognized. + These optimizations give a speed improvement by upto 40%. +- Removed adjacent whitespace during macro expansion (needs to be revised, + since there is some whitespace left, which may be removed) + +Sun Mar 16 23:19:11 2003 +- Fixed a problem with include paths given on the command line, if the file + to preprocess was not given as a full path (driver executable). +- Fixed a problem with path names containing blanks (driver executable). +- Cleaned command line and argument handling (driver executable). +- Fixed a severe memory leak. +- Fixed a bug, if a C++ keyword was used as a macro name or macro parameter + name, which prevented the macro recognition and expansion to function + properly. +- Implemented the WAVE_SUPPORT_MS_EXTENSIONS compiler switch for the re2c + generated lexer too. +- Fixed a problem, which caused an internal T_PLACEHOLDER token to show up + outside the macro replacement engine. +- Fixed a problem with macro #include directives, which prevents to find the + file to include, if after the macro expansion the token sequence representing + the filename began or ended with at least one whitespace token. +- Fixed a problem, which caused a false error message if the '#' character was + to be concatenated with an arbitrary other token. +- The concatenation of a whitespace token with an arbitrary other token was + reported as illegal token pasting (but it is certainly not). + +Sat Mar 15 21:43:56 2003 +- Added a default constructor to the wave::util::file_position template. +- Report the concatenation of unrelated tokens as an error. +- Finished the documentation. + +Fri Mar 14 20:14:18 2003 +- More work on documentation +- Changed file_position to expose accessor functions (the member variables are + marked as private now). This opens up the possibility to provide another + file_position implementation, which may be optimized in some way. +- Fixed a problem with the token name table, the alternate and trigraph token + names were printed incorrectly. +- Fixed a bug, which prevented the correct recognition of 'defined X' (without + parenthesises). +- Fixed a bug, which allowed to redefine and undefine the predefined name + 'defined'. +- Fixed a bug, which prevents the correct recognition of a macro based #include + directive, if it expands to something like #include <...>. +- Fixed a bug, which prevented the recognition of duplicate macro parameter + names. +- Removed the insertion of additional whitespace inside of string literals + (during stringizing). + +Wed Mar 12 19:16:40 2003 +- Fixed a bug, which prevented the instantiation of the wave::context object + with auxiliary iterators. The token type isn't coupled anymore with the + iterator type. + This required some changes in the interface: + - The wave::context object now has three template parameters (the iterator + type, the token type and the input policy type) + - The token type does not have the iterator type as it's template parameter + anymore. +- Implemented a new position_iterator template on top of the iterator_adaptor<> + template to make it work even for input_iterator type iterators. +- Fixed a bug in the regular expressions for the Slex lexer. +- The function 'set_sys_include_delimiter()' was renamed to + 'set_sysinclude_delimiter()' to better fit the naming scheme of the other + functions. +- Wrote more documentation +- Unified the different token definitions of the lexers, so that there is only + one token type left. This required some changes in the interface: + - There is no need anymore to explicitly specify the namespace of the token + type to use. +- Added the command line option -P to the Wave driver program, which predefines + a macro (i.e. defines it such, that is _not_ undefinable through an #undef + directive from inside the preprocessed program). + +Sat Mar 8 07:46:43 2003 +- Released Wave 0.9.0 + +Thu Mar 6 20:02:44 2003 +- Compiled Wave with IntelV7.0/DinkumwareSTL (from VC6sp5) +- Fixed new compilation problems with gcc -Wall +- Fixed the list_includes and cpp_tokens samples to compile and link correctly. +- Fixed a bug, where a wrong filename was reported by the generated #line + directive. +- Fixed a bug, where the __FILE__ macro was expanded without '\"' around the + filename. +- The generated #line directives and the expanded __FILE__ macro now report + the filename in a native (to the system) format. Additionally the generated + string literals are now escaped correctly. + +Wed Mar 5 21:11:14 2003 +- Reorganized the directory structure to mirror the namespace structure of the + library +- Fixed a bug, where the complete input after the first found #include + directive were eaten up. +- Fixed a bug, where the __LINE__ macro expanded to a incorrect linenumber, if + the __LINE__ macro was encountered on a line after a '\\' '\n' sequence. + +Tue Mar 4 11:50:24 2003 +- The new name of the project is 'Wave'. +- Adjusted namespaces, comments etc. to reflect the new name. +- Added the command line option -U [--undefine], which allows to remove one of + the predefined macros (except __LINE__, __FILE__, __DATE__, __TIME__, + __STDC__ and __cplusplus) + +Sun Mar 2 20:10:04 2003 +- Fixed a bug while expanding macros without any definition part (empty macros) +- The pp-iterator will not emit a newline for every recognized preprocessing + directive anymore. The generated output is much more condensed this way. +- The pp-iterator now emits #line directives at appropriate places. +- Added an additional parser to the library, which may be used to parse macros + given in the command line syntax, i.e. something like 'MACRO(x)=definition'. +- Added the possibility to the cpp driver sample, to add macros from the + command line through the -D command line switch. +- Martin Wille contributed a test script to allow automatic testing of the + cpp driver sample by feeding all files contained in the test_files directory + through the cpp driver and comparing the generated output with the + corresponding expectations. +- Added config file support to allow for predefined option sets (for instance + for the emulation of other compilers) +- Changed the way, how include paths are defined. It resembles now the + behaviour of gcc. + Any directories specified with '-I' options before an eventually given '-I-' + option are searched only for the case of '#include "file"', they are not + searched for '#include <file>' directives. If additional directories are + specified with '-I' options after a '-I-' option was given, these directories + are searched for all '#include' directives. In addition, the '-I-' option + inhibits the use of the current directory as the first search directory for + '#include "file"'. Therefore, the current directory is searched only if it is + requested explicitly with '-I.'. Specifying both '-I-' and '-I.' allows to + control precisely which directories are searched before the current one + and which are searched after. +- Added config file support to the cpp driver. +- stored not only the current 'name' of a file (given eventually by a #line + directive) but in parallel the actual full file system name of this file too. + +Tue Feb 25 21:44:19 2003 +- Fixed the warnings emitted by gcc -Wall. +- Fixed a bug in the cpp grammar, which causes to failing the recognition of + certain preprocessor directives if at the end of this directive were placed + a C++ comment. +- Simplified and extended the insertion of whitespace tokens at places, where + otherwise two adjacent tokens would form a new different token, if + retokenized. + +Mon Feb 24 19:13:46 2003 +- defined() functionality was broken +- added missing typename keywords +- added missing using namespace statements, where appropriate +- added a warning, when a predefined macro is to be undefined (by an #undef + directive) +- removed the 'compile in C mode' hack for the re2c generated lexer (VC7.1 + (final beta) is not able to compile it with optimizations switched on + anyway :( ) +- compiled with gcc 3.2 and Intel V7.0 (20030129Z) + +Sun Feb 23 23:39:33 2003 +- Fixed a couple of 'missing typename' bugs (thanks to Martin Wille) +- Added code to insert whitespace at places, where otherwise two adjacent + tokens would form a new different token, if retokenized. +- Fixed a severe macro expansion bug. +- Added the handling of invalid or not allowed universal character values + inside of string literals and character literals. + +Sat Feb 22 20:52:06 2003 +- Bumped version to 0.9.0 +- Added test for invalid or not allowed universal character values (see + C++ Standard 2.2.2 [lex.charset] and Annex E) +- Fixed a bug with newlines between a macro name and the opening parenthesis + during the macro expansion and a bug with newlines inside the parameter list + during the macro expansion. +- Added the following predefined macros: + __SPIRIT_PP__ + expands to the version number of the pp-iterator lib (i.e. 0x0090 for + V0.9.0) + __SPIRIT_PP_VERSION__ + expands to the full version number of the pp-iterator lib (i.e. + 0x00900436 for V0.9.0.436) + __SPIRIT_PP_VERSION_STR__ + expands to the full version string of the pp-iterator lib (i.e. + "0.9.0.436") + +Fri Feb 21 22:09:04 2003 (feature complete!) +- Allowed to optionally compile the Re2c generated lexer in 'C' mode, because + at least the VC7.1 (final beta) compiler has problems to compile it in 'C++' + mode with optimizations switch on +- Implemented #error and #warning (optional) directives (C++ standard 16.5). + Additionally there are now allowed the following preprocessor configuration + constants: + CPP_PREPROCESS_ERROR_MESSAGE_BODY + if defined, preprocesses the message body of #error and #warning + directives to allow for better diagnostics. + CPP_SUPPORT_WARNING_DIRECTIVE + if defined, then the #warning directive will be recognized such, that + a warning with the given message will be issued +- Adjusted the error handling for the Re2c generated C++ lexer, so that any + error inside the lexer is now propagated as an cpplexer_exception. +- Implemented the #line directive (C++ standard 16.4) +- Implemented #pragma directive (C++ standard 16.6) + Additionally there are now allowed the following preprocessor configuration + constants: + CPP_RETURN_PRAGMA_DIRECTIVES + if defined, then the whole pragma directive is returned as a token + sequence to the caller, if not defined the whole pragma directive is + skipped + CPP_PREPROCESS_PRAGMA_BODY + if defined, then the #pragma body will be preprocessed +- Implemented #include directive with macro arguments (C++ standard 16.2.4) +- Made the namespace structure finer granulated to leave only the main + interface classes in the main namespace cpp. All other classes are moved into + sub-namespaces to reflect the logical dependencies +- Reorganized the public interface of the context<> template class, made all + non relevant functions into the protected. +- Implemented predefined macros (__LINE__ et.al.) (C++ standard 16.8) +- Further documentation work + +Wed Feb 19 23:44:47 2003 +- Corrected a lot of bugs in the macro expansion engine, which now should be + conformant to the C++ standard. +- # (null) directive (C++ standard 16.7) + +Sun Feb 16 08:40:38 2003 +- Added a macro expansion engine which expands macros with arguments + C++ standard 16.3 [cpp.replace] +- Added a new sample: cpp_tokens. This sample preprocesses a given file and + prints out the string representations of all tokens returned from the pp + iterator +- Added documentation (to be continued!) +- Added a couple of small test files to test elementary functionality + (the tests mainly were contributed by Paul Mensonides) +- The main cpp sample is now a simple preprocessor driver program, which + outputs the string representation of the preprocessed input stream. Use + cpp --help to get a hint, how to use it. +- Fixed a bug in the preprocessor grammar which failed to recognize a pp + statement, if there was a C++ comment at the end of the line +- Added '#' operator (C++ standard 16.3.2) [cpp.stringize] +- Fixed a bug in the slex based C++ lexer to handle the concatenation + characters correctly ('\\' followed by a '\n') + +Sun Feb 9 23:01:00 2003 +- Improved error handling for #if et.al. +- Fixed a pair of lexer errors +- Implemented the #if/#elif statements, the sample now contains a complete C++ + expression evaluation engine (for the calculation of the outcome of the + #if/#elif statement conditions) +- Implemented macro replacement (with parameters) +- Implemented the '##' [cpp.concat] operator +- Implemented the defined() [cpp.cond] operator + +Sun Feb 2 23:28:24 2003 +- Implemented the #define, #undef, #ifdef, #ifndef, #else and #endif + statements +- Added optional parse tree output as xml stream (controlled through the config + pp constant CPP_DUMP_PARSE_TREE) + +Fri Jan 31 21:30:55 2003 +- Fixed different minor issues and a border case (#include statement at the + last line of a included file) + +Wed Jan 29 21:13:32 2003 +- Fixed exception handling to report the correct error position +- Fixed another bug in the stream position calculation scheme +- Added a more elaborate sample 'list_includes' which lists the dependency + information for a given source file (see test/list_includes/readme.txt). + +Sat Jan 18 22:01:03 2003 +- Fixed a bug in the stream position calculation scheme +- Made cpp::exceptions more standard conformant (added 'throw()' at appropriate + places) +- Overall housekeeping :-) + +Wed Jan 15 21:54:20 2003 +Changes since project start (still 0.5.0) +- Added #include <...> and #include "..." functionality +- pp directives are now generally recognized +- Decoupled the C++ lexers and the pp grammar to separate compilation + units (optionally) to speed up compilation (a lot!) + +Thu Jan 2 12:39:30 2003 +A completely new version 0.5.0 of the C preprocessor was started. It's a +complete rewrite of the existing code base. The main differences are: +- The preprocessor is now implemented as an iterator, which returns the + current preprocessed token from the input stream. +- The preprocessing of include files isn't implemented through recursion + anymore. This follows directly from the first change. As a result of this + change the internal error handling is simplified. +- The C preprocessor iterator itself is feeded by a new unified C++ lexer + iterator. BTW, this C++ lexer iterator could be used standalone and is not + tied to the C preprocessor. There are two different C++ lexers implemented + now, which are functionally completely identical. These expose a similar + interface, so the C preprocessor could be used with both of them. +- The C++ lexers integrated into the C preprocessor by now are: + Slex: A spirit based table driven regular expression lexer (the slex + engine originally was written by Dan Nuffer and is available as a + separate Spirit sample). + Re2c: A C++ lexer generated with the help of the re2c tool. This C++ + lexer was written as a sample by Dan Nuffer too. + It isn't hard to plug in additional different C++ lexers. There are plans to + integrate a third one written by Juan Carlos Arevalo-Baeza, which is + available as a Spirit sample. + +------------------------------------------------------------------------------- +Tue Feb 12 22:29:50 2002 +Changes from 0.2.3 to 0.2.4: +- Moved XML dumping functions to the main Spirit directory +- Fixed operator '##', it was not correctly implemented somehow :-( + +Sun Feb 10 21:07:19 2002 +Changes from 0.2.2 to 0.2.3: +- Implemented concatenation operator '##' (cpp.concat) +- Removed defined() functionality for Intel compiler (it ICE's) until this + issue is resolved +- Separated code for dumping a parse tree to XML for inclusion in the main + Spirit headers + +Thu Jan 17 23:51:21 2002 +Changes from 0.2.1 to 0.2.2: +- Fixes to compile with gcc 2.95.2 and gcc 3.0.2 (thanks Dan Nuffer) +- Reformatted the grammars to conform to a single formatting guideline +- Assigned explicit rule_id's to the rules of cpp_grammar, so that the + access code to the embedded definition class is not needed anymore +- Fixed a remaining const problem + +Tue Jan 15 23:40:40 2002 +Changes from 0.2.0 to 0.2.1: +- Corrected handling of defined() operator +- In preprocessing conditionals undefined identifiers now correctly + replaced by '0' +- Fixed several const problems +- Added parse_node_iterator for traversing one node in a parse_tree + without going deeper down the hierarchy than one level (this is useful, + if all inspected tokens arranged along a single node in the parse tree. + The main difference to the parse_tree_iterator is, that the underlying + iterator generally can be adjusted correctly after advancing the attached + parse_node_iterator +- Fixed a problem with gcc 2.95.2, which doesn't have a <sstream> header +- Prepared usage of slex for lexer states + +Sun Jan 13 10:21:16 2002 +Changes from 0.1.0 to 0.2.0: +- Added operator 'defined()' +- Added directive '#warning' +- Corrected error reporting +- Added command line option -I- for finer control of the searched include + directories (-I and -I- should now work as in gcc, see readme.html for + more info) +- Corrected conditional preprocessing (should be fully functional now) +- Fixed existing code base for changes made in parse tree support +- Moved parse tree utility functions to a separate header (prepared for + inclusion to the Spirit main library) diff --git a/src/boost/libs/wave/README.md b/src/boost/libs/wave/README.md new file mode 100644 index 000000000..1d42a2211 --- /dev/null +++ b/src/boost/libs/wave/README.md @@ -0,0 +1,8 @@ +# Boost.Wave + +Branch | Travis +---------|-------- +Develop | [![Build Status](https://travis-ci.org/boostorg/wave.svg?branch=develop)](https://travis-ci.org/boostorg/wave) +Master | [![Build Status](https://travis-ci.org/boostorg/wave.svg?branch=master)](https://travis-ci.org/boostorg/wave) + +The Wave C++ preprocessor library is a Standards conformant implementation of the mandated C99/C++ preprocessor functionality packed behind a simple to use interface, which integrates well with the well known idioms of the Standard Template Library (STL). diff --git a/src/boost/libs/wave/build/Jamfile.v2 b/src/boost/libs/wave/build/Jamfile.v2 new file mode 100644 index 000000000..ffc8e2188 --- /dev/null +++ b/src/boost/libs/wave/build/Jamfile.v2 @@ -0,0 +1,63 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Build Jamfile +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2011 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) + +project boost/wave + : requirements + <link>shared:<define>BOOST_ALL_DYN_LINK=1 + <link>static:<define>BOOST_THREAD_USE_LIB=1 + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE + : source-location ../src + ; + +SOURCES = + instantiate_cpp_exprgrammar + instantiate_cpp_grammar + instantiate_cpp_literalgrs + instantiate_defined_grammar + instantiate_predef_macros + instantiate_re2c_lexer + instantiate_re2c_lexer_str + token_ids + wave_config_constant + cpplexer/re2clex/aq + cpplexer/re2clex/cpp_re + ; + +lib boost_wave + : + $(SOURCES) + ../../filesystem/build//boost_filesystem + ../../thread/build//boost_thread + ../../date_time/build//boost_date_time + ; + +for local source in $(SOURCES) +{ + local requirements ; + + # workaround for compiler bug + requirements += <toolset-msvc:version>7.1:<rtti>off ; + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + + if $(source) in cpplexer/re2clex/cpp_re + { + requirements += <warnings>off ; + } + + if $(source) in instantiate_re2c_lexer instantiate_re2c_lexer_str + { + requirements += <toolset>msvc-8.0:<define>_CRT_SECURE_NO_WARNINGS ; + } + + obj $(source) : $(source).cpp : $(requirements) ; +} + +boost-install boost_wave ; diff --git a/src/boost/libs/wave/index.html b/src/boost/libs/wave/index.html new file mode 100644 index 000000000..7a3fa315d --- /dev/null +++ b/src/boost/libs/wave/index.html @@ -0,0 +1,106 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>Wave V2.0</title> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +<link href="doc/theme/style.css" rel="stylesheet" type="text/css"> +</head> +<body style="color: rgb(0, 0, 0); background-image: url(doc/theme/bkd.gif);"> +<table background="doc/theme/bkd2.gif" border="0" cellspacing="2" width="100%"> + <tbody> + <tr> + <td width="21"> </td> + <td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.3</b></font></td> + <td width="96"><a href="http://www.boost.org"><img src="doc/theme/wave.gif" align="right" border="0" height="68" width="93"></a></td> + </tr> + </tbody> +</table> +<br> +<table align="center" border="0" width="75%"> + <tbody> + <tr> + <td class="table_title">Table of Contents</td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/preface.html">Preface</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/introduction.html">Introduction</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/quickstart.html">Quick Start</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><b><font face="Geneva, Arial, Helvetica, san-serif">Class References </font></b></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_context.html">The Context Object</a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_inptpolcy.html">The Input Policy </a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_ctxpolicy.html">The Context Policy</a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_lexer.html">The Lexer Iterator + Interface </a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_tokentype.html">The Token Type</a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/token_ids.html">The Token Identifiers </a></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/class_reference_filepos.html">The File Position</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><b><a href="doc/predefined_macros.html">Predefined Macros</a></b></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/macro_expansion_process.html">The Macro Expansion + Process</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/compiletime_config.html">Compile Time Configuration</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/samples.html">Samples</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><b>The Wave Driver + Executable</b></td> + </tr> + <tr> + <td class="toc_cells_L1"><b><a href="doc/wave_driver.html">The Wave Driver Command Line </a></b></td> + </tr> + <tr> + <td class="toc_cells_L1"><b><a href="doc/tracing_facility.html">The Tracing Facility</a></b></td> + </tr> + <tr> + <td class="toc_cells_L1"><a href="doc/supported_pragmas.html">Supported Pragma + Directives </a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/acknowledgements.html">Acknowledgments</a></td> + </tr> + <tr> + <td class="toc_cells_L0"><a href="doc/references.html">References</a> </td> + </tr> + </tbody> +</table> +<br> +<hr size="1"> +<p class="copyright">Copyright © 2003-2008 + Hartmut Kaiser<br> + <br> + <font size="2">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) </font> </p> +<span class="updated"></span> +<p class="copyright"><span class="updated">Last updated: + <!-- #BeginDate format:fcAm1m -->Saturday, August 6, 2011 20:16<!-- #EndDate --> + </span></p> +</body> +</html> diff --git a/src/boost/libs/wave/meta/libraries.json b/src/boost/libs/wave/meta/libraries.json new file mode 100644 index 000000000..aed119eb5 --- /dev/null +++ b/src/boost/libs/wave/meta/libraries.json @@ -0,0 +1,14 @@ +{ + "key": "wave", + "name": "Wave", + "authors": [ + "Hartmut Kaiser" + ], + "description": "The Boost.Wave library is a Standards conformant, and highly configurable implementation of the mandated C99/C++ preprocessor functionality packed behind an easy to use iterator interface.", + "category": [ + "String" + ], + "maintainers": [ + "Hartmut Kaiser <hartmut.kaiser -at- gmail.com>" + ] +} diff --git a/src/boost/libs/wave/samples/Jamfile.v2 b/src/boost/libs/wave/samples/Jamfile.v2 new file mode 100644 index 000000000..2df785dc2 --- /dev/null +++ b/src/boost/libs/wave/samples/Jamfile.v2 @@ -0,0 +1,21 @@ +# Copyright Vladimir Prus 2004. +# 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) + +project + : requirements <hardcode-dll-paths>true + ; + +build-project advanced_hooks/build ; +build-project cpp_tokens/build ; +build-project lexed_tokens/build ; +build-project list_includes/build ; +build-project quick_start/build ; +build-project waveidl/build ; +build-project hannibal/build ; +build-project real_positions/build ; +build-project token_statistics/build ; +build-project preprocess_pragma_output/build ; +build-project custom_directives/build ; +build-project emit_custom_line_directives/build ; diff --git a/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.cpp b/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.cpp new file mode 100644 index 000000000..37fdbef26 --- /dev/null +++ b/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.cpp @@ -0,0 +1,124 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Sample demonstrating the usage of advanced preprocessor hooks. + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +#include "advanced_hooks.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// Main entry point +// +// This sample shows how to use the advanced hooks to output not only the +// preprocessed tokens but also the conditional directives found in the input +// file (these are commented out, tough) and the tokens from inside the +// conditional block which were not evaluated because the corresponding +// condition was false. These tokens are commented out as well. +// +int main(int argc, char *argv[]) +{ + if (2 != argc) { + 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; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> 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, + advanced_preprocessing_hooks + > context_type; + + // The preprocessor iterator shouldn't be constructed directly. It is + // to be generated through a wave::context<> object. This wave:context<> + // object additionally may be used to initialize and define different + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), argv[1]); + + ctx.set_language(boost::wave::enable_long_long(ctx.get_language())); + ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language())); + ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language())); + + // 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(); + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.hpp b/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.hpp new file mode 100644 index 000000000..c779c0a0f --- /dev/null +++ b/src/boost/libs/wave/samples/advanced_hooks/advanced_hooks.hpp @@ -0,0 +1,167 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED) +#define BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED + +#include <cstdio> +#include <ostream> +#include <string> + +#include <boost/assert.hpp> +#include <boost/config.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/macro_helpers.hpp> +#include <boost/wave/preprocessing_hooks.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// The advanced_preprocessing_hooks policy class is used to register some +// of the more advanced (and probably more rarely used hooks with the Wave +// library. +// +// This policy type is used as a template parameter to the boost::wave::context<> +// object. +// +/////////////////////////////////////////////////////////////////////////////// +class advanced_preprocessing_hooks +: public boost::wave::context_policies::default_preprocessing_hooks +{ +public: + advanced_preprocessing_hooks() : need_comment(true) {} + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_directive' is called, whenever a preprocessor + // directive was encountered, but before the corresponding action is + // executed. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'directive' is a reference to the token holding the + // preprocessing directive. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + template <typename TokenT> + void + found_directive(TokenT const& directive) +#else + template <typename ContextT, typename TokenT> + bool + found_directive(ContextT const& ctx, TokenT const& directive) +#endif + { + // print the commented conditional directives + using namespace boost::wave; + token_id id = token_id(directive); + switch (id) { + case T_PP_IFDEF: + case T_PP_IFNDEF: + case T_PP_IF: + case T_PP_ELIF: + std::cout << "// " << directive.get_value() << " "; + need_comment = false; + break; + + case T_PP_ELSE: + case T_PP_ENDIF: + std::cout << "// " << directive.get_value() << std::endl; + need_comment = true; + break; + + default: + break; + } + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 + return false; +#endif + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'evaluated_conditional_expression' is called, whenever a + // conditional preprocessing expression was evaluated (the expression + // given to a #if, #elif, #ifdef or #ifndef directive) + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'expression' holds the non-expanded token sequence + // comprising the evaluated expression. + // + // The parameter expression_value contains the result of the evaluation of + // the expression in the current preprocessing context. + // + // The return value defines, whether the given expression has to be + // evaluated again, allowing to decide which of the conditional branches + // should be expanded. You need to return 'true' from this hook function + // to force the expression to be re-evaluated. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + template <typename ContainerT> + bool + evaluated_conditional_expression( + ContainerT const& expression, bool expression_value) +#else + template <typename ContextT, typename TokenT, typename ContainerT> + bool + evaluated_conditional_expression(ContextT const &ctx, + TokenT const& directive, ContainerT const& expression, + bool expression_value) +#endif + { + // print the conditional expressions + std::cout << boost::wave::util::impl::as_string(expression) << std::endl; + need_comment = true; + return false; // ok to continue, do not re-evaluate expression + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'skipped_token' is called, whenever a token is about to be + // skipped due to a false preprocessor condition (code fragments to be + // skipped inside the not evaluated conditional #if/#else/#endif branches). + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'token' refers to the token to be skipped. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + template <typename TokenT> + void + skipped_token(TokenT const& token) +#else + template <typename ContextT, typename TokenT> + void + skipped_token(ContextT const& ctx, TokenT const& token) +#endif + { + // prepend a comment at the beginning of all skipped lines + using namespace boost::wave; + if (need_comment && token_id(token) != T_SPACE) { + std::cout << "// "; + need_comment = false; + } + std::cout << token.get_value(); + if (token_id(token) == T_NEWLINE || token_id(token) == T_CPPCOMMENT) + need_comment = true; + } + +private: + bool need_comment; +}; + +#endif // !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED) diff --git a/src/boost/libs/wave/samples/advanced_hooks/build/Jamfile.v2 b/src/boost/libs/wave/samples/advanced_hooks/build/Jamfile.v2 new file mode 100644 index 000000000..9c9f15c45 --- /dev/null +++ b/src/boost/libs/wave/samples/advanced_hooks/build/Jamfile.v2 @@ -0,0 +1,18 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (advanced_hooks) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe advanced_hooks + : ../advanced_hooks.cpp + /boost/wave//boost_wave + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + ; + diff --git a/src/boost/libs/wave/samples/cpp_tokens/build/Jamfile.v2 b/src/boost/libs/wave/samples/cpp_tokens/build/Jamfile.v2 new file mode 100644 index 000000000..597c897d6 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/build/Jamfile.v2 @@ -0,0 +1,38 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (cpp_tokens) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +SOURCES = + ../cpp_tokens + ../instantiate_cpp_exprgrammar + ../instantiate_cpp_grammar + ../instantiate_cpp_literalgrs + ../instantiate_defined_grammar + ../instantiate_slex_lexer + ; + +exe cpp_tokens + : + $(SOURCES) + /boost/wave//boost_wave + /boost/program_options//boost_program_options + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + +for local source in $(SOURCES) +{ + local requirements ; + # workaround for compiler bug + requirements += <toolset-msvc:version>7.1:<rtti>off ; + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + obj $(source) : $(source).cpp : $(requirements) ; +} diff --git a/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.cpp b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.cpp new file mode 100644 index 000000000..5e8ff5edc --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.cpp @@ -0,0 +1,140 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Print out the preprocessed tokens returned by the Wave iterator + + 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-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // global configuration + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// The following files contain the custom lexer type to use +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// include lexer specifics, import lexer names +#if !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION) +#include "slex/cpp_slex_lexer.hpp" +#endif // !defined(BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION) + +/////////////////////////////////////////////////////////////////////////////// +// import required names +using namespace boost::spirit::classic; + +using std::string; +using std::getline; +using std::ifstream; +using std::cout; +using std::cerr; +using std::endl; +using std::ostream; + +/////////////////////////////////////////////////////////////////////////////// +// main program +int +main(int argc, char *argv[]) +{ + if (2 != argc) { + cout << "Usage: cpp_tokens input_file" << endl; + return 1; + } + +// read the file to analyse into a std::string + ifstream infile(argv[1]); + string teststr; + if (infile.is_open()) { + infile.unsetf(std::ios::skipws); +#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) + // this is known to be very slow for large files on some systems + copy (std::istream_iterator<char>(infile), + std::istream_iterator<char>(), + std::inserter(teststr, teststr.end())); +#else + teststr = std::string(std::istreambuf_iterator<char>(infile.rdbuf()), + std::istreambuf_iterator<char>()); +#endif + } + else { + teststr = argv[1]; + } + +// The following typedef does the trick. It defines the context type to use, +// which depends on the lexer type (provided by the second template +// parameter). Our lexer type 'slex_iterator<>' depends on a custom token type +// 'slex_token<>'. Our custom token type differs from the original one provided +// by the Wave library only by defining an additional operator<<(), which is +// used to dump the token information carried by a given token (see loop +// below). + typedef boost::wave::cpplexer::slex_token<> token_type; + typedef boost::wave::cpplexer::slex::slex_iterator<token_type> lexer_type; + typedef boost::wave::context<std::string::iterator, lexer_type> + context_type; + +// The C++ preprocessor iterator shouldn't be constructed directly. It is to be +// generated through a boost::wave::context<> object. This object is +// additionally to be used to initialize and define different parameters of +// the actual preprocessing. +// The preprocessing of the input stream is done on the fly behind the scenes +// during iteration over the context_type::iterator_type stream. + context_type ctx (teststr.begin(), teststr.end(), argv[1]); + + ctx.set_language(boost::wave::support_cpp0x); + ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language())); + ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language())); + ctx.set_language(boost::wave::enable_emit_contnewlines(ctx.get_language())); + + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + context_type::token_type current_token; + + try { + // Traverse over the tokens generated from the input and dump the token + // contents. + while (first != last) { + // retrieve next token + current_token = *first; + + // output token info + cout << "matched " << current_token << endl; + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + cerr + << current_token.get_position().get_file() + << "(" << current_token.get_position().get_line() << "): " + << "unexpected exception: " << e.what() + << endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + cerr + << current_token.get_position().get_file() + << "(" << current_token.get_position().get_line() << "): " + << "unexpected exception." << endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.hpp b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.hpp new file mode 100644 index 000000000..092c01e48 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Print out the preprocessed tokens returned by the Wave iterator + + This sample shows, how it is possible to use a custom lexer object and a + custom token type with the Wave library. + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED) +#define CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// include often used files from the stdlib +#include <iostream> +#include <fstream> +#include <string> + +/////////////////////////////////////////////////////////////////////////////// +// include boost config +#include <boost/config.hpp> // global configuration information + +/////////////////////////////////////////////////////////////////////////////// +// configure this app here (global configuration constants) +#include "cpp_tokens_config.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/pool/pool_alloc.hpp> + +#endif // !defined(CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED) diff --git a/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens_config.hpp b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens_config.hpp new file mode 100644 index 000000000..80fa5ac24 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/cpp_tokens_config.hpp @@ -0,0 +1,55 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Print out the preprocessed tokens returned by the Wave iterator + Configuration data + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED) +#define CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// Uncomment the following, if you need debug output, the +// BOOST_SPIRIT_DEBUG_FLAGS constants below help to fine control the amount of +// the generated debug output +//#define BOOST_SPIRIT_DEBUG + +#if defined(BOOST_SPIRIT_DEBUG) +/////////////////////////////////////////////////////////////////////////////// +// debug flags for the pp-iterator library, possible flags (defined in +// wave_config.hpp): +// +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_GRAMMAR 0x0001 +// #define BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION 0x0002 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR 0x0004 +// #define BOOST_SPIRIT_DEBUG_FLAGS_INTLIT_GRAMMAR 0x0008 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010 +// #define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020 +// #define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040 + +#define BOOST_SPIRIT_DEBUG_FLAGS_CPP (\ + /* insert the required flags from above */ \ + ) \ + /**/ +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Include the configuration stuff for the Wave library itself +#include <boost/wave/wave_config.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// MSVC specific #pragma's +#if defined(BOOST_MSVC) +#pragma warning (disable: 4355) // 'this' used in base member initializer list +#pragma warning (disable: 4800) // forcing value to bool 'true' or 'false' +#pragma inline_depth(255) +#pragma inline_recursion(on) +#endif // defined(BOOST_MSVC) + +#endif // !defined(CPP_TOKENS_HPP_7C0F1F14_6ACA_4439_A073_32C61C0DB6C5_INCLUDED) diff --git a/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp new file mode 100644 index 000000000..0c4fa1298 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: prints out the preprocessed tokens returned by the pp iterator + Explicit instantiation of the cpp_expression_grammar parsing + function + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +#include <boost/wave/grammars/cpp_expression_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the expression_grammar_gen template with the +// correct token type. This instantiates the corresponding parse function, +// which in turn instantiates the expression_grammar object (see +// wave/grammars/cpp_expression_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::slex_token<> token_type; + +template struct boost::wave::grammars::expression_grammar_gen<token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..5781f83d7 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_grammar.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: prints out the preprocessed tokens returned by the pp iterator + Explicit instantiation of the cpp_grammar parsing function + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/token_ids.hpp> + +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +#include <boost/wave/grammars/cpp_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::slex_token<> token_type; +typedef boost::wave::cpplexer::slex::slex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp new file mode 100644 index 000000000..48758679e --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: prints out the preprocessed tokens returned by the pp iterator + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +#include <boost/wave/grammars/cpp_literal_grammar_gen.hpp> +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the intlit_grammar_gen, chlit_grammar_gen and +// floatlit_grammar_gen templates with the correct token type. This +// instantiates the corresponding parse function, which in turn instantiates +// the corresponding parser object. +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::slex_token<> token_type; + +template struct boost::wave::grammars::intlit_grammar_gen<token_type>; +#if BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_AUTOSELECT || \ + BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_FORCE_SIGNED +template struct boost::wave::grammars::chlit_grammar_gen<int, token_type>; +#endif +template struct boost::wave::grammars::chlit_grammar_gen<unsigned int, token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/cpp_tokens/instantiate_defined_grammar.cpp b/src/boost/libs/wave/samples/cpp_tokens/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..acec5c481 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/instantiate_defined_grammar.cpp @@ -0,0 +1,39 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::slex::slex_iterator< + boost::wave::cpplexer::slex_token<> > + lexer_type; +template struct boost::wave::grammars::defined_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/cpp_tokens/instantiate_slex_lexer.cpp b/src/boost/libs/wave/samples/cpp_tokens/instantiate_slex_lexer.cpp new file mode 100644 index 000000000..bbdcdd108 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/instantiate_slex_lexer.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + 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-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include "cpp_tokens.hpp" // config data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "slex_token.hpp" +#include "slex_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include "slex/cpp_slex_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the parameters +// supplied while instantiating the context<> template. +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::cpplexer::slex::new_lexer_gen< + std::string::iterator>; + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp b/src/boost/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp new file mode 100644 index 000000000..ffaa1904d --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp @@ -0,0 +1,827 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + SLex (Spirit Lex) based C++ lexer + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED) +#define SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED + +#include <string> +#if defined(BOOST_SPIRIT_DEBUG) +#include <iostream> +#endif // defined(BOOST_SPIRIT_DEBUG) + +#include <boost/assert.hpp> +#include <boost/spirit/include/classic_core.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/util/time_conversion_helper.hpp> +#include <boost/wave/cpplexer/validate_universal_char.hpp> +#include <boost/wave/cpplexer/convert_trigraphs.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 +#include <boost/wave/cpplexer/detect_include_guards.hpp> +#endif +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> + +#include "../slex_interface.hpp" +#include "../slex_token.hpp" +#include "../slex_iterator.hpp" + +#include "lexer.hpp" // "spirit/lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace slex { +namespace lexer { + +/////////////////////////////////////////////////////////////////////////////// +// The following numbers are the array sizes of the token regex's which we +// need to specify to make the CW compiler happy (at least up to V9.5). +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 +#define INIT_DATA_SIZE 175 +#else +#define INIT_DATA_SIZE 158 +#endif +#define INIT_DATA_CPP_SIZE 15 +#define INIT_DATA_PP_NUMBER_SIZE 2 +#define INIT_DATA_CPP0X_SIZE 15 + +/////////////////////////////////////////////////////////////////////////////// +// +// encapsulation of the boost::spirit::classic::slex based cpp lexer +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// The following lexer_base class was necessary to workaround a CodeWarrior +// bug (at least up to CW V9.5). +template <typename IteratorT, typename PositionT> +class lexer_base +: public boost::spirit::classic::lexer< + boost::wave::util::position_iterator<IteratorT, PositionT> > +{ +protected: + typedef boost::wave::util::position_iterator<IteratorT, PositionT> + iterator_type; + typedef typename std::iterator_traits<IteratorT>::value_type char_type; + typedef boost::spirit::classic::lexer<iterator_type> base_type; + + lexer_base(); + +// initialization data (regular expressions for the token definitions) + struct lexer_data { + token_id tokenid; // token data + char_type const *tokenregex; // associated token to match + typename base_type::callback_t tokencb; // associated callback function + unsigned int lexerstate; // valid for lexer state + }; +}; + +/////////////////////////////////////////////////////////////////////////////// +template <typename IteratorT, typename PositionT> +class lexer +: public lexer_base<IteratorT, PositionT> +{ +public: + typedef boost::wave::cpplexer::slex_token<PositionT> token_type; + + void init_dfa(boost::wave::language_support language); + +// get time of last compilation + static std::time_t get_compilation_time() + { return compilation_time.get_time(); } + +// helper for calculation of the time of last compilation + static boost::wave::util::time_conversion_helper compilation_time; + +private: + typedef lexer_base<IteratorT, PositionT> base_type; + + static typename base_type::lexer_data const init_data[INIT_DATA_SIZE]; // common patterns + static typename base_type::lexer_data const init_data_cpp[INIT_DATA_CPP_SIZE]; // C++ only patterns + static typename base_type::lexer_data const init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE]; // pp-number only patterns + static typename base_type::lexer_data const init_data_cpp0x[INIT_DATA_CPP0X_SIZE]; // C++0X only patterns +}; + +/////////////////////////////////////////////////////////////////////////////// +// data required for initialization of the lexer (token definitions) +#define OR "|" +#define Q(c) "\\" c +#define TRI(c) Q("?") Q("?") c + +// definition of some sub-token regexps to simplify the regex definitions +#define BLANK "[ \\t]" +#define CCOMMENT \ + Q("/") Q("*") "[^*]*" Q("*") "+" "(" "[^/*][^*]*" Q("*") "+" ")*" Q("/") + +#define PPSPACE "(" BLANK OR CCOMMENT ")*" + +#define OCTALDIGIT "[0-7]" +#define DIGIT "[0-9]" +#define HEXDIGIT "[0-9a-fA-F]" +#define OPTSIGN "[-+]?" +#define EXPSTART "[eE]" "[-+]" +#define EXPONENT "(" "[eE]" OPTSIGN "[0-9]+" ")" +#define NONDIGIT "[a-zA-Z_]" + +#define INTEGER \ + "(" "(0x|0X)" HEXDIGIT "+" OR "0" OCTALDIGIT "*" OR "[1-9]" DIGIT "*" ")" + +#define INTEGER_SUFFIX "(" "[uU][lL]?|[lL][uU]?" ")" +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 +#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \ + "(" "[lL][lL]" ")" "[uU]" "?" OR \ + "i64" \ + ")" +#else +#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \ + "(" "[lL][lL]" ")" "[uU]" "?" ")" +#endif +#define FLOAT_SUFFIX "(" "[fF][lL]?" OR "[lL][fF]?" ")" +#define CHAR_SPEC "L?" +#define EXTCHAR_SPEC "(" "[uU]" OR "u8" ")" + +#define BACKSLASH "(" Q("\\") OR TRI(Q("/")) ")" +#define ESCAPESEQ "(" BACKSLASH "(" \ + "[abfnrtv?'\"]" OR \ + BACKSLASH OR \ + "x" HEXDIGIT "+" OR \ + OCTALDIGIT OCTALDIGIT "?" OCTALDIGIT "?" \ + "))" +#define HEXQUAD "(" HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT ")" +#define UNIVERSALCHAR "(" BACKSLASH "(" \ + "u" HEXQUAD OR \ + "U" HEXQUAD HEXQUAD \ + "))" + +#define POUNDDEF "(" "#" OR TRI("=") OR Q("%:") ")" +#define NEWLINEDEF "(" "\n" OR "\r" OR "\r\n" ")" + +#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 +#define INCLUDEDEF "(include|include_next)" +#else +#define INCLUDEDEF "include" +#endif + +#define PP_NUMBERDEF Q(".") "?" DIGIT "(" DIGIT OR NONDIGIT OR EXPSTART OR Q(".") ")*" + +/////////////////////////////////////////////////////////////////////////////// +// lexer state constants +#define LEXER_STATE_NORMAL 0 +#define LEXER_STATE_PP 1 + +#define NUM_LEXER_STATES 1 + +// helper for initializing token data +#define TOKEN_DATA(id, regex) \ + { T_##id, regex, 0, LEXER_STATE_NORMAL } \ + /**/ + +#define TOKEN_DATA_EX(id, regex, callback) \ + { T_##id, regex, callback, LEXER_STATE_NORMAL } \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +// common C++/C99 token definitions +template <typename IteratorT, typename PositionT> +typename lexer_base<IteratorT, PositionT>::lexer_data const +lexer<IteratorT, PositionT>::init_data[INIT_DATA_SIZE] = +{ + TOKEN_DATA(AND, "&"), + TOKEN_DATA(ANDAND, "&&"), + TOKEN_DATA(ASSIGN, "="), + TOKEN_DATA(ANDASSIGN, "&="), + TOKEN_DATA(OR, Q("|")), + TOKEN_DATA(OR_TRIGRAPH, TRI("!")), + TOKEN_DATA(ORASSIGN, Q("|=")), + TOKEN_DATA(ORASSIGN_TRIGRAPH, TRI("!=")), + TOKEN_DATA(XOR, Q("^")), + TOKEN_DATA(XOR_TRIGRAPH, TRI("'")), + TOKEN_DATA(XORASSIGN, Q("^=")), + TOKEN_DATA(XORASSIGN_TRIGRAPH, TRI("'=")), + TOKEN_DATA(COMMA, ","), + TOKEN_DATA(COLON, ":"), + TOKEN_DATA(DIVIDEASSIGN, Q("/=")), + TOKEN_DATA(DIVIDE, Q("/")), + TOKEN_DATA(DOT, Q(".")), + TOKEN_DATA(ELLIPSIS, Q(".") Q(".") Q(".")), + TOKEN_DATA(EQUAL, "=="), + TOKEN_DATA(GREATER, ">"), + TOKEN_DATA(GREATEREQUAL, ">="), + TOKEN_DATA(LEFTBRACE, Q("{")), + TOKEN_DATA(LEFTBRACE_ALT, "<" Q("%")), + TOKEN_DATA(LEFTBRACE_TRIGRAPH, TRI("<")), + TOKEN_DATA(LESS, "<"), + TOKEN_DATA(LESSEQUAL, "<="), + TOKEN_DATA(LEFTPAREN, Q("(")), + TOKEN_DATA(LEFTBRACKET, Q("[")), + TOKEN_DATA(LEFTBRACKET_ALT, "<:"), + TOKEN_DATA(LEFTBRACKET_TRIGRAPH, TRI(Q("("))), + TOKEN_DATA(MINUS, Q("-")), + TOKEN_DATA(MINUSASSIGN, Q("-=")), + TOKEN_DATA(MINUSMINUS, Q("-") Q("-")), + TOKEN_DATA(PERCENT, Q("%")), + TOKEN_DATA(PERCENTASSIGN, Q("%=")), + TOKEN_DATA(NOT, "!"), + TOKEN_DATA(NOTEQUAL, "!="), + TOKEN_DATA(OROR, Q("|") Q("|")), + TOKEN_DATA(OROR_TRIGRAPH, TRI("!") Q("|") OR Q("|") TRI("!") OR TRI("!") TRI("!")), + TOKEN_DATA(PLUS, Q("+")), + TOKEN_DATA(PLUSASSIGN, Q("+=")), + TOKEN_DATA(PLUSPLUS, Q("+") Q("+")), + TOKEN_DATA(ARROW, Q("->")), + TOKEN_DATA(QUESTION_MARK, Q("?")), + TOKEN_DATA(RIGHTBRACE, Q("}")), + TOKEN_DATA(RIGHTBRACE_ALT, Q("%>")), + TOKEN_DATA(RIGHTBRACE_TRIGRAPH, TRI(">")), + TOKEN_DATA(RIGHTPAREN, Q(")")), + TOKEN_DATA(RIGHTBRACKET, Q("]")), + TOKEN_DATA(RIGHTBRACKET_ALT, ":>"), + TOKEN_DATA(RIGHTBRACKET_TRIGRAPH, TRI(Q(")"))), + TOKEN_DATA(SEMICOLON, ";"), + TOKEN_DATA(SHIFTLEFT, "<<"), + TOKEN_DATA(SHIFTLEFTASSIGN, "<<="), + TOKEN_DATA(SHIFTRIGHT, ">>"), + TOKEN_DATA(SHIFTRIGHTASSIGN, ">>="), + TOKEN_DATA(STAR, Q("*")), + TOKEN_DATA(COMPL, Q("~")), + TOKEN_DATA(COMPL_TRIGRAPH, TRI("-")), + TOKEN_DATA(STARASSIGN, Q("*=")), + TOKEN_DATA(ASM, "asm"), + TOKEN_DATA(AUTO, "auto"), + TOKEN_DATA(BOOL, "bool"), + TOKEN_DATA(FALSE, "false"), + TOKEN_DATA(TRUE, "true"), + TOKEN_DATA(BREAK, "break"), + TOKEN_DATA(CASE, "case"), + TOKEN_DATA(CATCH, "catch"), + TOKEN_DATA(CHAR, "char"), + TOKEN_DATA(CLASS, "class"), + TOKEN_DATA(CONST, "const"), + TOKEN_DATA(CONSTCAST, "const_cast"), + TOKEN_DATA(CONTINUE, "continue"), + TOKEN_DATA(DEFAULT, "default"), + TOKEN_DATA(DELETE, "delete"), + TOKEN_DATA(DO, "do"), + TOKEN_DATA(DOUBLE, "double"), + TOKEN_DATA(DYNAMICCAST, "dynamic_cast"), + TOKEN_DATA(ELSE, "else"), + TOKEN_DATA(ENUM, "enum"), + TOKEN_DATA(EXPLICIT, "explicit"), + TOKEN_DATA(EXPORT, "export"), + TOKEN_DATA(EXTERN, "extern"), + TOKEN_DATA(FLOAT, "float"), + TOKEN_DATA(FOR, "for"), + TOKEN_DATA(FRIEND, "friend"), + TOKEN_DATA(GOTO, "goto"), + TOKEN_DATA(IF, "if"), + TOKEN_DATA(INLINE, "inline"), + TOKEN_DATA(INT, "int"), + TOKEN_DATA(LONG, "long"), + TOKEN_DATA(MUTABLE, "mutable"), + TOKEN_DATA(NAMESPACE, "namespace"), + TOKEN_DATA(NEW, "new"), + TOKEN_DATA(OPERATOR, "operator"), + TOKEN_DATA(PRIVATE, "private"), + TOKEN_DATA(PROTECTED, "protected"), + TOKEN_DATA(PUBLIC, "public"), + TOKEN_DATA(REGISTER, "register"), + TOKEN_DATA(REINTERPRETCAST, "reinterpret_cast"), + TOKEN_DATA(RETURN, "return"), + TOKEN_DATA(SHORT, "short"), + TOKEN_DATA(SIGNED, "signed"), + TOKEN_DATA(SIZEOF, "sizeof"), + TOKEN_DATA(STATIC, "static"), + TOKEN_DATA(STATICCAST, "static_cast"), + TOKEN_DATA(STRUCT, "struct"), + TOKEN_DATA(SWITCH, "switch"), + TOKEN_DATA(TEMPLATE, "template"), + TOKEN_DATA(THIS, "this"), + TOKEN_DATA(THROW, "throw"), + TOKEN_DATA(TRY, "try"), + TOKEN_DATA(TYPEDEF, "typedef"), + TOKEN_DATA(TYPEID, "typeid"), + TOKEN_DATA(TYPENAME, "typename"), + TOKEN_DATA(UNION, "union"), + TOKEN_DATA(UNSIGNED, "unsigned"), + TOKEN_DATA(USING, "using"), + TOKEN_DATA(VIRTUAL, "virtual"), + TOKEN_DATA(VOID, "void"), + TOKEN_DATA(VOLATILE, "volatile"), + TOKEN_DATA(WCHART, "wchar_t"), + TOKEN_DATA(WHILE, "while"), + TOKEN_DATA(PP_DEFINE, POUNDDEF PPSPACE "define"), + TOKEN_DATA(PP_IF, POUNDDEF PPSPACE "if"), + TOKEN_DATA(PP_IFDEF, POUNDDEF PPSPACE "ifdef"), + TOKEN_DATA(PP_IFNDEF, POUNDDEF PPSPACE "ifndef"), + TOKEN_DATA(PP_ELSE, POUNDDEF PPSPACE "else"), + TOKEN_DATA(PP_ELIF, POUNDDEF PPSPACE "elif"), + TOKEN_DATA(PP_ENDIF, POUNDDEF PPSPACE "endif"), + TOKEN_DATA(PP_ERROR, POUNDDEF PPSPACE "error"), + TOKEN_DATA(PP_QHEADER, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE Q("\"") "[^\\n\\r\"]+" Q("\"")), + TOKEN_DATA(PP_HHEADER, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE "<" "[^\\n\\r>]+" ">"), + TOKEN_DATA(PP_INCLUDE, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE), + TOKEN_DATA(PP_LINE, POUNDDEF PPSPACE "line"), + TOKEN_DATA(PP_PRAGMA, POUNDDEF PPSPACE "pragma"), + TOKEN_DATA(PP_UNDEF, POUNDDEF PPSPACE "undef"), + TOKEN_DATA(PP_WARNING, POUNDDEF PPSPACE "warning"), +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + TOKEN_DATA(MSEXT_INT8, "__int8"), + TOKEN_DATA(MSEXT_INT16, "__int16"), + TOKEN_DATA(MSEXT_INT32, "__int32"), + TOKEN_DATA(MSEXT_INT64, "__int64"), + TOKEN_DATA(MSEXT_BASED, "_?" "_based"), + TOKEN_DATA(MSEXT_DECLSPEC, "_?" "_declspec"), + TOKEN_DATA(MSEXT_CDECL, "_?" "_cdecl"), + TOKEN_DATA(MSEXT_FASTCALL, "_?" "_fastcall"), + TOKEN_DATA(MSEXT_STDCALL, "_?" "_stdcall"), + TOKEN_DATA(MSEXT_TRY , "__try"), + TOKEN_DATA(MSEXT_EXCEPT, "__except"), + TOKEN_DATA(MSEXT_FINALLY, "__finally"), + TOKEN_DATA(MSEXT_LEAVE, "__leave"), + TOKEN_DATA(MSEXT_INLINE, "_?" "_inline"), + TOKEN_DATA(MSEXT_ASM, "_?" "_asm"), + TOKEN_DATA(MSEXT_PP_REGION, POUNDDEF PPSPACE "region"), + TOKEN_DATA(MSEXT_PP_ENDREGION, POUNDDEF PPSPACE "endregion"), +#endif // BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 +// TOKEN_DATA(OCTALINT, "0" OCTALDIGIT "*" INTEGER_SUFFIX "?"), +// TOKEN_DATA(DECIMALINT, "[1-9]" DIGIT "*" INTEGER_SUFFIX "?"), +// TOKEN_DATA(HEXAINT, "(0x|0X)" HEXDIGIT "+" INTEGER_SUFFIX "?"), + TOKEN_DATA(LONGINTLIT, INTEGER LONGINTEGER_SUFFIX), + TOKEN_DATA(INTLIT, INTEGER INTEGER_SUFFIX "?"), + TOKEN_DATA(FLOATLIT, + "(" DIGIT "*" Q(".") DIGIT "+" OR DIGIT "+" Q(".") ")" + EXPONENT "?" FLOAT_SUFFIX "?" OR + DIGIT "+" EXPONENT FLOAT_SUFFIX "?"), + TOKEN_DATA(CCOMMENT, CCOMMENT), + TOKEN_DATA(CPPCOMMENT, Q("/") Q("/[^\\n\\r]*") NEWLINEDEF ), + TOKEN_DATA(CHARLIT, CHAR_SPEC "'" + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\n\\r\\\\']" ")+" "'"), + TOKEN_DATA(STRINGLIT, CHAR_SPEC Q("\"") + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\n\\r\\\\\"]" ")*" Q("\"")), +#if BOOST_WAVE_USE_STRICT_LEXER != 0 + TOKEN_DATA(IDENTIFIER, "([a-zA-Z_]" OR UNIVERSALCHAR ")([a-zA-Z0-9_]" OR UNIVERSALCHAR ")*"), +#else + TOKEN_DATA(IDENTIFIER, "([a-zA-Z_$]" OR UNIVERSALCHAR ")([a-zA-Z0-9_$]" OR UNIVERSALCHAR ")*"), +#endif + TOKEN_DATA(SPACE, "[ \t\v\f]+"), +// TOKEN_DATA(SPACE2, "[\\v\\f]+"), + TOKEN_DATA(CONTLINE, Q("\\") "\n"), + TOKEN_DATA(NEWLINE, NEWLINEDEF), + TOKEN_DATA(POUND_POUND, "##"), + TOKEN_DATA(POUND_POUND_ALT, Q("%:") Q("%:")), + TOKEN_DATA(POUND_POUND_TRIGRAPH, TRI("=") TRI("=")), + TOKEN_DATA(POUND, "#"), + TOKEN_DATA(POUND_ALT, Q("%:")), + TOKEN_DATA(POUND_TRIGRAPH, TRI("=")), + TOKEN_DATA(ANY_TRIGRAPH, TRI(Q("/"))), + TOKEN_DATA(ANY, "."), // this should be the last recognized token + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// C++ only token definitions +template <typename IteratorT, typename PositionT> +typename lexer_base<IteratorT, PositionT>::lexer_data const +lexer<IteratorT, PositionT>::init_data_cpp[INIT_DATA_CPP_SIZE] = +{ + TOKEN_DATA(AND_ALT, "bitand"), + TOKEN_DATA(ANDASSIGN_ALT, "and_eq"), + TOKEN_DATA(ANDAND_ALT, "and"), + TOKEN_DATA(OR_ALT, "bitor"), + TOKEN_DATA(ORASSIGN_ALT, "or_eq"), + TOKEN_DATA(OROR_ALT, "or"), + TOKEN_DATA(XORASSIGN_ALT, "xor_eq"), + TOKEN_DATA(XOR_ALT, "xor"), + TOKEN_DATA(NOTEQUAL_ALT, "not_eq"), + TOKEN_DATA(NOT_ALT, "not"), + TOKEN_DATA(COMPL_ALT, "compl"), +#if BOOST_WAVE_SUPPORT_IMPORT_KEYWORD != 0 + TOKEN_DATA(IMPORT, "import"), +#endif + TOKEN_DATA(ARROWSTAR, Q("->") Q("*")), + TOKEN_DATA(DOTSTAR, Q(".") Q("*")), + TOKEN_DATA(COLON_COLON, "::"), + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// C++ only token definitions +template <typename IteratorT, typename PositionT> +typename lexer_base<IteratorT, PositionT>::lexer_data const +lexer<IteratorT, PositionT>::init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE] = +{ + TOKEN_DATA(PP_NUMBER, PP_NUMBERDEF), + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// C++ only token definitions + +#define T_EXTCHARLIT token_id(T_CHARLIT|AltTokenType) +#define T_EXTSTRINGLIT token_id(T_STRINGLIT|AltTokenType) +#define T_EXTRAWSTRINGLIT token_id(T_RAWSTRINGLIT|AltTokenType) + +template <typename IteratorT, typename PositionT> +typename lexer_base<IteratorT, PositionT>::lexer_data const +lexer<IteratorT, PositionT>::init_data_cpp0x[INIT_DATA_CPP0X_SIZE] = +{ + TOKEN_DATA(EXTCHARLIT, EXTCHAR_SPEC "'" + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\n\\r\\\\']" ")+" "'"), + TOKEN_DATA(EXTSTRINGLIT, EXTCHAR_SPEC Q("\"") + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\n\\r\\\\\"]" ")*" Q("\"")), + TOKEN_DATA(RAWSTRINGLIT, CHAR_SPEC "R" Q("\"") + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\\\\"]" ")*" Q("\"")), + TOKEN_DATA(EXTRAWSTRINGLIT, EXTCHAR_SPEC "R" Q("\"") + "(" ESCAPESEQ OR UNIVERSALCHAR OR "[^\\\\\"]" ")*" Q("\"")), + TOKEN_DATA(ALIGNAS, "alignas"), + TOKEN_DATA(ALIGNOF, "alignof"), + TOKEN_DATA(CHAR16_T, "char16_t"), + TOKEN_DATA(CHAR32_T, "char32_t"), + TOKEN_DATA(CONSTEXPR, "constexpr"), + TOKEN_DATA(DECLTYPE, "decltype"), + TOKEN_DATA(NOEXCEPT, "noexcept"), + TOKEN_DATA(NULLPTR, "nullptr"), + TOKEN_DATA(STATICASSERT, "static_assert"), + TOKEN_DATA(THREADLOCAL, "threadlocal"), + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// undefine macros, required for regular expression definitions +#undef INCLUDEDEF +#undef POUNDDEF +#undef CCOMMENT +#undef PPSPACE +#undef DIGIT +#undef OCTALDIGIT +#undef HEXDIGIT +#undef NONDIGIT +#undef OPTSIGN +#undef EXPSTART +#undef EXPONENT +#undef LONGINTEGER_SUFFIX +#undef INTEGER_SUFFIX +#undef INTEGER +#undef FLOAT_SUFFIX +#undef CHAR_SPEC +#undef BACKSLASH +#undef ESCAPESEQ +#undef HEXQUAD +#undef UNIVERSALCHAR +#undef PP_NUMBERDEF + +#undef Q +#undef TRI +#undef OR + +#undef TOKEN_DATA +#undef TOKEN_DATA_EX + +/////////////////////////////////////////////////////////////////////////////// +// initialize cpp lexer with token data +template <typename IteratorT, typename PositionT> +inline +lexer_base<IteratorT, PositionT>::lexer_base() +: base_type(NUM_LEXER_STATES) +{ +} + +template <typename IteratorT, typename PositionT> +inline void +lexer<IteratorT, PositionT>::init_dfa(boost::wave::language_support lang) +{ + if (this->has_compiled_dfa()) + return; + +// if pp-numbers should be preferred, insert the corresponding rule first + if (boost::wave::need_prefer_pp_numbers(lang)) { + for (int j = 0; 0 != init_data_pp_number[j].tokenid; ++j) { + this->register_regex(init_data_pp_number[j].tokenregex, + init_data_pp_number[j].tokenid, init_data_pp_number[j].tokencb, + init_data_pp_number[j].lexerstate); + } + } + +// if in C99 mode, some of the keywords are not valid + if (!boost::wave::need_c99(lang)) { + for (int j = 0; 0 != init_data_cpp[j].tokenid; ++j) { + this->register_regex(init_data_cpp[j].tokenregex, + init_data_cpp[j].tokenid, init_data_cpp[j].tokencb, + init_data_cpp[j].lexerstate); + } + } + +// if in C++0x mode, add all new keywords +#if BOOST_WAVE_SUPPORT_CPP0X != 0 + if (boost::wave::need_cpp0x(lang)) { + for (int j = 0; 0 != init_data_cpp0x[j].tokenid; ++j) { + this->register_regex(init_data_cpp0x[j].tokenregex, + init_data_cpp0x[j].tokenid, init_data_cpp0x[j].tokencb, + init_data_cpp0x[j].lexerstate); + } + } +#endif + + for (int i = 0; 0 != init_data[i].tokenid; ++i) { + this->register_regex(init_data[i].tokenregex, init_data[i].tokenid, + init_data[i].tokencb, init_data[i].lexerstate); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// get time of last compilation of this file +template <typename IteratorT, typename PositionT> +boost::wave::util::time_conversion_helper + lexer<IteratorT, PositionT>::compilation_time(__DATE__ " " __TIME__); + +/////////////////////////////////////////////////////////////////////////////// +} // namespace lexer + +/////////////////////////////////////////////////////////////////////////////// +// +template <typename IteratorT, typename PositionT> +inline void +init_lexer (lexer::lexer<IteratorT, PositionT> &lexer, + boost::wave::language_support language, bool force_reinit = false) +{ + if (lexer.has_compiled_dfa()) + return; // nothing to do + + using std::ifstream; + using std::ofstream; + using std::ios; + using std::cerr; + using std::endl; + +ifstream dfa_in("wave_slex_lexer.dfa", ios::in|ios::binary); + + lexer.init_dfa(language); + if (force_reinit || !dfa_in.is_open() || + !lexer.load (dfa_in, (long)lexer.get_compilation_time())) + { +#if defined(BOOST_SPIRIT_DEBUG) + cerr << "Compiling regular expressions for slex ..."; +#endif // defined(BOOST_SPIRIT_DEBUG) + + dfa_in.close(); + lexer.create_dfa(); + + ofstream dfa_out ("wave_slex_lexer.dfa", ios::out|ios::binary|ios::trunc); + + if (dfa_out.is_open()) + lexer.save (dfa_out, (long)lexer.get_compilation_time()); + +#if defined(BOOST_SPIRIT_DEBUG) + cerr << " Done." << endl; +#endif // defined(BOOST_SPIRIT_DEBUG) + } +} + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_functor +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename IteratorT, typename PositionT = wave::util::file_position_type> +class slex_functor +: public slex_input_interface< + typename lexer::lexer<IteratorT, PositionT>::token_type + > +{ +public: + + typedef boost::wave::util::position_iterator<IteratorT, PositionT> + iterator_type; + typedef typename std::iterator_traits<IteratorT>::value_type char_type; + typedef BOOST_WAVE_STRINGTYPE string_type; + typedef typename lexer::lexer<IteratorT, PositionT>::token_type token_type; + + slex_functor(IteratorT const &first_, IteratorT const &last_, + PositionT const &pos_, boost::wave::language_support language_) + : first(first_, last_, pos_), language(language_), at_eof(false) + { + // initialize lexer dfa tables + init_lexer(lexer, language_); + } + virtual ~slex_functor() {} + +// get the next token from the input stream + token_type& get(token_type& result) + { + if (!at_eof) { + do { + // generate and return the next token + std::string value; + PositionT pos = first.get_position(); // begin of token position + token_id id = token_id(lexer.next_token(first, last, &value)); + + if ((token_id)(-1) == id) + id = T_EOF; // end of input reached + + string_type token_val(value.c_str()); + + if (boost::wave::need_emit_contnewlines(language) || + T_CONTLINE != id) + { + // The cast should avoid spurious warnings about missing case labels + // for the other token ids's. + switch (id) { + case T_IDENTIFIER: + // test identifier characters for validity (throws if + // invalid chars found) + if (!boost::wave::need_no_character_validation(language)) { + using boost::wave::cpplexer::impl::validate_identifier_name; + validate_identifier_name(token_val, + pos.get_line(), pos.get_column(), pos.get_file()); + } + break; + + case T_EXTCHARLIT: + case T_EXTSTRINGLIT: + case T_EXTRAWSTRINGLIT: + id = token_id(id & ~AltTokenType); + BOOST_FALLTHROUGH; + + case T_CHARLIT: + case T_STRINGLIT: + case T_RAWSTRINGLIT: + // test literal characters for validity (throws if invalid + // chars found) + if (boost::wave::need_convert_trigraphs(language)) { + using boost::wave::cpplexer::impl::convert_trigraphs; + token_val = convert_trigraphs(token_val); + } + if (!boost::wave::need_no_character_validation(language)) { + using boost::wave::cpplexer::impl::validate_literal; + validate_literal(token_val, + pos.get_line(), pos.get_column(), pos.get_file()); + } + break; + + case T_LONGINTLIT: // supported in C99 and long_long mode + if (!boost::wave::need_long_long(language)) { + // syntax error: not allowed in C++ mode + BOOST_WAVE_LEXER_THROW( + boost::wave::cpplexer::lexing_exception, + invalid_long_long_literal, value.c_str(), + pos.get_line(), pos.get_column(), + pos.get_file().c_str()); + } + break; + + case T_PP_HHEADER: + case T_PP_QHEADER: + case T_PP_INCLUDE: + // convert to the corresponding ..._next token, if appropriate + { +#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 + // Skip '#' and whitespace and see whether we find an + // 'include_next' here. + typename string_type::size_type start = value.find("include"); + if (0 == value.compare(start, 12, "include_next", 12)) + id = token_id(id | AltTokenType); +#endif // BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 + 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; + token_val.clear(); + break; + + case T_OR_TRIGRAPH: + case T_XOR_TRIGRAPH: + case T_LEFTBRACE_TRIGRAPH: + case T_RIGHTBRACE_TRIGRAPH: + case T_LEFTBRACKET_TRIGRAPH: + case T_RIGHTBRACKET_TRIGRAPH: + case T_COMPL_TRIGRAPH: + case T_POUND_TRIGRAPH: + case T_ANY_TRIGRAPH: + if (boost::wave::need_convert_trigraphs(language)) + { + using boost::wave::cpplexer::impl::convert_trigraph; + token_val = convert_trigraph(token_val); + } + break; + } + + result = token_type(id, token_val, pos); +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + return guards.detect_guard(result); +#else + return result; +#endif + } + + // skip the T_CONTLINE token + } while (true); + } + return result = token_type(); // return T_EOI + } + + void set_position(PositionT const &pos) + { + // set position has to change the file name and line number only + first.get_position().set_file(pos.get_file()); + first.get_position().set_line(pos.get_line()); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + bool has_include_guards(std::string& guard_name) const + { return guards.detected(guard_name); } +#endif + +private: + iterator_type first; + iterator_type last; + boost::wave::language_support language; + static lexer::lexer<IteratorT, PositionT> lexer; // needed only once + + bool at_eof; + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + include_guards<token_type> guards; +#endif +}; + +template <typename IteratorT, typename PositionT> +lexer::lexer<IteratorT, PositionT> slex_functor<IteratorT, PositionT>::lexer; + +#undef T_EXTCHARLIT +#undef T_EXTSTRINGLIT +#undef T_EXTRAWSTRINGLIT + +/////////////////////////////////////////////////////////////////////////////// +// +// The 'new_lexer' function allows the opaque generation of a new lexer object. +// It is coupled to the iterator type to allow to decouple the lexer/iterator +// configurations at compile time. +// +// This function is declared inside the cpp_slex_token.hpp file, which is +// referenced by the source file calling the lexer and the source file, which +// instantiates the lex_functor. But it is defined here, so it will be +// instantiated only while compiling the source file, which instantiates the +// lex_functor. While the cpp_slex_token.hpp file may be included everywhere, +// this file (cpp_slex_lexer.hpp) should be included only once. This allows +// to decouple the lexer interface from the lexer implementation and reduces +// compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// +// The new_lexer_gen<>::new_lexer function (declared in cpp_slex_token.hpp) +// should be defined inline, if the lex_functor shouldn't be instantiated +// separately from the lex_iterator. +// +// Separate (explicit) instantiation helps to reduce compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_SLEX_NEW_LEXER_INLINE +#else +#define BOOST_WAVE_SLEX_NEW_LEXER_INLINE inline +#endif + +template <typename IteratorT, typename PositionT> +BOOST_WAVE_SLEX_NEW_LEXER_INLINE +lex_input_interface<slex_token<PositionT> > * +new_lexer_gen<IteratorT, PositionT>::new_lexer(IteratorT const &first, + IteratorT const &last, PositionT const &pos, + boost::wave::language_support language) +{ + return new slex_functor<IteratorT, PositionT>(first, last, pos, + language); +} + +#undef BOOST_WAVE_SLEX_NEW_LEXER_INLINE + +/////////////////////////////////////////////////////////////////////////////// +} // namespace slex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(SLEX_LEXER_HPP_5E8E1DF0_BB41_4938_B7E5_A4BB68222FF6_INCLUDED) diff --git a/src/boost/libs/wave/samples/cpp_tokens/slex/lexer.hpp b/src/boost/libs/wave/samples/cpp_tokens/slex/lexer.hpp new file mode 100644 index 000000000..32459cb4c --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/slex/lexer.hpp @@ -0,0 +1,2932 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Spirit based lexer + + http://www.boost.org/ + + Copyright (c) 2001, Daniel C. Nuffer. + Copyright (c) 2001-2012 Hartmut Kaiser. + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + TODO List: + X callback objects (called when a match is made.) + X callback passed first & last iterator, and + a reference to a lexercontrol object that supports some + operations on the lexer. + set state + terminate + state stack (push, pop, top) + set new token return value + ignore the current token + yymore + get length of matched token + get current lexer state + X DFA serialization to save recomputing the DFA. + + lexer states. + organize the file into hpp and ipp. arrange the classes in a logical order. + use buffering - iterator only needs be an input iterator, + lexer & callback are not templatized on iterator type, but char type. + next_token is templatized on iterator type. + beginning/ending contexts. + ^ and $ + DFA minimization. + DFA table compression. + +=============================================================================*/ +#ifndef BOOST_SPIRIT_LEXER_HPP +#define BOOST_SPIRIT_LEXER_HPP + +/////////////////////////////////////////////////////////////////////////////// +#include <boost/config.hpp> +#include <boost/throw_exception.hpp> + +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_symbols.hpp> +#include <boost/spirit/include/classic_chset.hpp> +#include <boost/spirit/include/classic_escape_char.hpp> + +#include <set> +#include <map> +#include <memory> // for auto_ptr/unique_ptr +#include <vector> +#include <stack> +#include <utility> // for pair +#include <iostream> +#include <fstream> +#include <boost/assert.hpp> +#include <boost/limits.hpp> + +#if defined(BOOST_NO_STD_ITERATOR_TRAITS) +#define BOOST_SPIRIT_IT_NS impl +#else +#define BOOST_SPIRIT_IT_NS std +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace spirit { +namespace classic { + +typedef unsigned char uchar; +typedef unsigned int node_id_t; +const node_id_t invalid_node = node_id_t(-1); +typedef std::set<node_id_t> node_set; +typedef std::vector<uchar> uchar_vector; +typedef std::map<node_id_t, node_set> followpos_t; +typedef std::vector<uchar_vector> state_match_t; + +template <typename TokenT> +class lexer_control; + +class bad_regex : public std::exception +{ +}; + +namespace lexerimpl +{ + +class node +{ +public: + + virtual ~node() {} + + virtual node* clone() const = 0; + virtual bool nullable() const = 0; + virtual node_set firstpos() const = 0; + virtual node_set lastpos() const = 0; + virtual void compute_followpos(followpos_t& followpos) const = 0; + virtual void compute_state_match(state_match_t& state_match) const = 0; + virtual void get_eof_ids(node_set& eof_set) const = 0; + virtual void assign_node_ids(node_id_t& node_count) = 0; +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const = 0; +#endif + +}; + +class char_node : public node +{ + +public: + + char_node(const uchar c); + char_node(const char_node& x); + virtual ~char_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + + uchar m_char; + node_id_t m_node_num; +}; + +inline +char_node::char_node(const uchar c) + : node() + , m_char(c) + , m_node_num(0) +{ +} + +inline +char_node::char_node(const char_node& x) + : node(x) + , m_char(x.m_char) + , m_node_num(x.m_node_num) +{ +} + +inline node * +char_node::clone() const +{ + return new char_node(*this); +} + +inline bool +char_node::nullable() const +{ + return false; +} + +inline node_set +char_node::firstpos() const +{ + node_set rval; + rval.insert(m_node_num); + return rval; +} + +inline node_set +char_node::lastpos() const +{ + return firstpos(); +} + +inline void +char_node::compute_followpos(followpos_t&) const +{ + return; +} + +inline void +char_node::compute_state_match(state_match_t& state_match) const +{ + if (state_match.size() < m_node_num + 1) + state_match.resize(m_node_num + 1); + state_match[m_node_num].resize(256); + state_match[m_node_num][m_char] = 1; +} + +inline void +char_node::get_eof_ids(node_set&) const +{ + return; +} + +inline void +char_node::assign_node_ids(node_id_t& node_count) +{ + m_node_num = node_count++; +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +char_node::dump(std::ostream& out) const +{ + out << "\nchar_node m_char = " << m_char; + out << " m_node_num = " << m_node_num; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); +} +#endif + + +class epsilon_node : public node +{ + +public: + + epsilon_node(); + epsilon_node(const epsilon_node& x); + virtual ~epsilon_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + + node_id_t m_node_num; +}; + +inline +epsilon_node::epsilon_node() + : node() + , m_node_num(0) +{ +} + +inline +epsilon_node::epsilon_node(const epsilon_node& x) + : node(x) + , m_node_num(x.m_node_num) +{ +} + +inline node * +epsilon_node::clone() const +{ + return new epsilon_node(*this); +} + +inline bool +epsilon_node::nullable() const +{ + return true; +} + +inline node_set +epsilon_node::firstpos() const +{ + return node_set(); +} + +inline node_set +epsilon_node::lastpos() const +{ + return node_set(); +} + +inline void +epsilon_node::compute_followpos(followpos_t&) const +{ + return; +} + +inline void +epsilon_node::compute_state_match(state_match_t& state_match) const +{ + if (state_match.size() < m_node_num + 1) + state_match.resize(m_node_num + 1); + state_match[m_node_num].resize(256, 1); +} + +inline void +epsilon_node::get_eof_ids(node_set&) const +{ + return; +} + +inline void +epsilon_node::assign_node_ids(node_id_t& node_count) +{ + m_node_num = node_count++; +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +epsilon_node::dump(std::ostream& out) const +{ + out << "\nepsilon_node"; + out << " m_node_num = " << m_node_num; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); +} +#endif + + +class or_node : public node +{ + +public: + + or_node(node* left, node* right); + or_node(const or_node& x); + virtual ~or_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> m_left; + std::unique_ptr<node> m_right; +#else + std::auto_ptr<node> m_left; + std::auto_ptr<node> m_right; +#endif +}; + +inline +or_node::or_node(node* left, node* right) + : node() + , m_left(left) + , m_right(right) +{ +} + +inline +or_node::or_node(const or_node& x) + : node(x) + , m_left(x.m_left->clone()) + , m_right(x.m_right->clone()) +{ +} + +inline node * +or_node::clone() const +{ + return new or_node(m_left->clone(), m_right->clone()); +} + +inline bool +or_node::nullable() const +{ + return m_left->nullable() || m_right->nullable(); +} + +inline node_set +or_node::firstpos() const +{ + node_set rval; + node_set l = m_left->firstpos(); + node_set r = m_right->firstpos(); + std::set_union(l.begin(), l.end(), r.begin(), r.end(), + std::inserter(rval, rval.begin())); + return rval; +} + +inline node_set +or_node::lastpos() const +{ + node_set rval; + node_set l = m_left->lastpos(); + node_set r = m_right->lastpos(); + std::set_union(l.begin(), l.end(), r.begin(), r.end(), + std::inserter(rval, rval.begin())); + return rval; +} + +inline void +or_node::compute_followpos(followpos_t& followpos) const +{ + m_left->compute_followpos(followpos); + m_right->compute_followpos(followpos); +} + +inline void +or_node::compute_state_match(state_match_t& state_match) const +{ + m_left->compute_state_match(state_match); + m_right->compute_state_match(state_match); +} + +inline void +or_node::get_eof_ids(node_set& eof_nodes) const +{ + m_left->get_eof_ids(eof_nodes); + m_right->get_eof_ids(eof_nodes); +} + +inline void +or_node::assign_node_ids(node_id_t& node_count) +{ + m_left->assign_node_ids(node_count); + m_right->assign_node_ids(node_count); +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +or_node::dump(std::ostream& out) const +{ + m_left->dump(out); + + out << "\nor_node"; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + m_right->dump(out); +} +#endif + + +class cat_node : public node +{ + +public: + + cat_node(node* left, node* right); + cat_node(const cat_node& x); + virtual ~cat_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> m_left; + std::unique_ptr<node> m_right; +#else + std::auto_ptr<node> m_left; + std::auto_ptr<node> m_right; +#endif +}; + +inline +cat_node::cat_node(node* left, node* right) + : node() + , m_left(left) + , m_right(right) +{ +} + +inline +cat_node::cat_node(const cat_node& x) + : node(x) + , m_left(x.m_left->clone()) + , m_right(x.m_right->clone()) +{ +} + +inline node * +cat_node::clone() const +{ + return new cat_node(m_left->clone(), m_right->clone()); +} + +inline bool +cat_node::nullable() const +{ + return m_left->nullable() && m_right->nullable(); +} + +inline node_set +cat_node::firstpos() const +{ + if (m_left->nullable()) + { + node_set rval; + node_set l = m_left->firstpos(); + node_set r = m_right->firstpos(); + std::set_union(l.begin(), l.end(), r.begin(), r.end(), + std::inserter(rval, rval.begin())); + return rval; + } + else + { + return m_left->firstpos(); + } +} + +inline node_set +cat_node::lastpos() const +{ + if (m_right->nullable()) + { + node_set rval; + node_set l = m_left->lastpos(); + node_set r = m_right->lastpos(); + std::set_union(l.begin(), l.end(), r.begin(), r.end(), + std::inserter(rval, rval.begin())); + return rval; + } + else + { + return m_right->lastpos(); + } +} + +inline void +cat_node::compute_followpos(followpos_t& followpos) const +{ + node_set l = m_left->lastpos(); + for (node_set::iterator i = l.begin(); + i != l.end(); + ++i) + { + node_set rf = m_right->firstpos(); + followpos[*i].insert(rf.begin(), rf.end()); + } + + m_left->compute_followpos(followpos); + m_right->compute_followpos(followpos); +} + +inline void +cat_node::compute_state_match(state_match_t& state_match) const +{ + m_left->compute_state_match(state_match); + m_right->compute_state_match(state_match); +} + +inline void +cat_node::get_eof_ids(node_set& eof_nodes) const +{ + m_left->get_eof_ids(eof_nodes); + m_right->get_eof_ids(eof_nodes); +} + +inline void +cat_node::assign_node_ids(node_id_t& node_count) +{ + m_left->assign_node_ids(node_count); + m_right->assign_node_ids(node_count); +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +cat_node::dump(std::ostream& out) const +{ + m_left->dump(out); + + out << "\ncat_node"; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + m_right->dump(out); +} +#endif + + +class star_node : public node +{ + +public: + + star_node(node* left); + star_node(const star_node& x); + virtual ~star_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> m_left; +#else + std::auto_ptr<node> m_left; +#endif +}; + +inline +star_node::star_node(node* left) + : node() + , m_left(left) +{ +} + +inline +star_node::star_node(const star_node& x) + : node(x) + , m_left(x.m_left->clone()) +{ +} + +inline node * +star_node::clone() const +{ + return new star_node(m_left->clone()); +} + +inline bool +star_node::nullable() const +{ + return true; +} + +inline node_set +star_node::firstpos() const +{ + return m_left->firstpos(); +} + +inline node_set +star_node::lastpos() const +{ + return m_left->lastpos(); +} + +inline void +star_node::compute_followpos(followpos_t& followpos) const +{ + node_set lp = this->lastpos(); + for (node_set::iterator i = lp.begin(); + i != lp.end(); + ++i) + { + node_set fp = this->firstpos(); + followpos[*i].insert(fp.begin(), fp.end()); + } + + m_left->compute_followpos(followpos); +} + +inline void +star_node::compute_state_match(state_match_t& state_match) const +{ + m_left->compute_state_match(state_match); +} + +inline void +star_node::get_eof_ids(node_set& eof_nodes) const +{ + m_left->get_eof_ids(eof_nodes); +} + +inline void +star_node::assign_node_ids(node_id_t& node_count) +{ + m_left->assign_node_ids(node_count); +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +star_node::dump(std::ostream& out) const +{ + m_left->dump(out); + + out << "\nstar_node"; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + +} +#endif + + +class eof_node : public node +{ + +public: + + eof_node(); + eof_node(const eof_node& x); + virtual ~eof_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + + node_id_t m_node_num; +}; + +inline +eof_node::eof_node() + : node() + , m_node_num(0) +{ +} + +inline +eof_node::eof_node(const eof_node& x) + : node(x) + , m_node_num(x.m_node_num) +{ +} + +inline node * +eof_node::clone() const +{ + return new eof_node(*this); +} + +inline bool +eof_node::nullable() const +{ + return false; +} + +inline node_set +eof_node::firstpos() const +{ + node_set rval; + rval.insert(m_node_num); + return rval; +} + +inline node_set +eof_node::lastpos() const +{ + node_set rval; + rval.insert(m_node_num); + return rval; +} + +inline void +eof_node::compute_followpos(followpos_t&) const +{ + return; +} + +inline void +eof_node::compute_state_match(state_match_t& state_match) const +{ + if (state_match.size() < m_node_num + 1) + state_match.resize(m_node_num + 1); + state_match[m_node_num].resize(256, 0); +} + +inline void +eof_node::get_eof_ids(node_set& eof_nodes) const +{ + eof_nodes.insert(m_node_num); +} + +inline void +eof_node::assign_node_ids(node_id_t& node_count) +{ + m_node_num = node_count++; +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +eof_node::dump(std::ostream& out) const +{ + out << "\neof_node"; + out << " m_node_num = " << m_node_num; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); +} +#endif + +class ccl_node : public node +{ + +public: + + ccl_node(const std::vector<uchar>& v); + ccl_node(const uchar c1, const uchar c2); + ccl_node(const ccl_node& x); + virtual ~ccl_node(){} + + virtual node* clone() const; + virtual bool nullable() const; + virtual node_set firstpos() const; + virtual node_set lastpos() const; + virtual void compute_followpos(followpos_t& followpos) const; + virtual void compute_state_match(state_match_t& state_match ) const; + virtual void get_eof_ids(node_set& eof_set) const; + virtual void assign_node_ids(node_id_t& node_count); +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + virtual void dump(std::ostream& out) const; +#endif + +private: + + std::vector<uchar> m_match; + node_id_t m_node_num; +}; + +inline +ccl_node::ccl_node(const std::vector<uchar>& v) + : node() + , m_match(v) + , m_node_num(0) +{ + m_match.resize(256); // make sure it's the right size +} + +inline +ccl_node::ccl_node(const uchar c1, const uchar c2) + : node() + , m_match(256, uchar(0)) + , m_node_num(0) +{ + BOOST_ASSERT(c1 < c2); + for (std::size_t i = c1; i <= std::size_t(c2); ++i) + { + m_match[i] = 1; + } +} + +inline +ccl_node::ccl_node(const ccl_node& x) + : node(x) + , m_match(x.m_match) + , m_node_num(x.m_node_num) +{ +} + +inline node * +ccl_node::clone() const +{ + return new ccl_node(*this); +} + +inline bool +ccl_node::nullable() const +{ + return false; +} + +inline node_set +ccl_node::firstpos() const +{ + node_set rval; + rval.insert(m_node_num); + return rval; +} + +inline node_set +ccl_node::lastpos() const +{ + return firstpos(); +} + +inline void +ccl_node::compute_followpos(followpos_t&) const +{ + return; +} + +inline void +ccl_node::compute_state_match(state_match_t& state_match) const +{ + if (state_match.size() < m_node_num + 1) + state_match.resize(m_node_num + 1); + state_match[m_node_num] = m_match; +} + +inline void +ccl_node::get_eof_ids(node_set&) const +{ + return; +} + +inline void +ccl_node::assign_node_ids(node_id_t& node_count) +{ + m_node_num = node_count++; +} + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +inline void +ccl_node::dump(std::ostream& out) const +{ + out << "\nccl_node m_match = "; + for (std::size_t i = 0; i < m_match.size(); ++i) + { + if (m_match[i]) + out << i << ", "; + } + out << " m_node_num = " << m_node_num; + out << " nullable() = " << (nullable() ? "true" : "false"); + out << " firstpos() = "; + node_set fp = firstpos(); + std::copy(fp.begin(), fp.end(), + std::ostream_iterator<node_id_t>(out, ",")); + + out << " lastpos() = "; + node_set lp = lastpos(); + std::copy(lp.begin(), lp.end(), + std::ostream_iterator<node_id_t>(out, ",")); +} +#endif + +template <typename ScannerT> +class make_concat +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + + make_concat(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const &, iterator_type const &) const + { + node* right = m_stack.top(); + m_stack.pop(); + node* left = m_stack.top(); + m_stack.pop(); + node* newnode = new cat_node(left, right); + m_stack.push(newnode); + } + + std::stack<node*>& m_stack; +}; + +template <int CharTSize> +struct get_byte_aux; + +template<> +struct get_byte_aux<1> +{ + template <typename CharT> + unsigned char operator()(CharT c, unsigned int byte) + { + BOOST_ASSERT(byte == 0); + return c; + } +}; + +template<> +struct get_byte_aux<2> +{ + template <typename CharT> + unsigned char operator()(CharT c, unsigned int byte) + { + static unsigned long mask[] = + { + 0xFF00, + 0x00FF + }; + + BOOST_ASSERT(byte < 2); + return (c & mask[byte]) >> ((sizeof(c) - 1 - byte) * 8); + } +}; + +template<> +struct get_byte_aux<4> +{ + template <typename CharT> + unsigned char operator()(CharT c, unsigned int byte) + { + static unsigned long mask[] = + { + 0xFF000000, + 0x00FF0000, + 0x0000FF00, + 0x000000FF + }; + + BOOST_ASSERT(byte < 4); + return (c & mask[byte]) >> ((sizeof(c) - 1 - byte) * 8); + } +}; + +template <typename CharT> +inline unsigned char +get_byte(CharT c, unsigned int byte) +{ + return get_byte_aux<sizeof(c)>()(c, byte); +} + +template <typename ScannerT> +class make_star +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + make_star(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(const char_t) const + { + node* left = m_stack.top(); + m_stack.pop(); + node* newnode = new star_node(left); + m_stack.push(newnode); + } + + std::stack<node*>& m_stack; +}; + +template <typename ScannerT> +class make_or +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + + make_or(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const&, iterator_type const&) const + { + node* right = m_stack.top(); + m_stack.pop(); + node* left = m_stack.top(); + m_stack.pop(); + node* newnode = new or_node(left, right); + m_stack.push(newnode); + } + + std::stack<node*>& m_stack; +}; + +template <typename ScannerT> +class make_plus +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + make_plus(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(const char_t) const + { + node* left = m_stack.top(); + m_stack.pop(); + + node* copy = left->clone(); + + node* new_star = new star_node(copy); + node* new_cat = new cat_node(left, new_star); + m_stack.push(new_cat); + } + + std::stack<node*>& m_stack; +}; + +template <typename ScannerT> +class make_optional +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + make_optional(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(const char_t) const + { + node* left = m_stack.top(); + m_stack.pop(); + + node* new_or = new or_node(left, new epsilon_node()); + m_stack.push(new_or); + } + + std::stack<node*>& m_stack; +}; + +/////////////////////////////////////////////////////////////////////////////// +// utility function +template <typename CharT> +inline utility::impl::range<CharT> const& +full_range() +{ + static utility::impl::range<CharT> full((std::numeric_limits<CharT>::min)(), + (std::numeric_limits<CharT>::max)()); + return full; +} + +namespace ccl_utils +{ + template <typename char_t> + inline utility::impl::range_run<char_t> + negate_range_run( + const utility::impl::range_run<char_t>& rr) + { + utility::impl::range_run<char_t> newrr; + newrr.set(full_range<char_t>()); + for (typename utility::impl::range_run<char_t>::const_iterator iter = rr.begin(); + iter != rr.end(); ++iter) + newrr.clear(*iter); + return newrr; + } + + template <typename char_t> + inline node* + create_mb_node_seq(char_t c) + { + node* newnode = new char_node(get_byte(c, 0)); + for (unsigned int i = 1; i < sizeof(c); ++i) + { + node* cnode = new char_node(get_byte(c, i)); + node* top_node = new cat_node(newnode, cnode); + newnode = top_node; + } + return newnode; + } + + template <typename char_t> + inline void + handle_mb_char(char_t c, bool first_time, + std::stack<node*>& stack) + { + node* newnode = create_mb_node_seq(c); + + if (first_time) + { + stack.push(newnode); + } + else + { + node* top = stack.top(); + stack.pop(); + + node* newtop = new or_node(top, newnode); + stack.push(newtop); + } + } + + // forward decl only + template <typename char_t> + inline void + handle_mb_range(char_t c1, char_t c2, bool first_time, + std::stack<node*>& stack); + + template <typename char_t> + inline void + create_nodes(const utility::impl::range_run<char_t>& rr, + std::stack<node*>& stack) + { + + if (sizeof(char_t) == 1) + { + std::vector<uchar> ccl; + ccl.resize(256); + for (typename utility::impl::range_run<char_t>::const_iterator iter = rr.begin(); + iter != rr.end(); ++iter) + { + for (int i = iter->first; i <= iter->last; ++i) + { +// this is always true because of the limited datatype +// BOOST_ASSERT(uchar(i) < 256 && ccl.size() == 256); + ccl[uchar(i)] = 1; + } + } + + node* new_ccl = new ccl_node(ccl); + stack.push(new_ccl); + } + else + { + bool mb_first_time = true; + for (typename utility::impl::range_run<char_t>::const_iterator iter = rr.begin(); + iter != rr.end(); ++iter) + { + if (iter->first == iter->last) + { + handle_mb_char(iter->first, mb_first_time, stack); + } + else + { + handle_mb_range(iter->first, iter->last, mb_first_time, stack); + } + mb_first_time = false; + } + } + } + + template <typename char_t> + inline std::size_t + compute_differing_byte(char_t c1, char_t c2) + { + std::size_t rval = 0; + while (rval < sizeof(c1) && + get_byte(c1, (unsigned int)rval) == get_byte(c2, (unsigned int)rval)) + { + ++rval; + } + return rval; + } + + template <typename char_t> + inline node* + create_mb_node_type1(std::size_t j, char_t c1, char_t c2) + { + std::size_t diff = get_byte(c2, (unsigned int)j) - + get_byte(c1, (unsigned int)j); + if (diff == 1) { + return 0; + } + else if (diff == 2) { + return new char_node(get_byte(c1, (unsigned int)j)+1); + } + else { + return new ccl_node(get_byte(c1, (unsigned int)j)+1, + get_byte(c2, (unsigned int)j)-1); + } + } + + template <typename char_t> + inline node * + create_mb_node_for_byte(std::size_t i, std::size_t j, std::size_t sizem1, + std::size_t differing_byte, char_t c1, char_t c2, node* newnode) + { + node* cnode; + if (i == sizem1 && j == differing_byte && j != sizem1) + { + node* tmp = create_mb_node_type1(j, c1, c2); + if (tmp == 0) + { + delete newnode; + return 0; + } + else + cnode = tmp; + } + else if (i == differing_byte && j == sizem1) + { + if (i != sizem1) { + cnode = new ccl_node(get_byte(c1, (unsigned int)j), 0xFF); + } + else { + cnode = new ccl_node(get_byte(c1, (unsigned int)j), + get_byte(c2, (unsigned int)j)); + } + } + else if (i != differing_byte && i != sizem1 && + j == (sizem1 - i + differing_byte)) + { + cnode = new ccl_node(get_byte(c1, (unsigned int)j)+1, 0xFF); + } + else if (i + j - differing_byte > sizem1) { + cnode = new ccl_node(0, 0xFF); + } + else {//if (is plain) + cnode = new char_node(get_byte(c1, (unsigned int)j)); + } + + node* top_node = new cat_node(newnode, cnode); + return top_node; + } + +// On platforms, where wchar_t is a typedef for unsigned short, the +// comparision for a negative value is pointless + template <bool is_signed> + struct correct_char_aux { + }; + + template <> + struct correct_char_aux<true> { + + template <typename char_t> + static char_t correct(char_t c) { if (c < 0) c = 0; return c; } + }; + + template <> + struct correct_char_aux<false> { + + template <typename char_t> + static char_t correct(char_t c) { return c; } + }; + + template <typename char_t> + struct correct_char + { + static char_t correct(char_t c) + { + return correct_char_aux<std::numeric_limits<char_t>::is_signed >:: + correct(c); + } + }; + + template <typename char_t> + inline void + handle_mb_range(char_t c1, char_t c2, bool first_time, + std::stack<node*>& stack) + { + // The algorithm can't handle negative value chars, which don't make + // much sense anyway. This comparision is pointless for wchar_t's on + // platforms, where wchar_t is a typedef for unsigned short + + c1 = correct_char<char_t>::correct(c1); + //if (c1 < 0) + // c1 = 0; + + BOOST_ASSERT(c1 < c2); + node* newnode = 0; + node* savednode = 0; + const std::size_t differing_byte = compute_differing_byte(c1, c2); + const std::size_t sizem1 = sizeof(c1) - 1; + const std::size_t ndb = sizem1 - differing_byte; + for (std::size_t i = differing_byte; i < sizeof(c1); ++i) + { + // generate node for the first byte + if (differing_byte == 0 && i == ndb) + { + node* tmp = create_mb_node_type1(0, c1, c2); + if (tmp == 0) + continue; + else + newnode = tmp; + } + else + { + newnode = new char_node(get_byte(c1, 0)); + } + for (std::size_t j = 1; j < sizeof(c1); ++j) + { + newnode = create_mb_node_for_byte(i, j, sizem1, differing_byte, + c1, c2, newnode); + if (newnode == 0) + goto end_outer_for; + } + + // or together the various parts + if (savednode) + { + node* top_node = new or_node(savednode, newnode); + savednode = top_node; + } + else + { + savednode = newnode; + } +end_outer_for: + continue; + } + + for (std::size_t k = 0; k < ndb; ++k) + { + newnode = new char_node(get_byte(c2, 0)); + for (std::size_t j = 1; j < sizeof(c2); ++j) + { + node* cnode; + if (k == differing_byte && j == sizem1 && k != sizem1) + cnode = new ccl_node(0, get_byte(c2, (unsigned int)j)); + + else if (k != differing_byte && k != sizem1 && + j == (sizem1 - k + differing_byte)) + cnode = new ccl_node(0, get_byte(c2, (unsigned int)j)-1); + + else if (k + j - differing_byte > sizem1) + cnode = new ccl_node(0, 0xFF); + + else //if (is plain) + cnode = new char_node(get_byte(c2, (unsigned int)j)); + + + node* top_node = new cat_node(newnode, cnode); + newnode = top_node; + } + + // or together the various parts + if (savednode) + { + node* top_node = new or_node(savednode, newnode); + savednode = top_node; + } + else + { + savednode = newnode; + } + } + + + if (first_time) + { + stack.push(savednode); + } + else + { + node* top = stack.top(); + stack.pop(); + + node* newtop = new or_node(top, savednode); + stack.push(newtop); + } + } +} // namespace ccl_utils + +template <typename ScannerT> +class make_char +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + make_char(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const& first, iterator_type const& last) const + { + const escape_char_parser<lex_escapes, char_t> lex_escape_ch = + escape_char_parser<lex_escapes, char_t>(); + char_t the_char; + iterator_type first_ = first; + ScannerT scan(first_, last); + lex_escape_ch[assign(the_char)].parse(scan); + node* newnode = ccl_utils::create_mb_node_seq(the_char); + m_stack.push(newnode); + } + + std::stack<node*>& m_stack; +}; + + +template <typename ScannerT> +class make_ccl +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + make_ccl(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + static bool is_equal_to_string(iterator_type first, + iterator_type const & last, const char* str) + { + while (first != last &&*str &&*first ==*str) + { + ++first; + ++str; + } + return*str == 0; + } + + template <typename ParserT> + static void fill_ccl(utility::impl::range_run<char_t>& rr, const ParserT& parser) + { + for (int i = 0; i < 256; ++i) + { + if (parser.test(static_cast<char_t>(uchar(i)))) + rr.set(utility::impl::range<char_t>(char_t(i), char_t(i))); + } + } + + void operator()(iterator_type const& first_, iterator_type const& last) const + { + BOOST_ASSERT(*first_ == '['); + + iterator_type first = first_; + ++first; // skip over '[' + bool negated_ccl = false; + if (*first == '^') + { + negated_ccl = true; + ++first; + } + + utility::impl::range_run<char_t> rr; + while (first != last &&*first != ']') + { + if (*first == '[') // it's a ccl_expr like [:space:] + { + // check for [:space:], etc. + if (is_equal_to_string(first, last, "[:alnum:]")) + { + fill_ccl(rr, alnum_p); + } + else if (is_equal_to_string(first, last, "[:alpha:]")) + { + fill_ccl(rr, alpha_p); + } + else if (is_equal_to_string(first, last, "[:blank:]")) + { + fill_ccl(rr, blank_p); + } + else if (is_equal_to_string(first, last, "[:cntrl:]")) + { + fill_ccl(rr, cntrl_p); + } + else if (is_equal_to_string(first, last, "[:digit:]")) + { + fill_ccl(rr, digit_p); + } + else if (is_equal_to_string(first, last, "[:graph:]")) + { + fill_ccl(rr, graph_p); + } + else if (is_equal_to_string(first, last, "[:lower:]")) + { + fill_ccl(rr, lower_p); + } + else if (is_equal_to_string(first, last, "[:print:]")) + { + fill_ccl(rr, print_p); + } + else if (is_equal_to_string(first, last, "[:punct:]")) + { + fill_ccl(rr, punct_p); + } + else if (is_equal_to_string(first, last, "[:space:]")) + { + fill_ccl(rr, space_p); + } + else if (is_equal_to_string(first, last, "[:upper:]")) + { + fill_ccl(rr, upper_p); + } + else if (is_equal_to_string(first, last, "[:xdigit:]")) + { + fill_ccl(rr, xdigit_p); + } + // this can't happen, because it's parsed before we get here. + //else + // throw bad_regex(); + + // Advance past the character class expression + while (first != last &&*first != ']') + ++first; + BOOST_ASSERT(*first == ']'); + ++first; + } + else { + const escape_char_parser<lex_escapes, char_t> lex_escape_ch = + escape_char_parser<lex_escapes, char_t>(); + + char_t c1; + ScannerT scan(first, last); + lex_escape_ch[assign(c1)].parse(scan); + if (*scan.first == '-') // insert a range + { + ++scan.first; + char_t c2; + lex_escape_ch[assign(c2)].parse(scan); + BOOST_ASSERT(c1 < c2); // Throw exception? + rr.set(utility::impl::range<char_t>(c1, c2)); + } + else // insert 1 char + { + rr.set(utility::impl::range<char_t>(c1, c1)); + } + } + } + + if (negated_ccl) + { + rr = ccl_utils::negate_range_run(rr); + } + + ccl_utils::create_nodes(rr, m_stack); + } + + std::stack<node*>& m_stack; +}; + +template <typename ScannerT> +class make_any_char +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + std::stack<node*>& m_stack; + + make_any_char(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(const char_t c) const + { + BOOST_ASSERT(c == '.'); + do_any_char(); + } + + void do_any_char() const + { + static utility::impl::range_run<char_t> rr; + rr.set(full_range<char_t>()); + char_t newline = '\n'; + rr.clear(utility::impl::range<char_t>(newline, newline)); + + ccl_utils::create_nodes(rr, m_stack); + } +}; + +template <typename ScannerT> +class make_string +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + std::stack<node*>& m_stack; + + make_string(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const& first, iterator_type const& last) const + { + BOOST_ASSERT(*first == '"'); + + iterator_type first_ = first; + ScannerT scan(first_, last); + ++scan.first; // skip over '"' + + // empty string not allowed + if (*scan.first == '"') + { + boost::throw_exception(bad_regex()); + } + + const escape_char_parser<lex_escapes, char_t> lex_escape_ch = + escape_char_parser<lex_escapes, char_t>(); + + char_t c; + lex_escape_ch[assign(c)].parse(scan); + node* top_node = ccl_utils::create_mb_node_seq(c); + + while (*scan.first != '"' && scan.first != scan.last) + { + lex_escape_ch[assign(c)].parse(scan); + node* cur_node = ccl_utils::create_mb_node_seq(c); + top_node = new cat_node(top_node, cur_node); + } + m_stack.push(top_node); + } +}; + +inline +node* repeat_node(node* n, int num) +{ + node* list_of_nodes = n; + for (int i = 1; i < num; ++i) + { + list_of_nodes = new cat_node(list_of_nodes, n->clone()); + } + return list_of_nodes; +} + +inline +node* optional_node(node* n) +{ + return new or_node(n, new epsilon_node()); +} + +template <typename ScannerT> +class make_rep1 +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + std::stack<node*>& m_stack; + + make_rep1(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const& first, iterator_type const& last) const + { + BOOST_ASSERT(*first == '{'); + + iterator_type first_ = first; + ScannerT scan(first_, last); + ++scan.first; // skip over '{' + + unsigned int count; + uint_p[assign(count)].parse(scan); + if (count == 0) + boost::throw_exception(bad_regex()); + + node* top_node = m_stack.top(); + m_stack.pop(); + top_node = repeat_node(top_node, count); + m_stack.push(top_node); + } +}; + +template <typename ScannerT> +class make_rep2 +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + std::stack<node*>& m_stack; + + make_rep2(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const& first, iterator_type const& last) const + { + BOOST_ASSERT(*first == '{'); + + iterator_type first_ = first; + ScannerT scan (first_, last); + ++scan.first; // skip over '{' + + unsigned int count; + uint_p[assign(count)].parse(scan); + if (count == 0) + boost::throw_exception(bad_regex()); + + node* top_node = m_stack.top(); + m_stack.pop(); + top_node = new cat_node(repeat_node(top_node, count), + new star_node(top_node->clone())); + m_stack.push(top_node); + + } +}; + +template <typename ScannerT> +class make_rep3 +{ + typedef typename ScannerT::iterator_t iterator_type; + +public: + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + std::stack<node*>& m_stack; + + make_rep3(std::stack<node*>& the_stack) + : m_stack(the_stack) + {} + + void operator()(iterator_type const& first, iterator_type const& last) const + { + BOOST_ASSERT(*first == '{'); + + iterator_type first_ = first; + ScannerT scan(first_, last); + ++scan.first; // skip over '{' + + unsigned int count1, count2; + uint_p[assign(count1)].parse(scan); + if (count1 == 0) + boost::throw_exception(bad_regex()); + + ++scan.first; // skip over ',' + + uint_p[assign(count2)].parse(scan); + if (count2 <= count1) + boost::throw_exception(bad_regex()); + + node* top_node = m_stack.top(); + m_stack.pop(); + node* repeats = repeat_node(top_node, count1); + top_node = new cat_node(repeats, + repeat_node(optional_node(top_node->clone()), + count2 - count1)); + + m_stack.push(top_node); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// Lexer grammar +// +// Defines the grammar, which mandates the syntax of the understood +// lexeme definitions passed to lexer::register_regex. +// +/////////////////////////////////////////////////////////////////////////////// +class lexer_grammar : public boost::spirit::classic::grammar<lexer_grammar> +{ +public: + lexer_grammar(std::stack<node*> &node_stack_) + : node_stack(node_stack_) {} + + template <typename ScannerT> + struct definition + { + typedef rule<ScannerT> rule_t; + typedef typename ScannerT::iterator_t iterator_type; + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<iterator_type>::value_type + char_t; + + rule_t regex, re, series, singleton, singleton2, fullccl, ccl, string, + escseq, ccl_char; + symbols<> ccl_expr; + + definition(lexer_grammar const &self) + { + regex = + re >> !('/' >> re) >> !ch_p('$') + ; + + re = + series + >>*( ('|' >> series)[make_or<ScannerT>(self.node_stack)] ) + ; + + series = + singleton + >>*( singleton[make_concat<ScannerT>(self.node_stack)] ) + ; + + singleton = + ch_p('.')[make_any_char<ScannerT>(self.node_stack)] + >> singleton2 + | fullccl + >> singleton2 + | ('"' >> string >> '"') + [ + make_string<ScannerT>(self.node_stack) + ] + >> singleton2 + | '(' >> re >> ')' + >> singleton2 + | ((anychar_p - chset<>("/|*+?.(){}\\")) | escseq) + [ + make_char<ScannerT>(self.node_stack) + ] + >> singleton2 + ; + + singleton2 = + ch_p('*')[make_star<ScannerT>(self.node_stack)] + >> singleton2 + | ch_p('+')[make_plus<ScannerT>(self.node_stack)] + >> singleton2 + | ch_p('?')[make_optional<ScannerT>(self.node_stack)] + >> singleton2 + | ('{' >> uint_p >> '}') + [ + make_rep1<ScannerT>(self.node_stack) + ] + >> singleton2 + | ('{' >> uint_p >> ',' >> '}') + [ + make_rep2<ScannerT>(self.node_stack) + ] + >> singleton2 + | ('{' >> uint_p >> ',' >> uint_p >> '}') + [ + make_rep3<ScannerT>(self.node_stack) + ] + >> singleton2 + | epsilon_p + ; + + fullccl = + ('[' >> !ch_p('^') >> ccl >> ']') + [ + make_ccl<ScannerT>(self.node_stack) + ] + ; + + ccl = + *(ccl_expr | (ccl_char >> !('-' >> ccl_char))) + ; + + ccl_char = + ( (anychar_p - chset<>("\\\n]")) | escseq ) + ; + + ccl_expr = + "[:alnum:]", + "[:alpha:]", + "[:blank:]", + "[:cntrl:]", + "[:digit:]", + "[:graph:]", + "[:lower:]", + "[:print:]", + "[:punct:]", + "[:space:]", + "[:upper:]", + "[:xdigit:]" + ; + + string = + +( (anychar_p - chset<>("\"\\")) | escseq ) + ; + + typedef + uint_parser<char_t, 8, 1, + std::numeric_limits<char_t>::digits / 3 + 1 + > oct_parser_t; + typedef + uint_parser<char_t, 16, 1, + std::numeric_limits<char_t>::digits / 4 + 1 + > hex_parser_t; + + escseq = + ch_p('\\') + >> ( + oct_parser_t() + | as_lower_d['x'] >> hex_parser_t() + | (anychar_p - chset<>('\n')) + ) + ; + +#define BOOST_SLEX_DEBUG (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + + BOOST_SPIRIT_DEBUG_TRACE_RULE(regex, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(re, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(series, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(singleton, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(singleton2, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(fullccl, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(ccl, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(string, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(escseq, BOOST_SLEX_DEBUG); + BOOST_SPIRIT_DEBUG_TRACE_RULE(ccl_char, BOOST_SLEX_DEBUG); + +#undef BOOST_SLEX_DEBUG + } + + rule<ScannerT> const& + start() const { return regex; } + }; + + std::stack<node*> &node_stack; + +}; // class lexer_grammar + +template <typename StringT> +inline node * +parse(lexer_grammar& g, StringT const& str) +{ + typedef + scanner<typename StringT::const_iterator, scanner_policies<> > + scanner_t; + typedef typename rule<scanner_t>::template result<scanner_t>::type + result_t; + + typename StringT::const_iterator first = str.begin(); + typename StringT::const_iterator last = str.end(); + + scanner_t scan(first, last); +// typename rule<scanner_t>::result_t hit = g.parse(scan); + result_t hit = g.parse(scan); + if (!hit || !scan.at_end()) + { + while (g.node_stack.size()) + { + delete g.node_stack.top(); + g.node_stack.pop(); + } + return 0; + } + + BOOST_ASSERT(g.node_stack.size() == 1); + node* rval = g.node_stack.top(); + g.node_stack.pop(); + node* an_eof_node = new eof_node(); + rval = new cat_node(rval, an_eof_node); + return rval; +} + +inline +void make_case_insensitive(state_match_t& state_match) +{ + // TODO: Fix this. + // This doesn't take into account foreign languages, figure out how to + // do that. Also this approach is broken for this implementation of + // wide chars. + for (state_match_t::iterator iter = state_match.begin(); + iter != state_match.end(); ++iter) + { + int i, j; + for (i = 'A', j = 'a'; i <= 'Z'; ++i, ++j) + { + // if either is set, turn them both on + (*iter)[i] = (*iter)[j] = uchar((*iter)[i] | (*iter)[j]); + } + } +} + +template<bool wide_char> +struct regex_match_helper; + +template<> +struct regex_match_helper<false> // single byte char +{ + template <typename DfaT, typename IteratorT> + static bool + do_match(DfaT const& dfa, IteratorT &first, IteratorT const& last, + int& regex_index, + std::basic_string< + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + > *token) + { + typedef std::basic_string< + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + > string_type; + typedef typename string_type::size_type size_type; + + node_id_t s = 0; + node_id_t last_accepting_index = invalid_node; + IteratorT p = first; + IteratorT last_accepting_cpos = first; + while (p != last) + { + s = dfa.transition_table[s][(uchar)*p]; + if (s == invalid_node) + break; + if (token) token->append((size_type)1, *p); + ++p; + if (dfa.acceptance_index[s] != invalid_node) + { + last_accepting_index = s; + last_accepting_cpos = p; + } + } + if (last_accepting_index != invalid_node) + { +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + std::cout << "dfa.acceptance_index[" << last_accepting_index << "] = " << + dfa.acceptance_index[last_accepting_index] << '\n'; +#endif + + first = last_accepting_cpos; + regex_index = dfa.acceptance_index[last_accepting_index]; + return true; + } + else + return false; + } +}; + +template<> +struct regex_match_helper<true> // wide char +{ + template <typename DfaT, typename IteratorT> + static bool + do_match(DfaT const& dfa, IteratorT &first, IteratorT const& last, + int& regex_index, + std::basic_string< + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + > *token) + { + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + char_t; + typedef std::basic_string<char_t> string_type; + typedef typename string_type::size_type size_type; + + node_id_t s = 0; + node_id_t last_accepting_index = invalid_node; + IteratorT wp = first; + IteratorT last_accepting_cpos = first; + + while (wp != last) + { + for (unsigned int i = 0; i < sizeof(char_t); ++i) + { + s = dfa.transition_table[s][get_byte(*wp,i)]; + if (s == invalid_node) + { + goto break_while; + } + } + if (token) token->append((size_type)1, *wp); + ++wp; + if (dfa.acceptance_index[s] != invalid_node) + { + last_accepting_index = s; + last_accepting_cpos = wp; + } + + } + + break_while: + if (last_accepting_index != invalid_node) + { +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + std::cout << "dfa.acceptance_index[" << last_accepting_index << "] = " << + dfa.acceptance_index[last_accepting_index] << '\n'; +#endif + first = last_accepting_cpos; + regex_index = dfa.acceptance_index[last_accepting_index]; + + return true; + } + else + return false; + } +}; + +template <typename DfaT, typename IteratorT, bool wide_char> +struct regex_match +{ + static bool + do_match(DfaT const& dfa, IteratorT &first, IteratorT const& last, + int& regex_index, + std::basic_string< + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + > *token) + { + return regex_match_helper<wide_char>::do_match( + dfa, first, last, regex_index, token); + } +}; + +} // namespace lexerimpl + +/////////////////////////////////////////////////////////////////////////////// +// +template <typename IteratorT = char const*, typename TokenT = int, + typename CallbackT = void(*)(IteratorT const &, + IteratorT &, + IteratorT const&, + TokenT const&, + lexer_control<TokenT> &)> +class lexer +{ +public: + typedef CallbackT callback_t; + typedef + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + char_t; + + struct regex_info + { + std::basic_string<char_t> str; + TokenT token; + CallbackT callback; + + regex_info(const std::basic_string<char_t>& _str, + const TokenT& _token, + const CallbackT& _callback) + : str(_str) + , token(_token) + , callback(_callback) + {} + + }; + + struct dfa_table + { + std::vector<std::vector<node_id_t> > transition_table; + std::vector<node_id_t> acceptance_index; + }; + typedef std::vector<node_id_t> node_table_t; + typedef std::vector<node_table_t> transition_table_t; + typedef std::vector<dfa_table> dfa_t; + + + lexer(unsigned int states = 1); + + void register_regex(const std::basic_string<char_t>& regex, + const TokenT& id, const CallbackT& cb = CallbackT(), + unsigned int state = 0); + + TokenT next_token(IteratorT &first, IteratorT const &last, + std::basic_string<char_t> *token = 0); + + void create_dfa(); + bool has_compiled_dfa() { return m_compiled_dfa; } + + void set_case_insensitive(bool insensitive); + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + void dump(std::ostream& out); +#endif + typedef std::vector<std::vector<regex_info> > regex_list_t; + + bool load (std::ifstream &in, long unique_id = 0); + bool save (std::ofstream &out, long unique_id = 0); + enum { + SLEX_SIGNATURE = 0x58454C53, // "SLEX" + SLEX_VERSION_100 = 0x0100, // persistance version + SLEX_LAST_KNOWN_VERSION = SLEX_VERSION_100, + SLEX_MINOR_VERSION_MASK = 0xFF + }; + +private: + + void create_dfa_for_state(int state); + + static bool regex_match(const dfa_t& dfa, IteratorT& first, + IteratorT& last, int& regex_index); + + mutable std::stack<lexerimpl::node*> node_stack; + lexerimpl::lexer_grammar g; + + mutable bool m_compiled_dfa; + mutable dfa_t m_dfa; + + regex_list_t m_regex_list; + bool m_case_insensitive; + + unsigned int m_state; + std::stack<unsigned int> m_state_stack; + unsigned int m_num_states; +}; + + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline +lexer<IteratorT, TokenT, CallbackT>::lexer(unsigned int states) + : g(node_stack) + , m_compiled_dfa(false) + , m_regex_list(states) + , m_case_insensitive(false) + , m_state(0) + , m_state_stack() + , m_num_states(states) +{ + BOOST_SPIRIT_DEBUG_TRACE_NODE_NAME(g, "slex::lexer", + BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX); +} + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline void +lexer<IteratorT, TokenT, CallbackT>::register_regex( + const std::basic_string<char_t>& regex, const TokenT& id, + const CallbackT& callback, unsigned int state) +{ + if (state > m_num_states) { + m_regex_list.resize(state); + m_num_states = state; + } + m_regex_list[state].push_back(regex_info(regex, id, callback)); +} + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline TokenT +lexer<IteratorT, TokenT, CallbackT>::next_token( + IteratorT &first, IteratorT const& last, + std::basic_string< + typename BOOST_SPIRIT_IT_NS::iterator_traits<IteratorT>::value_type + > *token) +{ + if (!m_compiled_dfa) + { + create_dfa(); + } + + IteratorT saved = first; + int regex_index; + if (!lexerimpl::regex_match<dfa_table, IteratorT, (sizeof(char_t) > 1)>:: + do_match(m_dfa[m_state], first, last, regex_index, token)) + return -1; // TODO: can't return -1, need to return some invalid token. + // how to figure this out? We can use traits I guess. + else + { + regex_info regex = m_regex_list[m_state][regex_index]; + TokenT rval = regex.token; + if (regex.callback) + { + // execute corresponding callback + lexer_control<TokenT> controller(rval, m_state, m_state_stack); + regex.callback(saved, first, last, regex.token, controller); + if (controller.ignore_current_token_set()) { + if (token) + token->erase(); + return next_token(first, last, token); + } + } + return rval; + } +} + +namespace lexerimpl +{ + +inline +bool find_acceptance_state(const node_set& eof_node_ids, + const node_set& current_set, + node_id_t& acceptance_node_id) +{ + for(node_set::const_iterator nsi = eof_node_ids.begin(); + nsi != eof_node_ids.end(); ++nsi) + { + node_id_t eof_node_id =*nsi; + if (current_set.end() != current_set.find(eof_node_id)) + { + // store the first one we come to as the + // matched pattern + acceptance_node_id = eof_node_id; + // don't bother searching for more + return true; + } + } + return false; +} + +template <typename RegexListT, typename GrammarT> +#ifndef BOOST_NO_CXX11_SMART_PTR +inline std::unique_ptr<node> +#else +inline std::auto_ptr<node> +#endif +parse_regexes(const RegexListT& regex_list, GrammarT& g) +{ + // parse the expressions into a tree + if (regex_list.begin() == regex_list.end()) + boost::throw_exception(bad_regex()); + + typename RegexListT::const_iterator ri = regex_list.begin(); +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> tree(lexerimpl::parse(g, (*ri).str)); +#else + std::auto_ptr<node> tree(lexerimpl::parse(g, (*ri).str)); +#endif + if (tree.get() == 0) + boost::throw_exception(bad_regex()); + + ++ri; + for (/**/; ri != regex_list.end(); ++ri) + { +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> next_tree(lexerimpl::parse(g, (*ri).str)); +#else + std::auto_ptr<node> next_tree(lexerimpl::parse(g, (*ri).str)); +#endif + if (next_tree.get() == 0) + boost::throw_exception(bad_regex()); +#ifndef BOOST_NO_CXX11_SMART_PTR + tree = std::unique_ptr<node>(new or_node(tree.release(), next_tree.release())); +#else + tree = std::auto_ptr<node>(new or_node(tree.release(), next_tree.release())); +#endif + } + return tree; +} + +} //namespace lexerimpl + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline void +lexer<IteratorT, TokenT, CallbackT>::create_dfa() +{ + m_dfa.resize(m_num_states); + for (unsigned int i = 0; i < m_num_states; ++i) + create_dfa_for_state(i); +} + +// Algorithm from Compilers: Principles, Techniques, and Tools p. 141 +template <typename IteratorT, typename TokenT, typename CallbackT> +inline void +lexer<IteratorT, TokenT, CallbackT>::create_dfa_for_state(int state) +{ + using lexerimpl::node; +#ifndef BOOST_NO_CXX11_SMART_PTR + std::unique_ptr<node> tree = lexerimpl::parse_regexes(m_regex_list[state], g); +#else + std::auto_ptr<node> tree = lexerimpl::parse_regexes(m_regex_list[state], g); +#endif + node_id_t dummy = 0; + tree->assign_node_ids(dummy); + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) + tree->dump(std::cout); +#endif + + // compute followpos(root) + followpos_t followpos; + tree->compute_followpos(followpos); + + // the dfa states <-> nfa state groups + std::map<node_set, node_id_t> dstates1; + std::map<node_id_t, node_set> dstates2; + + // the dfa transitions + m_dfa[state].transition_table.push_back( + std::vector<node_id_t>(256, invalid_node)); + m_dfa[state].acceptance_index.push_back(invalid_node); + + // whether the dfa state has been processed yet + std::vector<node_id_t> marked; + + // used to give a unique id to each dfa state + node_id_t num_states = 0; + + // initially, the only unmarked state in Dstates is firstpos(root). + marked.push_back(0); + node_set fpr = tree->firstpos(); + dstates1[fpr] = 0; + dstates2[0] = fpr; + state_match_t state_match; + tree->compute_state_match(state_match); + + if (m_case_insensitive) + lexerimpl::make_case_insensitive(state_match); + + node_set eof_node_ids; + tree->get_eof_ids(eof_node_ids); + // translate the eof_node_ids into a 0-based index + std::map<node_id_t, node_id_t> eof_node_id_map; + unsigned int x = 0; + for (node_set::iterator node_id_it = eof_node_ids.begin(); + node_id_it != eof_node_ids.end(); + ++node_id_it) + { + eof_node_id_map[*node_id_it] = x++; + } + + // figure out if this is an acceptance state + node_id_t eof_node_id; + if (lexerimpl::find_acceptance_state(eof_node_ids, fpr, eof_node_id)) + { + m_dfa[state].acceptance_index[0] = eof_node_id_map[eof_node_id]; + } + + std::vector<node_id_t>::iterator i = std::find(marked.begin(), marked.end(), + node_id_t(0)); + while (marked.end() != i) + { + *i = 1; + node_id_t T = node_id_t(std::distance(marked.begin(), i)); + BOOST_ASSERT(T < dstates2.size()); + node_set Tstates = dstates2[T]; + for (node_id_t j = 0; j < 256; ++j) + { + node_set U; + for (node_set::iterator k = Tstates.begin(); + k != Tstates.end(); ++k) + { + node_id_t p =*k; + BOOST_ASSERT(p < state_match.size()); + BOOST_ASSERT(j < state_match[p].size()); + if (state_match[p][j]) + { + node_set fpp = followpos[p]; + U.insert(fpp.begin(), fpp.end()); + } + } + if (U.size() > 0) + { + std::map<node_set, node_id_t>::iterator l = dstates1.find(U); + node_id_t target_state; + if (l == dstates1.end()) // not in the states yet + { + ++num_states; + dstates1[U] = target_state = num_states; + dstates2[target_state] = U; + marked.push_back(0); + m_dfa[state].transition_table.push_back( + std::vector<node_id_t>(256, invalid_node)); + m_dfa[state].acceptance_index.push_back(invalid_node); + // figure out if this is an acceptance state + node_id_t eof_node_id; + if (lexerimpl::find_acceptance_state(eof_node_ids, U, eof_node_id)) + { + m_dfa[state].acceptance_index[target_state] = + eof_node_id_map[eof_node_id]; + } + } + else + { + target_state = dstates1[U]; + } + + BOOST_ASSERT(T < m_dfa[state].transition_table.size()); + BOOST_ASSERT(j < m_dfa[state].transition_table[T].size()); + m_dfa[state].transition_table[T][j] = target_state; + } + + } + + i = std::find(marked.begin(), marked.end(), node_id_t(0)); + } + m_compiled_dfa = true; +} + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline void +lexer<IteratorT, TokenT, CallbackT>::set_case_insensitive(bool insensitive) +{ + m_case_insensitive = insensitive; +} + + +#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) +template <typename IteratorT, typename TokenT, typename CallbackT> +inline void +lexer<IteratorT, TokenT, CallbackT>::dump(std::ostream& out) +{ + for (unsigned x = 0; x < m_dfa.size(); ++x) + { + out << "\nm_dfa[" << x << "] has " << m_dfa[x].transition_table.size() << " states\n"; + for (node_id_t i = 0; i < m_dfa[x].transition_table.size(); ++i) + { + out << "state " << i << ":"; + for (node_id_t j = 0; j < m_dfa[x].transition_table[i].size(); ++j) + { + if (m_dfa[x].transition_table[i][j] != invalid_node) + out << j << "->" << m_dfa[x].transition_table[i][j] << " "; + } + out << "\n"; + } + out << "acceptance states: "; + for(unsigned int k = 0; k < m_dfa[x].acceptance_index.size(); ++k) + { + if (m_dfa[x].acceptance_index[k] != invalid_node) + out << '<' << k << ',' << m_dfa[x].acceptance_index[k] << "> "; + } + out << endl; + } +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +// load the lexer tables +#define slex_in(strm, val) \ + strm.read((char*)&val, sizeof(val)); \ + if (std::ios::goodbit != strm.rdstate()) return false + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline bool +lexer<IteratorT, TokenT, CallbackT>::load (std::ifstream &in, long unique_id) +{ +// ensure correct signature and version +long signature = 0; + + slex_in (in, signature); + if (signature != SLEX_SIGNATURE) + return false; // not for us + +long version = 0; + + slex_in (in, version); + if ((version & ~SLEX_MINOR_VERSION_MASK) > SLEX_LAST_KNOWN_VERSION) + return false; // to new for us + +long uid = 0; + + slex_in (in, uid); + if (uid != unique_id) + return false; // not saved by us + +// load auxiliary members +int num_states = 0; + + slex_in (in, num_states); + +// load the dfa tables +dfa_t in_dfa; +std::size_t dfa_size = 0; + + slex_in (in, dfa_size); + in_dfa.resize(dfa_size); + for (std::size_t dfa = 0; dfa < dfa_size; ++dfa) + { + // load the transition tables + std::size_t tt_size = 0; + transition_table_t &tt_table = in_dfa[dfa].transition_table; + + slex_in (in, tt_size); + tt_table.resize(tt_size); + for (std::size_t tt = 0; tt < tt_size; ++tt) + { + std::size_t nt_size = 0; + node_table_t &nt_table = tt_table[tt]; + + slex_in (in, nt_size); + nt_table.resize(nt_size); + for (std::size_t nt = 0; nt < nt_size; ++nt) + { + slex_in (in, nt_table[nt]); + } + } + + // load the acceptance index table + std::size_t ai_size = 0; + node_table_t &ai_table = in_dfa[dfa].acceptance_index; + + slex_in (in, ai_size); + ai_table.resize(ai_size); + for (std::size_t ai = 0; ai < ai_size; ++ai) + { + slex_in (in, ai_table[ai]); + } + } + + m_dfa.swap(in_dfa); // success, swap in the read values + m_num_states = num_states; + + m_compiled_dfa = true; + return true; +} + +#undef slex_in + +/////////////////////////////////////////////////////////////////////////////// +// save the lexer tables +#define slex_out(strm, val) \ + strm.write((char*)&val, sizeof(val)); \ + if (std::ios::goodbit != strm.rdstate()) return false + +template <typename IteratorT, typename TokenT, typename CallbackT> +inline bool +lexer<IteratorT, TokenT, CallbackT>::save (std::ofstream &out, long unique_id) +{ +// save signature and version information +long out_long = SLEX_SIGNATURE; + + slex_out(out, out_long); + out_long = SLEX_VERSION_100; + slex_out(out, out_long); + slex_out(out, unique_id); + +// save auxiliary members + slex_out(out, m_num_states); + +// save the dfa tables + typedef typename dfa_t::const_iterator dfa_iter_t; + typedef transition_table_t::const_iterator transition_table_iter_t; + typedef node_table_t::const_iterator node_table_iter_t; + + std::size_t out_size_t = m_dfa.size(); + slex_out(out, out_size_t); + + dfa_iter_t end = m_dfa.end(); + for (dfa_iter_t it = m_dfa.begin(); it != end; ++it) + { + // save the transition table + out_size_t = (*it).transition_table.size(); + slex_out(out, out_size_t); + + transition_table_iter_t tt_end = (*it).transition_table.end(); + for (transition_table_iter_t tt_it = (*it).transition_table.begin(); + tt_it != tt_end; + ++tt_it) + { + out_size_t = (*tt_it).size(); + slex_out(out, out_size_t); + + node_table_iter_t nt_end = (*tt_it).end(); + for (node_table_iter_t nt_it = (*tt_it).begin(); + nt_it != nt_end; + ++nt_it) + { + slex_out(out, (*nt_it)); + } + } + + // save the acceptance index table + out_size_t = (*it).acceptance_index.size(); + slex_out(out, out_size_t); + + node_table_iter_t nt_end = (*it).acceptance_index.end(); + for (node_table_iter_t nt_it = (*it).acceptance_index.begin(); + nt_it != nt_end; + ++nt_it) + { + slex_out(out, (*nt_it)); + } + } + return true; +} + +#undef slex_out + +/* +a lexer_control object supports some operations on the lexer. + get current lexer state + set state + terminate + state stack (push, pop, top) + set new token return value + ignore the current token + yymore + get length of matched token +*/ +template <typename TokenT> +class lexer_control +{ +public: + + lexer_control(TokenT& token, unsigned int& current_state, + std::stack<unsigned int>& state_stack); + // functions dealing with the lexer state + + // set the state to state + void set_state(unsigned int state); + + // get the current state + unsigned int get_state(); + + // pushes the current state onto the top of the state stack and + // switches to new_state + void push_state(unsigned int new_state); + + // pops the top of the state stack and switches to it. + void pop_state(); + + // returns the top of the stack without altering the stack's contents. + unsigned int top_state(); + + // functions dealing with the token returned. + + // set a new TokenT return value, overriding that one that was + // registered via. register_regex() + void set_token(const TokenT& token); + + // tell the lexer to return an invalid token, signifying termination. + void terminate(); + + // ignore the current token, and move on to the next one. The current + // token will NOT be returned from next_token() + void ignore_current_token(); + + // returns true if ignore_current_token() has been called, + // false otherwise. + bool ignore_current_token_set(); + +private: + TokenT& m_token; + bool m_ignore_current_token; + unsigned int& m_current_state; + std::stack<unsigned int>& m_state_stack; +}; + +template <typename TokenT> +inline +lexer_control<TokenT>::lexer_control(TokenT& token, unsigned int& current_state, + std::stack<unsigned int>& state_stack) + : m_token(token) + , m_ignore_current_token(false) + , m_current_state(current_state) + , m_state_stack(state_stack) +{ +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::set_state(unsigned int state) +{ + m_current_state = state; +} + +template <typename TokenT> +inline unsigned int +lexer_control<TokenT>::get_state() +{ + return m_current_state; +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::push_state(unsigned int new_state) +{ + m_state_stack.push(m_current_state); + m_current_state = new_state; +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::pop_state() +{ + m_current_state = m_state_stack.top(); + m_state_stack.pop(); +} + +template <typename TokenT> +inline unsigned int +lexer_control<TokenT>::top_state() +{ + return m_state_stack.top(); +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::set_token(const TokenT& token) +{ + m_token = token; +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::terminate() +{ + m_token = -1; // TOOD: fix this, need to be determined by traits +} + +template <typename TokenT> +inline void +lexer_control<TokenT>::ignore_current_token() +{ + m_ignore_current_token = true; +} + +template <typename TokenT> +inline bool +lexer_control<TokenT>::ignore_current_token_set() +{ + return m_ignore_current_token; +} + +} // namespace classic +} // namespace spirit +} // namespace boost + +#undef BOOST_SPIRIT_IT_NS + +#endif + diff --git a/src/boost/libs/wave/samples/cpp_tokens/slex_interface.hpp b/src/boost/libs/wave/samples/cpp_tokens/slex_interface.hpp new file mode 100644 index 000000000..c89c2e9ac --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/slex_interface.hpp @@ -0,0 +1,88 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the abstract lexer interface + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED) +#define SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace slex { + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_NEW_LEXER_DECL BOOST_WAVE_DECL +#else +#define BOOST_WAVE_NEW_LEXER_DECL +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// new_lexer_gen: generates a new instance of the required C++ lexer +// +/////////////////////////////////////////////////////////////////////////////// +template < + typename IteratorT, + typename PositionT = boost::wave::util::file_position_type +> +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<slex_token<PositionT> > * + new_lexer(IteratorT const &first, IteratorT const &last, + PositionT const &pos, boost::wave::language_support language); +}; + +#undef BOOST_WAVE_NEW_LEXER_DECL + +/////////////////////////////////////////////////////////////////////////////// +// +// The slex_input_interface helps to instantiate a concrete lexer to be used +// by the Wave preprocessor module. +// This is done to allow compile time reduction. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +struct slex_input_interface +: lex_input_interface<TokenT> +{ + typedef typename lex_input_interface<TokenT>::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. + template <typename IteratorT> + static lex_input_interface<TokenT> * + new_lexer(IteratorT const &first, IteratorT const &last, + position_type const &pos, boost::wave::language_support language) + { + return new_lexer_gen<IteratorT, position_type>::new_lexer (first, last, + pos, language); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace slex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED) diff --git a/src/boost/libs/wave/samples/cpp_tokens/slex_iterator.hpp b/src/boost/libs/wave/samples/cpp_tokens/slex_iterator.hpp new file mode 100644 index 000000000..1fe5ce93f --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/slex_iterator.hpp @@ -0,0 +1,232 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the lexer iterator + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(SLEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED) +#define SLEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED + +#include <string> +#include <iostream> + +#include <boost/assert.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/util/functor_input.hpp> + +#include "slex_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 { +namespace cpplexer { +namespace slex { +namespace impl { + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_iterator_functor_shim +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +class slex_iterator_functor_shim +{ + typedef typename TokenT::position_type position_type; + +public: + slex_iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + : eof() +#endif // 0 != __DECCXX_VER + {} + +// interface to the boost::spirit::classic::iterator_policies::functor_input +// policy + typedef TokenT result_type; + typedef slex_iterator_functor_shim unique; + typedef lex_input_interface<TokenT>* shared; + + BOOST_WAVE_EOF_PREFIX result_type const eof; + + template <typename MultiPass> + static result_type& get_next(MultiPass& mp, result_type& result) + { + return mp.shared()->ftor->get(result); + } + + // this will be called whenever the last reference to a multi_pass will + // be released + template <typename MultiPass> + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template <typename MultiPass> + static void set_position(MultiPass& mp, position_type const &pos) + { + mp.shared()->ftor->set_position(pos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + template <typename MultiPass> + static bool has_include_guards(MultiPass& mp, std::string& guard_name) + { + return mp.shared()->ftor->has_include_guards(guard_name); + } +#endif + +private: + boost::shared_ptr<lex_input_interface<TokenT> > functor_ptr; +}; + +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +/////////////////////////////////////////////////////////////////////////////// +// eof token +template <typename TokenT> +typename slex_iterator_functor_shim<TokenT>::result_type const + slex_iterator_functor_shim<TokenT>::eof = + typename slex_iterator_functor_shim<TokenT>::result_type(); +#endif // 0 != __COMO_VERSION__ + +/////////////////////////////////////////////////////////////////////////////// +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// +// slex_iterator +// +// A generic C++ lexer interface class, which allows to plug in different +// lexer implementations (template parameter LexT). The following +// requirement apply: +// +// - the lexer type should have a function implemented, which returnes +// the next lexed token from the input stream: +// typename LexT::token_type get(); +// - at the end of the input stream this function should return the +// eof token equivalent +// - the lexer should implement a constructor taking two iterators +// pointing to the beginning and the end of the input stream and +// a third parameter containing the name of the parsed input file, +// the 4th parameter contains the information about the mode the +// preprocessor is used in (C99/C++ mode etc.) +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template <typename FunctorData> +struct make_multi_pass +{ + typedef + std::pair<typename FunctorData::unique, typename FunctorData::shared> + 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<functor_data_type, policy_type> type; +}; + +/////////////////////////////////////////////////////////////////////////////// +template <typename TokenT> +class slex_iterator +: public make_multi_pass<impl::slex_iterator_functor_shim<TokenT> >::type +{ + typedef impl::slex_iterator_functor_shim<TokenT> input_policy_type; + + typedef typename make_multi_pass<input_policy_type>::type base_type; + typedef typename make_multi_pass<input_policy_type>::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; + + slex_iterator() + {} + + template <typename IteratorT> + slex_iterator(IteratorT const &first, IteratorT const &last, + typename TokenT::position_type const &pos, + boost::wave::language_support language) + : base_type( + functor_data_type( + unique_functor_type(), + slex_input_interface<TokenT> + ::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 = this->base_type::dereference(*this); + position_type currpos = currtoken.get_position(); + + currpos.set_file(pos.get_file()); + currpos.set_line(pos.get_line()); + const_cast<token_type&>(currtoken).set_position(currpos); + + // set the new position for future tokens as well + if (token_type::string_type::npos != + currtoken.get_value().find_first_of('\n')) + { + currpos.set_line(pos.get_line() + 1); + } + unique_functor_type::set_position(*this, currpos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + // return, whether the current file has include guards + // this function returns meaningful results only if the file was scanned + // completely + bool has_include_guards(std::string& guard_name) const + { + return unique_functor_type::has_include_guards(*this, guard_name); + } +#endif +}; + +/////////////////////////////////////////////////////////////////////////////// +} // slex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#undef BOOST_WAVE_EOF_PREFIX + +#endif // !defined(SLEX_ITERATOR_HPP_AF0C37E3_CBD8_4F33_A225_51CF576FA61F_INCLUDED) diff --git a/src/boost/libs/wave/samples/cpp_tokens/slex_token.hpp b/src/boost/libs/wave/samples/cpp_tokens/slex_token.hpp new file mode 100644 index 000000000..8a54776d7 --- /dev/null +++ b/src/boost/libs/wave/samples/cpp_tokens/slex_token.hpp @@ -0,0 +1,145 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + A generic C++ lexer token definition + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED) +#define SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED + +#include <iomanip> +#include <ios> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { + +/////////////////////////////////////////////////////////////////////////////// +// forward declaration of the token type +template <typename PositionT = boost::wave::util::file_position_type> +class slex_token; + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_token +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename PositionT> +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_) + {} + +// accessors + operator token_id() const { return id; } + 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; } + void set_position (position_type const &pos_) { pos = pos_; } + + friend bool operator== (slex_token const& lhs, slex_token const& rhs) + { + // two tokens are considered equal even if they contain different + // positions + return (lhs.id == rhs.id && lhs.value == rhs.value) ? true : false; + } + +// debug support +#if BOOST_WAVE_DUMP_PARSE_TREE != 0 +// access functions for the tree_to_xml functionality + static int get_token_id(slex_token const &t) + { return ID_FROM_TOKEN(token_id(t)); } + static string_type get_token_value(slex_token const &t) + { return t.get_value(); } +#endif + +// print support + void print (std::ostream &stream) const + { + using namespace std; + using namespace boost::wave; + + stream << std::setw(16) + << std::left << boost::wave::get_token_name(id) << " (" + << "#" << token_id(BASEID_FROM_TOKEN(*this)) + << ") at " << get_position().get_file() << " (" + << std::setw(3) << std::right << get_position().get_line() << "/" + << std::setw(2) << std::right << get_position().get_column() + << "): >"; + + for (std::size_t i = 0; i < value.size(); ++i) { + switch (value[i]) { + case '\r': stream << "\\r"; break; + case '\n': stream << "\\n"; break; + case '\t': stream << "\\t"; break; + default: + stream << value[i]; + break; + } + } + stream << "<"; + } + +private: + boost::wave::token_id id; // the token id + string_type value; // the text, which was parsed into this token + PositionT pos; // the original file position +}; + +template <typename PositionT> +inline std::ostream & +operator<< (std::ostream &stream, slex_token<PositionT> const &object) +{ + object.print(stream); + 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 <typename Position> +inline bool +token_is_valid(slex_token<Position> const& t) +{ + return t.is_valid(); +} + +/////////////////////////////////////////////////////////////////////////////// +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED) diff --git a/src/boost/libs/wave/samples/custom_directives/build/Jamfile.v2 b/src/boost/libs/wave/samples/custom_directives/build/Jamfile.v2 new file mode 100644 index 000000000..4d737bb84 --- /dev/null +++ b/src/boost/libs/wave/samples/custom_directives/build/Jamfile.v2 @@ -0,0 +1,18 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (advanced_hooks) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe custom_directives + : ../custom_directives.cpp + /boost/wave//boost_wave + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + ; + diff --git a/src/boost/libs/wave/samples/custom_directives/custom_directives.cpp b/src/boost/libs/wave/samples/custom_directives/custom_directives.cpp new file mode 100644 index 000000000..e2eddcd3c --- /dev/null +++ b/src/boost/libs/wave/samples/custom_directives/custom_directives.cpp @@ -0,0 +1,124 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Sample demonstrating the usage of advanced preprocessor hooks. + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +#include "custom_directives.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// Main entry point +// +// This sample shows how to use the advanced hooks to output not only the +// preprocessed tokens but also the conditional directives found in the input +// file (these are commented out, tough) and the tokens from inside the +// conditional block which were not evaluated because the corresponding +// condition was false. These tokens are commented out as well. +// +int main(int argc, char *argv[]) +{ + if (2 != argc) { + std::cerr << "Usage: custom_directives infile" << std::endl; + return -1; + } + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> 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, + custom_directives_hooks + > context_type; + + // The preprocessor iterator shouldn't be constructed directly. It is + // to be generated through a wave::context<> object. This wave:context<> + // object additionally may be used to initialize and define different + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), argv[1]); + + ctx.set_language(boost::wave::enable_long_long(ctx.get_language())); + ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language())); + ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language())); + + // 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(); + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/custom_directives/custom_directives.hpp b/src/boost/libs/wave/samples/custom_directives/custom_directives.hpp new file mode 100644 index 000000000..c18a8ae2c --- /dev/null +++ b/src/boost/libs/wave/samples/custom_directives/custom_directives.hpp @@ -0,0 +1,86 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_CUSTOM_DIRECTIVES_HOOKS_INCLUDED) +#define BOOST_WAVE_CUSTOM_DIRECTIVES_HOOKS_INCLUDED + +#include <cstdio> +#include <ostream> +#include <string> +#include <algorithm> + +#include <boost/assert.hpp> +#include <boost/config.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/macro_helpers.hpp> +#include <boost/wave/preprocessing_hooks.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// The custom_directives_hooks policy class is used to register some +// of the more advanced (and probably more rarely used hooks with the Wave +// library. +// +// This policy type is used as a template parameter to the boost::wave::context<> +// object. +// +/////////////////////////////////////////////////////////////////////////////// +class custom_directives_hooks +: public boost::wave::context_policies::default_preprocessing_hooks +{ +public: + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_unknown_directive' is called, whenever an unknown + // preprocessor directive was encountered. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'line' holds the tokens of the entire source line + // containing the unknown directive. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used as the replacement text for the whole + // line containing the unknown directive. + // + // The return value defines, whether the given expression has been + // properly interpreted by the hook function or not. If this function + // returns 'false', the library will raise an 'ill_formed_directive' + // preprocess_exception. Otherwise the tokens pushed back into 'pending' + // are passed on to the user program. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename ContainerT> + bool + found_unknown_directive(ContextT const& ctx, ContainerT const& line, + ContainerT& pending) + { + namespace wave = boost::wave; + + typedef typename ContainerT::const_iterator iterator_type; + iterator_type it = line.begin(); + wave::token_id id = wave::util::impl::skip_whitespace(it, line.end()); + + if (id != wave::T_IDENTIFIER) + return false; // nothing we could do + + if ((*it).get_value() == "version" || (*it).get_value() == "extension") + { + // handle #version and #extension directives + std::copy(line.begin(), line.end(), std::back_inserter(pending)); + return true; + } + + return false; // unknown directive + } +}; + +#endif // !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED) diff --git a/src/boost/libs/wave/samples/custom_directives/custom_directives.input b/src/boost/libs/wave/samples/custom_directives/custom_directives.input new file mode 100644 index 000000000..be09bd6e4 --- /dev/null +++ b/src/boost/libs/wave/samples/custom_directives/custom_directives.input @@ -0,0 +1,8 @@ +// This example recognizes two additional preprocessor directives (as defined +// in GLSL - OpenGL Shader Language). + +#version 150 core +#extension all : require // trailing comment + +// the following directive is not supported, so it will trigger an exception +#not_supported_directive diff --git a/src/boost/libs/wave/samples/emit_custom_line_directives/build/Jamfile.v2 b/src/boost/libs/wave/samples/emit_custom_line_directives/build/Jamfile.v2 new file mode 100644 index 000000000..924ff3c21 --- /dev/null +++ b/src/boost/libs/wave/samples/emit_custom_line_directives/build/Jamfile.v2 @@ -0,0 +1,18 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (advanced_hooks) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe emit_custom_line_directives + : ../emit_custom_line_directives.cpp + /boost/wave//boost_wave + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + ; + diff --git a/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.cpp b/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.cpp new file mode 100644 index 000000000..3ccbbde17 --- /dev/null +++ b/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.cpp @@ -0,0 +1,124 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Sample demonstrating the usage of advanced preprocessor hooks. + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +#include "emit_custom_line_directives.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// Main entry point +// +// This sample shows how to use the emit_line_directive preprocessing hooks +// to customize the format of any generated #line directive. The sample will +// emit #line directives formatted compatible with those generated by gcc: +// +// # <lineno> <rel_file_name> +// +int main(int argc, char *argv[]) +{ + if (2 != argc) { + std::cerr << "Usage: emit_custom_line_directives infile" << std::endl; + return -1; + } + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> 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, + emit_custom_line_directives_hooks + > context_type; + + // The preprocessor iterator shouldn't be constructed directly. It is + // to be generated through a wave::context<> object. This wave:context<> + // object additionally may be used to initialize and define different + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), argv[1]); + + ctx.set_language(boost::wave::enable_long_long(ctx.get_language())); + ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language())); + ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language())); + + // 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(); + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.hpp b/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.hpp new file mode 100644 index 000000000..2284a3c83 --- /dev/null +++ b/src/boost/libs/wave/samples/emit_custom_line_directives/emit_custom_line_directives.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_emit_custom_line_directives_HOOKS_INCLUDED) +#define BOOST_WAVE_emit_custom_line_directives_HOOKS_INCLUDED + +#include <cstdio> +#include <ostream> +#include <string> +#include <algorithm> + +#include <boost/assert.hpp> +#include <boost/config.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/macro_helpers.hpp> +#include <boost/wave/preprocessing_hooks.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// The emit_custom_line_directives_hooks policy class is used to register some +// of the more advanced (and probably more rarely used hooks with the Wave +// library. +// +// This policy type is used as a template parameter to the boost::wave::context<> +// object. +// +/////////////////////////////////////////////////////////////////////////////// +class emit_custom_line_directives_hooks +: public boost::wave::context_policies::default_preprocessing_hooks +{ +public: + /////////////////////////////////////////////////////////////////////////// + // + // The function 'emit_line_directive' is called whenever a #line directive + // has to be emitted into the generated output. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used instead of the default output generated + // for the #line directive. + // + // The parameter 'act_token' contains the actual #pragma token, which may + // be used for error output. The line number stored in this token can be + // used as the line number emitted as part of the #line directive. + // + // If the return value is 'false', a default #line directive is emitted + // by the library. A return value of 'true' will inhibit any further + // actions, the tokens contained in 'pending' will be copied verbatim + // to the output. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename ContainerT> + bool + emit_line_directive(ContextT const& ctx, ContainerT &pending, + typename ContextT::token_type const& act_token) + { + // emit a #line directive showing the relative filename instead + typename ContextT::position_type pos = act_token.get_position(); + unsigned int column = 1; + + typedef typename ContextT::token_type result_type; + using namespace boost::wave; + + pos.set_column(column); + pending.push_back(result_type(T_POUND, "#", pos)); + + pos.set_column(++column); // account for '#' + pending.push_back(result_type(T_SPACE, " ", pos)); + + // 21 is the max required size for a 64 bit integer represented as a + // string + char buffer[22]; + + using namespace std; // for some systems sprintf is in namespace std + sprintf (buffer, "%d", pos.get_line()); + + pos.set_column(++column); // account for ' ' + pending.push_back(result_type(T_INTLIT, buffer, pos)); + pos.set_column(column += (unsigned int)strlen(buffer)); // account for <number> + pending.push_back(result_type(T_SPACE, " ", pos)); + pos.set_column(++column); // account for ' ' + + std::string file("\""); + boost::filesystem::path filename( + boost::wave::util::create_path(ctx.get_current_relative_filename().c_str())); + + using boost::wave::util::impl::escape_lit; + file += escape_lit(boost::wave::util::native_file_string(filename)) + "\""; + + pending.push_back(result_type(T_STRINGLIT, file.c_str(), pos)); + pos.set_column(column += (unsigned int)file.size()); // account for filename + pending.push_back(result_type(T_GENERATEDNEWLINE, "\n", pos)); + + return true; + } +}; + +#endif // !defined(BOOST_WAVE_ADVANCED_PREPROCESSING_HOOKS_INCLUDED) diff --git a/src/boost/libs/wave/samples/hannibal/build/Jamfile.v2 b/src/boost/libs/wave/samples/hannibal/build/Jamfile.v2 new file mode 100644 index 000000000..32a65d94a --- /dev/null +++ b/src/boost/libs/wave/samples/hannibal/build/Jamfile.v2 @@ -0,0 +1,20 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (Hannibal) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe hannibal + : ../hannibal.cpp + /boost/wave//boost_wave + /boost/filesystem//boost_filesystem + /boost/program_options//boost_program_options + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + diff --git a/src/boost/libs/wave/samples/hannibal/hannibal.cpp b/src/boost/libs/wave/samples/hannibal/hannibal.cpp new file mode 100644 index 000000000..fa9e1f291 --- /dev/null +++ b/src/boost/libs/wave/samples/hannibal/hannibal.cpp @@ -0,0 +1,319 @@ +// Hannibal: partial C++ grammar to parse C++ type information +// Copyright (c) 2005-2006 Danny Havenith +// +// Boost.Wave: A Standard compliant C++ preprocessor +// Copyright (c) 2001-2010 Hartmut Kaiser +// +// http://www.boost.org/ +// +// 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) + +#define HANNIBAL_DUMP_PARSE_TREE 1 +//#define HANNIBAL_TRACE_DECLARATIONS +//#define BOOST_SPIRIT_DEBUG + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +#include <boost/spirit/include/classic_ast.hpp> +#include <boost/spirit/include/classic_tree_to_xml.hpp> +#include <boost/program_options.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +/////////////////////////////////////////////////////////////////////////////// +// Include the Hannibal grammar +#include "translation_unit_parser.h" +#include "translation_unit_skipper.h" + +using std::vector; +using std::string; +namespace po = boost::program_options; + +#if HANNIBAL_DUMP_PARSE_TREE != 0 +/////////////////////////////////////////////////////////////////////////////// +namespace { + + /////////////////////////////////////////////////////////////////////////// + // helper routines needed to generate the parse tree XML dump + typedef boost::wave::cpplexer::lex_token<> token_type; + + token_type::string_type get_token_id(token_type const &t) + { + using namespace boost::wave; + return get_token_name(token_id(t)); // boost::wave::token_id(t); + } + + token_type::string_type get_token_value(token_type const &t) + { + return t.get_value(); + } + +/////////////////////////////////////////////////////////////////////////////// +} // unnamed namespace +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace { + + /////////////////////////////////////////////////////////////////////////// + // Parse the command line for input files and (system-) include paths + // Prints usage info if needed. + // returns true if program should continue, false if program must stop + bool parse_command_line( int argc, char *argv[], po::variables_map &vm) + { + // + // Setup command line structure + po::options_description visible("Usage: hannibal [options] file"); + visible.add_options() + ("help,h", "show this help message") + ("include,I", po::value<vector<string> >(), + "specify additional include directory") + ("sysinclude,S", po::value<vector<string> >(), + "specify additional system include directory") + ("define,D", po::value<vector<string> >()->composing(), + "specify a macro to define (as macro[=[value]])") + ("predefine,P", po::value<vector<string> >()->composing(), + "specify a macro to predefine (as macro[=[value]])") + ("undefine,U", po::value<vector<string> >()->composing(), + "specify a macro to undefine") + ; + + po::options_description hidden; + hidden.add_options() + ("input-file", "input file"); + + po::options_description desc; + desc.add( visible).add( hidden); + + po::positional_options_description p; + p.add("input-file", 1); + + // + // Parse + po::store(po::command_line_parser(argc, argv). + options(desc).positional(p).run(), vm); + po::notify(vm); + + // + // Print usage, if necessary + if (!vm.count( "input-file") || vm.count( "help")) + { + std::cout << visible << std::endl; + return false; + } + else + { + return true; + } + } + +/////////////////////////////////////////////////////////////////////////////// +} // unnamed namespace + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int main(int argc, char *argv[]) +{ + po::variables_map vm; + + if (!parse_command_line( argc, argv, vm)) + { + return -1; + } + + string inputfile = vm["input-file"].as< string>(); + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // Open and read in the specified input file. + std::ifstream instream( inputfile.c_str()); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Hannibal: could not open input file: " << inputfile + << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> 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 + > context_type; + + // 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 + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), inputfile.c_str()); + + // add include directories to the include path + if (vm.count("include")) { + vector<string> const &paths = + vm["include"].as<vector<string> >(); + vector<string>::const_iterator end = paths.end(); + for (vector<string>::const_iterator cit = paths.begin(); + cit != end; ++cit) + { + ctx.add_include_path((*cit).c_str()); + } + } + + // add system include directories to the include path + if (vm.count("sysinclude")) { + vector<string> const &syspaths = + vm["sysinclude"].as<vector<string> >(); + vector<string>::const_iterator end = syspaths.end(); + for (vector<string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + ctx.add_sysinclude_path((*cit).c_str()); + } + } + + // add additional defined macros + if (vm.count("define")) { + vector<string> const ¯os = vm["define"].as<vector<string> >(); + vector<string>::const_iterator end = macros.end(); + for (vector<string>::const_iterator cit = macros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit); + } + } + + // add additional predefined macros + if (vm.count("predefine")) { + vector<string> const &predefmacros = + vm["predefine"].as<vector<string> >(); + vector<string>::const_iterator end = predefmacros.end(); + for (vector<string>::const_iterator cit = predefmacros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit, true); + } + } + + // undefine specified macros + if (vm.count("undefine")) { + vector<string> const &undefmacros = + vm["undefine"].as<vector<string> >(); + vector<string>::const_iterator end = undefmacros.end(); + for (vector<string>::const_iterator cit = undefmacros.begin(); + cit != end; ++cit) + { + ctx.remove_macro_definition((*cit).c_str(), true); + } + } + + // 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 + typedef boost::spirit::classic::tree_parse_info<context_type::iterator_type> + result_type; + translation_unit_grammar::rule_map_type rule_map; + translation_unit_grammar g(&rule_map); + + // parse the input file + result_type pi = boost::spirit::classic::ast_parse(first, last, g, s); +#else + typedef boost::spirit::classic::parse_info<context_type::iterator_type> + result_type; + translation_unit_grammar g; + + // parse the input file + result_type pi = boost::spirit::classic::parse(first, last, g, s); +#endif + + if (pi.full) { + std::cout + << "Hannibal: parsed sucessfully: " << inputfile << std::endl; + +#if HANNIBAL_DUMP_PARSE_TREE != 0 + // generate xml dump from parse tree, if requested + boost::spirit::classic::tree_to_xml(std::cerr, pi.trees, "", rule_map, + &get_token_id, &get_token_value); +#endif + } + else { + std::cerr + << "Hannibal: parsing failed: " << inputfile << std::endl; + std::cerr + << "Hannibal: last recognized token was: " + << get_token_id(*pi.stop) << std::endl; + + using boost::wave::util::file_position_type; + file_position_type const& pos(pi.stop->get_position()); + std::cerr + << "Hannibal: at: " << pos.get_file() << "(" << pos.get_line() + << "," << pos.get_column() << ")" << std::endl; + return 1; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << ":" << e.line_no() << ":" << e.column_no() + << ": " << e.description() << std::endl; + return 2; + } + catch (boost::wave::cpplexer::lexing_exception const& e) { + // some lexing error + std::cerr + << e.file_name() << ":" << e.line_no() << ":" << e.column_no() + << ": " << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/hannibal/translation_unit_parser.h b/src/boost/libs/wave/samples/hannibal/translation_unit_parser.h new file mode 100644 index 000000000..48b9a032e --- /dev/null +++ b/src/boost/libs/wave/samples/hannibal/translation_unit_parser.h @@ -0,0 +1,1345 @@ +// Hannibal: partial C++ grammar to parse C++ type information +// Copyright (c) 2005-2006 Danny Havenith +// +// Boost.Wave: A Standard compliant C++ preprocessor +// Copyright (c) 2001-2009 Hartmut Kaiser +// +// http://www.boost.org/ +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(HANNIBAL_TRANSLATION_UNIT_GRAMMAR_H_INCLUDED) +#define HANNIBAL_TRANSLATION_UNIT_GRAMMAR_H_INCLUDED + +#include <map> + +#include <boost/assert.hpp> +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_confix.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/pattern_parser.hpp> + +// +// If so required, trace every declaration and member-declaration. +// This can be a much faster alternative to BOOST_SPIRIT_DEBUG-type of +// debugging. +// +#ifdef HANNIBAL_TRACE_DECLARATIONS +struct trace_actor +{ + trace_actor( + const char rule_type[], + std::ostream &strm + ) + : strm_( strm), rule_type_( rule_type) + { + // nop + } + + template<typename PositionIterator> + void operator()(PositionIterator begin, PositionIterator end) const + { + typedef const boost::wave::cpplexer::lex_token<>::position_type + position_type; + //typedef pos_iterator_type::token_type::position_type position_type; + + position_type &begin_pos(begin->get_position()); + + strm_ << "Parsed " << rule_type_ << std::endl; + strm_ << " from: " << begin_pos.get_file() + << "(" << begin_pos.get_line() << ")" + << std::endl; + }; + +private: + std::ostream &strm_; + char const* const rule_type_; +}; + +#define HANNIBAL_TRACE_ACTION( type) [trace_actor( (type), std::cout)] +#else +#define HANNIBAL_TRACE_ACTION( type) +#endif + +/////////////////////////////////////////////////////////////////////////////// +#define HANNIBAL_TRACE_TRANSLATION_UNIT_GRAMMAR \ + bool(BOOST_SPIRIT_DEBUG_FLAGS_CPP & BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR) \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +// Helper macro to register rules for debugging +#if HANNIBAL_DUMP_PARSE_TREE != 0 +#define HANNIBAL_REGISTER_RULE(r) \ + BOOST_SPIRIT_DEBUG_NODE(r); \ + self.declare_rule(r, #r) \ + /**/ +#else +#define HANNIBAL_REGISTER_RULE(r) \ + BOOST_SPIRIT_DEBUG_NODE(r) \ + /**/ +#endif + +/////////////////////////////////////////////////////////////////////////////// +struct dump_actor { + template<typename ForwardIterator> + void operator()(ForwardIterator begin, ForwardIterator end) + { + std::cerr << "*** COULD NOT PARSE THE FOLLOWING ***" << std::endl; + while (begin != end) + { + std::cerr << begin->get_value(); + ++begin; + } + } +} dump_a; + +/////////////////////////////////////////////////////////////////////////////// +struct translation_unit_grammar +: public boost::spirit::classic::grammar<translation_unit_grammar> +{ +#if HANNIBAL_DUMP_PARSE_TREE != 0 +// +// allow an external map with rule-id -> rule-name mappings. +// this map is external so it can be altered by the definition constructor, +// which receives a const grammar object. +// +// Please Note: the lifetime of the rule map should at least extend beyond the +// call of the definition constructor... +// + typedef std::map<boost::spirit::classic::parser_id, std::string> + rule_map_type; + + translation_unit_grammar(rule_map_type *rule_map_ptr_ = 0) + : rule_map_ptr(rule_map_ptr_) +#else + translation_unit_grammar() +#endif + { + BOOST_SPIRIT_DEBUG_TRACE_GRAMMAR_NAME(*this, + "translation_unit_grammar", HANNIBAL_TRACE_TRANSLATION_UNIT_GRAMMAR); + } + + template <typename ScannerT> + struct definition + { + // declare non-terminals + typedef boost::spirit::classic::rule<ScannerT> rule_type; + + rule_type constant_expression; + rule_type logical_or_exp, logical_and_exp; + rule_type inclusive_or_exp, exclusive_or_exp, and_exp; + rule_type cmp_equality, cmp_relational; + rule_type shift_exp; + rule_type add_exp, multiply_exp; + rule_type unary_exp, primary_exp, constant; + + boost::spirit::classic::subrule<0> const_exp_subrule; + boost::spirit::classic::subrule<1> shift_exp_clos; + + rule_type simple_type_name, class_keywords; + rule_type storage_class_specifier, cv_qualifier, function_specifier; + rule_type access_specifier; + rule_type extension_type_decorator; + rule_type operator_sym; + rule_type class_key; + rule_type enumerator; + rule_type enumerator_list; + rule_type enumerator_definition; + rule_type member_declarator; + rule_type member_declarator_list; + rule_type member_declaration; + rule_type constant_initializer; + rule_type pure_specifier; + rule_type namespace_body; + rule_type type_id; + rule_type unnamed_namespace_definition; + rule_type extension_namespace_definition; + rule_type original_namespace_definition; + rule_type named_namespace_definition; + rule_type namespace_definition; + rule_type linkage_specification; + rule_type explicit_specialization; + rule_type using_directive; + rule_type using_declaration; + rule_type type_parameter; + rule_type template_parameter; + rule_type template_parameter_list; + rule_type template_declaration; + rule_type explicit_instantiation; + rule_type qualified_namespace_specifier; + rule_type namespace_alias_definition; + rule_type expression_list; + rule_type initializer_list; + rule_type initializer_clause; + rule_type initializer; + rule_type init_declarator; + rule_type init_declarator_list; + rule_type asm_definition; + rule_type simple_declaration; + rule_type block_declaration; + rule_type declaration; + rule_type declaration_seq; + rule_type translation_unit; + + rule_type function_definition, function_definition_helper, declarator; + rule_type direct_declarator, parameters_or_array_spec; + rule_type abstract_declarator, direct_abstract_declarator; + rule_type direct_abstract_declarator_helper; + rule_type parameter_declaration_clause, parameter_declaration_list; + rule_type parameter_declaration, assignment_expression, decimal_literal; + rule_type octal_literal, hexadecimal_literal; + rule_type declarator_id, id_expression, qualified_id, unqualified_id; + rule_type operator_function_id, conversion_function_id, conversion_type_id; + rule_type conversion_declarator, function_body; + rule_type compound_statement, ctor_initializer, ptr_operator; + rule_type decl_specifier, type_specifier; + rule_type type_specifier_seq, cv_qualifier_seq, enum_specifier; + rule_type enum_keyword, simple_type_specifier; + rule_type class_specifier, member_specification, class_head; + rule_type type_name, elaborated_type_specifier, template_argument_list; + rule_type template_argument, nested_name_specifier; + rule_type class_or_namespace_name, class_name, enum_name, typedef_name; + rule_type namespace_name, template_id; + rule_type decl_specifier_seq, no_type_decl_specifier; + rule_type function_try_block, handler_seq, handler; + rule_type exception_specification, template_name; + rule_type original_namespace_name, base_specifier; + rule_type base_specifier_list, base_clause; + rule_type odd_language_extension, mem_initializer_id; + rule_type mem_initializer, mem_initializer_list; + + + rule_type ta_expression_operator; + rule_type ta_logical_or_expression; + rule_type ta_expression; + rule_type ta_conditional_expression; + rule_type ta_throw_expression; + rule_type ta_assignment_expression; + rule_type postfix_expression_helper; + rule_type simple_postfix_expression; + rule_type pseudo_destructor_name; + rule_type direct_new_declarator; + rule_type new_declarator; + rule_type new_initializer; + rule_type new_type_id; + rule_type new_placement; + rule_type delete_expression; + rule_type new_expression; + rule_type unary_operator; + rule_type postfix_expression; + rule_type unary_expression; + rule_type expression_operator; + rule_type cast_expression; + rule_type throw_expression; + rule_type assignment_operator; + rule_type logical_or_expression; + rule_type conditional_expression; + rule_type boolean_literal; + rule_type string_literal; + rule_type floating_literal; + rule_type character_literal; + rule_type integer_literal; + rule_type expression; + rule_type literal; + rule_type primary_expression; + + // + // grammar definition. + + definition(translation_unit_grammar const& self) + { + using namespace boost::spirit::classic; + using namespace boost::wave; + using boost::wave::util::pattern_p; + + // + // First, a long list of expression rules. + // + HANNIBAL_REGISTER_RULE( primary_expression); + primary_expression + = literal + | ch_p(T_THIS) + | ch_p(T_COLON_COLON) >> ch_p(T_IDENTIFIER) + | ch_p(T_COLON_COLON) >> operator_function_id + | ch_p(T_COLON_COLON) >> qualified_id + | ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | id_expression + ; + + HANNIBAL_REGISTER_RULE( literal); + literal + = integer_literal + | character_literal + | floating_literal + | string_literal + | boolean_literal + ; + + HANNIBAL_REGISTER_RULE( integer_literal); + integer_literal + = pattern_p( IntegerLiteralTokenType, TokenTypeMask) + ; + + HANNIBAL_REGISTER_RULE( character_literal); + character_literal + = pattern_p( CharacterLiteralTokenType, TokenTypeMask) + ; + + HANNIBAL_REGISTER_RULE( floating_literal); + floating_literal + = pattern_p( FloatingLiteralTokenType, TokenTypeMask) + ; + + HANNIBAL_REGISTER_RULE( string_literal); + string_literal + = pattern_p( StringLiteralTokenType, TokenTypeMask) + ; + + HANNIBAL_REGISTER_RULE( boolean_literal); + boolean_literal + = pattern_p( BoolLiteralTokenType, TokenTypeMask) + ; + + // + // TODO: separate assignment expression into a grammar of it's own + // + HANNIBAL_REGISTER_RULE( assignment_expression); + assignment_expression + = conditional_expression + | logical_or_expression >> assignment_operator >> assignment_expression + | throw_expression + ; + + // + // Have a separate assignment expression for template arguments. + // This is needed, because without it, an expression of the form + // template < a, b, c > x; + // would not parse, since the 'c > x' part would be taken by the + // assignment expression. + // + // Note that this ta_xxxxx duplication cascades all the way down to + // logical_or_expression. + // Both the previous example and a declaration of the form + // template < a, b, (c > d) > x; + // should parse fine now. + // + // + HANNIBAL_REGISTER_RULE( ta_assignment_expression); + ta_assignment_expression + = ta_conditional_expression + | ta_logical_or_expression >> assignment_operator >> ta_assignment_expression + | ta_throw_expression + ; + + HANNIBAL_REGISTER_RULE( throw_expression); + throw_expression + = ch_p(T_THROW) >> !assignment_expression + ; + + HANNIBAL_REGISTER_RULE( ta_throw_expression); + ta_throw_expression + = ch_p(T_THROW) >> !ta_assignment_expression + ; + + HANNIBAL_REGISTER_RULE( conditional_expression); + conditional_expression + = logical_or_expression + >> !( + ch_p(T_QUESTION_MARK) + >> expression + >> ch_p(T_COLON) + >> assignment_expression + ) + ; + + HANNIBAL_REGISTER_RULE( ta_conditional_expression); + ta_conditional_expression + = ta_logical_or_expression + >> !( + ch_p(T_QUESTION_MARK) + >> ta_expression + >> ch_p(T_COLON) + >> ta_assignment_expression + ) + ; + + HANNIBAL_REGISTER_RULE( expression); + expression + = assignment_expression % ch_p(T_COMMA); + + HANNIBAL_REGISTER_RULE( ta_expression); + ta_expression + = ta_assignment_expression % ch_p(T_COMMA); + + HANNIBAL_REGISTER_RULE( assignment_operator); + assignment_operator + = pp(T_ASSIGN) + | pp(T_ANDASSIGN) + | pp(T_ORASSIGN) + | pp(T_XORASSIGN) + | pp(T_DIVIDEASSIGN) + | pp(T_MINUSASSIGN) + | pp(T_PERCENTASSIGN) + | pp(T_PLUSASSIGN) + | pp(T_SHIFTLEFTASSIGN) + | pp(T_SHIFTRIGHTASSIGN) + | pp(T_STARASSIGN) + ; + + + // we skip quite a few rules here, since we're not interested in operator precedence + // just now. + HANNIBAL_REGISTER_RULE( logical_or_expression); + logical_or_expression + = cast_expression % expression_operator + ; + + HANNIBAL_REGISTER_RULE( ta_logical_or_expression); + ta_logical_or_expression + = cast_expression % ta_expression_operator + ; + + HANNIBAL_REGISTER_RULE( expression_operator ); + expression_operator + = ta_expression_operator | pp(T_GREATER) + ; + + HANNIBAL_REGISTER_RULE( ta_expression_operator ); + ta_expression_operator + = pp(T_OROR) + | pp(T_ANDAND) + | pp(T_OR) + | pp(T_XOR) + | pp(T_AND) + | pp(T_NOTEQUAL) + | pp(T_EQUAL) + | pp(T_GREATEREQUAL) + | pp(T_LESSEQUAL) + | pp(T_LESS) + | pp(T_SHIFTLEFT) + | pp(T_SHIFTRIGHT) + | pp(T_PLUS) + | pp(T_MINUS) + | pp(T_PERCENT) + | pp(T_DIVIDE) + | pp(T_STAR) + | pp(T_ARROWSTAR) + | pp(T_DOTSTAR) + ; + + HANNIBAL_REGISTER_RULE( cast_expression); + cast_expression + = ch_p(T_LEFTPAREN) >> type_id >> ch_p(T_RIGHTPAREN) + >> cast_expression + | unary_expression + ; + + HANNIBAL_REGISTER_RULE( unary_expression); + unary_expression + = postfix_expression + | ch_p(T_PLUSPLUS) >> cast_expression + | ch_p(T_MINUSMINUS) >> cast_expression + | unary_operator >> cast_expression + | ch_p(T_SIZEOF) >> unary_expression + | ch_p(T_SIZEOF) + >> ch_p(T_LEFTPAREN) >> type_id >> ch_p(T_RIGHTPAREN) + | new_expression + | delete_expression + ; + + HANNIBAL_REGISTER_RULE( unary_operator); + unary_operator + = ch_p(T_STAR) + | pp(T_AND) + | pp(T_PLUS) + | ch_p(T_MINUS) + | ch_p(T_NOT) + | pp(T_COMPL) + ; + + HANNIBAL_REGISTER_RULE( new_expression); + new_expression + = !ch_p(T_COLON_COLON) >> ch_p(T_NEW) >> !new_placement + >> ( + new_type_id >> !new_initializer + | ch_p(T_LEFTPAREN) >> type_id >> ch_p(T_RIGHTPAREN) >> !new_initializer + ) + ; + + HANNIBAL_REGISTER_RULE( new_placement); + new_placement + = ch_p(T_LEFTPAREN) >> expression_list >> ch_p(T_RIGHTPAREN) + ; + + HANNIBAL_REGISTER_RULE( new_type_id); + new_type_id + = type_specifier_seq >> !new_declarator + ; + + HANNIBAL_REGISTER_RULE( new_declarator); + new_declarator + = ptr_operator >> !new_declarator + | direct_new_declarator + ; + + HANNIBAL_REGISTER_RULE( direct_new_declarator); + direct_new_declarator + = *( pp(T_LEFTBRACKET) >> expression >> pp(T_RIGHTBRACKET) ) + >> pp(T_LEFTBRACKET) >> constant_expression >> pp(T_RIGHTBRACKET) + ; + + HANNIBAL_REGISTER_RULE( new_initializer); + new_initializer + = ch_p(T_LEFTPAREN) >> !expression_list >> ch_p(T_RIGHTPAREN) + ; + + HANNIBAL_REGISTER_RULE( delete_expression); + delete_expression + = !ch_p(T_COLON_COLON) >> ch_p(T_DELETE) >> cast_expression + | !ch_p(T_COLON_COLON) >> ch_p(T_DELETE) + >> pp(T_LEFTBRACKET) >> pp(T_RIGHTBRACKET) + >> cast_expression + ; + + HANNIBAL_REGISTER_RULE( postfix_expression); + postfix_expression + = simple_postfix_expression >> *postfix_expression_helper + ; + + HANNIBAL_REGISTER_RULE( simple_postfix_expression); + simple_postfix_expression + = primary_expression + | simple_type_specifier + >> ch_p(T_LEFTPAREN) >> !expression_list >> ch_p(T_RIGHTPAREN) + | ch_p(T_DYNAMICCAST) + >> ch_p(T_LESS) >> type_id >> ch_p(T_GREATER) + >> ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | ch_p(T_STATICCAST) + >> ch_p(T_LESS) >> type_id >> ch_p(T_GREATER) + >> ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | ch_p(T_REINTERPRETCAST) + >> ch_p(T_LESS) >> type_id >> ch_p(T_GREATER) + >> ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | ch_p(T_CONSTCAST) + >> ch_p(T_LESS) >> type_id >> ch_p(T_GREATER) + >> ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | ch_p(T_TYPEID) + >> ch_p(T_LEFTPAREN) >> expression >> ch_p(T_RIGHTPAREN) + | ch_p(T_TYPEID) + >> ch_p(T_LEFTPAREN) >> type_id >> ch_p(T_RIGHTPAREN) + ; + + HANNIBAL_REGISTER_RULE( postfix_expression_helper ); + postfix_expression_helper + = pp(T_LEFTBRACKET) >> expression >> pp(T_RIGHTBRACKET) + | ch_p(T_LEFTPAREN) >> !expression_list >> ch_p(T_RIGHTPAREN) + | ch_p(T_DOT) >> !ch_p(T_TEMPLATE) >> !ch_p(T_COLON_COLON) >> id_expression + | ch_p(T_ARROW) >> !ch_p(T_TEMPLATE) >> !ch_p(T_COLON_COLON) >> id_expression + | ch_p(T_DOT) >> pseudo_destructor_name + | ch_p(T_ARROW) >> pseudo_destructor_name + | ch_p(T_PLUSPLUS) + | ch_p(T_MINUSMINUS) + ; + + HANNIBAL_REGISTER_RULE( pseudo_destructor_name); + pseudo_destructor_name + = !ch_p(T_COLON_COLON) >> !nested_name_specifier + >> ( + type_name >> ch_p(T_COLON_COLON) >> ch_p(T_COMPL) >> type_name + | ch_p(T_COMPL) >> type_name + ) + ; + + + HANNIBAL_REGISTER_RULE(constant_expression); + constant_expression + = conditional_expression + ; + + HANNIBAL_REGISTER_RULE(ctor_initializer); + ctor_initializer + = ch_p(T_COLON) >> mem_initializer_list + ; + + HANNIBAL_REGISTER_RULE(mem_initializer_list); + mem_initializer_list + = mem_initializer % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(mem_initializer); + mem_initializer + = mem_initializer_id + >> comment_nest_p(ch_p(T_LEFTPAREN), ch_p(T_RIGHTPAREN)) + // TODO: restore after assignment expression has been implemented + //ch_p(T_LEFTPAREN) >> !expression_list >> ch_p(T_RIGHTPAREN) + ; + + HANNIBAL_REGISTER_RULE(mem_initializer_id); + mem_initializer_id + = !ch_p(T_COLON_COLON) >> !nested_name_specifier >> class_name + | ch_p(T_IDENTIFIER) + ; + + // + // the eps_p is added to allow skipping of trailing whitespace + // (post-skip) + // + HANNIBAL_REGISTER_RULE(translation_unit); + translation_unit + = !declaration_seq >> end_p; + ; + + HANNIBAL_REGISTER_RULE(odd_language_extension); + odd_language_extension // read: microsoft extensions + = extension_type_decorator + >> !comment_nest_p(ch_p(T_LEFTPAREN), ch_p(T_RIGHTPAREN)) + ; + + HANNIBAL_REGISTER_RULE(declaration_seq); + declaration_seq + = +declaration HANNIBAL_TRACE_ACTION( "declaration") + ; + + HANNIBAL_REGISTER_RULE(declaration); + declaration + = template_declaration + | explicit_instantiation + | explicit_specialization + | linkage_specification + | namespace_definition + | block_declaration + | function_definition + ; + + HANNIBAL_REGISTER_RULE(block_declaration); + block_declaration + = simple_declaration + | asm_definition + | namespace_alias_definition + | using_declaration + | using_directive + ; + + HANNIBAL_REGISTER_RULE(simple_declaration); + simple_declaration + = !decl_specifier_seq >> !init_declarator_list + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(asm_definition); + asm_definition + = ch_p(T_ASM) + >> ch_p(T_LEFTPAREN) >> ch_p(T_STRINGLIT) >> ch_p(T_RIGHTPAREN) + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(init_declarator_list); + init_declarator_list + = init_declarator % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(init_declarator); + init_declarator + = declarator >> !initializer + ; + + HANNIBAL_REGISTER_RULE(initializer); + initializer + = ch_p(T_ASSIGN) >> initializer_clause + | ch_p(T_LEFTPAREN) >> expression_list >> ch_p(T_RIGHTPAREN) + ; + + HANNIBAL_REGISTER_RULE(initializer_clause); + initializer_clause + = assignment_expression + | ch_p(T_LEFTBRACE) >> initializer_list + >> !ch_p(T_COMMA) >> ch_p(T_RIGHTBRACE) + | ch_p(T_LEFTBRACE) >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(initializer_list); + initializer_list + = initializer_clause % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(expression_list); + expression_list + = assignment_expression % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(namespace_alias_definition); + namespace_alias_definition + = ch_p(T_NAMESPACE) >> ch_p(T_IDENTIFIER) >> ch_p(T_ASSIGN) + >> qualified_namespace_specifier + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(qualified_namespace_specifier); + qualified_namespace_specifier + = !ch_p(T_COLON_COLON) >> !nested_name_specifier + >> namespace_name + ; + + HANNIBAL_REGISTER_RULE(explicit_instantiation); + explicit_instantiation + = template_declaration + ; + + HANNIBAL_REGISTER_RULE(template_declaration); + template_declaration + = !ch_p(T_EXPORT) >> ch_p(T_TEMPLATE) + >> ch_p(T_LESS) >> template_parameter_list >> ch_p(T_GREATER) + >> declaration + ; + + HANNIBAL_REGISTER_RULE(template_parameter_list); + template_parameter_list + = template_parameter % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(template_parameter); + template_parameter + = type_parameter + | parameter_declaration + ; + + HANNIBAL_REGISTER_RULE(type_parameter); + type_parameter + = ch_p(T_CLASS) >> !ch_p(T_IDENTIFIER) + >> !(ch_p(T_ASSIGN) >> type_id) + | ch_p(T_TYPENAME) >> !ch_p(T_IDENTIFIER) + >> !(ch_p(T_ASSIGN) >> type_id) + | ch_p(T_TEMPLATE) + >> ch_p(T_LESS) >> template_parameter_list >> ch_p(T_GREATER) + >> ch_p(T_CLASS) >> !ch_p(T_IDENTIFIER) + >> !(ch_p(T_ASSIGN) >> template_name) + ; + + HANNIBAL_REGISTER_RULE(template_name); + template_name + = ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(using_declaration); + using_declaration // optimize? + = ch_p(T_USING) >> !ch_p(T_TYPENAME) >> !ch_p(T_COLON_COLON) + >> nested_name_specifier >> unqualified_id + >> ch_p(T_SEMICOLON) + | ch_p(T_USING) >> ch_p(T_COLON_COLON) >> unqualified_id + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(using_directive); + using_directive + = ch_p(T_USING) >> ch_p(T_NAMESPACE) >> !ch_p(T_COLON_COLON) + >> !nested_name_specifier >> namespace_name + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(explicit_specialization); + explicit_specialization + = ch_p(T_TEMPLATE) >> ch_p(T_LESS) >> ch_p(T_GREATER) + >> declaration + ; + + HANNIBAL_REGISTER_RULE(linkage_specification); + linkage_specification + = ch_p(T_EXTERN) >> ch_p(T_STRINGLIT) + >> ( ch_p(T_LEFTBRACE) >> !declaration_seq >> ch_p(T_RIGHTBRACE) + | declaration + ) + ; + + HANNIBAL_REGISTER_RULE(namespace_definition); + namespace_definition + = named_namespace_definition + | unnamed_namespace_definition // TODO: optimize? + ; + + HANNIBAL_REGISTER_RULE(named_namespace_definition); + named_namespace_definition + = original_namespace_definition + // | extension_namespace_definition // optimization: extension namespace is syntactically identical + ; + + HANNIBAL_REGISTER_RULE(original_namespace_definition); + original_namespace_definition + = ch_p(T_NAMESPACE) >> ch_p(T_IDENTIFIER) + >> ch_p(T_LEFTBRACE) >> namespace_body >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(extension_namespace_definition); + extension_namespace_definition + = ch_p(T_NAMESPACE) >> original_namespace_name + >> ch_p(T_LEFTBRACE) >> namespace_body >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(original_namespace_name); + original_namespace_name + = ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(unnamed_namespace_definition); + unnamed_namespace_definition + = ch_p(T_NAMESPACE) + >> ch_p(T_LEFTBRACE) >> namespace_body >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(namespace_body); + namespace_body + = !declaration_seq + ; + + HANNIBAL_REGISTER_RULE(function_definition); + function_definition + = function_definition_helper + >> !ctor_initializer >> !function_body // removed semicolons + | decl_specifier_seq >> declarator >> function_try_block + | declarator >> function_try_block + ; + + HANNIBAL_REGISTER_RULE(function_definition_helper); + function_definition_helper + = decl_specifier_seq >> declarator + | +no_type_decl_specifier >> declarator + | declarator + ; + + HANNIBAL_REGISTER_RULE(function_try_block); + function_try_block + = ch_p(T_TRY) + >> !ctor_initializer >> function_body >> handler_seq + ; + + HANNIBAL_REGISTER_RULE(handler_seq); + handler_seq + = +handler + ; + + HANNIBAL_REGISTER_RULE(handler); + handler // TODO + = ch_p(T_CATCH) + >> comment_nest_p(ch_p(T_LEFTPAREN), ch_p(T_RIGHTPAREN)) + >> compound_statement + ; + + HANNIBAL_REGISTER_RULE(declarator); + declarator + = *( ptr_operator + | odd_language_extension + ) + >> direct_declarator + ; + + HANNIBAL_REGISTER_RULE(direct_declarator); + direct_declarator + = ( declarator_id + | ch_p(T_LEFTPAREN) >> declarator >> ch_p(T_RIGHTPAREN) + ) + >> *parameters_or_array_spec + ; + + HANNIBAL_REGISTER_RULE(parameters_or_array_spec); + parameters_or_array_spec + = ch_p(T_LEFTPAREN) >> parameter_declaration_clause >> ch_p(T_RIGHTPAREN) + >> !cv_qualifier_seq >> !exception_specification + | pp(T_LEFTBRACKET) >> !constant_expression >> pp(T_RIGHTBRACKET) + ; + + HANNIBAL_REGISTER_RULE(exception_specification); + exception_specification // TODO + = ch_p(T_THROW) + >> comment_nest_p(ch_p(T_LEFTPAREN), ch_p(T_RIGHTPAREN)) + ; + + HANNIBAL_REGISTER_RULE(abstract_declarator); + abstract_declarator + = +( ptr_operator + | odd_language_extension + ) + >> !direct_abstract_declarator + | direct_abstract_declarator + ; + + HANNIBAL_REGISTER_RULE(direct_abstract_declarator); + direct_abstract_declarator + = ch_p(T_LEFTPAREN) >> abstract_declarator >> ch_p(T_RIGHTPAREN) + >> *direct_abstract_declarator_helper + ; + + HANNIBAL_REGISTER_RULE(direct_abstract_declarator_helper); + direct_abstract_declarator_helper + = ch_p(T_LEFTPAREN) >> parameter_declaration_clause >> ch_p(T_RIGHTPAREN) + >> !cv_qualifier_seq >> !exception_specification + | pp(T_LEFTBRACKET) >> !constant_expression >> pp(T_RIGHTBRACKET) + ; + + HANNIBAL_REGISTER_RULE(parameter_declaration_clause); + parameter_declaration_clause + = parameter_declaration_list >> ch_p(T_COMMA) + >> ch_p(T_ELLIPSIS) + | !parameter_declaration_list >> !ch_p(T_ELLIPSIS) + ; + + HANNIBAL_REGISTER_RULE(parameter_declaration_list); + parameter_declaration_list + = parameter_declaration % ch_p(T_COMMA) + ; + + + HANNIBAL_REGISTER_RULE(parameter_declaration); + parameter_declaration + = decl_specifier_seq + >> !(declarator | abstract_declarator) + >> !(ch_p(T_ASSIGN) >> assignment_expression) + ; + + HANNIBAL_REGISTER_RULE(declarator_id); + declarator_id + = !ch_p(T_COLON_COLON) + >> ( id_expression + | !nested_name_specifier >> type_name + ) + ; + + HANNIBAL_REGISTER_RULE(id_expression); + id_expression + = qualified_id + | unqualified_id + ; + + HANNIBAL_REGISTER_RULE(qualified_id); + qualified_id + = nested_name_specifier >> !ch_p(T_TEMPLATE) >> unqualified_id + ; + + HANNIBAL_REGISTER_RULE(unqualified_id); + unqualified_id + = operator_function_id + | conversion_function_id + | ch_p(T_COMPL) >> class_name + | template_id + | ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(operator_function_id); + operator_function_id + = ch_p(T_OPERATOR) >> operator_sym // this is called 'operator' in the std grammar + ; + + HANNIBAL_REGISTER_RULE(operator_sym); + operator_sym + = ch_p(T_DELETE) >> !(pp(T_LEFTBRACKET) >> pp(T_RIGHTBRACKET)) + | ch_p(T_NEW) >> !(pp(T_LEFTBRACKET) >> pp(T_RIGHTBRACKET)) + | pp(T_LEFTBRACKET) >> pp(T_RIGHTBRACKET) + | ch_p(T_LEFTPAREN) >> ch_p(T_RIGHTPAREN) + | pattern_p(OperatorTokenType, TokenTypeMask) + ; + + HANNIBAL_REGISTER_RULE(conversion_function_id); + conversion_function_id + = ch_p(T_OPERATOR) >> conversion_type_id + ; + + HANNIBAL_REGISTER_RULE( conversion_type_id); + conversion_type_id + = type_specifier_seq >> !conversion_declarator + ; + + HANNIBAL_REGISTER_RULE(type_id); + type_id + = type_specifier_seq >> !abstract_declarator + ; + + + HANNIBAL_REGISTER_RULE(conversion_declarator); + conversion_declarator + = ptr_operator >> !conversion_declarator + ; + + HANNIBAL_REGISTER_RULE(function_body); + function_body + = compound_statement + ; + + HANNIBAL_REGISTER_RULE(compound_statement); + compound_statement + = comment_nest_p(ch_p(T_LEFTBRACE), ch_p(T_RIGHTBRACE)) + ; // TODO later + + + HANNIBAL_REGISTER_RULE(ptr_operator); + ptr_operator + = ch_p(T_STAR) >> !cv_qualifier_seq + | ch_p(T_AND) + | !ch_p(T_COLON_COLON) >> nested_name_specifier + >> ch_p(T_STAR) >> !cv_qualifier_seq + ; + + + HANNIBAL_REGISTER_RULE(decl_specifier); + decl_specifier + = no_type_decl_specifier + | type_specifier + ; + + HANNIBAL_REGISTER_RULE(no_type_decl_specifier); + no_type_decl_specifier + = storage_class_specifier + | function_specifier + | ch_p(T_FRIEND) + | ch_p(T_TYPEDEF) + | cv_qualifier + | odd_language_extension + ; + + HANNIBAL_REGISTER_RULE(type_specifier_seq); + type_specifier_seq + = +type_specifier + ; + + HANNIBAL_REGISTER_RULE(type_specifier); + type_specifier + = enum_specifier + | class_specifier + | elaborated_type_specifier + | simple_type_specifier + | cv_qualifier + ; + + HANNIBAL_REGISTER_RULE(cv_qualifier_seq); + cv_qualifier_seq + = cv_qualifier >> !cv_qualifier_seq + ; + + HANNIBAL_REGISTER_RULE(cv_qualifier); + cv_qualifier + = ch_p(T_CONST) + | ch_p(T_VOLATILE) + ; + + HANNIBAL_REGISTER_RULE(enum_specifier); + enum_specifier + = enum_keyword >> !ch_p(T_IDENTIFIER) + >> ch_p(T_LEFTBRACE) >> !enumerator_list >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(enum_keyword); + enum_keyword + = ch_p(T_ENUM) + ; + + HANNIBAL_REGISTER_RULE(enumerator_list); + enumerator_list + = enumerator_definition % ch_p(T_COMMA) + >> !ch_p(T_COMMA) + // TODO find out if this last COMMA_T is an MS-"extension"? + // it seems not to be in the grammar but MSVC 7.0 accepts it. + ; + + HANNIBAL_REGISTER_RULE(enumerator_definition); + enumerator_definition + = enumerator >> !(ch_p(T_ASSIGN) >> constant_expression) + ; + + HANNIBAL_REGISTER_RULE(enumerator); + enumerator + = ch_p(T_IDENTIFIER) + ; + + + HANNIBAL_REGISTER_RULE(simple_type_specifier); + simple_type_specifier + = !ch_p(T_COLON_COLON) >> !nested_name_specifier + >> ch_p(T_TEMPLATE) >> template_id + | +simple_type_name + | !ch_p(T_COLON_COLON) >> !nested_name_specifier >> type_name + ; + + HANNIBAL_REGISTER_RULE(class_head); + class_head // DH changed the order because otherwise it would always parse the (!IDENTIFIER) part. + = !access_specifier >> *odd_language_extension + >> class_key >> *odd_language_extension + >> ( + !nested_name_specifier >> template_id + | nested_name_specifier >> ch_p(T_IDENTIFIER) + | !ch_p(T_IDENTIFIER) + ) + >> !base_clause + ; + + HANNIBAL_REGISTER_RULE(type_name); + type_name + = class_name + | enum_name + | typedef_name + ; + + HANNIBAL_REGISTER_RULE(elaborated_type_specifier); + elaborated_type_specifier + = class_key >> *odd_language_extension + >> !ch_p(T_COLON_COLON) + >> !nested_name_specifier + >> ( + !ch_p(T_TEMPLATE) >> template_id + | ch_p(T_IDENTIFIER) + ) + | ch_p(T_ENUM) >> !ch_p(T_COLON_COLON) + >> !nested_name_specifier + >> ch_p(T_IDENTIFIER) + | ch_p(T_TYPENAME) + >> !ch_p(T_COLON_COLON) + >> nested_name_specifier + >> ( + !ch_p(T_TEMPLATE) >> template_id + | ch_p(T_IDENTIFIER) + ) + ; + + HANNIBAL_REGISTER_RULE(template_argument_list); + template_argument_list + = template_argument % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(template_argument); + template_argument + = longest_d + [ + type_id + | ta_assignment_expression + | template_name + ] + ; + + HANNIBAL_REGISTER_RULE(class_key); + class_key + = class_keywords + ; + + HANNIBAL_REGISTER_RULE(class_keywords); + class_keywords + = ch_p(T_CLASS) + | ch_p(T_STRUCT) + | ch_p(T_UNION) + ; + + HANNIBAL_REGISTER_RULE(nested_name_specifier); + nested_name_specifier + = class_or_namespace_name >> ch_p(T_COLON_COLON) + >> ch_p(T_TEMPLATE) >> nested_name_specifier + | class_or_namespace_name >> ch_p(T_COLON_COLON) + >> !nested_name_specifier + ; + + HANNIBAL_REGISTER_RULE(class_or_namespace_name); + class_or_namespace_name + = class_name + | namespace_name + ; + + HANNIBAL_REGISTER_RULE(class_name); + class_name + = template_id + | ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(enum_name); + enum_name + = ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(typedef_name); + typedef_name + = ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(namespace_name); + namespace_name // TODO + = ch_p(T_IDENTIFIER) + ; + + HANNIBAL_REGISTER_RULE(template_id); + template_id + = template_name + >> ch_p(T_LESS) >> template_argument_list >> ch_p(T_GREATER) + ; + + // + // This is kind of a HACK. We want to prevent the decl_specifier_seq + // from eating the whole declaration, including the ch_p(T_IDENTIFIER). + // Therefore in the sequence, we only allow one 'unknown' word + // (the type_specifier), the rest of the decl_specifier sequence + // must consist of known keywords or constructs (the + // no_type_decl_specifier). + // This means that a declaration like: + // MYDLL_EXPORT int f(); + // will not be accepted unless the MYDLL_EXPORT is properly + // expanded by the preprocessor first. + // + // This should not cause any problems normally, it just means that + // this rule is not very robust in the case where not all symbols + // are known. + // + HANNIBAL_REGISTER_RULE(decl_specifier_seq); + decl_specifier_seq + = *no_type_decl_specifier >> type_specifier >> *no_type_decl_specifier + ; + + // The following rule is more according to the standard grammar + // decl_specifier_seq // adapted + // = decl_specifier >> decl_specifier_seq + // | (decl_specifier - (declarator_id >> parameters_or_array_spec )) + // ; + + HANNIBAL_REGISTER_RULE( storage_class_specifier); + storage_class_specifier + = ch_p(T_AUTO) + | ch_p(T_REGISTER) + | ch_p(T_STATIC) + | ch_p(T_EXTERN) + | ch_p(T_MUTABLE) + ; + + HANNIBAL_REGISTER_RULE( function_specifier); + function_specifier + = ch_p(T_INLINE) + | ch_p(T_VIRTUAL) + | ch_p(T_EXPLICIT) + ; + + HANNIBAL_REGISTER_RULE(class_specifier); + class_specifier + = class_head + >> ch_p(T_LEFTBRACE) >> !member_specification >> ch_p(T_RIGHTBRACE) + ; + + HANNIBAL_REGISTER_RULE(member_specification); + member_specification + = +( access_specifier >> ch_p(T_COLON) + | member_declaration HANNIBAL_TRACE_ACTION("member declaration") + ) + ; + + // member_specification + // = access_specifier >> COLON_T >> !member_specification + // | member_declaration >> !member_specification + // ; + + HANNIBAL_REGISTER_RULE(member_declaration); + member_declaration + = using_declaration + | template_declaration + | !decl_specifier_seq >> !member_declarator_list + >> ch_p(T_SEMICOLON) + | function_definition >> + !ch_p(T_SEMICOLON) + | qualified_id + >> ch_p(T_SEMICOLON) + ; + + HANNIBAL_REGISTER_RULE(member_declarator_list); + member_declarator_list + = member_declarator % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(member_declarator); + member_declarator + = !ch_p(T_IDENTIFIER) >> ch_p(T_COLON) >> constant_expression + | declarator >> !(pure_specifier | constant_initializer) + ; + + HANNIBAL_REGISTER_RULE(pure_specifier); + pure_specifier + = ch_p(T_ASSIGN) >> ch_p(T_INTLIT) + ; + + HANNIBAL_REGISTER_RULE(constant_initializer); + constant_initializer + = ch_p(T_ASSIGN) >> constant_expression + ; + + HANNIBAL_REGISTER_RULE(access_specifier); + access_specifier + = ch_p(T_PUBLIC) + | ch_p(T_PROTECTED) + | ch_p(T_PRIVATE) + ; + + HANNIBAL_REGISTER_RULE(base_clause); + base_clause + = ch_p(T_COLON) >> base_specifier_list + ; + + HANNIBAL_REGISTER_RULE(base_specifier_list); + base_specifier_list + = base_specifier % ch_p(T_COMMA) + ; + + HANNIBAL_REGISTER_RULE(base_specifier); + base_specifier + = ch_p(T_VIRTUAL) >> !access_specifier >> !ch_p(T_COLON_COLON) + >> !nested_name_specifier >> class_name + | access_specifier >> !ch_p(T_VIRTUAL) >> !ch_p(T_COLON_COLON) + >> !nested_name_specifier >> class_name + | !ch_p(T_COLON_COLON) >> !nested_name_specifier >> class_name + ; + + HANNIBAL_REGISTER_RULE(extension_type_decorator); + extension_type_decorator + = ch_p(T_MSEXT_CDECL) + | ch_p(T_MSEXT_DECLSPEC) + | ch_p(T_MSEXT_BASED) + | ch_p(T_MSEXT_FASTCALL) + | ch_p(T_MSEXT_INLINE) + ; + + HANNIBAL_REGISTER_RULE(simple_type_name); + simple_type_name + = ch_p(T_CHAR) + | ch_p(T_WCHART) + | ch_p(T_BOOL) + | ch_p(T_SHORT) + | ch_p(T_INT) + | ch_p(T_LONG) + | ch_p(T_UNSIGNED) + | ch_p(T_SIGNED) + | ch_p(T_FLOAT) + | ch_p(T_DOUBLE) + | ch_p(T_VOID) + | ch_p(T_MSEXT_INT64) + | ch_p(T_MSEXT_INT8) + | ch_p(T_MSEXT_INT16) + | ch_p(T_MSEXT_INT32) + ; + } + + rule_type const& start() const { return translation_unit; } + + // Helper function wrapping pattern_p + static inline boost::wave::util::pattern_and< boost::wave::token_id> + pp (boost::wave::token_id id) + { + using namespace boost::wave; + return util::pattern_p(id, MainTokenMask); + } + }; + +#if HANNIBAL_DUMP_PARSE_TREE != 0 +private: + template<typename Rule> + void declare_rule(Rule const& rule, std::string const& rule_name) const + { + if (rule_map_ptr) + (*rule_map_ptr)[rule.id()] = rule_name; + } + rule_map_type *rule_map_ptr; +#endif +}; + +#undef HANNIBAL_REGISTER_RULE +#undef HANNIBAL_TRACE_TRANSLATION_UNIT_GRAMMAR + +#endif // HANNIBAL_TRANSLATION_UNIT_GRAMMAR_H_INCLUDED diff --git a/src/boost/libs/wave/samples/hannibal/translation_unit_skipper.h b/src/boost/libs/wave/samples/hannibal/translation_unit_skipper.h new file mode 100644 index 000000000..4dc2e2737 --- /dev/null +++ b/src/boost/libs/wave/samples/hannibal/translation_unit_skipper.h @@ -0,0 +1,51 @@ +// Hannibal: partial C++ grammar to parse C++ type information +// Copyright (c) 2005-2006 Danny Havenith +// +// Boost.Wave: A Standard compliant C++ preprocessor +// Copyright (c) 2001-2009 Hartmut Kaiser +// +// http://www.boost.org/ +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#if !defined(HANNIBAL_TRANSLATION_UNIT_SKIPPER_H_INCLUDED) +#define HANNIBAL_TRANSLATION_UNIT_SKIPPER_H_INCLUDED + +#include <boost/spirit/include/classic_core.hpp> +#include <boost/spirit/include/classic_confix.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/pattern_parser.hpp> + +/////////////////////////////////////////////////////////////////////////////// +struct translation_unit_skipper +: public boost::spirit::classic::grammar<translation_unit_skipper> +{ + template <typename ScannerT> + struct definition + { + definition(translation_unit_skipper const& /*self*/) + { + using namespace boost::spirit::classic; + using namespace boost::wave; + using boost::wave::util::pattern_p; + + skip + = pattern_p(WhiteSpaceTokenType, TokenTypeMask) + | pattern_p(EOLTokenType, TokenTypeMask) + | pattern_p(EOFTokenType, TokenTypeMask) + | comment_p(pattern_p(PPTokenType, TokenTypeMask), + pattern_p(EOLTokenType, TokenTypeMask)) + ; + } + + boost::spirit::classic::rule<ScannerT> skip; + + boost::spirit::classic::rule<ScannerT> const& + start() const { return skip; } + }; +}; + +#endif // HANNIBAL_TRANSLATION_UNIT_SKIPPER_H_INCLUDED diff --git a/src/boost/libs/wave/samples/lexed_tokens/build/Jamfile.v2 b/src/boost/libs/wave/samples/lexed_tokens/build/Jamfile.v2 new file mode 100644 index 000000000..f834c9cd1 --- /dev/null +++ b/src/boost/libs/wave/samples/lexed_tokens/build/Jamfile.v2 @@ -0,0 +1,19 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (lexed_tokens) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe lexed_tokens + : ../lexed_tokens.cpp + /boost/wave//boost_wave + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + diff --git a/src/boost/libs/wave/samples/lexed_tokens/lexed_tokens.cpp b/src/boost/libs/wave/samples/lexed_tokens/lexed_tokens.cpp new file mode 100644 index 000000000..9f30aa010 --- /dev/null +++ b/src/boost/libs/wave/samples/lexed_tokens/lexed_tokens.cpp @@ -0,0 +1,151 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <iostream> +#include <iomanip> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +/////////////////////////////////////////////////////////////////////////////// +// +// Special output operator for a lex_token. +// +// Note: this doesn't compile if BOOST_SPIRIT_DEBUG is defined. +// +/////////////////////////////////////////////////////////////////////////////// +template <typename PositionT> +inline std::ostream & +operator<< (std::ostream &stream, + boost::wave::cpplexer::lex_token<PositionT> 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) << " (" + << "#" << setw(3) << BASEID_FROM_TOKEN(id); + + if (ExtTokenTypeMask & id) { + // this is an extended token id + if (AltTokenType == (id & ExtTokenOnlyMask)) { + stream << ", AltTokenType"; + } + else if (TriGraphTokenType == (id & ExtTokenOnlyMask)) { + stream << ", TriGraphTokenType"; + } + else if (AltExtTokenType == (id & ExtTokenOnlyMask)){ + stream << ", AltExtTokenType"; + } + } + + stream + << ") at " << t.get_position().get_file() << " (" + << setw(3) << right << t.get_position().get_line() << "/" + << setw(2) << right << t.get_position().get_column() + << "): >"; + + typedef typename boost::wave::cpplexer::lex_token<PositionT>::string_type + string_type; + + string_type const& value = t.get_value(); + for (std::size_t i = 0; i < value.size(); ++i) { + switch (value[i]) { + case '\r': stream << "\\r"; break; + case '\n': stream << "\\n"; break; + case '\t': stream << "\\t"; break; + default: + stream << value[i]; + break; + } + } + stream << "<"; + + return stream; +} + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int main(int argc, char *argv[]) +{ + if (2 != argc) { + std::cerr << "Usage: lexed_tokens infile" << std::endl; + return -1; + } + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instr; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instr = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // tokenize the input data into C++ tokens using the C++ lexer + typedef boost::wave::cpplexer::lex_token<> token_type; + typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; + typedef token_type::position_type position_type; + + position_type pos(argv[1]); + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, + boost::wave::language_support( + boost::wave::support_cpp|boost::wave::support_option_long_long)); + lexer_type end = lexer_type(); + + while (it != end) { + current_position = (*it).get_position(); // for error reporting + std::cout << *it << std::endl; // dump the tokenf info + ++it; + } + } + catch (boost::wave::cpplexer::lexing_exception const& e) { + // some lexing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/list_includes/build/Jamfile.v2 b/src/boost/libs/wave/samples/list_includes/build/Jamfile.v2 new file mode 100644 index 000000000..548cc61da --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/build/Jamfile.v2 @@ -0,0 +1,38 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (list_includes) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +SOURCES = + ../list_includes + ../instantiate_cpp_exprgrammar + ../instantiate_cpp_grammar + ../instantiate_cpp_literalgrs + ../instantiate_defined_grammar + ../instantiate_lexertl_lexer + ; + +exe list_includes + : + $(SOURCES) + /boost/wave//boost_wave + /boost/program_options//boost_program_options/<link>static + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + +for local source in $(SOURCES) +{ + local requirements ; + # workaround for compiler bug + requirements += <toolset-msvc:version>7.1:<rtti>off ; + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + obj $(source) : $(source).cpp : $(requirements) ; +} diff --git a/src/boost/libs/wave/samples/list_includes/instantiate_cpp_exprgrammar.cpp b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_exprgrammar.cpp new file mode 100644 index 000000000..112a5867e --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_exprgrammar.cpp @@ -0,0 +1,40 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + Explicit instantiation of the cpp_expression_grammar parsing + function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include <boost/wave/grammars/cpp_expression_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the expression_grammar_gen template with the +// correct token type. This instantiates the corresponding parse function, +// which in turn instantiates the expression_grammar object (see +// wave/grammars/cpp_expression_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; + +template struct boost::wave::grammars::expression_grammar_gen<token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/list_includes/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..30ce93fd3 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_grammar.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + Explicit instantiation of the cpp_grammar parsing function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "lexertl_iterator.hpp" + +#include <boost/wave/grammars/cpp_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::cpplexer::lexertl::lex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/list_includes/instantiate_cpp_literalgrs.cpp b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_literalgrs.cpp new file mode 100644 index 000000000..f87b99d64 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/instantiate_cpp_literalgrs.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include <boost/wave/grammars/cpp_literal_grammar_gen.hpp> +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the intlit_grammar_gen, chlit_grammar_gen and +// floatlit_grammar_gen templates with the correct token type. This +// instantiates the corresponding parse function, which in turn instantiates +// the corresponding parser object. +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; + +template struct boost::wave::grammars::intlit_grammar_gen<token_type>; +#if BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_AUTOSELECT || \ + BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_FORCE_SIGNED +template struct boost::wave::grammars::chlit_grammar_gen<int, token_type>; +#endif +template struct boost::wave::grammars::chlit_grammar_gen<unsigned int, token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/list_includes/instantiate_defined_grammar.cpp b/src/boost/libs/wave/samples/list_includes/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..c6dd2ab52 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/instantiate_defined_grammar.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "lexertl_iterator.hpp" + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lexertl::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lexer_type; +template struct boost::wave::grammars::defined_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/list_includes/instantiate_lexertl_lexer.cpp b/src/boost/libs/wave/samples/list_includes/instantiate_lexertl_lexer.cpp new file mode 100644 index 000000000..774615e36 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/instantiate_lexertl_lexer.cpp @@ -0,0 +1,44 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "lexertl_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include "lexertl/lexertl_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the parameters +// supplied while instantiating the context<> template. +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::cpplexer::lexertl::new_lexer_gen< + std::string::iterator>; + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp b/src/boost/libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp new file mode 100644 index 000000000..7e692f331 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp @@ -0,0 +1,809 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LEXERTL_LEXER_HPP_INCLUDED) +#define BOOST_WAVE_LEXERTL_LEXER_HPP_INCLUDED + +#include <fstream> + +#include <boost/iterator/iterator_traits.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/time_conversion_helper.hpp> + +#include <boost/wave/cpplexer/validate_universal_char.hpp> +#include <boost/wave/cpplexer/convert_trigraphs.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 +#include <boost/wave/cpplexer/detect_include_guards.hpp> +#endif + +#include "wave_lexertl_config.hpp" +#include "../lexertl_iterator.hpp" + +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES != 0 +#include "wave_lexertl_tables.hpp" +#else +#include <boost/spirit/home/support/detail/lexer/generator.hpp> +#include <boost/spirit/home/support/detail/lexer/rules.hpp> +#include <boost/spirit/home/support/detail/lexer/state_machine.hpp> +#include <boost/spirit/home/support/detail/lexer/consts.hpp> +//#include "lexertl/examples/serialise.hpp> +// #if BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE != 0 +// #include "lexertl/examples/cpp_code.hpp" +// #endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace wave { namespace cpplexer { namespace lexertl +{ + +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 +/////////////////////////////////////////////////////////////////////////////// +// The following numbers are the array sizes of the token regex's which we +// need to specify to make the CW compiler happy (at least up to V9.5). +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 +#define INIT_DATA_SIZE 176 +#else +#define INIT_DATA_SIZE 159 +#endif +#define INIT_DATA_CPP_SIZE 15 +#define INIT_DATA_PP_NUMBER_SIZE 2 +#define INIT_MACRO_DATA_SIZE 27 +#endif // #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 + +// this is just a hack to have a unique token id not otherwise used by Wave +#define T_ANYCTRL T_LAST_TOKEN_ID + +/////////////////////////////////////////////////////////////////////////////// +namespace lexer +{ + +/////////////////////////////////////////////////////////////////////////////// +// this is the wrapper for the lexertl lexer library +template <typename Iterator, typename Position> +class lexertl +{ +private: + typedef BOOST_WAVE_STRINGTYPE string_type; + typedef typename boost::iterators::iterator_value<Iterator>::type + char_type; + +public: + wave::token_id next_token(Iterator &first, Iterator const &last, + string_type& token_value); + +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES != 0 + lexertl() {} + void init_dfa(wave::language_support lang, Position const& pos, + bool force_reinit = false) {} + bool is_initialized() const { return true; } +#else + lexertl() : has_compiled_dfa_(false) {} + bool init_dfa(wave::language_support lang, Position const& pos, + bool force_reinit = false); + bool is_initialized() const { return has_compiled_dfa_; } + +// get time of last compilation + static std::time_t get_compilation_time() + { return compilation_time.get_time(); } + + bool load (std::istream& instrm); + bool save (std::ostream& outstrm); + +private: + 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 + char_type const *macro; // associated macro definition + }; + static lexer_macro_data const init_macro_data[INIT_MACRO_DATA_SIZE]; // macro patterns + + struct lexer_data { + token_id tokenid; // token data + char_type const *tokenregex; // associated token to match + }; + static lexer_data const init_data[INIT_DATA_SIZE]; // common patterns + static lexer_data const init_data_cpp[INIT_DATA_CPP_SIZE]; // C++ only patterns + static lexer_data const init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE]; // pp-number only patterns + +// helper for calculation of the time of last compilation + static boost::wave::util::time_conversion_helper compilation_time; +#endif // #if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 +}; + +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 +/////////////////////////////////////////////////////////////////////////////// +// get time of last compilation of this file +template <typename IteratorT, typename PositionT> +boost::wave::util::time_conversion_helper + lexertl<IteratorT, PositionT>::compilation_time(__DATE__ " " __TIME__); + +/////////////////////////////////////////////////////////////////////////////// +// token regex definitions + +// helper for initializing token data and macro definitions +#define Q(c) "\\" c +#define TRI(c) "{TRI}" c +#define OR "|" +#define MACRO_DATA(name, macro) { name, macro } +#define TOKEN_DATA(id, regex) { id, regex } + +// lexertl macro definitions +template <typename Iterator, typename Position> +typename lexertl<Iterator, Position>::lexer_macro_data const +lexertl<Iterator, Position>::init_macro_data[INIT_MACRO_DATA_SIZE] = +{ + MACRO_DATA("ANY", "[\t\v\f\r\n\\040-\\377]"), + MACRO_DATA("ANYCTRL", "[\\000-\\037]"), + MACRO_DATA("TRI", "\\?\\?"), + MACRO_DATA("BLANK", "[ \t\v\f]"), + MACRO_DATA("CCOMMENT", "\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/"), + MACRO_DATA("PPSPACE", "(" "{BLANK}" OR "{CCOMMENT}" ")*"), + MACRO_DATA("OCTALDIGIT", "[0-7]"), + MACRO_DATA("DIGIT", "[0-9]"), + MACRO_DATA("HEXDIGIT", "[0-9a-fA-F]"), + MACRO_DATA("OPTSIGN", "[-+]?"), + MACRO_DATA("EXPSTART", "[eE][-+]"), + MACRO_DATA("EXPONENT", "([eE]{OPTSIGN}{DIGIT}+)"), + MACRO_DATA("NONDIGIT", "[a-zA-Z_]"), + MACRO_DATA("INTEGER", "(" "(0x|0X){HEXDIGIT}+" OR "0{OCTALDIGIT}*" OR "[1-9]{DIGIT}*" ")"), + MACRO_DATA("INTEGER_SUFFIX", "(" "[uU][lL]?" OR "[lL][uU]?" ")"), +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + MACRO_DATA("LONGINTEGER_SUFFIX", "([uU]([lL][lL])|([lL][lL])[uU]?|i64)"), +#else + MACRO_DATA("LONGINTEGER_SUFFIX", "([uU]([lL][lL])|([lL][lL])[uU]?)"), +#endif + MACRO_DATA("FLOAT_SUFFIX", "(" "[fF][lL]?" OR "[lL][fF]?" ")"), + MACRO_DATA("CHAR_SPEC", "L?"), + MACRO_DATA("BACKSLASH", "(" Q("\\") OR TRI(Q("/")) ")"), + MACRO_DATA("ESCAPESEQ", "{BACKSLASH}([abfnrtv?'\"]|{BACKSLASH}|x{HEXDIGIT}+|{OCTALDIGIT}{1,3})"), + MACRO_DATA("HEXQUAD", "{HEXDIGIT}{4}"), + MACRO_DATA("UNIVERSALCHAR", "{BACKSLASH}(u{HEXQUAD}|U{HEXQUAD}{2})"), + MACRO_DATA("POUNDDEF", "(" "#" OR TRI("=") OR Q("%:") ")"), + MACRO_DATA("NEWLINEDEF", "(" "\\n" OR "\\r" OR "\\r\\n" ")"), +#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 + MACRO_DATA("INCLUDEDEF", "(include|include_next)"), +#else + MACRO_DATA("INCLUDEDEF", "include"), +#endif + MACRO_DATA("PP_NUMBERDEF", "\\.?{DIGIT}({DIGIT}|{NONDIGIT}|{EXPSTART}|\\.)*"), + MACRO_DATA(NULL, NULL) // should be the last entry +}; + +// common C++/C99 token definitions +template <typename Iterator, typename Position> +typename lexertl<Iterator, Position>::lexer_data const +lexertl<Iterator, Position>::init_data[INIT_DATA_SIZE] = +{ + TOKEN_DATA(T_AND, "&"), + TOKEN_DATA(T_ANDAND, "&&"), + TOKEN_DATA(T_ASSIGN, "="), + TOKEN_DATA(T_ANDASSIGN, "&="), + TOKEN_DATA(T_OR, Q("|")), + TOKEN_DATA(T_OR_TRIGRAPH, "{TRI}!"), + TOKEN_DATA(T_ORASSIGN, Q("|=")), + TOKEN_DATA(T_ORASSIGN_TRIGRAPH, "{TRI}!="), + TOKEN_DATA(T_XOR, Q("^")), + TOKEN_DATA(T_XOR_TRIGRAPH, "{TRI}'"), + TOKEN_DATA(T_XORASSIGN, Q("^=")), + TOKEN_DATA(T_XORASSIGN_TRIGRAPH, "{TRI}'="), + TOKEN_DATA(T_COMMA, ","), + TOKEN_DATA(T_COLON, ":"), + TOKEN_DATA(T_DIVIDEASSIGN, Q("/=")), + TOKEN_DATA(T_DIVIDE, Q("/")), + TOKEN_DATA(T_DOT, Q(".")), + TOKEN_DATA(T_ELLIPSIS, Q(".") "{3}"), + TOKEN_DATA(T_EQUAL, "=="), + TOKEN_DATA(T_GREATER, ">"), + TOKEN_DATA(T_GREATEREQUAL, ">="), + TOKEN_DATA(T_LEFTBRACE, Q("{")), + TOKEN_DATA(T_LEFTBRACE_ALT, "<" Q("%")), + TOKEN_DATA(T_LEFTBRACE_TRIGRAPH, "{TRI}<"), + TOKEN_DATA(T_LESS, "<"), + TOKEN_DATA(T_LESSEQUAL, "<="), + TOKEN_DATA(T_LEFTPAREN, Q("(")), + TOKEN_DATA(T_LEFTBRACKET, Q("[")), + TOKEN_DATA(T_LEFTBRACKET_ALT, "<:"), + TOKEN_DATA(T_LEFTBRACKET_TRIGRAPH, "{TRI}" Q("(")), + TOKEN_DATA(T_MINUS, Q("-")), + TOKEN_DATA(T_MINUSASSIGN, Q("-=")), + TOKEN_DATA(T_MINUSMINUS, Q("-") "{2}"), + TOKEN_DATA(T_PERCENT, Q("%")), + TOKEN_DATA(T_PERCENTASSIGN, Q("%=")), + TOKEN_DATA(T_NOT, "!"), + TOKEN_DATA(T_NOTEQUAL, "!="), + TOKEN_DATA(T_OROR, Q("|") "{2}"), + TOKEN_DATA(T_OROR_TRIGRAPH, "{TRI}!\\||\\|{TRI}!|{TRI}!{TRI}!"), + TOKEN_DATA(T_PLUS, Q("+")), + TOKEN_DATA(T_PLUSASSIGN, Q("+=")), + TOKEN_DATA(T_PLUSPLUS, Q("+") "{2}"), + TOKEN_DATA(T_ARROW, Q("->")), + TOKEN_DATA(T_QUESTION_MARK, Q("?")), + TOKEN_DATA(T_RIGHTBRACE, Q("}")), + TOKEN_DATA(T_RIGHTBRACE_ALT, Q("%>")), + TOKEN_DATA(T_RIGHTBRACE_TRIGRAPH, "{TRI}>"), + TOKEN_DATA(T_RIGHTPAREN, Q(")")), + TOKEN_DATA(T_RIGHTBRACKET, Q("]")), + TOKEN_DATA(T_RIGHTBRACKET_ALT, ":>"), + TOKEN_DATA(T_RIGHTBRACKET_TRIGRAPH, "{TRI}" Q(")")), + TOKEN_DATA(T_SEMICOLON, ";"), + TOKEN_DATA(T_SHIFTLEFT, "<<"), + TOKEN_DATA(T_SHIFTLEFTASSIGN, "<<="), + TOKEN_DATA(T_SHIFTRIGHT, ">>"), + TOKEN_DATA(T_SHIFTRIGHTASSIGN, ">>="), + TOKEN_DATA(T_STAR, Q("*")), + TOKEN_DATA(T_COMPL, Q("~")), + TOKEN_DATA(T_COMPL_TRIGRAPH, "{TRI}-"), + TOKEN_DATA(T_STARASSIGN, Q("*=")), + TOKEN_DATA(T_ASM, "asm"), + TOKEN_DATA(T_AUTO, "auto"), + TOKEN_DATA(T_BOOL, "bool"), + TOKEN_DATA(T_FALSE, "false"), + TOKEN_DATA(T_TRUE, "true"), + TOKEN_DATA(T_BREAK, "break"), + TOKEN_DATA(T_CASE, "case"), + TOKEN_DATA(T_CATCH, "catch"), + TOKEN_DATA(T_CHAR, "char"), + TOKEN_DATA(T_CLASS, "class"), + TOKEN_DATA(T_CONST, "const"), + TOKEN_DATA(T_CONSTCAST, "const_cast"), + TOKEN_DATA(T_CONTINUE, "continue"), + TOKEN_DATA(T_DEFAULT, "default"), + TOKEN_DATA(T_DELETE, "delete"), + TOKEN_DATA(T_DO, "do"), + TOKEN_DATA(T_DOUBLE, "double"), + TOKEN_DATA(T_DYNAMICCAST, "dynamic_cast"), + TOKEN_DATA(T_ELSE, "else"), + TOKEN_DATA(T_ENUM, "enum"), + TOKEN_DATA(T_EXPLICIT, "explicit"), + TOKEN_DATA(T_EXPORT, "export"), + TOKEN_DATA(T_EXTERN, "extern"), + TOKEN_DATA(T_FLOAT, "float"), + TOKEN_DATA(T_FOR, "for"), + TOKEN_DATA(T_FRIEND, "friend"), + TOKEN_DATA(T_GOTO, "goto"), + TOKEN_DATA(T_IF, "if"), + TOKEN_DATA(T_INLINE, "inline"), + TOKEN_DATA(T_INT, "int"), + TOKEN_DATA(T_LONG, "long"), + TOKEN_DATA(T_MUTABLE, "mutable"), + TOKEN_DATA(T_NAMESPACE, "namespace"), + TOKEN_DATA(T_NEW, "new"), + TOKEN_DATA(T_OPERATOR, "operator"), + TOKEN_DATA(T_PRIVATE, "private"), + TOKEN_DATA(T_PROTECTED, "protected"), + TOKEN_DATA(T_PUBLIC, "public"), + TOKEN_DATA(T_REGISTER, "register"), + TOKEN_DATA(T_REINTERPRETCAST, "reinterpret_cast"), + TOKEN_DATA(T_RETURN, "return"), + TOKEN_DATA(T_SHORT, "short"), + TOKEN_DATA(T_SIGNED, "signed"), + TOKEN_DATA(T_SIZEOF, "sizeof"), + TOKEN_DATA(T_STATIC, "static"), + TOKEN_DATA(T_STATICCAST, "static_cast"), + TOKEN_DATA(T_STRUCT, "struct"), + TOKEN_DATA(T_SWITCH, "switch"), + TOKEN_DATA(T_TEMPLATE, "template"), + TOKEN_DATA(T_THIS, "this"), + TOKEN_DATA(T_THROW, "throw"), + TOKEN_DATA(T_TRY, "try"), + TOKEN_DATA(T_TYPEDEF, "typedef"), + TOKEN_DATA(T_TYPEID, "typeid"), + TOKEN_DATA(T_TYPENAME, "typename"), + TOKEN_DATA(T_UNION, "union"), + TOKEN_DATA(T_UNSIGNED, "unsigned"), + TOKEN_DATA(T_USING, "using"), + TOKEN_DATA(T_VIRTUAL, "virtual"), + TOKEN_DATA(T_VOID, "void"), + TOKEN_DATA(T_VOLATILE, "volatile"), + TOKEN_DATA(T_WCHART, "wchar_t"), + TOKEN_DATA(T_WHILE, "while"), + TOKEN_DATA(T_PP_DEFINE, "{POUNDDEF}{PPSPACE}define"), + TOKEN_DATA(T_PP_IF, "{POUNDDEF}{PPSPACE}if"), + TOKEN_DATA(T_PP_IFDEF, "{POUNDDEF}{PPSPACE}ifdef"), + TOKEN_DATA(T_PP_IFNDEF, "{POUNDDEF}{PPSPACE}ifndef"), + TOKEN_DATA(T_PP_ELSE, "{POUNDDEF}{PPSPACE}else"), + TOKEN_DATA(T_PP_ELIF, "{POUNDDEF}{PPSPACE}elif"), + TOKEN_DATA(T_PP_ENDIF, "{POUNDDEF}{PPSPACE}endif"), + TOKEN_DATA(T_PP_ERROR, "{POUNDDEF}{PPSPACE}error"), + TOKEN_DATA(T_PP_QHEADER, "{POUNDDEF}{PPSPACE}{INCLUDEDEF}{PPSPACE}" Q("\"") "[^\\n\\r\"]+" Q("\"")), + TOKEN_DATA(T_PP_HHEADER, "{POUNDDEF}{PPSPACE}{INCLUDEDEF}{PPSPACE}" "<" "[^\\n\\r>]+" ">"), + TOKEN_DATA(T_PP_INCLUDE, "{POUNDDEF}{PPSPACE}{INCLUDEDEF}{PPSPACE}"), + TOKEN_DATA(T_PP_LINE, "{POUNDDEF}{PPSPACE}line"), + TOKEN_DATA(T_PP_PRAGMA, "{POUNDDEF}{PPSPACE}pragma"), + TOKEN_DATA(T_PP_UNDEF, "{POUNDDEF}{PPSPACE}undef"), + TOKEN_DATA(T_PP_WARNING, "{POUNDDEF}{PPSPACE}warning"), +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + TOKEN_DATA(T_MSEXT_INT8, "__int8"), + TOKEN_DATA(T_MSEXT_INT16, "__int16"), + TOKEN_DATA(T_MSEXT_INT32, "__int32"), + TOKEN_DATA(T_MSEXT_INT64, "__int64"), + TOKEN_DATA(T_MSEXT_BASED, "_?" "_based"), + TOKEN_DATA(T_MSEXT_DECLSPEC, "_?" "_declspec"), + TOKEN_DATA(T_MSEXT_CDECL, "_?" "_cdecl"), + TOKEN_DATA(T_MSEXT_FASTCALL, "_?" "_fastcall"), + TOKEN_DATA(T_MSEXT_STDCALL, "_?" "_stdcall"), + TOKEN_DATA(T_MSEXT_TRY , "__try"), + TOKEN_DATA(T_MSEXT_EXCEPT, "__except"), + TOKEN_DATA(T_MSEXT_FINALLY, "__finally"), + TOKEN_DATA(T_MSEXT_LEAVE, "__leave"), + TOKEN_DATA(T_MSEXT_INLINE, "_?" "_inline"), + TOKEN_DATA(T_MSEXT_ASM, "_?" "_asm"), + TOKEN_DATA(T_MSEXT_PP_REGION, "{POUNDDEF}{PPSPACE}region"), + TOKEN_DATA(T_MSEXT_PP_ENDREGION, "{POUNDDEF}{PPSPACE}endregion"), +#endif // BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + TOKEN_DATA(T_LONGINTLIT, "{INTEGER}{LONGINTEGER_SUFFIX}"), + TOKEN_DATA(T_INTLIT, "{INTEGER}{INTEGER_SUFFIX}?"), + TOKEN_DATA(T_FLOATLIT, + "(" "{DIGIT}*" Q(".") "{DIGIT}+" OR "{DIGIT}+" Q(".") "){EXPONENT}?{FLOAT_SUFFIX}?" OR + "{DIGIT}+{EXPONENT}{FLOAT_SUFFIX}?"), +#if BOOST_WAVE_USE_STRICT_LEXER != 0 + TOKEN_DATA(T_IDENTIFIER, + "(" "{NONDIGIT}" OR "{UNIVERSALCHAR}" ")" + "(" "{NONDIGIT}" OR "{DIGIT}" OR "{UNIVERSALCHAR}" ")*"), +#else + TOKEN_DATA(T_IDENTIFIER, + "(" "{NONDIGIT}" OR Q("$") OR "{UNIVERSALCHAR}" ")" + "(" "{NONDIGIT}" OR Q("$") OR "{DIGIT}" OR "{UNIVERSALCHAR}" ")*"), +#endif + TOKEN_DATA(T_CCOMMENT, "{CCOMMENT}"), + TOKEN_DATA(T_CPPCOMMENT, Q("/") Q("/[^\\n\\r]*") "{NEWLINEDEF}" ), + TOKEN_DATA(T_CHARLIT, + "{CHAR_SPEC}" "'" "({ESCAPESEQ}|[^\\n\\r']|{UNIVERSALCHAR})+" "'"), + TOKEN_DATA(T_STRINGLIT, + "{CHAR_SPEC}" Q("\"") "({ESCAPESEQ}|[^\\n\\r\"]|{UNIVERSALCHAR})*" Q("\"")), + TOKEN_DATA(T_SPACE, "{BLANK}+"), + TOKEN_DATA(T_CONTLINE, Q("\\") "\\n"), + TOKEN_DATA(T_NEWLINE, "{NEWLINEDEF}"), + TOKEN_DATA(T_POUND_POUND, "##"), + TOKEN_DATA(T_POUND_POUND_ALT, Q("%:") Q("%:")), + TOKEN_DATA(T_POUND_POUND_TRIGRAPH, "({TRI}=){2}"), + TOKEN_DATA(T_POUND, "#"), + TOKEN_DATA(T_POUND_ALT, Q("%:")), + TOKEN_DATA(T_POUND_TRIGRAPH, "{TRI}="), + TOKEN_DATA(T_ANY_TRIGRAPH, "{TRI}\\/"), + TOKEN_DATA(T_ANY, "{ANY}"), + TOKEN_DATA(T_ANYCTRL, "{ANYCTRL}"), // this should be the last recognized token + { token_id(0) } // this should be the last entry +}; + +// C++ only token definitions +template <typename Iterator, typename Position> +typename lexertl<Iterator, Position>::lexer_data const +lexertl<Iterator, Position>::init_data_cpp[INIT_DATA_CPP_SIZE] = +{ + TOKEN_DATA(T_AND_ALT, "bitand"), + TOKEN_DATA(T_ANDASSIGN_ALT, "and_eq"), + TOKEN_DATA(T_ANDAND_ALT, "and"), + TOKEN_DATA(T_OR_ALT, "bitor"), + TOKEN_DATA(T_ORASSIGN_ALT, "or_eq"), + TOKEN_DATA(T_OROR_ALT, "or"), + TOKEN_DATA(T_XORASSIGN_ALT, "xor_eq"), + TOKEN_DATA(T_XOR_ALT, "xor"), + TOKEN_DATA(T_NOTEQUAL_ALT, "not_eq"), + TOKEN_DATA(T_NOT_ALT, "not"), + TOKEN_DATA(T_COMPL_ALT, "compl"), +#if BOOST_WAVE_SUPPORT_IMPORT_KEYWORD != 0 + TOKEN_DATA(T_IMPORT, "import"), +#endif + TOKEN_DATA(T_ARROWSTAR, Q("->") Q("*")), + TOKEN_DATA(T_DOTSTAR, Q(".") Q("*")), + TOKEN_DATA(T_COLON_COLON, "::"), + { token_id(0) } // this should be the last entry +}; + +// pp-number specific token definitions +template <typename Iterator, typename Position> +typename lexertl<Iterator, Position>::lexer_data const +lexertl<Iterator, Position>::init_data_pp_number[INIT_DATA_PP_NUMBER_SIZE] = +{ + TOKEN_DATA(T_PP_NUMBER, "{PP_NUMBERDEF}"), + { token_id(0) } // this should be the last entry +}; + +#undef MACRO_DATA +#undef TOKEN_DATA +#undef OR +#undef TRI +#undef Q + +/////////////////////////////////////////////////////////////////////////////// +// initialize lexertl lexer from C++ token regex's +template <typename Iterator, typename Position> +inline bool +lexertl<Iterator, Position>::init_dfa(wave::language_support lang, + Position const& pos, bool force_reinit) +{ + if (has_compiled_dfa_) + return true; + +std::ifstream dfa_in("wave_lexertl_lexer.dfa", std::ios::in|std::ios::binary); + + if (force_reinit || !dfa_in.is_open() || !load (dfa_in)) + { + dfa_in.close(); + + state_machine_.clear(); + + // register macro definitions + 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); + } + + // if pp-numbers should be preferred, insert the corresponding rule first + if (wave::need_prefer_pp_numbers(lang)) { + for (int j = 0; 0 != init_data_pp_number[j].tokenid; ++j) { + rules.add(init_data_pp_number[j].tokenregex, + init_data_pp_number[j].tokenid); + } + } + + // if in C99 mode, some of the keywords are not valid + if (!wave::need_c99(lang)) { + for (int j = 0; 0 != init_data_cpp[j].tokenid; ++j) { + rules.add(init_data_cpp[j].tokenregex, + 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 { + 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: "); + msg += e.what(); + BOOST_WAVE_LEXER_THROW(wave::cpplexer::lexing_exception, + unexpected_error, msg.c_str(), + pos.get_line(), pos.get_column(), pos.get_file().c_str()); + return false; + } + + std::ofstream dfa_out ("wave_lexertl_lexer.dfa", + std::ios::out|std::ios::binary|std::ios::trunc); + + if (dfa_out.is_open()) + save (dfa_out); + } + + has_compiled_dfa_ = true; + return true; +} +#endif // BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 + +/////////////////////////////////////////////////////////////////////////////// +// return next token from the input stream +template <typename Iterator, typename Position> +inline wave::token_id +lexertl<Iterator, Position>::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_.data()._lookup[0]->front (); + size_t const dfa_alphabet = state_machine_.data()._dfa_alphabet[0]; + + 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 + + Iterator curr = first; + Iterator end_token = first; + bool end_state = (*ptr != 0); + size_t id = *(ptr + 1); + + while (curr != last) { + 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 + boost::lexer::dfa_offset)]; +#else + ptr = &dfa[state * dfa_offset]; +#endif // BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 + + if (0 != *ptr) { + end_state = true; + id = *(ptr + 1); + end_token = curr; + } + } + + if (end_state) { + if (T_ANY == id) { + id = TOKEN_FROM_ID(*first, UnknownTokenType); + } + + // return longest match + string_type str(first, end_token); + token_value.swap(str); + first = end_token; + return wave::token_id(id); + } + return T_EOF; +} + +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES == 0 +/////////////////////////////////////////////////////////////////////////////// +// load the DFA tables to/from a stream +template <typename Iterator, typename Position> +inline bool +lexertl<Iterator, Position>::load (std::istream& instrm) +{ +// #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 +} + +/////////////////////////////////////////////////////////////////////////////// +// save the DFA tables to/from a stream +template <typename Iterator, typename Position> +inline bool +lexertl<Iterator, Position>::save (std::ostream& outstrm) +{ +// #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 + +/////////////////////////////////////////////////////////////////////////////// +} // namespace lexer + +/////////////////////////////////////////////////////////////////////////////// +template <typename Iterator, typename Position = wave::util::file_position_type> +class lexertl_functor +: public lexertl_input_interface<wave::cpplexer::lex_token<Position> > +{ +public: + typedef wave::util::position_iterator<Iterator, Position> iterator_type; + typedef typename boost::iterators::iterator_value<Iterator>::type + char_type; + typedef BOOST_WAVE_STRINGTYPE string_type; + typedef wave::cpplexer::lex_token<Position> token_type; + + lexertl_functor(Iterator const &first_, Iterator const &last_, + Position const &pos_, wave::language_support language) + : first(first_, last_, pos_), language(language), at_eof(false) + { + lexer_.init_dfa(language, pos_); + } + ~lexertl_functor() {} + +// get the next token from the input stream + token_type& get(token_type& result) + { + if (lexer_.is_initialized() && !at_eof) { + do { + // generate and return the next token + string_type token_val; + Position pos = first.get_position(); // begin of token position + wave::token_id id = lexer_.next_token(first, last, token_val); + + if (T_CONTLINE != id) { + // The cast should avoid spurious warnings about missing case labels + // for the other token ids's. + switch (id) { + case T_IDENTIFIER: + // test identifier characters for validity (throws if + // invalid chars found) + if (!wave::need_no_character_validation(language)) { + using wave::cpplexer::impl::validate_identifier_name; + validate_identifier_name(token_val, + pos.get_line(), pos.get_column(), pos.get_file()); + } + break; + + case T_STRINGLIT: + case T_CHARLIT: + // test literal characters for validity (throws if invalid + // chars found) + if (wave::need_convert_trigraphs(language)) { + using wave::cpplexer::impl::convert_trigraphs; + token_val = convert_trigraphs(token_val); + } + if (!wave::need_no_character_validation(language)) { + using wave::cpplexer::impl::validate_literal; + validate_literal(token_val, + pos.get_line(), pos.get_column(), pos.get_file()); + } + break; + + case T_LONGINTLIT: // supported in C99 and long_long mode + if (!wave::need_long_long(language)) { + // syntax error: not allowed in C++ mode + BOOST_WAVE_LEXER_THROW( + wave::cpplexer::lexing_exception, + invalid_long_long_literal, token_val.c_str(), + pos.get_line(), pos.get_column(), + pos.get_file().c_str()); + } + break; + + case T_PP_HHEADER: + case T_PP_QHEADER: + case T_PP_INCLUDE: + // convert to the corresponding ..._next token, if appropriate +#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 + { + // Skip '#' and whitespace and see whether we find an + // 'include_next' here. + typename string_type::size_type start = token_val.find("include"); + if (0 == token_val.compare(start, 12, "include_next", 12)) + id = token_id(id | AltTokenType); + } +#endif // BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 + 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; + token_val.clear(); + break; + + case T_OR_TRIGRAPH: + case T_XOR_TRIGRAPH: + case T_LEFTBRACE_TRIGRAPH: + case T_RIGHTBRACE_TRIGRAPH: + case T_LEFTBRACKET_TRIGRAPH: + case T_RIGHTBRACKET_TRIGRAPH: + case T_COMPL_TRIGRAPH: + case T_POUND_TRIGRAPH: + case T_ANY_TRIGRAPH: + if (wave::need_convert_trigraphs(language)) + { + using wave::cpplexer::impl::convert_trigraph; + token_val = convert_trigraph(token_val); + } + break; + + case T_ANYCTRL: + // matched some unexpected character + { + // 21 is the max required size for a 64 bit integer + // represented as a string + char buffer[22]; + string_type msg("invalid character in input stream: '0x"); + + // for some systems sprintf is in namespace std + using namespace std; + sprintf(buffer, "%02x'", token_val[0]); + msg += buffer; + BOOST_WAVE_LEXER_THROW( + wave::cpplexer::lexing_exception, + generic_lexing_error, + msg.c_str(), pos.get_line(), pos.get_column(), + pos.get_file().c_str()); + } + break; + } + + result = token_type(id, token_val, pos); +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + return guards.detect_guard(result); +#else + return result; +#endif + } + } while (true); // skip the T_CONTLINE token + } + return result = token_type(); // return T_EOI + } + + void set_position(Position const &pos) + { + // set position has to change the file name and line number only + first.get_position().set_file(pos.get_file()); + first.get_position().set_line(pos.get_line()); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + bool has_include_guards(std::string& guard_name) const + { return guards.detected(guard_name); } +#endif + +private: + iterator_type first; + iterator_type last; + + wave::language_support language; + bool at_eof; +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + include_guards<token_type> guards; +#endif + + static lexer::lexertl<iterator_type, Position> lexer_; +}; + +template <typename Iterator, typename Position> +lexer::lexertl< + typename lexertl_functor<Iterator, Position>::iterator_type, Position> + lexertl_functor<Iterator, Position>::lexer_; + +#undef INIT_DATA_SIZE +#undef INIT_DATA_CPP_SIZE +#undef INIT_DATA_PP_NUMBER_SIZE +#undef INIT_MACRO_DATA_SIZE +#undef T_ANYCTRL + +/////////////////////////////////////////////////////////////////////////////// +// +// The new_lexer_gen<>::new_lexer function (declared in lexertl_interface.hpp) +// should be defined inline, if the lex_functor shouldn't be instantiated +// separately from the lex_iterator. +// +// Separate (explicit) instantiation helps to reduce compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_FLEX_NEW_LEXER_INLINE +#else +#define BOOST_WAVE_FLEX_NEW_LEXER_INLINE inline +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// The 'new_lexer' function allows the opaque generation of a new lexer object. +// It is coupled to the iterator type to allow to decouple the lexer/iterator +// configurations at compile time. +// +// This function is declared inside the xlex_interface.hpp file, which is +// referenced by the source file calling the lexer and the source file, which +// instantiates the lex_functor. But it is defined here, so it will be +// instantiated only while compiling the source file, which instantiates the +// lex_functor. While the xlex_interface.hpp file may be included everywhere, +// this file (xlex_lexer.hpp) should be included only once. This allows +// to decouple the lexer interface from the lexer implementation and reduces +// compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename Iterator, typename Position> +BOOST_WAVE_FLEX_NEW_LEXER_INLINE +wave::cpplexer::lex_input_interface<wave::cpplexer::lex_token<Position> > * +new_lexer_gen<Iterator, Position>::new_lexer(Iterator const &first, + Iterator const &last, Position const &pos, wave::language_support language) +{ + return new lexertl_functor<Iterator, Position>(first, last, pos, language); +} + +#undef BOOST_WAVE_FLEX_NEW_LEXER_INLINE + +/////////////////////////////////////////////////////////////////////////////// +}}}} // namespace boost::wave::cpplexer::lexertl + +#endif // !defined(BOOST_WAVE_LEXERTL_LEXER_HPP_INCLUDED) + diff --git a/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_config.hpp b/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_config.hpp new file mode 100644 index 000000000..919e3ffcd --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_config.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_WAVE_LEXERTL_CONFIG_HPP_INCLUDED) +#define BOOST_WAVE_WAVE_LEXERTL_CONFIG_HPP_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// If the BOOST_WAVE_LEXERTL_USE_STATIC_TABLES constant is defined to be not +// equal to zero, the lexer will use static pre-compiled dfa tables (as +// included in the file: wave_lexertl_tables.hpp). Enabling the static tables +// 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 0 +#endif + +/////////////////////////////////////////////////////////////////////////////// +// If the dfa tables have to be generated at runtime, and the constant +// BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE is defined to be not equal to zero, +// the lexer will write C++ code for static DFA tables. This is useful for +// generating the static tables required for the +// BOOST_WAVE_LEXERTL_USE_STATIC_TABLES as described above. +#if BOOST_WAVE_LEXERTL_USE_STATIC_TABLES != 0 +#if !defined(BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE) +#define BOOST_WAVE_LEXERTL_GENERATE_CPP_CODE 0 +#endif +#endif + +#endif // !BOOST_WAVE_WAVE_LEXERTL_CONFIG_HPP_INCLUDED diff --git a/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_tables.hpp b/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_tables.hpp new file mode 100644 index 000000000..494125bce --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/lexertl/wave_lexertl_tables.hpp @@ -0,0 +1,6598 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_WAVE_LEXERTL_TABLES_HPP_INCLUDED) +#define BOOST_WAVE_WAVE_LEXERTL_TABLES_HPP_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace wave { namespace cpplexer { namespace lexertl +{ +// this number was manually taken from the generated code +// here: const std::size_t *ptr_ = dfa_ + 81; + const int dfa_offset = 81; + +// Auto-generated by lexertl (http://www.benhanson.net/lexertl.html) + const std::size_t lookup[256] = {4, 4, 4, 4, 4, 4, 4, 4, + 4, 5, 7, 5, 5, 8, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 6, 9, 10, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 24, 23, 25, 26, + 27, 31, 32, 33, 34, 28, 35, 28, + 36, 29, 37, 38, 39, 40, 41, 42, + 80, 30, 30, 30, 30, 46, 47, 43, + 43, 43, 43, 43, 48, 43, 43, 43, + 43, 43, 43, 43, 43, 49, 43, 43, + 50, 43, 43, 51, 52, 53, 54, 55, + 80, 56, 12, 57, 58, 59, 13, 60, + 61, 62, 43, 63, 45, 64, 65, 66, + 67, 68, 69, 70, 71, 44, 11, 72, + 73, 74, 75, 76, 77, 78, 79, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80}; + const std::size_t dfa[52326] = {0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 59, 55, 55, + 56, 57, 24, 54, 44, 2, 32, 46, + 50, 23, 11, 53, 21, 27, 30, 25, + 8, 16, 9, 17, 48, 49, 49, 50, + 49, 49, 49, 49, 49, 49, 10, 29, + 20, 12, 18, 14, 50, 43, 38, 50, + 50, 52, 50, 50, 22, 51, 28, 15, + 47, 3, 7, 34, 35, 36, 50, 37, + 50, 39, 6, 4, 40, 50, 41, 42, + 33, 45, 5, 50, 50, 19, 13, 26, + 31, 58, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 60, 50, 50, 50, 61, 50, 50, 62, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 67, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 65, 50, 50, 50, + 50, 66, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 69, + 50, 68, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 70, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 72, 50, + 50, 73, 50, 50, 50, 50, 50, 50, + 71, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 77, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 75, + 50, 50, 50, 50, 76, 50, 50, 50, + 50, 74, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 805306647, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 79, 78, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306636, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 81, 0, + 0, 0, 82, 0, 83, 83, 83, 0, + 83, 83, 83, 83, 83, 83, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306633, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 84, + 0, 0, 0, 85, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 805306624, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 87, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306626, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 88, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 805306628, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 89, 0, 91, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 90, 0, 0, 0, 3, 805306660, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306630, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306632, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306634, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 95, 0, + 0, 0, 0, 96, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 94, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306640, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 97, 98, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 805306642, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306643, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 99, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 101, 0, 102, 100, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 805306645, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 805306646, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306650, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 105, 0, 0, 103, + 104, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306652, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 106, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306655, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 108, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 107, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306661, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 805306662, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306663, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 805306665, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 805306670, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 109, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306671, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 111, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 110, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 112, 50, 50, 113, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 115, 50, 116, 50, + 50, 50, 50, 50, 50, 50, 114, 50, + 50, 50, 50, 117, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 118, 50, 50, + 50, 50, 50, 50, 119, 50, 50, 50, + 50, 50, 50, 50, 120, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 121, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 122, 50, 50, 50, + 50, 50, 50, 50, 123, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 124, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 125, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 126, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 127, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 128, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 130, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 129, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 131, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 132, + 133, 50, 50, 50, 50, 50, 50, 50, + 50, 134, 135, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 136, 50, 50, 50, + 50, 137, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 138, 50, 50, 50, 139, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 140, 50, + 50, 50, 141, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 805306765, + 0, 0, 0, 142, 142, 0, 0, 0, + 0, 0, 0, 0, 152, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 143, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 149, 147, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 146, 0, 0, 145, 0, 0, 0, + 0, 148, 0, 151, 0, 0, 150, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 154, 157, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 153, 160, + 156, 155, 50, 50, 50, 159, 50, 50, + 50, 50, 50, 50, 50, 158, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 1090519425, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 83, 0, 162, 162, 166, 0, 162, + 162, 162, 162, 162, 166, 0, 0, 0, + 0, 0, 0, 0, 163, 164, 167, 0, + 164, 163, 161, 0, 0, 0, 0, 0, + 0, 0, 0, 167, 0, 0, 165, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 161, 0, 0, 0, 0, 0, 0, + 0, 3, 1090519425, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 83, 0, 49, 49, 49, 0, + 49, 49, 49, 49, 49, 49, 0, 0, + 0, 0, 0, 0, 0, 163, 164, 167, + 0, 164, 163, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 0, 0, 165, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 2684354958, 0, 0, 0, + 0, 0, 170, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 168, + 0, 0, 0, 0, 169, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 172, 50, + 50, 50, 0, 50, 0, 0, 171, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 2684354958, 0, + 0, 175, 175, 175, 0, 0, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 0, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 174, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 173, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 3, 2684354958, + 0, 0, 172, 172, 172, 0, 0, 172, + 178, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 177, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 176, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 3, + 3489661321, 0, 0, 0, 55, 55, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 2952790411, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 2952790411, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 2684354958, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 536871335, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 179, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 180, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 181, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 168, 0, 0, 0, 0, + 169, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 182, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 183, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 184, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 185, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 810549534, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 186, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 187, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 188, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 189, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 190, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 191, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 192, 193, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 194, 195, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 196, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 197, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 805306658, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 198, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306648, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306649, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306637, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 199, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 1107296643, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 83, 83, + 83, 0, 83, 83, 83, 83, 83, 83, + 0, 0, 0, 0, 0, 0, 0, 0, + 202, 200, 201, 202, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 200, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306664, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 806355239, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 805306625, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306627, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306639, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306629, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306654, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 203, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 204, 0, 0, + 0, 0, 0, 0, 0, 0, 205, 207, + 209, 0, 0, 210, 0, 0, 212, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 206, 211, 208, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 805306631, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 805306635, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 213, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 95, 95, + 0, 0, 0, 0, 96, 96, 96, 214, + 215, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, + 96, 3, 805306641, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306668, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 216, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 806355218, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306644, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 806355222, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 805306666, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 217, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306651, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 806355237, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 806355341, 0, 0, 0, 142, 142, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 218, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 143, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 149, 147, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 144, 146, 0, 0, 145, + 0, 0, 0, 0, 148, 0, 151, 0, + 0, 150, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 805306653, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 805306656, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 805306657, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 805306672, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 219, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 220, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 221, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 222, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 223, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 224, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 225, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 226, 50, 50, 50, 50, 50, + 50, 227, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 228, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 229, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 230, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871233, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 231, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 232, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 233, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 234, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 235, 50, + 50, 50, 236, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 237, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871245, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 238, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 239, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 240, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 241, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 242, + 50, 50, 50, 243, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 244, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 245, + 50, 246, 50, 50, 50, 50, 50, 50, + 50, 50, 247, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 248, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 249, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 250, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 251, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 252, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 253, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 254, 50, + 50, 50, 50, 50, 50, 50, 255, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 256, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 257, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 259, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 258, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 260, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 261, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 142, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 143, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 149, 147, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 144, 146, 0, 0, 145, 0, 0, 0, + 0, 148, 0, 151, 0, 0, 150, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 262, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 263, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 264, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 265, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 266, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 267, 0, 0, 0, 268, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 269, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 270, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 271, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 272, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 273, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306764, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 154, 275, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 278, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 160, 156, 155, 277, 50, 50, 274, + 50, 50, 50, 50, 50, 50, 50, 158, + 276, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 279, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 280, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 281, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 282, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 283, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 284, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 285, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 286, 286, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 286, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 286, + 286, 0, 0, 0, 0, 0, 0, 0, + 0, 286, 286, 286, 286, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 1090519425, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 83, 0, 162, 162, 166, + 0, 162, 162, 162, 162, 162, 166, 0, + 0, 0, 0, 0, 0, 0, 163, 164, + 167, 0, 164, 163, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 167, 0, 0, + 165, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 1090519425, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 287, 0, 0, 287, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 1090519425, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 289, 288, 0, 0, 288, 289, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 290, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 83, + 0, 166, 166, 166, 0, 166, 166, 166, + 166, 166, 166, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 167, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 291, 291, 0, + 0, 0, 292, 292, 292, 0, 292, 292, + 292, 292, 292, 292, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 293, 293, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 293, 293, 293, 293, 293, + 293, 293, 293, 293, 293, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 293, 293, + 0, 0, 0, 0, 0, 0, 0, 0, + 293, 293, 293, 293, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 294, 294, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 294, 294, 294, 294, + 294, 294, 294, 294, 294, 294, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 294, + 294, 0, 0, 0, 0, 0, 0, 0, + 0, 294, 294, 294, 294, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 2952790408, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 175, + 175, 175, 0, 0, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 0, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 174, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 173, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 0, 0, 0, 0, + 172, 172, 172, 0, 0, 172, 178, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 177, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 176, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 0, 0, 0, + 0, 175, 175, 175, 0, 0, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 295, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 297, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 296, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 298, 175, + 175, 175, 175, 175, 175, 175, 0, 0, + 0, 0, 175, 175, 175, 0, 0, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 300, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 299, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 296, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 0, + 0, 0, 0, 175, 175, 175, 0, 0, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 300, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 297, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 296, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 0, 0, 0, 0, 172, 172, 172, 0, + 0, 172, 301, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 177, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 176, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 302, 172, 172, 172, 172, 172, 172, + 172, 0, 0, 0, 0, 172, 172, 172, + 0, 0, 172, 178, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 303, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 176, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 3, 1124073863, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 304, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 305, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 306, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 307, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 63, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 810549505, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 308, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871217, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 309, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 310, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 311, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 810549510, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 312, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 810549532, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 313, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 314, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871251, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 315, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 316, + 317, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 318, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 319, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 320, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 321, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 805306659, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 805306638, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 322, 322, + 0, 0, 0, 323, 323, 323, 0, 323, + 323, 323, 323, 323, 323, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 1107296643, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 324, 0, + 0, 324, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 1107296643, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 324, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 324, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 325, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 807403780, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 326, 0, 91, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 325, 0, 0, 0, 3, 807403782, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 807403794, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 807403798, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 807403813, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 807403815, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 807403823, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 807403917, 0, 0, 0, + 142, 142, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 143, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 328, 0, 149, + 147, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 144, 146, 0, + 0, 145, 0, 0, 0, 0, 148, 0, + 151, 0, 0, 150, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 2686452110, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 168, 0, 0, 0, 0, 169, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 213, 329, 329, 329, 329, 330, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 3, 3490709893, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 3490709893, 0, 0, 0, 0, 0, 214, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 805306669, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 805306667, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 331, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 332, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 333, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871242, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 334, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 335, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871269, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 336, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 337, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 338, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 339, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 340, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 341, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 342, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 343, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 344, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 345, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 346, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 347, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 348, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 349, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 350, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871247, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 351, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 352, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 353, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 354, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 355, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 356, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 357, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 358, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 359, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 360, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 361, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 362, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 363, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 364, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 365, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 366, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 367, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 368, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 369, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 370, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 371, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 372, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 373, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 262, + 262, 262, 262, 262, 262, 262, 262, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 374, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 1350566258, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 375, 0, 0, 0, 0, 0, + 0, 376, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 377, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 379, 0, 0, 0, 0, 0, 0, 0, + 378, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 380, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 381, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 382, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 383, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 384, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 385, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 386, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 387, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 282, 50, 50, 50, 50, + 50, 388, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 389, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 390, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 391, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 392, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 393, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 394, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 395, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 396, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 397, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 398, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 1090519425, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 286, 286, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 286, 286, 286, 286, 286, 286, 286, + 286, 286, 286, 0, 0, 0, 0, 0, + 0, 0, 163, 164, 286, 286, 164, 163, + 0, 0, 0, 0, 0, 0, 286, 286, + 286, 286, 0, 0, 165, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 1090519425, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 399, 0, 0, 399, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 1090519426, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 399, 0, 0, 0, + 0, 399, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 1090519425, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 399, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 292, 292, + 292, 0, 292, 292, 292, 292, 292, 292, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 1107296643, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 201, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 292, + 292, 292, 0, 292, 292, 292, 292, 292, + 292, 0, 0, 0, 0, 0, 0, 0, + 0, 202, 0, 201, 202, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 400, 400, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 400, 400, 400, 400, 400, 400, 400, 400, + 400, 400, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 400, 400, 0, 0, 0, + 0, 0, 0, 0, 0, 400, 400, 400, + 400, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 401, 401, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 401, 401, 401, 401, 401, 401, 401, + 401, 401, 401, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 401, 401, 0, 0, + 0, 0, 0, 0, 0, 0, 401, 401, + 401, 401, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 1140851078, 0, 0, 175, 175, 175, 0, 0, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 300, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 297, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 296, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 0, 0, 0, 0, 175, 175, 175, 0, + 0, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 295, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 297, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 296, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 402, 175, 175, 175, 175, 175, 175, + 175, 0, 0, 0, 0, 175, 175, 175, + 0, 0, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 300, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 403, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 296, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 0, 0, 0, 0, 175, 175, + 175, 0, 0, 175, 175, 175, 298, 298, + 175, 175, 175, 175, 300, 175, 175, 175, + 175, 175, 175, 175, 175, 298, 298, 298, + 298, 298, 298, 298, 298, 298, 298, 175, + 175, 175, 175, 175, 297, 175, 175, 175, + 298, 298, 175, 175, 175, 175, 296, 175, + 175, 175, 298, 298, 298, 298, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 0, 0, 0, 0, 175, + 175, 175, 0, 0, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 300, 175, 175, + 175, 175, 175, 175, 175, 173, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 403, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 296, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 3, 1140851078, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 1124073863, 0, + 0, 172, 172, 172, 0, 0, 172, 178, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 177, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 176, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 0, 0, + 0, 0, 172, 172, 172, 0, 0, 172, + 178, 172, 302, 302, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 302, 302, 302, 302, 302, 302, 302, + 302, 302, 302, 172, 172, 172, 172, 172, + 177, 172, 172, 172, 302, 302, 172, 172, + 172, 172, 176, 172, 172, 172, 302, 302, + 302, 302, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 0, + 0, 0, 0, 172, 172, 172, 0, 0, + 172, 178, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 176, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 303, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 176, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 172, 172, 172, 172, 172, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 404, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 405, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 536871219, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 406, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 407, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871218, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 408, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 409, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 410, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 411, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 412, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 413, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 414, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 415, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871223, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 416, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871225, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 417, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 323, 323, 323, + 0, 323, 323, 323, 323, 323, 323, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 1107296643, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 201, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 323, 323, + 323, 0, 323, 323, 323, 323, 323, 323, + 0, 0, 0, 0, 0, 0, 0, 0, + 202, 0, 201, 202, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 1107296643, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 807403806, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 807403781, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 807403783, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 418, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 419, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 3, 3490709892, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 806355340, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 420, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 421, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 422, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 1157628213, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 423, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871267, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 424, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 425, 50, 50, + 50, 426, 50, 50, 427, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 428, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 429, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 430, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 431, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871236, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871237, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 432, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 433, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 434, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871244, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 435, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871248, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 436, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 437, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 438, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 439, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 440, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 441, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 442, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 443, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 444, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 445, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 446, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 447, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 448, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 449, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 450, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 451, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 452, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871277, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 453, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 454, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 455, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 373, 456, 456, 456, 456, 142, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 457, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 458, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 459, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 460, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 461, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 462, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 463, 0, 0, 0, 0, 0, + 0, 464, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 465, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 466, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 467, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 468, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 469, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 470, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 397, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 471, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 472, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 473, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 474, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 475, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 476, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 477, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 478, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 479, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 480, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 481, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871331, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 1090519426, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 482, 482, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 482, 482, 482, 482, 482, + 482, 482, 482, 482, 482, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 482, 482, + 0, 0, 0, 0, 0, 0, 0, 0, + 482, 482, 482, 482, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 483, 483, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 483, 483, 483, 483, + 483, 483, 483, 483, 483, 483, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 483, + 483, 0, 0, 0, 0, 0, 0, 0, + 0, 483, 483, 483, 483, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 175, 175, + 175, 0, 0, 175, 175, 175, 402, 402, + 175, 175, 175, 175, 300, 175, 175, 175, + 175, 175, 175, 175, 175, 402, 402, 402, + 402, 402, 402, 402, 402, 402, 402, 175, + 175, 175, 175, 175, 297, 175, 175, 175, + 402, 402, 175, 175, 175, 175, 296, 175, + 175, 175, 402, 402, 402, 402, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 0, 0, 0, 0, 175, + 175, 175, 0, 0, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 300, 175, 175, + 175, 175, 175, 175, 175, 296, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 403, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 296, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 175, 175, 175, 175, + 175, 175, 175, 175, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 484, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 810549508, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871222, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 485, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 810549509, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 486, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 487, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 488, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 489, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 810549551, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871227, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 490, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 491, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871224, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871226, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 492, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 419, 329, 329, 329, 329, 330, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 3, 1157628212, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871241, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 493, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 494, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871268, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 495, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 496, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 497, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 498, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 499, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 500, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 501, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 502, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 503, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 504, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 505, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 506, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 507, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 508, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 509, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 510, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 511, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 512, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871259, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 513, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 514, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 515, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 516, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 517, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871273, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 518, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871275, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 519, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 520, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 521, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871280, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 522, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 523, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 524, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 525, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 526, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 1350566261, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 1350566262, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 527, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 528, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 529, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 1342177657, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 530, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 531, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 532, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 533, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 535, 50, + 536, 50, 537, 534, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 538, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871326, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 539, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 540, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 541, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 542, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 543, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 544, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 545, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 546, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 168, + 168, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 168, 168, + 168, 168, 168, 168, 168, 168, 168, 168, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 168, 168, 0, 0, 0, 0, 0, + 0, 0, 0, 168, 168, 168, 168, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 810549504, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 810549507, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 547, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 810549511, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 810549533, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 548, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 549, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 550, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 807403916, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 536871243, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 551, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 552, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871271, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 553, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 554, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871232, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871234, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 555, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 556, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871239, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871240, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871246, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 557, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 558, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 559, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871255, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 560, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 561, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871258, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871260, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 536871261, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871262, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 562, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871265, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 563, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 564, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 565, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 566, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 522, + 456, 456, 456, 456, 142, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 456, 456, 456, 456, 456, + 456, 456, 456, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 567, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 1350566259, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 568, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 569, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, + 1350566263, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 570, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 1342177656, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 571, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 1342177659, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 572, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 573, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 536871317, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 574, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 575, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 576, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 577, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 578, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 579, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871321, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 580, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871323, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 581, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 582, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 583, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 584, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 585, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 586, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 587, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 588, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871270, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 589, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 536871230, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 590, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 591, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871249, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871253, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 592, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 593, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 594, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 595, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 596, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871276, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 597, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871279, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 1342177649, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 1350566260, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 598, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 599, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 3, 1342177658, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 600, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 1342177700, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 536871318, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871319, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871320, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 601, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 602, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871329, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 603, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 268435837, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 604, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 605, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871330, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871252, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 606, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 607, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871229, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871266, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871272, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 608, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 536871238, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 609, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871256, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 610, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 611, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871274, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871278, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 1342177679, + 0, 0, 0, 612, 612, 0, 0, 0, + 614, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 613, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 616, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 615, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 617, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 1342177660, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 618, 50, 0, 0, 0, + 0, 0, 3, 536871327, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 619, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 620, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871325, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 536871250, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 621, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 622, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 3, 536871254, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 3, 268435837, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 623, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 624, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 1342177679, 0, 0, + 0, 612, 612, 0, 0, 0, 614, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 613, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 616, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 625, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 626, 626, 626, 0, 0, 626, + 0, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 627, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 628, 628, 628, 0, + 0, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 0, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 629, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 3, 536871328, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 0, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 64, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 63, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 3, 536871322, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 536871324, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871228, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 630, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 631, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 268435837, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 632, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 633, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 625, 625, 625, 625, 625, 625, + 625, 625, 0, 0, 0, 0, 626, 626, + 626, 0, 0, 626, 634, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 626, 626, 626, 626, 626, + 626, 626, 626, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 635, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 628, 628, 628, 0, 0, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 636, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 628, 628, 628, + 628, 628, 628, 628, 628, 3, 1342177701, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 637, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 3, + 268435837, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 0, 50, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 64, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 63, 0, 0, 638, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 3, 536871263, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 0, 50, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 64, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 63, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 633, 639, + 639, 639, 639, 612, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 3, 1342177680, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 640, 0, 0, 0, + 0, 0, 0, 0, 3, 1342177681, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 536871235, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 3, 268435837, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 0, 50, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 0, 0, 0, 0, 0, + 64, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 63, 0, 0, 50, 50, 641, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 642, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 612, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 268435837, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 0, + 50, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 0, + 0, 0, 0, 64, 50, 50, 50, 50, + 50, 50, 50, 50, 0, 63, 0, 0, + 50, 643, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 642, + 639, 639, 639, 639, 612, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 639, 639, 639, 639, 639, + 639, 639, 639, 3, 268435837, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 0, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 64, 50, 50, + 50, 50, 50, 50, 50, 50, 0, 63, + 0, 0, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 644, 50, 50, 50, 50, 50, 0, + 0, 0, 0, 0, 3, 268435837, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 0, 50, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0, 64, 50, + 50, 50, 50, 50, 50, 50, 50, 0, + 63, 0, 0, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 645, 50, 50, 50, 50, + 0, 0, 0, 0, 0, 3, 536871257, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 0, 50, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 0, 0, 0, 0, 0, 64, + 50, 50, 50, 50, 50, 50, 50, 50, + 0, 63, 0, 0, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 0, 0, 0, 0, 0}; + +/////////////////////////////////////////////////////////////////////////////// +}}}} // namespace boost::wave::cpplexer::lexertl + +#endif // !BOOST_WAVE_WAVE_LEXERTL_TABLES_HPP_INCLUDED diff --git a/src/boost/libs/wave/samples/list_includes/lexertl_interface.hpp b/src/boost/libs/wave/samples/list_includes/lexertl_interface.hpp new file mode 100644 index 000000000..5b29d9b95 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/lexertl_interface.hpp @@ -0,0 +1,77 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the abstract lexer interface for the lexertl based C++ lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LEXERTL_INTERFACE_HPP_INCLUDED) +#define BOOST_WAVE_LEXERTL_INTERFACE_HPP_INCLUDED + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace wave { namespace cpplexer { namespace lexertl +{ + +/////////////////////////////////////////////////////////////////////////////// +// +// new_lexer_gen: generates a new instance of the required C++ lexer +// +/////////////////////////////////////////////////////////////////////////////// +template < + typename IteratorT, + typename PositionT = wave::util::file_position_type +> +struct 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 wave::cpplexer::lex_input_interface< + wave::cpplexer::lex_token<PositionT> + > * + new_lexer(IteratorT const &first, IteratorT const &last, + PositionT const &pos, wave::language_support language); +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// The lexertl_input_interface helps to instantiate a concrete lexer +// to be used by the Wave preprocessor module. +// This is done to allow compile time reduction by separation of the lexer +// iterator exposed to the Wave library and the lexer implementation. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +struct lexertl_input_interface +: wave::cpplexer::lex_input_interface<TokenT> +{ + typedef typename wave::cpplexer::lex_input_interface<TokenT>::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. + template <typename IteratorT> + static wave::cpplexer::lex_input_interface<TokenT> * + new_lexer(IteratorT const &first, IteratorT const &last, + position_type const &pos, wave::language_support language) + { + return new_lexer_gen<IteratorT, position_type>::new_lexer (first, last, + pos, language); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +}}}} // namespace boost::wave::cpplexer::lexertl + +#endif // !defined(BOOST_WAVE_LEXERTL_INTERFACE_HPP_INCLUDED) diff --git a/src/boost/libs/wave/samples/list_includes/lexertl_iterator.hpp b/src/boost/libs/wave/samples/list_includes/lexertl_iterator.hpp new file mode 100644 index 000000000..42d821f9d --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/lexertl_iterator.hpp @@ -0,0 +1,227 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the lexertl based lexer iterator + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LEXERTL_ITERATOR_HPP_INCLUDED) +#define BOOST_WAVE_LEXERTL_ITERATOR_HPP_INCLUDED + +#include <string> + +#include <boost/assert.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/util/functor_input.hpp> + +#include "lexertl_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 { namespace cpplexer { namespace lexertl +{ + +/////////////////////////////////////////////////////////////////////////////// +namespace impl { + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_iterator_functor_shim +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +class iterator_functor_shim +{ + typedef typename TokenT::position_type position_type; + +public: + iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + , eof() +#endif // 0 != __DECCXX_VER + {} + +// interface to the boost::spirit::classic::iterator_policies::functor_input +// policy + typedef TokenT result_type; + typedef iterator_functor_shim unique; + typedef lex_input_interface<TokenT>* shared; + + BOOST_WAVE_EOF_PREFIX result_type const eof; + + template <typename MultiPass> + static result_type& get_next(MultiPass& mp, result_type& result) + { + return mp.shared()->ftor->get(result); + } + + // this will be called whenever the last reference to a multi_pass will + // be released + template <typename MultiPass> + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template <typename MultiPass> + static void set_position(MultiPass& mp, position_type const &pos) + { + mp.shared()->ftor->set_position(pos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + template <typename MultiPass> + static bool has_include_guards(MultiPass& mp, std::string& guard_name) + { + return mp.shared()->ftor->has_include_guards(guard_name); + } +#endif + +private: + boost::shared_ptr<lex_input_interface<TokenT> > functor_ptr; +}; + +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +/////////////////////////////////////////////////////////////////////////////// +// eof token +template <typename TokenT> +typename iterator_functor_shim<TokenT>::result_type const + iterator_functor_shim<TokenT>::eof = + typename iterator_functor_shim<TokenT>::result_type(); +#endif // 0 != __COMO_VERSION__ + +/////////////////////////////////////////////////////////////////////////////// +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// +// lexertl_iterator +// +// A generic C++ lexer interface class, which allows to plug in different +// lexer implementations (template parameter LexT). The following +// requirement apply: +// +// - the lexer type should have a function implemented, which returnes +// the next lexed token from the input stream: +// typename LexT::token_type get(); +// - at the end of the input stream this function should return the +// eof token equivalent +// - the lexer should implement a constructor taking two iterators +// pointing to the beginning and the end of the input stream and +// a third parameter containing the name of the parsed input file, +// the 4th parameter contains the information about the mode the +// preprocessor is used in (C99/C++ mode etc.) +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template <typename FunctorData> +struct make_multi_pass +{ + typedef + std::pair<typename FunctorData::unique, typename FunctorData::shared> + 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<functor_data_type, policy_type> type; +}; + +template <typename TokenT> +class lex_iterator +: public make_multi_pass<impl::iterator_functor_shim<TokenT> >::type +{ + typedef impl::iterator_functor_shim<TokenT> input_policy_type; + + typedef typename make_multi_pass<input_policy_type>::type base_type; + typedef typename make_multi_pass<input_policy_type>::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 <typename IteratorT> + lex_iterator(IteratorT const &first, IteratorT const &last, + typename TokenT::position_type const &pos, + boost::wave::language_support language) + : base_type( + functor_data_type( + unique_functor_type(), + lexertl_input_interface<TokenT> + ::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 + token_type const& currtoken = this->base_type::dereference(*this); + position_type currpos = currtoken.get_position(); + + currpos.set_file(pos.get_file()); + currpos.set_line(pos.get_line()); + const_cast<token_type&>(currtoken).set_position(currpos); + + // set the new position for future tokens as well + if (token_type::string_type::npos != + currtoken.get_value().find_first_of('\n')) + { + currpos.set_line(pos.get_line() + 1); + } + unique_functor_type::set_position(*this, currpos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + // Return, whether the current file has include guards. This function + // returns meaningful results only if the file was scanned completely. + // For now we always return false, but this can be fixed easily later on. + bool has_include_guards(std::string& guard_name) const + { + return base_type::get_functor().has_include_guards(*this, guard_name); + } +#endif +}; + +/////////////////////////////////////////////////////////////////////////////// +}}}} // namespace boost::wave::cpplexer::lexertl + +#undef BOOST_WAVE_EOF_PREFIX + +#endif // !defined(BOOST_WAVE_LEXERTL_ITERATOR_HPP_INCLUDED) diff --git a/src/boost/libs/wave/samples/list_includes/list_includes.cpp b/src/boost/libs/wave/samples/list_includes/list_includes.cpp new file mode 100644 index 000000000..47c2b6042 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/list_includes.cpp @@ -0,0 +1,324 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + + The 'list_includes' sample shows a simple way, how to use the Wave C++ + preprocessor library to extract a list of included files from a given + source file. + To get a hint which commandline options are supported, call it with the + --help option. + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "list_includes.hpp" // config data + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/program_options.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // standard token type +#include "lexertl_iterator.hpp" // lexertl based lexer + +/////////////////////////////////////////////////////////////////////////////// +// Include the default context trace policies +#include <boost/wave/preprocessing_hooks.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// include lexer specifics, import lexer names +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION == 0 +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> +#endif + +/////////////////////////////////////////////////////////////////////////////// +// import required names +using namespace boost::spirit::classic; + +using std::string; +using std::vector; +using std::set; +using std::cout; +using std::cerr; +using std::endl; +using std::ifstream; +using std::ostream; +using std::istreambuf_iterator; + +namespace po = boost::program_options; + +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_util { + + // predicate to extract all positional arguments from the command line + struct is_argument { + bool operator()(po::option const &opt) + { + return (opt.position_key == -1) ? true : false; + } + }; + +/////////////////////////////////////////////////////////////////////////////// +} + +/////////////////////////////////////////////////////////////////////////////// +// print the current version + +int print_version() +{ +// get time of last compilation of this file +boost::wave::util::time_conversion_helper compilation_time(__DATE__ " " __TIME__); + +// calculate the number of days since Jan 29 2003 +// (the day the list_includes project was started) +std::tm first_day; + + std::memset (&first_day, 0, sizeof(std::tm)); + first_day.tm_mon = 0; // Jan + first_day.tm_mday = 29; // 29 + first_day.tm_year = 103; // 2003 + +long seconds = long(std::difftime(compilation_time.get_time(), + std::mktime(&first_day))); + + cout + << LIST_INCLUDES_VERSION_MAJOR << '.' + << LIST_INCLUDES_VERSION_MINOR << '.' + << LIST_INCLUDES_VERSION_SUBMINOR << '.' + << seconds/(3600*24); // get number of days from seconds + return 1; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// policy class +struct trace_include_files +: public boost::wave::context_policies::default_preprocessing_hooks +{ + trace_include_files(set<string> &files_) + : files(files_), include_depth(0) + {} + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + void + opened_include_file(string const &relname, string const &filename, + std::size_t /*include_depth*/, bool is_system_include) +#else + template <typename ContextT> + void + opened_include_file(ContextT const& ctx, std::string const& relname, + std::string const& filename, bool is_system_include) +#endif + { + set<string>::iterator it = files.find(filename); + if (it == files.end()) { + // print indented filename + for (std::size_t i = 0; i < include_depth; ++i) + cout << " "; + cout << filename << endl; + + files.insert(filename); + } + ++include_depth; + } + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + void returning_from_include_file() +#else + template <typename ContextT> + void returning_from_include_file(ContextT const& ctx) +#endif + { + --include_depth; + } + + set<string> &files; + std::size_t include_depth; +}; + +/////////////////////////////////////////////////////////////////////////////// +// +int +do_actual_work(vector<string> const &arguments, po::variables_map const &vm) +{ +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // list the included files for all arguments given + vector<string>::const_iterator lastfile = arguments.end(); + for (vector<string>::const_iterator file_it = arguments.begin(); + file_it != lastfile; ++file_it) + { + ifstream instream((*file_it).c_str()); + string instring; + + if (!instream.is_open()) { + cerr << "Could not open input file: " << *file_it << endl; + continue; + } + instream.unsetf(std::ios::skipws); + instring = string(istreambuf_iterator<char>(instream.rdbuf()), + istreambuf_iterator<char>()); + + // The template boost::wave::cpplexer::lex_token<> is the token type to be + // used by the Wave library. + typedef boost::wave::cpplexer::lexertl::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lex_iterator_type; + typedef boost::wave::context< + std::string::iterator, lex_iterator_type, + boost::wave::iteration_context_policies::load_file_to_string, + trace_include_files + > context_type; + + set<string> files; + trace_include_files trace(files); + + // The preprocessor iterator shouldn't be constructed directly. It is + // to be generated through a wave::context<> object. This wave:context<> + // object is additionally to be used to initialize and define different + // parameters of the actual preprocessing. + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), (*file_it).c_str(), trace); + + // add include directories to the include path + if (vm.count("include")) { + vector<string> const &paths = + vm["include"].as<vector<string> >(); + vector<string>::const_iterator end = paths.end(); + for (vector<string>::const_iterator cit = paths.begin(); + cit != end; ++cit) + { + ctx.add_include_path((*cit).c_str()); + } + } + + // add system include directories to the include path + if (vm.count("sysinclude")) { + vector<string> const &syspaths = + vm["sysinclude"].as<vector<string> >(); + vector<string>::const_iterator end = syspaths.end(); + for (vector<string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + ctx.add_sysinclude_path((*cit).c_str()); + } + } + + // analyze the actual file + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + + cout << "Printing dependency information for: " + << *file_it << endl; + + while (first != last) { + current_position = (*first).get_position(); + ++first; + } + + // prepend endl before next file + cout << endl; + } + } + catch (boost::wave::cpp_exception &e) { + // some preprocessing error + cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << endl; + return 2; + } + catch (std::exception &e) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << endl; + return 4; + } + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// here we go! +int +main (int argc, char *argv[]) +{ + try { + // analyze the command line options and arguments + vector<string> syspathes; + po::options_description desc("Usage: list_includes [options] file ..."); + + desc.add_options() + ("help,h", "print out program usage (this message)") + ("version,v", "print the version number") + ("include,I", po::value<vector<string> >(), + "specify additional include directory") + ("sysinclude,S", po::value<vector<string> >(), + "specify additional system include directory") + ; + + using namespace boost::program_options::command_line_style; + + po::parsed_options opts = po::parse_command_line(argc, argv, desc, unix_style); + po::variables_map vm; + + po::store(opts, vm); + po::notify(vm); + + if (vm.count("help")) { + cout << desc << endl; + return 1; + } + + if (vm.count("version")) { + return print_version(); + } + + // extract the arguments from the parsed command line + vector<po::option> arguments; + + std::remove_copy_if(opts.options.begin(), opts.options.end(), + inserter(arguments, arguments.end()), cmd_line_util::is_argument()); + + // if there is no input file given, then exit + if (0 == arguments.size() || 0 == arguments[0].value.size()) { + cerr << "list_includes: No input file given. " + << "Use --help to get a hint." << endl; + return 5; + } + + // iterate over all given input files + return do_actual_work(arguments[0].value , vm); + } + catch (std::exception &e) { + cout << "list_includes: exception caught: " << e.what() << endl; + return 6; + } + catch (...) { + cerr << "list_includes: unexpected exception caught." << endl; + return 7; + } +} + diff --git a/src/boost/libs/wave/samples/list_includes/list_includes.hpp b/src/boost/libs/wave/samples/list_includes/list_includes.hpp new file mode 100644 index 000000000..2a6277ebf --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/list_includes.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file + Configuration data + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(LIST_INCLUDES_HPP_843DB412_3AA8_4BCF_8081_AA4A5FDE0BE7_INCLUDED) +#define LIST_INCLUDES_HPP_843DB412_3AA8_4BCF_8081_AA4A5FDE0BE7_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// include often used files from the stdlib +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <set> + +/////////////////////////////////////////////////////////////////////////////// +// include boost config +#include <boost/config.hpp> // global configuration information + +/////////////////////////////////////////////////////////////////////////////// +// build version +#include "list_includes_version.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// configure this app here (global configuration constants) +#include "list_includes_config.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/pool/pool_alloc.hpp> + +#endif // !defined(LIST_INCLUDES_HPP_843DB412_3AA8_4BCF_8081_AA4A5FDE0BE7_INCLUDED) diff --git a/src/boost/libs/wave/samples/list_includes/list_includes_config.hpp b/src/boost/libs/wave/samples/list_includes/list_includes_config.hpp new file mode 100644 index 000000000..59556af09 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/list_includes_config.hpp @@ -0,0 +1,64 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Global application configuration of the list_includes sample + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(LIST_INCLUDES_CONFIG_HPP_0DE80E47_8D50_4DFA_9C1C_0EECAA8A934A_INCLUDED) +#define LIST_INCLUDES_CONFIG_HPP_0DE80E47_8D50_4DFA_9C1C_0EECAA8A934A_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// Uncomment the following, if you need debug output, the +// BOOST_SPIRIT_DEBUG_FLAGS constants below help to fine control the amount of +// the generated debug output +//#define BOOST_SPIRIT_DEBUG + +/////////////////////////////////////////////////////////////////////////////// +// debug rules, subrules and grammars only, for possible flags see +// spirit/debug.hpp +#if defined(BOOST_SPIRIT_DEBUG) + +#define BOOST_SPIRIT_DEBUG_FLAGS ( \ + BOOST_SPIRIT_DEBUG_FLAGS_NODES | \ + BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES \ + ) \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +// debug flags for the pp-iterator library, possible flags (defined in +// wave_config.hpp): +// +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_GRAMMAR 0x0001 +// #define BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION 0x0002 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR 0x0004 +// #define BOOST_SPIRIT_DEBUG_FLAGS_INTLIT_GRAMMAR 0x0008 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010 +// #define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020 +// #define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040 + +#define BOOST_SPIRIT_DEBUG_FLAGS_CPP (\ + /* insert the required flags from above */ \ + ) \ + /**/ +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Now include the configuration stuff for the Wave library itself +#include <boost/wave/wave_config.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// MSVC specific #pragma's +#if defined(BOOST_MSVC) +#pragma warning (disable: 4355) // 'this' used in base member initializer list +#pragma warning (disable: 4800) // forcing value to bool 'true' or 'false' +#pragma inline_depth(255) +#pragma inline_recursion(on) +#endif // defined(BOOST_MSVC) + +#endif // !defined(LIST_INCLUDES_CONFIG_HPP_0DE80E47_8D50_4DFA_9C1C_0EECAA8A934A_INCLUDED) diff --git a/src/boost/libs/wave/samples/list_includes/list_includes_version.hpp b/src/boost/libs/wave/samples/list_includes/list_includes_version.hpp new file mode 100644 index 000000000..8f517e080 --- /dev/null +++ b/src/boost/libs/wave/samples/list_includes/list_includes_version.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: List include dependencies of a given source file version number + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(LIST_INCLUDES_VERSION_HPP_FF662D6C_C3E6_4BEC_A062_5D9BD7415EBF_INCLUDED) +#define LIST_INCLUDES_VERSION_HPP_FF662D6C_C3E6_4BEC_A062_5D9BD7415EBF_INCLUDED + +#define LIST_INCLUDES_VERSION_MAJOR 0 +#define LIST_INCLUDES_VERSION_MINOR 4 +#define LIST_INCLUDES_VERSION_SUBMINOR 0 + +#endif // !defined(LIST_INCLUDES_VERSION_HPP_FF662D6C_C3E6_4BEC_A062_5D9BD7415EBF_INCLUDED) diff --git a/src/boost/libs/wave/samples/preprocess_pragma_output/build/Jamfile.v2 b/src/boost/libs/wave/samples/preprocess_pragma_output/build/Jamfile.v2 new file mode 100644 index 000000000..237ffc95e --- /dev/null +++ b/src/boost/libs/wave/samples/preprocess_pragma_output/build/Jamfile.v2 @@ -0,0 +1,22 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (preprocess_pragma_output) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2008 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) + +exe preprocess_pragma_output + : ../preprocess_pragma_output.cpp + /boost/wave//boost_wave + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + /boost/system//boost_system + : + <toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc-8.0:<define>_CRT_SECURE_NO_DEPRECATE + ; + diff --git a/src/boost/libs/wave/samples/preprocess_pragma_output/example.cpp b/src/boost/libs/wave/samples/preprocess_pragma_output/example.cpp new file mode 100644 index 000000000..5c39e9cfd --- /dev/null +++ b/src/boost/libs/wave/samples/preprocess_pragma_output/example.cpp @@ -0,0 +1,24 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example demonstrating how to preprocess the token stream generated by a + #pragma directive + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +/////////////////////////////////////////////////////////////////////////////// +// This special pragma is implemented by the interpret_pragma hook function +// provided in the preprocess_pragma_output_hooks policy class. This +// #pragma preprocesses the provided arguments in the current context. +#pragma wave pp ( \ + "#define A() \"some text\" and more\n" \ + "#define B() 1.0\n" \ + ) \ + /**/ + +A() // this should produce: "some text" and more +B() // and this expands to 1.0 diff --git a/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.cpp b/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.cpp new file mode 100644 index 000000000..063eaddad --- /dev/null +++ b/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.cpp @@ -0,0 +1,115 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example demonstrating how to preprocess the token stream generated by a + #pragma directive + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +/////////////////////////////////////////////////////////////////////////////// +// Include special preprocessing hooks +#include "preprocess_pragma_output.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int main(int argc, char *argv[]) +{ + if (2 != argc) { + std::cerr << "Usage: preprocess_pragma_output infile" << std::endl; + return -1; + } + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> lex_iterator_type; + + // This is the resulting context type to use. + typedef boost::wave::context< + std::string::iterator, lex_iterator_type, + boost::wave::iteration_context_policies::load_file_to_string, + preprocess_pragma_output_hooks> + context_type; + + // 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 + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), argv[1]); + + // analyze the input file + 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(); + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.hpp b/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.hpp new file mode 100644 index 000000000..9c2415bda --- /dev/null +++ b/src/boost/libs/wave/samples/preprocess_pragma_output/preprocess_pragma_output.hpp @@ -0,0 +1,167 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example demonstrating how to preprocess the token stream generated by a + #pragma directive + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_SAMPLE_PREPROCESS_PRAGMA_OUTPUT_APR_03_2008_0813AM) +#define BOOST_WAVE_SAMPLE_PREPROCESS_PRAGMA_OUTPUT_APR_03_2008_0813AM + +template <typename String, typename Iterator> +inline String +as_unescaped_string(Iterator it, Iterator const& end) +{ + using namespace boost::wave; + + String result; + for (/**/; it != end; ++it) + { + switch (token_id(*it)) { + case T_STRINGLIT: + { + String val (util::impl::unescape_lit((*it).get_value()).c_str()); + val.erase(val.size()-1); + val.erase(0, 1); + result += val; + } + break; + + default: // just skip everything else (hey it's a sample) + break; + } + } + return result; +} + +// return the string representation of a token sequence +template <typename String, typename Container> +inline String +as_unescaped_string(Container const &token_sequence) +{ + return as_unescaped_string<String>(token_sequence.begin(), + token_sequence.end()); +} + +/////////////////////////////////////////////////////////////////////////////// +// +// The preprocess_pragma_output_hooks policy class is used implement a special +// #pragma wave pp("some C++ code") directive allowing to insert preprocessed +// code into the output sequence generated by the tool. +// +// This policy type is used as a template parameter to the boost::wave::context<> +// object. +// +/////////////////////////////////////////////////////////////////////////////// +class preprocess_pragma_output_hooks +: public boost::wave::context_policies::default_preprocessing_hooks +{ +public: + preprocess_pragma_output_hooks() {} + + template <typename Context> + struct reset_language_support + { + reset_language_support(Context& ctx) + : ctx_(ctx), lang_(ctx.get_language()) + { + ctx.set_language(boost::wave::enable_single_line(lang_), false); + } + ~reset_language_support() + { + ctx_.set_language(lang_, false); + } + + Context& ctx_; + boost::wave::language_support lang_; + }; + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'interpret_pragma' is called, whenever a #pragma command + // directive is found which isn't known to the core Wave library, where + // command is the value defined as the BOOST_WAVE_PRAGMA_KEYWORD constant + // which defaults to "wave". + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used as the replacement text for the whole + // #pragma directive. + // + // The parameter 'option' contains the name of the interpreted pragma. + // + // The parameter 'values' holds the values of the parameter provided to + // the pragma operator. + // + // The parameter 'act_token' contains the actual #pragma token, which may + // be used for error output. + // + // 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. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + interpret_pragma(Context& ctx, Container &pending, + typename Context::token_type const& option, + Container const& values, typename Context::token_type const& act_token) + { + typedef typename Context::token_type token_type; + typedef typename Context::iterator_type iterator_type; + + if (option.get_value() == "pp") { + // Concatenate the string(s) passed as the options to this pragma, + // preprocess the result using the current context and insert the + // generated token sequence in place of the pragma directive into the + // output stream. + + try { + // We're explicitly using a std::string here since the type of the + // iterators passed to the ctx.begin() below must match the types + // of the iterator the original context instance has been created + // with. + std::string s (as_unescaped_string<std::string>(values)); + reset_language_support<Context> lang(ctx); + + using namespace boost::wave; + + // The expanded token sequence is stored in the 'pragma' container + // to ensure consistency in the output in the case of an error + // while preprocessing the pragma option strings. + Container pragma; + iterator_type end = ctx.end(); + for (iterator_type it = ctx.begin(s.begin(), s.end()); + it != end && token_id(*it) != T_EOF; ++it) + { + pragma.push_back(*it); + it++; + } + + // prepend the newly generated token sequence to the 'pending' + // container + pending.splice(pending.begin(), pragma); + } + catch (boost::wave::preprocess_exception const& /*e*/) { + // the library will report an 'ill_formed_pragma_option' for us + return false; + } + return true; + } + + // we don't know anything about this #pragma wave directive + return false; + } +}; + + +#endif + diff --git a/src/boost/libs/wave/samples/quick_start/build/Jamfile.v2 b/src/boost/libs/wave/samples/quick_start/build/Jamfile.v2 new file mode 100644 index 000000000..2f039fdde --- /dev/null +++ b/src/boost/libs/wave/samples/quick_start/build/Jamfile.v2 @@ -0,0 +1,19 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (quick_start) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2011 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) + +exe quick_start + : ../quick_start.cpp + /boost/wave//boost_wave + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + ; + diff --git a/src/boost/libs/wave/samples/quick_start/quick_start.cpp b/src/boost/libs/wave/samples/quick_start/quick_start.cpp new file mode 100644 index 000000000..ac31001b0 --- /dev/null +++ b/src/boost/libs/wave/samples/quick_start/quick_start.cpp @@ -0,0 +1,119 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer class + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int main(int argc, char *argv[]) +{ + if (2 != argc) { + std::cerr << "Usage: quick_start infile" << std::endl; + return -1; + } + +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { +//[quick_start_main + // The following preprocesses the input file given by argv[1]. + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // This token type is one of the central types used throughout the library. + // It is a template parameter to some of the public classes and instances + // of this type are returned from the iterators. + typedef boost::wave::cpplexer::lex_token<> token_type; + + // The template boost::wave::cpplexer::lex_iterator<> is the lexer type to + // to use as the token source for the preprocessing engine. It is + // parametrized with the token type. + typedef boost::wave::cpplexer::lex_iterator<token_type> lex_iterator_type; + + // This is the resulting context type. The first template parameter should + // match the iterator type used during construction of the context + // instance (see below). It is the type of the underlying input stream. + typedef boost::wave::context<std::string::iterator, lex_iterator_type> + context_type; + + // The preprocessor iterator shouldn't be constructed directly. It is + // generated through a wave::context<> object. This wave:context<> object + // is additionally used to initialize and define different parameters of + // the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the range of context_type::iterator_type + // instances. + context_type ctx (instring.begin(), instring.end(), argv[1]); + + // Get the preprocessor iterators and use them to generate the token + // sequence. + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + + // The input stream is preprocessed for you while iterating over the range + // [first, last). The dereferenced iterator returns tokens holding + // information about the preprocessed input stream, such as token type, + // token value, and position. + while (first != last) { + current_position = (*first).get_position(); + std::cout << (*first).get_value(); + ++first; + } +//] + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/real_positions/build/Jamfile.v2 b/src/boost/libs/wave/samples/real_positions/build/Jamfile.v2 new file mode 100644 index 000000000..7373fae45 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/build/Jamfile.v2 @@ -0,0 +1,25 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (real_positions) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +exe real_positions + : ../real_positions.cpp + ../instantiate_cpp_exprgrammar.cpp + ../instantiate_cpp_grammar.cpp + ../instantiate_cpp_literalgrs.cpp + ../instantiate_defined_grammar.cpp + ../instantiate_re2c_lexer.cpp + ../instantiate_re2c_lexer_str.cpp + /boost/wave//boost_wave + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + diff --git a/src/boost/libs/wave/samples/real_positions/correct_token_positions.hpp b/src/boost/libs/wave/samples/real_positions/correct_token_positions.hpp new file mode 100644 index 000000000..e42fd08c9 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/correct_token_positions.hpp @@ -0,0 +1,126 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CORRECT_TOKEN_POSITIONS_HK_061106_INCLUDED) +#define CORRECT_TOKEN_POSITIONS_HK_061106_INCLUDED + +#include <boost/iterator/transform_iterator.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace detail +{ + // count the newlines in a C style comment + template <typename String> + unsigned count_newlines(String const& str) + { + unsigned newlines = 0; + typename String::size_type p = str.find_first_of('\n'); + while (p != String::npos) + { + ++newlines; + p = str.find_first_of('\n', p+1); + } + return newlines; + } + + // return the length of the last line in a C style comment + template <typename String> + unsigned last_line_length(String const& str) + { + unsigned len = str.size(); + typename String::size_type p = str.find_last_of('\n'); + if (p != String::npos) + len -= p; + return len; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// This is the position correcting functor +template <typename Token> +struct correct_token_position +: public boost::wave::context_policies::eat_whitespace<Token> +{ + correct_token_position(typename Token::string_type filename) + : pos(filename) {} + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'generated_token' will be called by the library whenever a + // token is about to be returned from the library. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 't' is the token about to be returned from the library. + // This function may alter the token, but in this case it must be + // implemented with a corresponding signature: + // + // TokenT const& + // generated_token(ContextT const& ctx, TokenT& t); + // + // which makes it possible to modify the token in place. + // + // The default behavior is to return the token passed as the parameter + // without modification. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + Token const& + generated_token(Context const& ctx, Token& token) + { + 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: + pos.set_line(current_pos.get_line()+1); + pos.set_column(1); + break; + + case T_CCOMMENT: + { + unsigned lines = detail::count_newlines(v); + if (lines > 0) { + pos.set_line(current_pos.get_line() + lines); + pos.set_column(detail::last_line_length(v)); + } + else { + pos.set_column(current_pos.get_column() + + detail::last_line_length(v)); + } + } + 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; +}; + +/////////////////////////////////////////////////////////////////////////////// + +#endif diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_cpp_exprgrammar.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_exprgrammar.cpp new file mode 100644 index 000000000..69c59d429 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_exprgrammar.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example: real_positions + + Explicit instantiation of the cpp_expression_grammar parsing function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +#include <boost/wave/grammars/cpp_expression_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the expression_grammar_gen template with the +// correct token type. This instantiates the corresponding parse function, +// which in turn instantiates the expression_grammar object (see +// wave/grammars/cpp_expression_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef lex_token<> token_type; + +template struct boost::wave::grammars::expression_grammar_gen<token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..2b4436c8e --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_grammar.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example: real_positions + + Explicit instantiation of the cpp_grammar parsing function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +#include <boost/wave/grammars/cpp_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef lex_token<> token_type; +typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_cpp_literalgrs.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_literalgrs.cpp new file mode 100644 index 000000000..422a3197e --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_cpp_literalgrs.cpp @@ -0,0 +1,46 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example: real_positions + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +#include <boost/wave/grammars/cpp_literal_grammar_gen.hpp> +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the intlit_grammar_gen, chlit_grammar_gen and +// floatlit_grammar_gen templates with the correct token type. This +// instantiates the corresponding parse function, which in turn instantiates +// the corresponding parser object. +// +/////////////////////////////////////////////////////////////////////////////// + +typedef lex_token<> token_type; + +template struct boost::wave::grammars::intlit_grammar_gen<token_type>; +#if BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_AUTOSELECT || \ + BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_FORCE_SIGNED +template struct boost::wave::grammars::chlit_grammar_gen<int, token_type>; +#endif +template struct boost::wave::grammars::chlit_grammar_gen<unsigned int, token_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_defined_grammar.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..2f6bd50df --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_defined_grammar.cpp @@ -0,0 +1,39 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Example: real_positions + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_iterator<lex_token<> > lexer_type; + +template struct boost::wave::grammars::defined_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer.cpp new file mode 100644 index 000000000..938d40e20 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer.cpp @@ -0,0 +1,62 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> // configuration data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. You will have to instantiate the +// new_lexer_gen<> template with the same iterator type, as you have used for +// instantiating the boost::wave::context<> object. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::cpplexer::new_lexer_gen< + std::string::iterator, boost::wave::util::file_position_type, + lex_token<boost::wave::util::file_position_type> >; +template struct boost::wave::cpplexer::new_lexer_gen< + std::string::const_iterator, boost::wave::util::file_position_type, + lex_token<boost::wave::util::file_position_type> >; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer_str.cpp b/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer_str.cpp new file mode 100644 index 000000000..e2affaf57 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/instantiate_re2c_lexer_str.cpp @@ -0,0 +1,61 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 +#include <boost/wave/wave_config.hpp> // configuration data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// If you've used another iterator type than std::string::iterator, you have to +// instantiate the new_lexer_gen<> template for this iterator type too. +// The reason is, that the library internally uses the new_lexer_gen<> +// template with a std::string::iterator. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) +template struct boost::wave::cpplexer::new_lexer_gen<std::string::iterator>; +template struct boost::wave::cpplexer::new_lexer_gen<std::string::const_iterator>; +#endif + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/real_positions/real_position_token.hpp b/src/boost/libs/wave/samples/real_positions/real_position_token.hpp new file mode 100644 index 000000000..413cf81c2 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/real_position_token.hpp @@ -0,0 +1,218 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + A C++ lexer token definition for the real_positions example + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED) +#define REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/token_ids.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/detail/atomic_count.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace impl { + +template <typename StringTypeT, typename PositionT> +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(boost::wave::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) + {} + + token_data(token_data const& rhs) + : 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; } + position_type const &get_position() const { return pos; } + position_type const &get_corrected_position() const + { return corrected_pos; } + bool is_eoi() const + { + return id == boost::wave::T_EOI; + } + + void set_token_id (boost::wave::token_id id_) { id = id_; } + void set_value (string_type const &value_) { value = value_; } + void set_position (position_type const &pos_) { pos = pos_; } + void set_corrected_position (position_type const &pos_) + { corrected_pos = pos_; } + + friend bool operator== (token_data const& lhs, token_data const& rhs) + { + // two tokens are considered equal even if they refer to different + // 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 + boost::detail::atomic_count refcnt; +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// forward declaration of the token type +template <typename PositionT = boost::wave::util::file_position_type> +class lex_token; + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_token +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename PositionT> +class lex_token +{ +public: + typedef BOOST_WAVE_STRINGTYPE string_type; + typedef PositionT position_type; + typedef impl::token_data<string_type, position_type> data_type; + + lex_token() + : data(new impl::token_data<string_type, position_type>()) + {} + + // construct an invalid token + explicit lex_token(int) + : data(new data_type(0)) + {} + + lex_token(lex_token const& rhs) + : data(rhs.data) + { + data->addref(); + } + + lex_token(boost::wave::token_id id_, string_type const &value_, + PositionT const &pos_) + : data(new impl::token_data<string_type, position_type>(id_, value_, pos_)) + {} + + ~lex_token() + { + if (0 == data->release()) + delete data; + data = 0; + } + + lex_token& operator=(lex_token const& rhs) + { + if (&rhs != this) { + if (0 == data->release()) + delete data; + + data = rhs.data; + data->addref(); + } + return *this; + } + +// accessors + operator boost::wave::token_id() const + { return boost::wave::token_id(*data); } + string_type const &get_value() const + { return data->get_value(); } + position_type const &get_position() const + { return data->get_position(); } + position_type const &get_corrected_position() const + { return data->get_corrected_position(); } + bool is_valid() const + { + using namespace boost::wave; + return 0 != data && token_id(*data) != boost::wave::T_UNKNOWN; + } + + void set_token_id (boost::wave::token_id id_) + { make_unique(); data->set_token_id(id_); } + void set_value (string_type const &value_) + { make_unique(); data->set_value(value_); } + void set_position (position_type const &pos_) + { make_unique(); data->set_position(pos_); } + void set_corrected_position (position_type const &pos_) + { make_unique(); data->set_corrected_position(pos_); } + + friend bool operator== (lex_token const& lhs, lex_token const& rhs) + { + return *(lhs.data) == *(rhs.data); + } + +// 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) + { return token_id(t); } + 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<string_type, position_type> *newdata = + new impl::token_data<string_type, position_type>(*data); + + data->release(); // release this reference, can't get zero + data = newdata; + } + + impl::token_data<string_type, position_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 <typename Position> +inline bool +token_is_valid(lex_token<Position> const& t) +{ + return t.is_valid(); +} + +#endif // !defined(REAL_POSITION_TOKEN_HPP_HK_061109_INCLUDED) diff --git a/src/boost/libs/wave/samples/real_positions/real_positions.cpp b/src/boost/libs/wave/samples/real_positions/real_positions.cpp new file mode 100644 index 000000000..3039af3c6 --- /dev/null +++ b/src/boost/libs/wave/samples/real_positions/real_positions.cpp @@ -0,0 +1,183 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample showing how to correct the positions inside the returned tokens in + a way that these appear to be consecutive (ignoring positions from macro + definitions). + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <iostream> +#include <fstream> +#include <iomanip> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include "real_position_token.hpp" // token class +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +#include "correct_token_positions.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// Special output operator for a lex_token. +// +// Note: this doesn't compile if BOOST_SPIRIT_DEBUG is defined. +// +/////////////////////////////////////////////////////////////////////////////// +template <typename PositionT> +inline std::ostream & +operator<< (std::ostream &stream, lex_token<PositionT> 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) << " (" + << "#" << setw(3) << BASEID_FROM_TOKEN(id); + + if (ExtTokenTypeMask & id) { + // this is an extended token id + if (AltTokenType == (id & ExtTokenOnlyMask)) { + stream << ", AltTokenType"; + } + else if (TriGraphTokenType == (id & ExtTokenOnlyMask)) { + stream << ", TriGraphTokenType"; + } + else if (AltExtTokenType == (id & ExtTokenOnlyMask)){ + stream << ", AltExtTokenType"; + } + } + + stream << "): >"; + + typedef typename lex_token<PositionT>::string_type string_type; + + string_type const& value = t.get_value(); + for (std::size_t i = 0; i < value.size(); ++i) { + switch (value[i]) { + case '\r': stream << "\\r"; break; + case '\n': stream << "\\n"; break; + case '\t': stream << "\\t"; break; + default: + stream << value[i]; + break; + } + } + stream << "<" << std::endl; + stream << " at: " << t.get_position().get_file() << " (" + << setw(3) << right << t.get_position().get_line() << "/" + << setw(2) << right << t.get_position().get_column() + << ")" << std::endl; + stream << " and: " << t.get_corrected_position().get_file() << " (" + << setw(3) << right << t.get_corrected_position().get_line() << "/" + << setw(2) << right << t.get_corrected_position().get_column() + << ")"; + + return stream; +} + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int main(int argc, char *argv[]) +{ + if (2 != argc) { + 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; + + try { + // Open and read in the specified input file. + std::ifstream instream(argv[1]); + std::string instring; + + if (!instream.is_open()) { + std::cerr << "Could not open input file: " << argv[1] << std::endl; + return -2; + } + instream.unsetf(std::ios::skipws); + instring = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); + + // 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<token_type> + 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<token_type> > + context_type; + + // This preprocessor hooks are used to correct the file positions inside + // the tokens returned from the library + correct_token_position<token_type> 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 + // parameters of the actual preprocessing (not done here). + // + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), argv[1], hooks); + + // analyze the input file + 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 << std::endl; + ++first; + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << std::endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + std::cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << std::endl; + return 4; + } + return 0; +} diff --git a/src/boost/libs/wave/samples/token_statistics/build/Jamfile.v2 b/src/boost/libs/wave/samples/token_statistics/build/Jamfile.v2 new file mode 100644 index 000000000..97134c3b2 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/build/Jamfile.v2 @@ -0,0 +1,36 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (token_statistics) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +SOURCES = + ../token_statistics + ../instantiate_xlex_lexer + ../instantiate_cpp_grammar + ../instantiate_defined_grammar + ; + +exe token_statistics + : + $(SOURCES) + /boost/wave//boost_wave + /boost/program_options//boost_program_options/<link>static + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + ; + +for local source in $(SOURCES) +{ + local requirements ; + requirements += <toolset-msvc:version>7.1:<rtti>off ; # workaround for compiler bug + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + obj $(source) : $(source).cpp : $(requirements) ; +} + diff --git a/src/boost/libs/wave/samples/token_statistics/collect_token_statistics.hpp b/src/boost/libs/wave/samples/token_statistics/collect_token_statistics.hpp new file mode 100644 index 000000000..815cf0e3e --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/collect_token_statistics.hpp @@ -0,0 +1,71 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Collect token statistics from the analysed files + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(COLLECT_TOKEN_STATISTICS_VERSION_HPP) +#define COLLECT_TOKEN_STATISTICS_VERSION_HPP + +#include <algorithm> +#include <map> + +#include <boost/assert.hpp> +#include <boost/wave/token_ids.hpp> + +/////////////////////////////////////////////////////////////////////////////// +class collect_token_statistics +{ + enum { + count = boost::wave::T_LAST_TOKEN - boost::wave::T_FIRST_TOKEN + }; + +public: + collect_token_statistics() + { + std::fill(&token_count[0], &token_count[count], 0); + } + + // account for the given token type + template <typename Token> + void operator() (Token const& token) + { + using boost::wave::token_id; + + int id = token_id(token) - boost::wave::T_FIRST_TOKEN; + BOOST_ASSERT(id < count); + ++token_count[id]; + } + + // print out the token statistics in descending order + void print() const + { + using namespace boost::wave; + typedef std::multimap<int, token_id> ids_type; + + ids_type ids; + for (unsigned int i = 0; i < count; ++i) + { + ids.insert(ids_type::value_type( + token_count[i], token_id(i + T_FIRST_TOKEN))); + } + + ids_type::reverse_iterator rend = ids.rend(); + for(ids_type::reverse_iterator rit = ids.rbegin(); rit != rend; ++rit) + { + std::cout << boost::wave::get_token_name((*rit).second) << ": " + << (*rit).first << std::endl; + } + } + +private: + int token_count[count]; +}; + +#endif // !defined(COLLECT_TOKEN_STATISTICS_VERSION_HPP) diff --git a/src/boost/libs/wave/samples/token_statistics/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/samples/token_statistics/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..14cabab6b --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/instantiate_cpp_grammar.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Collect token statistics + Explicit instantiation of the cpp_grammar template + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "token_statistics.hpp" + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "xlex_iterator.hpp" + +#include <boost/wave/grammars/cpp_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::cpplexer::xlex::xlex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/token_statistics/instantiate_defined_grammar.cpp b/src/boost/libs/wave/samples/token_statistics/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..c54b9f9e3 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/instantiate_defined_grammar.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Collect token statistics + Explicit instantiation of the defined_grammar template + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "token_statistics.hpp" + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "xlex_iterator.hpp" + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::xlex::xlex_iterator< + boost::wave::cpplexer::lex_token<> > + lexer_type; +template struct boost::wave::grammars::defined_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/token_statistics/instantiate_xlex_lexer.cpp b/src/boost/libs/wave/samples/token_statistics/instantiate_xlex_lexer.cpp new file mode 100644 index 000000000..a217feac2 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/instantiate_xlex_lexer.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Explicit instantiation of the xlex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <boost/wave.hpp> + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include "xlex_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include "xlex/xlex_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the parameters +// supplied while instantiating the context<> template. +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::cpplexer::xlex::new_lexer_gen<std::string::iterator>; + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/token_statistics/token_statistics.cpp b/src/boost/libs/wave/samples/token_statistics/token_statistics.cpp new file mode 100644 index 000000000..dc2ecdd36 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/token_statistics.cpp @@ -0,0 +1,259 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "token_statistics.hpp" // config data + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/program_options.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token class +#include "xlex_iterator.hpp" // lexer class + +#include "collect_token_statistics.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// import required names +using namespace boost::spirit::classic; + +using std::string; +using std::vector; +using std::cout; +using std::cerr; +using std::endl; +using std::ifstream; +using std::ostream; +using std::istreambuf_iterator; + +namespace po = boost::program_options; + +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_util { + + // predicate to extract all positional arguments from the command line + struct is_argument { + + bool operator()(po::option const &opt) + { + return (opt.position_key == -1) ? true : false; + } + }; + +/////////////////////////////////////////////////////////////////////////////// +} + +/////////////////////////////////////////////////////////////////////////////// +// print the current version + +int print_version() +{ +// get time of last compilation of this file +boost::wave::util::time_conversion_helper compilation_time(__DATE__ " " __TIME__); + +// calculate the number of days since May 9 2005 +// (the day the token_statistics project was started) +std::tm first_day; + + std::memset (&first_day, 0, sizeof(std::tm)); + first_day.tm_mon = 4; // May + first_day.tm_mday = 9; // 09 + first_day.tm_year = 105; // 2005 + +long seconds = long(std::difftime(compilation_time.get_time(), + std::mktime(&first_day))); + + cout + << TOKEN_STATISTICS_VERSION_MAJOR << '.' + << TOKEN_STATISTICS_VERSION_MINOR << '.' + << TOKEN_STATISTICS_VERSION_SUBMINOR << '.' + << seconds/(3600*24); // get number of days from seconds + return 1; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// +int +do_actual_work(vector<string> const &arguments, po::variables_map const &vm) +{ +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // this object keeps track of all the statistics + collect_token_statistics stats; + + // collect the token statistics for all arguments given + vector<string>::const_iterator lastfile = arguments.end(); + for (vector<string>::const_iterator file_it = arguments.begin(); + file_it != lastfile; ++file_it) + { + ifstream instream((*file_it).c_str()); + string instring; + + if (!instream.is_open()) { + cerr << "token_statistics: could not open input file: " + << *file_it << endl; + continue; + } + instream.unsetf(std::ios::skipws); + instring = string(istreambuf_iterator<char>(instream.rdbuf()), + istreambuf_iterator<char>()); + + // The template boost::wave::cpplexer::lex_token<> is the token type to be + // used by the Wave library. + typedef boost::wave::cpplexer::xlex::xlex_iterator< + boost::wave::cpplexer::lex_token<> > + lexer_type; + typedef boost::wave::context< + std::string::iterator, lexer_type + > context_type; + + // The preprocessor iterator shouldn't be constructed directly. It is + // to be generated through a wave::context<> object. This wave:context<> + // object is additionally to be used to initialize and define different + // parameters of the actual preprocessing. + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), (*file_it).c_str()); + + // add include directories to the include path + if (vm.count("include")) { + vector<string> const &paths = + vm["include"].as<vector<string> >(); + vector<string>::const_iterator end = paths.end(); + for (vector<string>::const_iterator cit = paths.begin(); + cit != end; ++cit) + { + ctx.add_include_path((*cit).c_str()); + } + } + + // add system include directories to the include path + if (vm.count("sysinclude")) { + vector<string> const &syspaths = + vm["sysinclude"].as<vector<string> >(); + vector<string>::const_iterator end = syspaths.end(); + for (vector<string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + ctx.add_sysinclude_path((*cit).c_str()); + } + } + + // analyze the actual file + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + + while (first != last) { + current_position = (*first).get_position(); + stats(*first); + ++first; + } + } + + // print out the collected statistics + stats.print(); + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << endl; + return 4; + } + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// here we go! +int +main (int argc, char *argv[]) +{ + try { + // analyze the command line options and arguments + vector<string> syspathes; + po::options_description desc("Usage: token_statistics [options] file ..."); + + desc.add_options() + ("help,h", "print out program usage (this message)") + ("version,v", "print the version number") + ("include,I", po::value<vector<string> >(), + "specify additional include directory") + ("sysinclude,S", po::value<vector<string> >(), + "specify additional system include directory") + ; + + using namespace boost::program_options::command_line_style; + + po::parsed_options opts = po::parse_command_line(argc, argv, desc, unix_style); + po::variables_map vm; + + po::store(opts, vm); + po::notify(vm); + + if (vm.count("help")) { + cout << desc << endl; + return 1; + } + + if (vm.count("version")) { + return print_version(); + } + + // extract the arguments from the parsed command line + vector<po::option> arguments; + + std::remove_copy_if(opts.options.begin(), opts.options.end(), + inserter(arguments, arguments.end()), cmd_line_util::is_argument()); + + // if there is no input file given, then exit + if (0 == arguments.size() || 0 == arguments[0].value.size()) { + cerr << "token_statistics: No input file given. " + << "Use --help to get a hint." << endl; + return 5; + } + + // iterate over all given input files + return do_actual_work(arguments[0].value , vm); + } + catch (std::exception const& e) { + cout << "token_statistics: exception caught: " << e.what() << endl; + return 6; + } + catch (...) { + cerr << "token_statistics: unexpected exception caught." << endl; + return 7; + } +} + diff --git a/src/boost/libs/wave/samples/token_statistics/token_statistics.hpp b/src/boost/libs/wave/samples/token_statistics/token_statistics.hpp new file mode 100644 index 000000000..bd84a6ad0 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/token_statistics.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Collect token statistics from the analysed files + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(TOKEN_STATISTICS_HPP) +#define TOKEN_STATISTICS_HPP + +/////////////////////////////////////////////////////////////////////////////// +// include often used files from the stdlib +#include <iostream> +#include <fstream> +#include <string> +#include <vector> + +/////////////////////////////////////////////////////////////////////////////// +// include boost config +#include <boost/config.hpp> // global configuration information +#include <boost/assert.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// build version +#include "token_statistics_version.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// Now include the configuration stuff for the Wave library itself +#include <boost/wave/wave_config.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// MSVC specific #pragma's +#if defined(BOOST_MSVC) +#pragma warning (disable: 4355) // 'this' used in base member initializer list +#pragma warning (disable: 4800) // forcing value to bool 'true' or 'false' +#pragma inline_depth(255) +#pragma inline_recursion(on) +#endif // defined(BOOST_MSVC) + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/pool/pool_alloc.hpp> + +#endif // !defined(TOKEN_STATISTICS_HPP) diff --git a/src/boost/libs/wave/samples/token_statistics/token_statistics_version.hpp b/src/boost/libs/wave/samples/token_statistics/token_statistics_version.hpp new file mode 100644 index 000000000..5092a9e6e --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/token_statistics_version.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Collect token statistics from the analysed files + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(TOKEN_STATISTICS_VERSION_HPP) +#define TOKEN_STATISTICS_VERSION_HPP + +#define TOKEN_STATISTICS_VERSION_MAJOR 0 +#define TOKEN_STATISTICS_VERSION_MINOR 1 +#define TOKEN_STATISTICS_VERSION_SUBMINOR 0 + +#endif // !defined(TOKEN_STATISTICS_VERSION_HPP) diff --git a/src/boost/libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp b/src/boost/libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp new file mode 100644 index 000000000..c9e8c4cd2 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp @@ -0,0 +1,588 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Xpressive based C++ lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(XLEX_LEXER_HPP) +#define XLEX_LEXER_HPP + +#include <string> +#include <cstdio> +#include <cstdarg> +#if defined(BOOST_SPIRIT_DEBUG) +#include <iostream> +#endif // defined(BOOST_SPIRIT_DEBUG) + +#include <boost/concept_check.hpp> +#include <boost/assert.hpp> +#include <boost/spirit/include/classic_core.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/cpplexer/validate_universal_char.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 +#include <boost/wave/cpplexer/detect_include_guards.hpp> +#endif +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> + +// reuse the default token type +#include "../xlex_iterator.hpp" + +// include the xpressive headers +#include "xpressive_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace xlex { +namespace lexer { + +/////////////////////////////////////////////////////////////////////////////// +// +// encapsulation of the xpressive based C++ lexer +// +/////////////////////////////////////////////////////////////////////////////// + +template < + typename Iterator, + typename Position = boost::wave::util::file_position_type +> +class lexer +{ +public: + typedef char char_type; + typedef boost::wave::cpplexer::lex_token<Position> token_type; + typedef typename token_type::string_type string_type; + + lexer(Iterator const &first, Iterator const &last, + Position const &pos, boost::wave::language_support language); + ~lexer() {} + + token_type& get(token_type& t); + void set_position(Position const &pos) + { + // set position has to change the file name and line number only + filename = pos.get_file(); + line = pos.get_line(); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + bool has_include_guards(std::string& guard_name) const + { return guards.detected(guard_name); } +#endif + +private: + typedef xpressive_lexer<Iterator, token_id> lexer_type; + typedef typename lexer_type::callback_type callback_type; + + lexer_type xlexer; + Iterator first; + Iterator last; + + string_type filename; + int line; + bool at_eof; + boost::wave::language_support language; + +// initialization data (regular expressions for the token definitions) + struct lexer_data { + token_id tokenid; // token data + char_type const *tokenregex; // associated token to match + callback_type tokencb; // associated callback function + }; + + static lexer_data const init_data[]; // common patterns + static lexer_data const init_data_cpp[]; // C++ only patterns + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + boost::wave::cpplexer::include_guards<token_type> guards; +#endif +}; + +/////////////////////////////////////////////////////////////////////////////// +// helper for initializing token data +#define TOKEN_DATA(id, regex) \ + { id, regex, 0 } + +#define TOKEN_DATA_EX(id, regex, callback) \ + { id, regex, callback } + +/////////////////////////////////////////////////////////////////////////////// +// data required for initialization of the lexer (token definitions) +#define OR "|" +#define Q(c) "\\" c +#define TRI(c) Q("?") Q("?") c + +// definition of some subtoken regexps to simplify the regex definitions +#define BLANK "[ \t]" +#define CCOMMENT Q("/") Q("*") ".*?" Q("*") Q("/") + +#define PPSPACE "(" BLANK OR CCOMMENT ")*" + +#define OCTALDIGIT "[0-7]" +#define DIGIT "[0-9]" +#define HEXDIGIT "[0-9a-fA-F]" +#define SIGN "[-+]?" +#define EXPONENT "(" "[eE]" SIGN "[0-9]+" ")" + +#define INTEGER "(" \ + "(0x|0X)" HEXDIGIT "+" OR \ + "0" OCTALDIGIT "*" OR \ + "[1-9]" DIGIT "*" \ + ")" + +#define INTEGER_SUFFIX "(" "[uU][lL]?|[lL][uU]?" ")" +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 +#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \ + "(" "[lL][lL]" ")" "[uU]" "?" OR \ + "i64" \ + ")" +#else +#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "[lL][lL]" ")" OR \ + "(" "[lL][lL]" ")" "[uU]" "?" ")" +#endif +#define FLOAT_SUFFIX "(" "[fF][lL]?|[lL][fF]?" ")" +#define CHAR_SPEC "L?" + +#define BACKSLASH "(" Q("\\") OR TRI(Q("/")) ")" +#define ESCAPESEQ BACKSLASH "(" \ + "[abfnrtv?'\"]" OR \ + BACKSLASH OR \ + "x" HEXDIGIT "+" OR \ + OCTALDIGIT OCTALDIGIT "?" OCTALDIGIT "?" \ + ")" +#define HEXQUAD HEXDIGIT HEXDIGIT HEXDIGIT HEXDIGIT +#define UNIVERSALCHAR BACKSLASH "(" \ + "u" HEXQUAD OR \ + "U" HEXQUAD HEXQUAD \ + ")" + +#define POUNDDEF "(" "#" OR TRI("=") OR Q("%:") ")" +#define NEWLINEDEF "(" "\n" OR "\r\n" OR "\r" ")" + +#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 +#define INCLUDEDEF "(include_next|include)" +#else +#define INCLUDEDEF "include" +#endif + +/////////////////////////////////////////////////////////////////////////////// +// common C++/C99 token definitions +template <typename Iterator, typename Position> +typename lexer<Iterator, Position>::lexer_data const +lexer<Iterator, Position>::init_data[] = +{ + TOKEN_DATA(T_CCOMMENT, CCOMMENT), + TOKEN_DATA(T_CPPCOMMENT, Q("/") Q("/.*?") NEWLINEDEF ), + TOKEN_DATA(T_CHARLIT, CHAR_SPEC "'" + "(" ESCAPESEQ OR "[^\n\r']" OR UNIVERSALCHAR ")+" "'"), + TOKEN_DATA(T_STRINGLIT, CHAR_SPEC Q("\"") + "(" ESCAPESEQ OR "[^\n\r\"]" OR UNIVERSALCHAR ")*" Q("\"")), + TOKEN_DATA(T_ANDAND, "&&"), + TOKEN_DATA(T_ANDASSIGN, "&="), + TOKEN_DATA(T_AND, "&"), + TOKEN_DATA(T_EQUAL, "=="), + TOKEN_DATA(T_ASSIGN, "="), + TOKEN_DATA(T_ORASSIGN, Q("|=")), + TOKEN_DATA(T_ORASSIGN_TRIGRAPH, TRI("!=")), + TOKEN_DATA(T_OROR, Q("|") Q("|")), + TOKEN_DATA(T_OROR_TRIGRAPH, TRI("!") Q("|") OR Q("|") TRI("!") OR TRI("!") TRI("!")), + TOKEN_DATA(T_OR, Q("|")), + TOKEN_DATA(T_OR_TRIGRAPH, TRI("!")), + TOKEN_DATA(T_XORASSIGN, Q("^=")), + TOKEN_DATA(T_XORASSIGN_TRIGRAPH, TRI("'=")), + TOKEN_DATA(T_XOR, Q("^")), + TOKEN_DATA(T_XOR_TRIGRAPH, TRI("'")), + TOKEN_DATA(T_COMMA, ","), + TOKEN_DATA(T_RIGHTBRACKET_ALT, ":>"), + TOKEN_DATA(T_COLON, ":"), + TOKEN_DATA(T_DIVIDEASSIGN, Q("/=")), + TOKEN_DATA(T_DIVIDE, Q("/")), + TOKEN_DATA(T_ELLIPSIS, Q(".") Q(".") Q(".")), + TOKEN_DATA(T_SHIFTRIGHTASSIGN, ">>="), + TOKEN_DATA(T_SHIFTRIGHT, ">>"), + TOKEN_DATA(T_GREATEREQUAL, ">="), + TOKEN_DATA(T_GREATER, ">"), + TOKEN_DATA(T_LEFTBRACE, Q("{")), + TOKEN_DATA(T_SHIFTLEFTASSIGN, "<<="), + TOKEN_DATA(T_SHIFTLEFT, "<<"), + TOKEN_DATA(T_LEFTBRACE_ALT, "<" Q("%")), + TOKEN_DATA(T_LESSEQUAL, "<="), + TOKEN_DATA(T_LEFTBRACKET_ALT, "<:"), + TOKEN_DATA(T_LESS, "<"), + TOKEN_DATA(T_LEFTBRACE_TRIGRAPH, TRI("<")), + TOKEN_DATA(T_LEFTPAREN, Q("(")), + TOKEN_DATA(T_LEFTBRACKET, Q("[")), + TOKEN_DATA(T_LEFTBRACKET_TRIGRAPH, TRI(Q("("))), + TOKEN_DATA(T_MINUSMINUS, Q("-") Q("-")), + TOKEN_DATA(T_MINUSASSIGN, Q("-=")), + TOKEN_DATA(T_ARROW, Q("->")), + TOKEN_DATA(T_MINUS, Q("-")), + TOKEN_DATA(T_POUND_POUND_ALT, Q("%:") Q("%:")), + TOKEN_DATA(T_PERCENTASSIGN, Q("%=")), + TOKEN_DATA(T_RIGHTBRACE_ALT, Q("%>")), + TOKEN_DATA(T_POUND_ALT, Q("%:")), + TOKEN_DATA(T_PERCENT, Q("%")), + TOKEN_DATA(T_NOTEQUAL, "!="), + TOKEN_DATA(T_NOT, "!"), + TOKEN_DATA(T_PLUSASSIGN, Q("+=")), + TOKEN_DATA(T_PLUSPLUS, Q("+") Q("+")), + TOKEN_DATA(T_PLUS, Q("+")), + TOKEN_DATA(T_RIGHTBRACE, Q("}")), + TOKEN_DATA(T_RIGHTBRACE_TRIGRAPH, TRI(">")), + TOKEN_DATA(T_RIGHTPAREN, Q(")")), + TOKEN_DATA(T_RIGHTBRACKET, Q("]")), + TOKEN_DATA(T_RIGHTBRACKET_TRIGRAPH, TRI(Q(")"))), + TOKEN_DATA(T_SEMICOLON, ";"), + TOKEN_DATA(T_STARASSIGN, Q("*=")), + TOKEN_DATA(T_STAR, Q("*")), + TOKEN_DATA(T_COMPL, Q("~")), + TOKEN_DATA(T_COMPL_TRIGRAPH, TRI("-")), + TOKEN_DATA(T_ASM, "asm"), + TOKEN_DATA(T_AUTO, "auto"), + TOKEN_DATA(T_BOOL, "bool"), + TOKEN_DATA(T_FALSE, "false"), + TOKEN_DATA(T_TRUE, "true"), + TOKEN_DATA(T_BREAK, "break"), + TOKEN_DATA(T_CASE, "case"), + TOKEN_DATA(T_CATCH, "catch"), + TOKEN_DATA(T_CHAR, "char"), + TOKEN_DATA(T_CLASS, "class"), + TOKEN_DATA(T_CONSTCAST, "const_cast"), + TOKEN_DATA(T_CONST, "const"), + TOKEN_DATA(T_CONTINUE, "continue"), + TOKEN_DATA(T_DEFAULT, "default"), + TOKEN_DATA(T_DELETE, "delete"), + TOKEN_DATA(T_DOUBLE, "double"), + TOKEN_DATA(T_DO, "do"), + TOKEN_DATA(T_DYNAMICCAST, "dynamic_cast"), + TOKEN_DATA(T_ELSE, "else"), + TOKEN_DATA(T_ENUM, "enum"), + TOKEN_DATA(T_EXPLICIT, "explicit"), + TOKEN_DATA(T_EXPORT, "export"), + TOKEN_DATA(T_EXTERN, "extern"), + TOKEN_DATA(T_FLOAT, "float"), + TOKEN_DATA(T_FOR, "for"), + TOKEN_DATA(T_FRIEND, "friend"), + TOKEN_DATA(T_GOTO, "goto"), + TOKEN_DATA(T_IF, "if"), + TOKEN_DATA(T_INLINE, "inline"), + TOKEN_DATA(T_INT, "int"), + TOKEN_DATA(T_LONG, "long"), + TOKEN_DATA(T_MUTABLE, "mutable"), + TOKEN_DATA(T_NAMESPACE, "namespace"), + TOKEN_DATA(T_NEW, "new"), + TOKEN_DATA(T_OPERATOR, "operator"), + TOKEN_DATA(T_PRIVATE, "private"), + TOKEN_DATA(T_PROTECTED, "protected"), + TOKEN_DATA(T_PUBLIC, "public"), + TOKEN_DATA(T_REGISTER, "register"), + TOKEN_DATA(T_REINTERPRETCAST, "reinterpret_cast"), + TOKEN_DATA(T_RETURN, "return"), + TOKEN_DATA(T_SHORT, "short"), + TOKEN_DATA(T_SIGNED, "signed"), + TOKEN_DATA(T_SIZEOF, "sizeof"), + TOKEN_DATA(T_STATICCAST, "static_cast"), + TOKEN_DATA(T_STATIC, "static"), + TOKEN_DATA(T_STRUCT, "struct"), + TOKEN_DATA(T_SWITCH, "switch"), + TOKEN_DATA(T_TEMPLATE, "template"), + TOKEN_DATA(T_THIS, "this"), + TOKEN_DATA(T_THROW, "throw"), + TOKEN_DATA(T_TRY, "try"), + TOKEN_DATA(T_TYPEDEF, "typedef"), + TOKEN_DATA(T_TYPEID, "typeid"), + TOKEN_DATA(T_TYPENAME, "typename"), + TOKEN_DATA(T_UNION, "union"), + TOKEN_DATA(T_UNSIGNED, "unsigned"), + TOKEN_DATA(T_USING, "using"), + TOKEN_DATA(T_VIRTUAL, "virtual"), + TOKEN_DATA(T_VOID, "void"), + TOKEN_DATA(T_VOLATILE, "volatile"), + TOKEN_DATA(T_WCHART, "wchar_t"), + TOKEN_DATA(T_WHILE, "while"), +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + TOKEN_DATA(T_MSEXT_INT8, "__int8"), + TOKEN_DATA(T_MSEXT_INT16, "__int16"), + TOKEN_DATA(T_MSEXT_INT32, "__int32"), + TOKEN_DATA(T_MSEXT_INT64, "__int64"), + TOKEN_DATA(T_MSEXT_BASED, "_?" "_based"), + TOKEN_DATA(T_MSEXT_DECLSPEC, "_?" "_declspec"), + TOKEN_DATA(T_MSEXT_CDECL, "_?" "_cdecl"), + TOKEN_DATA(T_MSEXT_FASTCALL, "_?" "_fastcall"), + TOKEN_DATA(T_MSEXT_STDCALL, "_?" "_stdcall"), + TOKEN_DATA(T_MSEXT_TRY , "__try"), + TOKEN_DATA(T_MSEXT_EXCEPT, "__except"), + TOKEN_DATA(T_MSEXT_FINALLY, "__finally"), + TOKEN_DATA(T_MSEXT_LEAVE, "__leave"), + TOKEN_DATA(T_MSEXT_INLINE, "_?" "_inline"), + TOKEN_DATA(T_MSEXT_ASM, "_?" "_asm"), + TOKEN_DATA(T_MSEXT_PP_REGION, POUNDDEF PPSPACE "region"), + TOKEN_DATA(T_MSEXT_PP_ENDREGION, POUNDDEF PPSPACE "endregion"), +#endif // BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + TOKEN_DATA(T_PP_DEFINE, POUNDDEF PPSPACE "define"), + TOKEN_DATA(T_PP_IFDEF, POUNDDEF PPSPACE "ifdef"), + TOKEN_DATA(T_PP_IFNDEF, POUNDDEF PPSPACE "ifndef"), + TOKEN_DATA(T_PP_IF, POUNDDEF PPSPACE "if"), + TOKEN_DATA(T_PP_ELSE, POUNDDEF PPSPACE "else"), + TOKEN_DATA(T_PP_ELIF, POUNDDEF PPSPACE "elif"), + TOKEN_DATA(T_PP_ENDIF, POUNDDEF PPSPACE "endif"), + TOKEN_DATA(T_PP_ERROR, POUNDDEF PPSPACE "error"), + TOKEN_DATA(T_PP_QHEADER, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE Q("\"") "[^\n\r\"]+" Q("\"")), + TOKEN_DATA(T_PP_HHEADER, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE "<" "[^\n\r>]+" ">"), + TOKEN_DATA(T_PP_INCLUDE, POUNDDEF PPSPACE \ + INCLUDEDEF PPSPACE), + TOKEN_DATA(T_PP_LINE, POUNDDEF PPSPACE "line"), + TOKEN_DATA(T_PP_PRAGMA, POUNDDEF PPSPACE "pragma"), + TOKEN_DATA(T_PP_UNDEF, POUNDDEF PPSPACE "undef"), + TOKEN_DATA(T_PP_WARNING, POUNDDEF PPSPACE "warning"), + TOKEN_DATA(T_FLOATLIT, + "(" DIGIT "*" Q(".") DIGIT "+" OR DIGIT "+" Q(".") ")" + EXPONENT "?" FLOAT_SUFFIX "?" OR + DIGIT "+" EXPONENT FLOAT_SUFFIX "?"), + TOKEN_DATA(T_LONGINTLIT, INTEGER LONGINTEGER_SUFFIX), + TOKEN_DATA(T_INTLIT, INTEGER INTEGER_SUFFIX "?"), +#if BOOST_WAVE_USE_STRICT_LEXER != 0 + TOKEN_DATA(T_IDENTIFIER, "([a-zA-Z_]" OR UNIVERSALCHAR ")([a-zA-Z0-9_]" OR UNIVERSALCHAR ")*"), +#else + TOKEN_DATA(T_IDENTIFIER, "([a-zA-Z_$]" OR UNIVERSALCHAR ")([a-zA-Z0-9_$]" OR UNIVERSALCHAR ")*"), +#endif + TOKEN_DATA(T_SPACE, BLANK "+"), + TOKEN_DATA(T_SPACE2, "[\v\f]+"), + TOKEN_DATA(T_CONTLINE, Q("\\") "\n"), + TOKEN_DATA(T_NEWLINE, NEWLINEDEF), + TOKEN_DATA(T_POUND_POUND, "##"), + TOKEN_DATA(T_POUND_POUND_TRIGRAPH, TRI("=") TRI("=")), + TOKEN_DATA(T_POUND, "#"), + TOKEN_DATA(T_POUND_TRIGRAPH, TRI("=")), + TOKEN_DATA(T_ANY_TRIGRAPH, TRI(Q("/"))), + TOKEN_DATA(T_QUESTION_MARK, Q("?")), + TOKEN_DATA(T_DOT, Q(".")), + TOKEN_DATA(T_ANY, "."), + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// C++ only token definitions +template <typename Iterator, typename Position> +typename lexer<Iterator, Position>::lexer_data const +lexer<Iterator, Position>::init_data_cpp[] = +{ + TOKEN_DATA(T_AND_ALT, "bitand"), + TOKEN_DATA(T_ANDASSIGN_ALT, "and_eq"), + TOKEN_DATA(T_ANDAND_ALT, "and"), + TOKEN_DATA(T_OR_ALT, "bitor"), + TOKEN_DATA(T_ORASSIGN_ALT, "or_eq"), + TOKEN_DATA(T_OROR_ALT, "or"), + TOKEN_DATA(T_XORASSIGN_ALT, "xor_eq"), + TOKEN_DATA(T_XOR_ALT, "xor"), + TOKEN_DATA(T_NOTEQUAL_ALT, "not_eq"), + TOKEN_DATA(T_NOT_ALT, "not"), + TOKEN_DATA(T_COMPL_ALT, "compl"), + TOKEN_DATA(T_ARROWSTAR, Q("->") Q("*")), + TOKEN_DATA(T_DOTSTAR, Q(".") Q("*")), + TOKEN_DATA(T_COLON_COLON, "::"), + { token_id(0) } // this should be the last entry +}; + +/////////////////////////////////////////////////////////////////////////////// +// undefine macros, required for regular expression definitions +#undef INCLUDEDEF +#undef POUNDDEF +#undef CCOMMENT +#undef PPSPACE +#undef DIGIT +#undef OCTALDIGIT +#undef HEXDIGIT +#undef SIGN +#undef EXPONENT +#undef LONGINTEGER_SUFFIX +#undef INTEGER_SUFFIX +#undef INTEGER +#undef FLOAT_SUFFIX +#undef CHAR_SPEC +#undef BACKSLASH +#undef ESCAPESEQ +#undef HEXQUAD +#undef UNIVERSALCHAR + +#undef Q +#undef TRI +#undef OR + +#undef TOKEN_DATA +#undef TOKEN_DATA_EX + +/////////////////////////////////////////////////////////////////////////////// +// initialize cpp lexer +template <typename Iterator, typename Position> +inline +lexer<Iterator, Position>::lexer(Iterator const &first, + Iterator const &last, Position const &pos, + boost::wave::language_support language) +: first(first), last(last), + filename(pos.get_file()), line(0), at_eof(false), language(language) +{ +// if in C99 mode, some of the keywords/operators are not valid + if (!boost::wave::need_c99(language)) { + for (int j = 0; 0 != init_data_cpp[j].tokenid; ++j) { + xlexer.register_regex(init_data_cpp[j].tokenregex, + init_data_cpp[j].tokenid, init_data_cpp[j].tokencb); + } + } + +// tokens valid for C++ and C99 + for (int i = 0; 0 != init_data[i].tokenid; ++i) { + xlexer.register_regex(init_data[i].tokenregex, init_data[i].tokenid, + init_data[i].tokencb); + } +} + +/////////////////////////////////////////////////////////////////////////////// +// get the next token from the input stream +template <typename Iterator, typename Position> +inline boost::wave::cpplexer::lex_token<Position>& +lexer<Iterator, Position>::get(boost::wave::cpplexer::lex_token<Position>& t) +{ + using namespace boost::wave; // to import token ids to this scope + + if (at_eof) + return t = cpplexer::lex_token<Position>(); // 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 + + if (T_IDENTIFIER == id) { + // test identifier characters for validity (throws if invalid chars found) + if (!boost::wave::need_no_character_validation(language)) { + cpplexer::impl::validate_identifier_name(value, line, -1, filename); + } + } + else if (T_STRINGLIT == id || T_CHARLIT == id) { + // test literal characters for validity (throws if invalid chars found) + if (!boost::wave::need_no_character_validation(language)) { + cpplexer::impl::validate_literal(value, line, -1, filename); + } + } + else if (T_EOF == id) { + // 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(); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + cpplexer::lex_token<Position> tok(id, value, Position(filename, line, -1)); + return t = guards.detect_guard(tok); +#else + return t = cpplexer::lex_token<Position>(id, value, + Position(filename, line, -1)); +#endif +} + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_functor +// +/////////////////////////////////////////////////////////////////////////////// +template < + typename Iterator, + typename Position = boost::wave::util::file_position_type +> +class xlex_functor +: public xlex_input_interface<typename lexer<Iterator, Position>::token_type> +{ +public: + + typedef typename lexer<Iterator, Position>::token_type token_type; + + xlex_functor(Iterator const &first, Iterator const &last, + Position const &pos, boost::wave::language_support language) + : lexer_(first, last, pos, language) + {} + virtual ~xlex_functor() {} + +// get the next token from the input stream + 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); } +#endif + +private: + lexer<Iterator, Position> lexer_; +}; + +} // namespace lexer + +/////////////////////////////////////////////////////////////////////////////// +// +// The new_lexer_gen<>::new_lexer function (declared in cpp_slex_token.hpp) +// should be defined inline, if the lex_functor shouldn't be instantiated +// separately from the lex_iterator. +// +// Separate (explicit) instantiation helps to reduce compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_XLEX_NEW_LEXER_INLINE +#else +#define BOOST_WAVE_XLEX_NEW_LEXER_INLINE inline +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// The 'new_lexer' function allows the opaque generation of a new lexer object. +// It is coupled to the iterator type to allow to decouple the lexer/iterator +// configurations at compile time. +// +// This function is declared inside the xlex_interface.hpp file, which is +// referenced by the source file calling the lexer and the source file, which +// instantiates the lex_functor. But it is defined here, so it will be +// instantiated only while compiling the source file, which instantiates the +// lex_functor. While the xlex_interface.hpp file may be included everywhere, +// this file (xlex_lexer.hpp) should be included only once. This allows +// to decouple the lexer interface from the lexer implementation and reduces +// compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename Iterator, typename Position> +BOOST_WAVE_XLEX_NEW_LEXER_INLINE +lex_input_interface<boost::wave::cpplexer::lex_token<Position> > * +new_lexer_gen<Iterator, Position>::new_lexer(Iterator const &first, + Iterator const &last, Position const &pos, + wave::language_support language) +{ + return new lexer::xlex_functor<Iterator, Position>( + first, last, pos, language); +} + +#undef BOOST_WAVE_XLEX_NEW_LEXER_INLINE + +/////////////////////////////////////////////////////////////////////////////// +} // namespace xlex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(XLEX_LEXER_HPP) diff --git a/src/boost/libs/wave/samples/token_statistics/xlex/xpressive_lexer.hpp b/src/boost/libs/wave/samples/token_statistics/xlex/xpressive_lexer.hpp new file mode 100644 index 000000000..4038742e6 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/xlex/xpressive_lexer.hpp @@ -0,0 +1,135 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Xpressive based generic lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(XPRESSIVE_LEXER_HPP) +#define XPRESSIVE_LEXER_HPP + +#include <string> +#include <vector> +#include <utility> +#include <algorithm> + +#include <boost/detail/iterator.hpp> +#include <boost/xpressive/xpressive.hpp> + +namespace boost { +namespace wave { +namespace cpplexer { +namespace xlex { + +/////////////////////////////////////////////////////////////////////////////// +template < + typename Iterator = char const*, + typename Token = int, + typename Callback = bool (*)( + Iterator const&, Iterator&, Iterator const&, Token const&) +> +class xpressive_lexer +{ +private: + typedef typename boost::iterators::iterator_value<Iterator>::type + char_type; + typedef std::basic_string<char_type> string_type; + + // this represents a single token to match + struct regex_info + { + typedef boost::xpressive::basic_regex<Iterator> regex_type; + + string_type str; + Token token; + regex_type regex; + Callback callback; + + regex_info(string_type const& str, Token const& token, + Callback const& callback) + : str(str), token(token), + regex(regex_type::compile(str)), + callback(callback) + {} + + // these structures are to be ordered by the token id + friend bool operator< (regex_info const& lhs, regex_info const& rhs) + { + return lhs.token < rhs.token; + } + }; + + typedef std::vector<regex_info> regex_list_type; + +public: + typedef Callback callback_type; + + xpressive_lexer() {} + + // register a the regex with the lexer + void register_regex(string_type const& regex, Token const& id, + Callback const& cb = Callback()); + + // match the given input and return the next recognized token + Token next_token(Iterator &first, Iterator const& last, string_type& token); + +private: + regex_list_type regex_list; +}; + +/////////////////////////////////////////////////////////////////////////////// +template <typename Iterator, typename Token, typename Callback> +inline void +xpressive_lexer<Iterator, Token, Callback>::register_regex( + string_type const& regex, Token const& id, Callback const& cb) +{ + regex_list.push_back(regex_info(regex, id, cb)); +} + +/////////////////////////////////////////////////////////////////////////////// +template <typename Iterator, typename Token, typename Callback> +inline Token +xpressive_lexer<Iterator, Token, Callback>::next_token( + Iterator &first, Iterator const& last, string_type& token) +{ + typedef typename regex_list_type::iterator iterator; + + xpressive::match_results<Iterator> regex_result; + 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<Iterator> regex_result; + if (xpressive::regex_search(first, last, regex_result, (*it).regex, + xpressive::regex_constants::match_continuous)) + { + Iterator saved = first; + Token rval = (*it).token; + + std::advance(first, regex_result.length()); + token = string_type(saved, first); + + if (NULL != (*it).callback) { + // execute corresponding callback + if ((*it).callback(saved, first, last, (*it).token)) + rval = next_token(first, last, token); + } + + return rval; + } + } + return Token(-1); // TODO: change this to use token_traits<Token> +} + +/////////////////////////////////////////////////////////////////////////////// +}}}} // boost::wave::cpplexer::xlex + +#endif // !defined(XPRESSIVE_LEXER_HPP) + + diff --git a/src/boost/libs/wave/samples/token_statistics/xlex_interface.hpp b/src/boost/libs/wave/samples/token_statistics/xlex_interface.hpp new file mode 100644 index 000000000..a1edabd89 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/xlex_interface.hpp @@ -0,0 +1,89 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the abstract lexer interface for the xpressive lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(XLEX_INTERFACE_HPP) +#define XLEX_INTERFACE_HPP + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace xlex { + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_NEW_LEXER_DECL BOOST_WAVE_DECL +#else +#define BOOST_WAVE_NEW_LEXER_DECL +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// new_lexer_gen: generates a new instance of the required C++ lexer +// +/////////////////////////////////////////////////////////////////////////////// +template < + typename IteratorT, + typename PositionT = wave::util::file_position_type +> +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 wave::cpplexer::lex_input_interface<wave::cpplexer::lex_token<PositionT> > * + new_lexer(IteratorT const &first, IteratorT const &last, + PositionT const &pos, wave::language_support language); +}; + +#undef BOOST_WAVE_NEW_LEXER_DECL + +/////////////////////////////////////////////////////////////////////////////// +// +// The xlex_input_interface helps to instantiate a concrete lexer to be used +// by the Wave preprocessor module. +// This is done to allow compile time reduction. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +struct xlex_input_interface +: lex_input_interface<TokenT> +{ + typedef typename wave::cpplexer::lex_input_interface<TokenT>::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. + template <typename IteratorT> + static wave::cpplexer::lex_input_interface<TokenT> * + new_lexer(IteratorT const &first, IteratorT const &last, + position_type const &pos, wave::language_support language) + { + return new_lexer_gen<IteratorT, position_type>::new_lexer (first, last, + pos, language); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace xlex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(XLEX_INTERFACE_HPP) diff --git a/src/boost/libs/wave/samples/token_statistics/xlex_iterator.hpp b/src/boost/libs/wave/samples/token_statistics/xlex_iterator.hpp new file mode 100644 index 000000000..d0e461090 --- /dev/null +++ b/src/boost/libs/wave/samples/token_statistics/xlex_iterator.hpp @@ -0,0 +1,232 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the lexer iterator for the xpressive lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(XLEX_ITERATOR_HPP) +#define XLEX_ITERATOR_HPP + +#include <string> +#include <iostream> + +#include <boost/assert.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/util/functor_input.hpp> + +#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 { +namespace cpplexer { +namespace xlex { +namespace impl { + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_iterator_functor_shim +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +class xlex_iterator_functor_shim +{ + typedef typename TokenT::position_type position_type; + +public: + xlex_iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + : eof() +#endif // 0 != __DECCXX_VER + {} + +// interface to the boost::spirit::classic::iterator_policies::functor_input +// policy + typedef TokenT result_type; + + BOOST_WAVE_EOF_PREFIX result_type const eof; + typedef xlex_iterator_functor_shim unique; + typedef lex_input_interface<TokenT>* shared; + + template <typename MultiPass> + static result_type& get_next(MultiPass& mp, result_type& result) + { + return mp.shared()->ftor->get(result); + } + + // this will be called whenever the last reference to a multi_pass will + // be released + template <typename MultiPass> + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template <typename MultiPass> + static void set_position(MultiPass& mp, position_type const &pos) + { + mp.shared()->ftor->set_position(pos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + template <typename MultiPass> + static bool has_include_guards(MultiPass& mp, std::string& guard_name) + { + return mp.shared()->ftor->has_include_guards(guard_name); + } +#endif + +private: + boost::shared_ptr<lex_input_interface<TokenT> > functor_ptr; +}; + +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +/////////////////////////////////////////////////////////////////////////////// +// eof token +template <typename TokenT> +typename xlex_iterator_functor_shim<TokenT>::result_type const + xlex_iterator_functor_shim<TokenT>::eof = + typename xlex_iterator_functor_shim<TokenT>::result_type(); +#endif // 0 != __COMO_VERSION__ + +/////////////////////////////////////////////////////////////////////////////// +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// +// xlex_iterator +// +// A generic C++ lexer interface class, which allows to plug in different +// lexer implementations (template parameter LexT). The following +// requirement apply: +// +// - the lexer type should have a function implemented, which returns +// the next lexed token from the input stream: +// typename LexT::token_type get(); +// - at the end of the input stream this function should return the +// eof token equivalent +// - the lexer should implement a constructor taking two iterators +// pointing to the beginning and the end of the input stream and +// a third parameter containing the name of the parsed input file, +// the 4th parameter contains the information about the mode the +// preprocessor is used in (C99/C++ mode etc.) +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template <typename FunctorData> +struct make_multi_pass +{ + typedef + std::pair<typename FunctorData::unique, typename FunctorData::shared> + 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<functor_data_type, policy_type> type; +}; + +/////////////////////////////////////////////////////////////////////////////// +template <typename TokenT> +class xlex_iterator +: public make_multi_pass<impl::xlex_iterator_functor_shim<TokenT> >::type +{ + typedef impl::xlex_iterator_functor_shim<TokenT> input_policy_type; + + typedef typename make_multi_pass<input_policy_type>::type base_type; + typedef typename make_multi_pass<input_policy_type>::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 <typename IteratorT> + xlex_iterator(IteratorT const &first, IteratorT const &last, + typename TokenT::position_type const &pos, + boost::wave::language_support language) + : base_type( + functor_data_type( + unique_functor_type(), + xlex_input_interface<TokenT> + ::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 = this->base_type::dereference(*this); + position_type currpos = currtoken.get_position(); + + currpos.set_file(pos.get_file()); + currpos.set_line(pos.get_line()); + const_cast<token_type&>(currtoken).set_position(currpos); + + // set the new position for future tokens as well + if (token_type::string_type::npos != + currtoken.get_value().find_first_of('\n')) + { + currpos.set_line(pos.get_line() + 1); + } + unique_functor_type::set_position(*this, currpos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + // return, whether the current file has include guards + // this function returns meaningful results only if the file was scanned + // completely + bool has_include_guards(std::string& guard_name) const + { + return unique_functor_type::has_include_guards(*this, guard_name); + } +#endif +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace xlex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#undef BOOST_WAVE_EOF_PREFIX + +#endif // !defined(XLEX_ITERATOR_HPP) diff --git a/src/boost/libs/wave/samples/waveidl/build/Jamfile.v2 b/src/boost/libs/wave/samples/waveidl/build/Jamfile.v2 new file mode 100644 index 000000000..c3eadd3f8 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/build/Jamfile.v2 @@ -0,0 +1,40 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Sample Build Jamfile (waveidl) +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +SOURCES = + ../idl + ../instantiate_cpp_grammar + ../instantiate_defined_grammar + ../instantiate_predef_macros + ../instantiate_re2c_lexer + ../instantiate_re2c_lexer_str + ../idllexer/idl_re + ; + +exe waveidl + : + $(SOURCES) + /boost/wave//boost_wave + /boost/program_options//boost_program_options/<link>static + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + /boost/filesystem//boost_filesystem + ; + +for local source in $(SOURCES) +{ + local requirements ; + # workaround for compiler bug + requirements += <toolset-msvc:version>7.1:<rtti>off ; + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + obj $(source) : $(source).cpp : $(requirements) ; +} + diff --git a/src/boost/libs/wave/samples/waveidl/idl.cpp b/src/boost/libs/wave/samples/waveidl/idl.cpp new file mode 100644 index 000000000..eedcccdac --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idl.cpp @@ -0,0 +1,537 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" // global configuration + +#include <boost/assert.hpp> +#include <boost/program_options.hpp> +#include <boost/filesystem/path.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include "idllexer/idl_lex_iterator.hpp" // lexer type + +/////////////////////////////////////////////////////////////////////////////// +// include lexer specifics, import lexer names +// +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION == 0 +#include "idllexer/idl_re2c_lexer.hpp" +#endif + +/////////////////////////////////////////////////////////////////////////////// +// include the grammar definitions, if these shouldn't be compiled separately +// (ATTENTION: _very_ large compilation times!) +// +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION == 0 +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> +#include <boost/wave/grammars/cpp_grammar.hpp> +#include <boost/wave/grammars/cpp_expression_grammar.hpp> +#include <boost/wave/grammars/cpp_predef_macros_grammar.hpp> +#include <boost/wave/grammars/cpp_defined_grammar.hpp> +#endif + +/////////////////////////////////////////////////////////////////////////////// +// import required names +using namespace boost::spirit::classic; + +using std::string; +using std::pair; +using std::vector; +using std::getline; +using std::ifstream; +using std::cout; +using std::cerr; +using std::endl; +using std::ostream; +using std::istreambuf_iterator; + +namespace po = boost::program_options; +namespace fs = boost::filesystem; + +/////////////////////////////////////////////////////////////////////////////// +// print the current version +int print_version() +{ + typedef boost::wave::idllexer::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lex_iterator_type; + typedef boost::wave::context<std::string::iterator, lex_iterator_type> + context_type; + + string version (context_type::get_version_string()); + cout + << version.substr(1, version.size()-2) // strip quotes + << " (" << IDL_VERSION_DATE << ")" // add date + << endl; + return 0; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// print the copyright statement +int print_copyright() +{ + char const *copyright[] = { + "", + "Sample: IDL oriented preprocessor", + "Based on: Wave, A Standard conformant C++ preprocessor library", + "It is hosted by http://www.boost.org/.", + "", + "Copyright (c) 2001-2010 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)", + 0 + }; + + for (int i = 0; 0 != copyright[i]; ++i) + cout << copyright[i] << endl; + + return 0; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_util { + + // Additional command line parser which interprets '@something' as an + // option "config-file" with the value "something". + pair<string, string> at_option_parser(string const&s) + { + if ('@' == s[0]) + return std::make_pair(string("config-file"), s.substr(1)); + else + return pair<string, string>(); + } + + // class, which keeps include file information read from the command line + class include_paths { + public: + include_paths() : seen_separator(false) {} + + vector<string> paths; // stores user paths + vector<string> syspaths; // stores system paths + bool seen_separator; // command line contains a '-I-' option + + // Function which validates additional tokens from command line. + static void + validate(boost::any &v, vector<string> const &tokens) + { + if (v.empty()) + v = boost::any(include_paths()); + + include_paths *p = boost::any_cast<include_paths>(&v); + + BOOST_ASSERT(p); + // Assume only one path per '-I' occurrence. + string t = tokens[0]; + if (t == "-") { + // found -I- option, so switch behaviour + p->seen_separator = true; + } + else if (p->seen_separator) { + // store this path as a system path + p->syspaths.push_back(t); + } + else { + // store this path as an user path + p->paths.push_back(t); + } + } + }; + + // Read all options from a given config file, parse and add them to the + // given variables_map + void read_config_file_options(string const &filename, + po::options_description const &desc, po::variables_map &vm, + bool may_fail = false) + { + ifstream ifs(filename.c_str()); + + if (!ifs.is_open()) { + if (!may_fail) { + cerr << filename + << ": command line warning: config file not found" + << endl; + } + return; + } + + vector<string> options; + string line; + + while (std::getline(ifs, line)) { + // skip empty lines + string::size_type pos = line.find_first_not_of(" \t"); + if (pos == string::npos) + continue; + + // skip comment lines + if ('#' != line[pos]) + options.push_back(line); + } + + if (options.size() > 0) { + using namespace boost::program_options::command_line_style; + po::store(po::command_line_parser(options) + .options(desc).style(unix_style).run(), vm); + po::notify(vm); + } + } + + // predicate to extract all positional arguments from the command line + struct is_argument { + bool operator()(po::option const &opt) + { + return (opt.position_key == -1) ? true : false; + } + }; + +/////////////////////////////////////////////////////////////////////////////// +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Special validator overload, which allows to handle the -I- syntax for +// switching the semantics of an -I option. +// +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_util { + +void validate(boost::any &v, std::vector<std::string> const &s, + cmd_line_util::include_paths *, int) { + cmd_line_util::include_paths::validate(v, s); +} + +} // namespace cmd_line_util + +/////////////////////////////////////////////////////////////////////////////// +// do the actual preprocessing +int +do_actual_work (std::string file_name, po::variables_map const &vm) +{ +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; + + try { + // process the given file + ifstream instream(file_name.c_str()); + string instring; + + if (!instream.is_open()) { + cerr << "waveidl: could not open input file: " << file_name << endl; + return -1; + } + instream.unsetf(std::ios::skipws); + +#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) + // this is known to be very slow for large files on some systems + copy (istream_iterator<char>(instream), + istream_iterator<char>(), + inserter(instring, instring.end())); +#else + instring = string(istreambuf_iterator<char>(instream.rdbuf()), + istreambuf_iterator<char>()); +#endif + + // This sample uses the lex_token type predefined in the Wave library, but + // but uses a custom lexer type. + typedef boost::wave::idllexer::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lex_iterator_type; + typedef boost::wave::context<std::string::iterator, lex_iterator_type> + context_type; + + // The C++ preprocessor iterators shouldn't be constructed directly. They + // are to be generated through a boost::wave::context<> object. This + // boost::wave::context object is additionally to be used to initialize and + // define different parameters of the actual preprocessing. + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + context_type ctx (instring.begin(), instring.end(), file_name.c_str()); + + // add include directories to the system include search paths + if (vm.count("sysinclude")) { + vector<string> const &syspaths = + vm["sysinclude"].as<vector<string> >(); + vector<string>::const_iterator end = syspaths.end(); + for (vector<string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + ctx.add_sysinclude_path((*cit).c_str()); + } + } + + // add include directories to the include search paths + if (vm.count("include")) { + cmd_line_util::include_paths const &ip = + vm["include"].as<cmd_line_util::include_paths>(); + vector<string>::const_iterator end = ip.paths.end(); + + for (vector<string>::const_iterator cit = ip.paths.begin(); + cit != end; ++cit) + { + ctx.add_include_path((*cit).c_str()); + } + + // if on the command line was given -I- , this has to be propagated + if (ip.seen_separator) + ctx.set_sysinclude_delimiter(); + + // add system include directories to the include path + vector<string>::const_iterator sysend = ip.syspaths.end(); + for (vector<string>::const_iterator syscit = ip.syspaths.begin(); + syscit != sysend; ++syscit) + { + ctx.add_sysinclude_path((*syscit).c_str()); + } + } + + // add additional defined macros + if (vm.count("define")) { + vector<string> const ¯os = vm["define"].as<vector<string> >(); + vector<string>::const_iterator end = macros.end(); + for (vector<string>::const_iterator cit = macros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit); + } + } + + // add additional predefined macros + if (vm.count("predefine")) { + vector<string> const &predefmacros = + vm["predefine"].as<vector<string> >(); + vector<string>::const_iterator end = predefmacros.end(); + for (vector<string>::const_iterator cit = predefmacros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit, true); + } + } + + // undefine specified macros + if (vm.count("undefine")) { + vector<string> const &undefmacros = + vm["undefine"].as<vector<string> >(); + vector<string>::const_iterator end = undefmacros.end(); + for (vector<string>::const_iterator cit = undefmacros.begin(); + cit != end; ++cit) + { + ctx.remove_macro_definition((*cit).c_str(), true); + } + } + + // open the output file + std::ofstream output; + + if (vm.count("output")) { + // try to open the file, where to put the preprocessed output + string out_file (vm["output"].as<string>()); + + output.open(out_file.c_str()); + if (!output.is_open()) { + cerr << "waveidl: could not open output file: " << out_file + << endl; + return -1; + } + } + else { + // output the preprocessed result to std::cout + output.copyfmt(cout); + output.clear(cout.rdstate()); + static_cast<std::basic_ios<char> &>(output).rdbuf(cout.rdbuf()); + } + + // analyze the input file + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + + // loop over all generated tokens outputing the generated text + while (first != last) { + // print out the string representation of this token (skip comments) + using namespace boost::wave; + + // store the last known good token position + current_position = (*first).get_position(); + + token_id id = token_id(*first); + + if (T_CPPCOMMENT == id || T_NEWLINE == id) { + // C++ comment tokens contain the trailing newline + output << endl; + } + else if (id != T_CCOMMENT) { + // print out the current token value + output << (*first).get_value(); + } + ++first; // advance to the next token + } + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << endl; + return 1; + } + catch (boost::wave::cpplexer::lexing_exception const& e) { + // some lexing error + cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << endl; + return 2; + } + catch (std::exception const& e) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "exception caught: " << e.what() + << endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + cerr + << current_position.get_file() + << "(" << current_position.get_line() << "): " + << "unexpected exception caught." << endl; + return 4; + } + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int +main (int argc, char *argv[]) +{ + try { + // analyze the command line options and arguments + + // declare the options allowed from the command line only + po::options_description desc_cmdline ("Options allowed on the command line only"); + + 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") + ("config-file", po::value<vector<string> >(), + "specify a config file (alternatively: @filepath)") + ; + + // declare the options allowed on command line and in config files + po::options_description desc_generic ("Options allowed additionally in a config file"); + + desc_generic.add_options() + ("output,o", po::value<string>()->composing(), + "specify a file to use for output instead of stdout") + ("include,I", po::value<cmd_line_util::include_paths>()->composing(), + "specify an additional include directory") + ("sysinclude,S", po::value<vector<string> >()->composing(), + "specify an additional system include directory") + ("define,D", po::value<vector<string> >()->composing(), + "specify a macro to define (as macro[=[value]])") + ("predefine,P", po::value<vector<string> >()->composing(), + "specify a macro to predefine (as macro[=[value]])") + ("undefine,U", po::value<vector<string> >()->composing(), + "specify a macro to undefine") + ; + + // combine the options for the different usage schemes + po::options_description desc_overall_cmdline; + po::options_description desc_overall_cfgfile; + + desc_overall_cmdline.add(desc_cmdline).add(desc_generic); + desc_overall_cfgfile.add(desc_generic); + + // parse command line and store results + using namespace boost::program_options::command_line_style; + + po::parsed_options opts = po::parse_command_line(argc, argv, + desc_overall_cmdline, unix_style, cmd_line_util::at_option_parser); + po::variables_map vm; + + po::store(opts, vm); + po::notify(vm); + + // Try to find a waveidl.cfg in the same directory as the executable was + // started from. If this exists, treat it as a wave config file + fs::path filename = boost::wave::util::create_path(argv[0]); + + filename = filename.branch_path() / "waveidl.cfg"; + cmd_line_util::read_config_file_options(filename.string(), + desc_overall_cfgfile, vm, true); + + // 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")) { + vector<string> const &cfg_files = + vm["config-file"].as<vector<string> >(); + vector<string>::const_iterator end = cfg_files.end(); + for (vector<string>::const_iterator cit = cfg_files.begin(); + cit != end; ++cit) + { + // parse a single config file and store the results + cmd_line_util::read_config_file_options(*cit, + desc_overall_cfgfile, vm); + } + } + + // ... act as required + if (vm.count("help")) { + po::options_description desc_help ( + "Usage: waveidl [options] [@config-file(s)] file"); + + desc_help.add(desc_cmdline).add(desc_generic); + cout << desc_help << endl; + return 1; + } + + if (vm.count("version")) { + return print_version(); + } + + if (vm.count("copyright")) { + return print_copyright(); + } + + // extract the arguments from the parsed command line + vector<po::option> arguments; + + std::remove_copy_if(opts.options.begin(), opts.options.end(), + inserter(arguments, arguments.end()), cmd_line_util::is_argument()); + + // if there is no input file given, then exit + if (0 == arguments.size() || 0 == arguments[0].value.size()) { + cerr << "waveidl: no input file given, " + << "use --help to get a hint." << endl; + return 5; + } + + // preprocess the given input file + return do_actual_work(arguments[0].value[0], vm); + } + catch (std::exception const& e) { + cout << "waveidl: exception caught: " << e.what() << endl; + return 6; + } + catch (...) { + cerr << "waveidl: unexpected exception caught." << endl; + return 7; + } +} + diff --git a/src/boost/libs/wave/samples/waveidl/idl.hpp b/src/boost/libs/wave/samples/waveidl/idl.hpp new file mode 100644 index 000000000..a0a3f5739 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_HPP_FC7EE131_5CE9_43F2_A713_8D9BBC3C8477_INCLUDED) +#define IDL_HPP_FC7EE131_5CE9_43F2_A713_8D9BBC3C8477_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// This file may be used as a precompiled header (if applicable) + +/////////////////////////////////////////////////////////////////////////////// +// include often used files from the stdlib +#include <iostream> +#include <fstream> +#include <string> +#include <vector> +#include <algorithm> +#include <iterator> + +/////////////////////////////////////////////////////////////////////////////// +// include boost config +#include <boost/config.hpp> // global configuration information + +/////////////////////////////////////////////////////////////////////////////// +// build version +#include "idl_version.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// configure this app here (global configuration constants) +#include "idl_config.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/pool/pool_alloc.hpp> + +#endif // !defined(IDL_HPP_FC7EE131_5CE9_43F2_A713_8D9BBC3C8477_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idl_config.hpp b/src/boost/libs/wave/samples/waveidl/idl_config.hpp new file mode 100644 index 000000000..a7314fb35 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idl_config.hpp @@ -0,0 +1,65 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Global application configuration of the Wave driver command + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_CONFIG_HPP_012D7524_FF3F_482F_9123_91966C72F4EA_INCLUDED) +#define IDL_CONFIG_HPP_012D7524_FF3F_482F_9123_91966C72F4EA_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// Uncomment the following, if you need debug output, the +// BOOST_SPIRIT_DEBUG_FLAGS constants below help to fine control the amount of +// the generated debug output +//#define BOOST_SPIRIT_DEBUG + +/////////////////////////////////////////////////////////////////////////////// +// debug rules, subrules and grammars only, for possible flags see +// spirit/debug.hpp +#if defined(BOOST_SPIRIT_DEBUG) + +#define BOOST_SPIRIT_DEBUG_FLAGS ( \ + BOOST_SPIRIT_DEBUG_FLAGS_NODES | \ + BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES \ + ) \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +// debug flags for the pp-iterator library, possible flags (defined in +// wave_config.hpp): +// +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_GRAMMAR 0x0001 +// #define BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION 0x0002 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR 0x0004 +// #define BOOST_SPIRIT_DEBUG_FLAGS_INTLIT_GRAMMAR 0x0008 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010 +// #define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020 +// #define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040 + +#define BOOST_SPIRIT_DEBUG_FLAGS_CPP (\ + /* insert the required flags from above */ \ + ) \ + /**/ +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Now include the cofiguration stuff for the Wave library itself +#include <boost/wave/wave_config.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// MSVC specific #pragma's +#if defined(BOOST_MSVC) +#pragma warning (disable: 4355) // 'this' used in base member initializer list +#pragma warning (disable: 4800) // forcing value to bool 'true' or 'false' +#pragma inline_depth(255) +#pragma inline_recursion(on) +#endif // defined(BOOST_MSVC) + +#endif // !defined(IDL_CONFIG_HPP_012D7524_FF3F_482F_9123_91966C72F4EA_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idl_version.hpp b/src/boost/libs/wave/samples/waveidl/idl_version.hpp new file mode 100644 index 000000000..3ab6ade36 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idl_version.hpp @@ -0,0 +1,23 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_VERSION_HPP_780C1190_3107_440B_B303_B687A449749B_INCLUDED) +#define IDL_VERSION_HPP_780C1190_3107_440B_B303_B687A449749B_INCLUDED + +#include <boost/wave/wave_version.hpp> + +#define IDL_VERSION_MAJOR BOOST_WAVE_VERSION_MAJOR +#define IDL_VERSION_MINOR BOOST_WAVE_VERSION_MINOR +#define IDL_VERSION_SUBMINOR BOOST_WAVE_VERSION_SUBMINOR +#define IDL_VERSION_DATE 20050117L + +#endif // !defined(IDL_VERSION_HPP_780C1190_3107_440B_B303_B687A449749B_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl.inc b/src/boost/libs/wave/samples/waveidl/idllexer/idl.inc new file mode 100644 index 000000000..878c7c2a0 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl.inc @@ -0,0 +1,3387 @@ +/* Generated by re2c 0.13.5 on Tue Apr 30 08:38:09 2019 */ +#line 1 "idl.re" +#line 20 "idl.re" + + + +#line 8 "idl.inc" +{ + YYCTYPE yych; + unsigned int yyaccept = 0; + static const unsigned char yybm[] = { + /* table 1 .. 8: 0 */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 60, 32, 56, 56, 64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 60, 56, 40, 56, 56, 56, 56, 56, + 56, 56, 152, 56, 56, 56, 56, 56, + 59, 59, 59, 59, 59, 59, 59, 59, + 58, 58, 56, 56, 56, 56, 48, 56, + 56, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 56, 56, 56, 56, 58, + 56, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 58, 58, 58, 58, 58, + 58, 58, 58, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, + /* table 9 .. 15: 256 */ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 70, 0, 70, 70, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 70, 68, 64, 68, 68, 68, 68, 4, + 68, 68, 68, 68, 68, 68, 68, 68, + 204, 204, 204, 204, 204, 204, 204, 204, + 204, 204, 68, 68, 68, 68, 68, 16, + 68, 76, 76, 76, 76, 76, 76, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 32, 68, 68, 68, + 68, 76, 76, 76, 76, 76, 76, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, + }; + + if ((YYLIMIT - YYCURSOR) < 12) YYFILL(12); + yych = *YYCURSOR; + switch (yych) { + case 0x00: goto yy69; + case '\t': + case '\v': + case '\f': + case ' ': goto yy64; + case '\n': goto yy66; + case '\r': goto yy68; + case '!': goto yy45; + case '"': goto yy63; + case '#': goto yy15; + case '%': goto yy35; + case '&': goto yy39; + case '\'': goto yy62; + case '(': goto yy17; + case ')': goto yy19; + case '*': goto yy33; + case '+': goto yy29; + case ',': goto yy53; + case '-': goto yy31; + case '.': goto yy27; + case '/': goto yy2; + case '0': goto yy59; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': goto yy61; + case ':': goto yy23; + case ';': goto yy21; + case '<': goto yy49; + case '=': goto yy47; + case '>': goto yy51; + case '?': goto yy25; + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': goto yy55; + case 'F': goto yy6; + case 'L': goto yy56; + case 'T': goto yy4; + case '[': goto yy11; + case '\\': goto yy57; + case ']': goto yy13; + case '^': goto yy37; + case '{': goto yy7; + case '|': goto yy41; + case '}': goto yy9; + case '~': goto yy43; + default: goto yy71; + } +yy2: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '*') goto yy356; + if (yych == '/') goto yy354; +#line 44 "idl.re" + { BOOST_WAVE_RET(T_DIVIDE); } +#line 190 "idl.inc" +yy4: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'R') goto yy350; + goto yy202; +yy5: +#line 67 "idl.re" + { BOOST_WAVE_RET(T_IDENTIFIER); } +#line 199 "idl.inc" +yy6: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'A') goto yy345; + goto yy202; +yy7: + ++YYCURSOR; +#line 29 "idl.re" + { BOOST_WAVE_RET(T_LEFTBRACE); } +#line 209 "idl.inc" +yy9: + ++YYCURSOR; +#line 30 "idl.re" + { BOOST_WAVE_RET(T_RIGHTBRACE); } +#line 214 "idl.inc" +yy11: + ++YYCURSOR; +#line 31 "idl.re" + { BOOST_WAVE_RET(T_LEFTBRACKET); } +#line 219 "idl.inc" +yy13: + ++YYCURSOR; +#line 32 "idl.re" + { BOOST_WAVE_RET(T_RIGHTBRACKET); } +#line 224 "idl.inc" +yy15: + yyaccept = 1; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= 'e') { + if (yych <= '"') { + if (yych <= '\t') { + if (yych >= '\t') goto yy239; + } else { + if (yych == ' ') goto yy239; + } + } else { + if (yych <= '.') { + if (yych <= '#') goto yy343; + } else { + if (yych <= '/') goto yy239; + if (yych >= 'd') goto yy239; + } + } + } else { + if (yych <= 'o') { + if (yych <= 'i') { + if (yych >= 'i') goto yy239; + } else { + if (yych == 'l') goto yy239; + } + } else { + if (yych <= 'u') { + if (yych <= 'p') goto yy239; + if (yych >= 'u') goto yy239; + } else { + if (yych == 'w') goto yy239; + } + } + } +yy16: +#line 33 "idl.re" + { BOOST_WAVE_RET(T_POUND); } +#line 262 "idl.inc" +yy17: + ++YYCURSOR; +#line 35 "idl.re" + { BOOST_WAVE_RET(T_LEFTPAREN); } +#line 267 "idl.inc" +yy19: + ++YYCURSOR; +#line 36 "idl.re" + { BOOST_WAVE_RET(T_RIGHTPAREN); } +#line 272 "idl.inc" +yy21: + ++YYCURSOR; +#line 37 "idl.re" + { BOOST_WAVE_RET(T_SEMICOLON); } +#line 277 "idl.inc" +yy23: + ++YYCURSOR; +#line 38 "idl.re" + { BOOST_WAVE_RET(T_COLON); } +#line 282 "idl.inc" +yy25: + yyaccept = 2; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == '?') goto yy341; +yy26: +#line 39 "idl.re" + { BOOST_WAVE_RET(T_QUESTION_MARK); } +#line 290 "idl.inc" +yy27: + ++YYCURSOR; + if ((yych = *YYCURSOR) <= '/') goto yy28; + if (yych <= '9') goto yy168; +yy28: +#line 40 "idl.re" + { BOOST_WAVE_RET(T_DOT); } +#line 298 "idl.inc" +yy29: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '+') goto yy339; +#line 41 "idl.re" + { BOOST_WAVE_RET(T_PLUS); } +#line 304 "idl.inc" +yy31: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '-') goto yy337; +#line 42 "idl.re" + { BOOST_WAVE_RET(T_MINUS); } +#line 310 "idl.inc" +yy33: + ++YYCURSOR; +#line 43 "idl.re" + { BOOST_WAVE_RET(T_STAR); } +#line 315 "idl.inc" +yy35: + yyaccept = 3; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == ':') goto yy238; +yy36: +#line 45 "idl.re" + { BOOST_WAVE_RET(T_PERCENT); } +#line 323 "idl.inc" +yy37: + ++YYCURSOR; +#line 46 "idl.re" + { BOOST_WAVE_RET(T_XOR); } +#line 328 "idl.inc" +yy39: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '&') goto yy236; +#line 47 "idl.re" + { BOOST_WAVE_RET(T_AND); } +#line 334 "idl.inc" +yy41: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '|') goto yy234; +#line 48 "idl.re" + { BOOST_WAVE_RET(T_OR); } +#line 340 "idl.inc" +yy43: + ++YYCURSOR; +#line 49 "idl.re" + { BOOST_WAVE_RET(T_COMPL); } +#line 345 "idl.inc" +yy45: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '=') goto yy232; +#line 50 "idl.re" + { BOOST_WAVE_RET(T_NOT); } +#line 351 "idl.inc" +yy47: + ++YYCURSOR; + if ((yych = *YYCURSOR) == '=') goto yy230; +#line 51 "idl.re" + { BOOST_WAVE_RET(T_ASSIGN); } +#line 357 "idl.inc" +yy49: + ++YYCURSOR; + if ((yych = *YYCURSOR) <= ';') goto yy50; + if (yych <= '<') goto yy228; + if (yych <= '=') goto yy226; +yy50: +#line 52 "idl.re" + { BOOST_WAVE_RET(T_LESS); } +#line 366 "idl.inc" +yy51: + ++YYCURSOR; + if ((yych = *YYCURSOR) <= '<') goto yy52; + if (yych <= '=') goto yy222; + if (yych <= '>') goto yy224; +yy52: +#line 53 "idl.re" + { BOOST_WAVE_RET(T_GREATER); } +#line 375 "idl.inc" +yy53: + ++YYCURSOR; +#line 64 "idl.re" + { BOOST_WAVE_RET(T_COMMA); } +#line 380 "idl.inc" +yy55: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + goto yy202; +yy56: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 2) { + goto yy201; + } + if (yych <= '\'') { + if (yych == '"') goto yy75; + if (yych <= '&') goto yy5; + goto yy221; + } else { + if (yych <= '?') { + if (yych <= '>') goto yy5; + goto yy204; + } else { + if (yych == '\\') goto yy203; + goto yy5; + } + } +yy57: + yyaccept = 4; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'U') goto yy193; + if (yych == 'u') goto yy192; +yy58: +#line 134 "idl.re" + { + BOOST_WAVE_RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); + } +#line 414 "idl.inc" +yy59: + yyaccept = 5; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 1) { + goto yy185; + } + if (yych <= 'U') { + if (yych <= 'C') { + if (yych <= '.') { + if (yych >= '.') goto yy168; + } else { + if (yych <= '/') goto yy60; + if (yych <= '9') goto yy187; + } + } else { + if (yych <= 'K') { + if (yych <= 'D') goto yy164; + if (yych <= 'E') goto yy171; + } else { + if (yych <= 'L') goto yy173; + if (yych >= 'U') goto yy172; + } + } + } else { + if (yych <= 'k') { + if (yych <= 'c') { + if (yych == 'X') goto yy189; + } else { + if (yych <= 'd') goto yy164; + if (yych <= 'e') goto yy171; + } + } else { + if (yych <= 'u') { + if (yych <= 'l') goto yy173; + if (yych >= 'u') goto yy172; + } else { + if (yych == 'x') goto yy189; + } + } + } +yy60: +#line 70 "idl.re" + { BOOST_WAVE_RET(T_INTLIT); } +#line 458 "idl.inc" +yy61: + yyaccept = 5; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[256+yych] & 128) { + goto yy166; + } + if (yych <= 'T') { + if (yych <= 'D') { + if (yych == '.') goto yy168; + if (yych <= 'C') goto yy60; + goto yy164; + } else { + if (yych <= 'E') goto yy171; + if (yych == 'L') goto yy173; + goto yy60; + } + } else { + if (yych <= 'e') { + if (yych <= 'U') goto yy172; + if (yych <= 'c') goto yy60; + if (yych <= 'd') goto yy164; + goto yy171; + } else { + if (yych <= 'l') { + if (yych <= 'k') goto yy60; + goto yy173; + } else { + if (yych == 'u') goto yy172; + goto yy60; + } + } + } +yy62: + yyaccept = 4; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '\f') { + if (yych == '\t') goto yy121; + if (yych <= '\n') goto yy58; + goto yy121; + } else { + if (yych <= 0x1F) goto yy58; + if (yych == '\'') goto yy58; + goto yy121; + } +yy63: + yyaccept = 4; + yych = *(YYMARKER = ++YYCURSOR); + if (yych <= '\n') { + if (yych == '\t') goto yy76; + goto yy58; + } else { + if (yych <= '\f') goto yy76; + if (yych <= 0x1F) goto yy58; + goto yy76; + } +yy64: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy74; +yy65: +#line 109 "idl.re" + { BOOST_WAVE_RET(T_SPACE); } +#line 521 "idl.inc" +yy66: + ++YYCURSOR; +yy67: +#line 112 "idl.re" + { + s->line++; + BOOST_WAVE_RET(T_NEWLINE); + } +#line 530 "idl.inc" +yy68: + yych = *++YYCURSOR; + if (yych == '\n') goto yy72; + goto yy67; +yy69: + ++YYCURSOR; +#line 118 "idl.re" + { + if(cursor != s->eof) + { + using namespace std; // some systems have printf in std + if (0 != s->error_proc) { + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + } + else + printf("Error: 0 in file\n"); + } + BOOST_WAVE_RET(T_EOF); + } +#line 552 "idl.inc" +yy71: + yych = *++YYCURSOR; + goto yy58; +yy72: + yych = *++YYCURSOR; + goto yy67; +yy73: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy74: + if (yybm[256+yych] & 2) { + goto yy73; + } + goto yy65; +yy75: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy76: + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy78; + goto yy79; +yy77: + YYCURSOR = YYMARKER; + if (yyaccept <= 6) { + if (yyaccept <= 3) { + if (yyaccept <= 1) { + if (yyaccept <= 0) { + goto yy5; + } else { + goto yy16; + } + } else { + if (yyaccept <= 2) { + goto yy26; + } else { + goto yy36; + } + } + } else { + if (yyaccept <= 5) { + if (yyaccept <= 4) { + goto yy58; + } else { + goto yy60; + } + } else { + goto yy81; + } + } + } else { + if (yyaccept <= 9) { + if (yyaccept <= 8) { + if (yyaccept <= 7) { + goto yy131; + } else { + goto yy170; + } + } else { + goto yy294; + } + } else { + if (yyaccept <= 11) { + if (yyaccept <= 10) { + goto yy302; + } else { + goto yy349; + } + } else { + goto yy353; + } + } + } +yy78: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy91; +yy79: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '`') { + if (yych <= '7') { + if (yych <= '&') { + if (yych == '"') goto yy75; + goto yy77; + } else { + if (yych <= '\'') goto yy75; + if (yych <= '/') goto yy77; + goto yy86; + } + } else { + if (yych <= 'T') { + if (yych == '?') goto yy84; + goto yy77; + } else { + if (yych <= 'U') goto yy83; + if (yych == '\\') goto yy75; + goto yy77; + } + } + } else { + if (yych <= 'r') { + if (yych <= 'f') { + if (yych <= 'b') goto yy75; + if (yych <= 'e') goto yy77; + goto yy75; + } else { + if (yych == 'n') goto yy75; + if (yych <= 'q') goto yy77; + goto yy75; + } + } else { + if (yych <= 'u') { + if (yych <= 's') goto yy77; + if (yych <= 't') goto yy75; + goto yy82; + } else { + if (yych <= 'v') goto yy75; + if (yych == 'x') goto yy85; + goto yy77; + } + } + } +yy80: + ++YYCURSOR; +yy81: +#line 82 "idl.re" + { BOOST_WAVE_RET(T_STRINGLIT); } +#line 693 "idl.inc" +yy82: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy117; + goto yy77; + } else { + if (yych <= 'F') goto yy117; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy117; + goto yy77; + } +yy83: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy110; + goto yy77; + } else { + if (yych <= 'F') goto yy110; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy110; + goto yy77; + } +yy84: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy90; + goto yy79; +yy85: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 8) { + goto yy88; + } + goto yy77; +yy86: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '"') { + if (yych <= '\n') { + if (yych == '\t') goto yy75; + goto yy77; + } else { + if (yych <= '\f') goto yy75; + if (yych <= 0x1F) goto yy77; + if (yych <= '!') goto yy75; + goto yy80; + } + } else { + if (yych <= '>') { + if (yych <= '/') goto yy75; + if (yych >= '8') goto yy75; + } else { + if (yych <= '?') goto yy78; + if (yych == '\\') goto yy79; + goto yy75; + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy78; + goto yy79; +yy88: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 8) { + goto yy88; + } + if (yych <= '!') { + if (yych <= '\n') { + if (yych == '\t') goto yy75; + goto yy77; + } else { + if (yych <= '\f') goto yy75; + if (yych <= 0x1F) goto yy77; + goto yy75; + } + } else { + if (yych <= '?') { + if (yych <= '"') goto yy80; + if (yych <= '>') goto yy75; + goto yy78; + } else { + if (yych == '\\') goto yy79; + goto yy75; + } + } +yy90: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych >= '\\') goto yy79; +yy91: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 16) { + goto yy91; + } + if (yych <= '!') { + if (yych <= '\n') { + if (yych == '\t') goto yy75; + goto yy77; + } else { + if (yych <= '\f') goto yy75; + if (yych <= 0x1F) goto yy77; + goto yy75; + } + } else { + if (yych <= '/') { + if (yych <= '"') goto yy80; + if (yych <= '.') goto yy75; + } else { + if (yych == '\\') goto yy79; + goto yy75; + } + } +yy93: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 32) { + goto yy93; + } + if (yych <= '7') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy97; + if (yych <= '/') goto yy75; + goto yy86; + } + } + } else { + if (yych <= 'U') { + if (yych == '?') goto yy98; + if (yych <= 'T') goto yy75; + goto yy96; + } else { + if (yych <= 'u') { + if (yych <= 't') goto yy75; + } else { + if (yych == 'x') goto yy88; + goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + goto yy107; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + goto yy107; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych <= 'f') goto yy107; + goto yy75; + } + } + } +yy96: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + goto yy100; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + goto yy100; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych <= 'f') goto yy100; + goto yy75; + } + } + } +yy97: + yyaccept = 6; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy81; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy78; + goto yy79; +yy98: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych >= '\\') goto yy79; + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 16) { + goto yy91; + } + if (yych <= '!') { + if (yych <= '\n') { + if (yych == '\t') goto yy75; + goto yy77; + } else { + if (yych <= '\f') goto yy75; + if (yych <= 0x1F) goto yy77; + goto yy75; + } + } else { + if (yych <= '/') { + if (yych <= '"') goto yy80; + if (yych <= '.') goto yy75; + goto yy93; + } else { + if (yych == '\\') goto yy79; + goto yy75; + } + } +yy100: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy78; + goto yy79; +yy107: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy75; + if (yych <= '\n') goto yy77; + goto yy75; + } else { + if (yych <= '!') { + if (yych <= 0x1F) goto yy77; + goto yy75; + } else { + if (yych <= '"') goto yy80; + if (yych <= '/') goto yy75; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy78; + if (yych <= '@') goto yy75; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy75; + goto yy79; + } else { + if (yych <= '`') goto yy75; + if (yych >= 'g') goto yy75; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 4) { + goto yy75; + } + if (yych <= '!') goto yy77; + if (yych <= '"') goto yy80; + if (yych <= '[') goto yy78; + goto yy79; +yy110: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy111; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy111: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy112; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy112: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy113; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy113: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy114; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy114: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy115; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy115: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy116; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy116: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy75; + goto yy77; + } else { + if (yych <= 'F') goto yy75; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy75; + goto yy77; + } +yy117: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy118; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy118: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy119; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy119: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy75; + goto yy77; + } else { + if (yych <= 'F') goto yy75; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy75; + goto yy77; + } +yy120: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy121: + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych >= '\\') goto yy123; +yy122: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy135; +yy123: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '`') { + if (yych <= '7') { + if (yych <= '&') { + if (yych == '"') goto yy120; + goto yy77; + } else { + if (yych <= '\'') goto yy120; + if (yych <= '/') goto yy77; + goto yy128; + } + } else { + if (yych <= 'T') { + if (yych == '?') goto yy126; + goto yy77; + } else { + if (yych <= 'U') goto yy125; + if (yych == '\\') goto yy120; + goto yy77; + } + } + } else { + if (yych <= 'r') { + if (yych <= 'f') { + if (yych <= 'b') goto yy120; + if (yych <= 'e') goto yy77; + goto yy120; + } else { + if (yych == 'n') goto yy120; + if (yych <= 'q') goto yy77; + goto yy120; + } + } else { + if (yych <= 'u') { + if (yych <= 's') goto yy77; + if (yych <= 't') goto yy120; + } else { + if (yych <= 'v') goto yy120; + if (yych == 'x') goto yy127; + goto yy77; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy161; + goto yy77; + } else { + if (yych <= 'F') goto yy161; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy161; + goto yy77; + } +yy125: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy154; + goto yy77; + } else { + if (yych <= 'F') goto yy154; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy154; + goto yy77; + } +yy126: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy134; + goto yy123; +yy127: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy132; + goto yy77; + } else { + if (yych <= 'F') goto yy132; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy132; + goto yy77; + } +yy128: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\'') { + if (yych <= '\n') { + if (yych == '\t') goto yy120; + goto yy77; + } else { + if (yych <= '\f') goto yy120; + if (yych <= 0x1F) goto yy77; + if (yych <= '&') goto yy120; + goto yy130; + } + } else { + if (yych <= '>') { + if (yych <= '/') goto yy120; + if (yych >= '8') goto yy120; + } else { + if (yych <= '?') goto yy122; + if (yych == '\\') goto yy123; + goto yy120; + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy122; + goto yy123; +yy130: + ++YYCURSOR; +yy131: +#line 79 "idl.re" + { BOOST_WAVE_RET(T_CHARLIT); } +#line 1540 "idl.inc" +yy132: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + goto yy132; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + goto yy132; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych <= 'f') goto yy132; + goto yy120; + } + } + } +yy134: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych >= '\\') goto yy123; +yy135: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\'') { + if (yych <= '\n') { + if (yych == '\t') goto yy120; + goto yy77; + } else { + if (yych <= '\f') goto yy120; + if (yych <= 0x1F) goto yy77; + if (yych <= '&') goto yy120; + goto yy130; + } + } else { + if (yych <= '>') { + if (yych != '/') goto yy120; + } else { + if (yych <= '?') goto yy135; + if (yych == '\\') goto yy123; + goto yy120; + } + } +yy137: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '>') { + if (yych <= 0x1F) { + if (yych <= '\t') { + if (yych <= 0x08) goto yy77; + goto yy120; + } else { + if (yych <= '\n') goto yy77; + if (yych <= '\f') goto yy120; + goto yy77; + } + } else { + if (yych <= '\'') { + if (yych <= '&') goto yy120; + goto yy141; + } else { + if (yych <= '/') goto yy120; + if (yych <= '7') goto yy128; + goto yy120; + } + } + } else { + if (yych <= '\\') { + if (yych <= 'T') { + if (yych <= '?') goto yy142; + goto yy120; + } else { + if (yych <= 'U') goto yy140; + if (yych <= '[') goto yy120; + goto yy137; + } + } else { + if (yych <= 'u') { + if (yych <= 't') goto yy120; + } else { + if (yych == 'x') goto yy132; + goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + goto yy151; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + goto yy151; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych <= 'f') goto yy151; + goto yy120; + } + } + } +yy140: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + goto yy144; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + goto yy144; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych <= 'f') goto yy144; + goto yy120; + } + } + } +yy141: + yyaccept = 7; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy131; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy122; + goto yy123; +yy142: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych >= '\\') goto yy123; + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\'') { + if (yych <= '\n') { + if (yych == '\t') goto yy120; + goto yy77; + } else { + if (yych <= '\f') goto yy120; + if (yych <= 0x1F) goto yy77; + if (yych <= '&') goto yy120; + goto yy130; + } + } else { + if (yych <= '>') { + if (yych == '/') goto yy137; + goto yy120; + } else { + if (yych <= '?') goto yy135; + if (yych == '\\') goto yy123; + goto yy120; + } + } +yy144: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy122; + goto yy123; +yy151: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '9') { + if (yych <= '\f') { + if (yych == '\t') goto yy120; + if (yych <= '\n') goto yy77; + goto yy120; + } else { + if (yych <= '&') { + if (yych <= 0x1F) goto yy77; + goto yy120; + } else { + if (yych <= '\'') goto yy130; + if (yych <= '/') goto yy120; + } + } + } else { + if (yych <= 'F') { + if (yych == '?') goto yy122; + if (yych <= '@') goto yy120; + } else { + if (yych <= '\\') { + if (yych <= '[') goto yy120; + goto yy123; + } else { + if (yych <= '`') goto yy120; + if (yych >= 'g') goto yy120; + } + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[256+yych] & 64) { + goto yy120; + } + if (yych <= '&') goto yy77; + if (yych <= '\'') goto yy130; + if (yych <= '[') goto yy122; + goto yy123; +yy154: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy155; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy155: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy156; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy156: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy157; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy157: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy158; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy158: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy159; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy159: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy160; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy160: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy120; + goto yy77; + } else { + if (yych <= 'F') goto yy120; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy120; + goto yy77; + } +yy161: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy162; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy162: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy163; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy163: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy120; + goto yy77; + } else { + if (yych <= 'F') goto yy120; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy120; + goto yy77; + } +yy164: + ++YYCURSOR; +#line 76 "idl.re" + { BOOST_WAVE_RET(T_FIXEDPOINTLIT); } +#line 2164 "idl.inc" +yy166: + yyaccept = 5; + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + if (yybm[256+yych] & 128) { + goto yy166; + } + if (yych <= 'T') { + if (yych <= 'D') { + if (yych == '.') goto yy168; + if (yych <= 'C') goto yy60; + goto yy164; + } else { + if (yych <= 'E') goto yy171; + if (yych == 'L') goto yy173; + goto yy60; + } + } else { + if (yych <= 'e') { + if (yych <= 'U') goto yy172; + if (yych <= 'c') goto yy60; + if (yych <= 'd') goto yy164; + goto yy171; + } else { + if (yych <= 'l') { + if (yych <= 'k') goto yy60; + goto yy173; + } else { + if (yych == 'u') goto yy172; + goto yy60; + } + } + } +yy168: + yyaccept = 8; + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + if (yych <= 'K') { + if (yych <= 'C') { + if (yych <= '/') goto yy170; + if (yych <= '9') goto yy168; + } else { + if (yych <= 'D') goto yy164; + if (yych <= 'E') goto yy181; + if (yych <= 'F') goto yy178; + } + } else { + if (yych <= 'e') { + if (yych <= 'L') goto yy179; + if (yych <= 'c') goto yy170; + if (yych <= 'd') goto yy164; + goto yy181; + } else { + if (yych <= 'f') goto yy178; + if (yych == 'l') goto yy179; + } + } +yy170: +#line 73 "idl.re" + { BOOST_WAVE_RET(T_FLOATLIT); } +#line 2227 "idl.inc" +yy171: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych == '+') goto yy175; + goto yy77; + } else { + if (yych <= '-') goto yy175; + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy176; + goto yy77; + } +yy172: + yych = *++YYCURSOR; + if (yych == 'L') goto yy174; + if (yych == 'l') goto yy174; + goto yy60; +yy173: + yych = *++YYCURSOR; + if (yych == 'U') goto yy174; + if (yych != 'u') goto yy60; +yy174: + yych = *++YYCURSOR; + goto yy60; +yy175: + yych = *++YYCURSOR; + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; +yy176: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= 'K') { + if (yych <= '9') { + if (yych <= '/') goto yy170; + goto yy176; + } else { + if (yych != 'F') goto yy170; + } + } else { + if (yych <= 'f') { + if (yych <= 'L') goto yy179; + if (yych <= 'e') goto yy170; + } else { + if (yych == 'l') goto yy179; + goto yy170; + } + } +yy178: + yych = *++YYCURSOR; + if (yych == 'L') goto yy180; + if (yych == 'l') goto yy180; + goto yy170; +yy179: + yych = *++YYCURSOR; + if (yych == 'F') goto yy180; + if (yych != 'f') goto yy170; +yy180: + yych = *++YYCURSOR; + goto yy170; +yy181: + yych = *++YYCURSOR; + if (yych <= ',') { + if (yych != '+') goto yy77; + } else { + if (yych <= '-') goto yy182; + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy183; + goto yy77; + } +yy182: + yych = *++YYCURSOR; + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; +yy183: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= 'K') { + if (yych <= '9') { + if (yych <= '/') goto yy170; + goto yy183; + } else { + if (yych == 'F') goto yy178; + goto yy170; + } + } else { + if (yych <= 'f') { + if (yych <= 'L') goto yy179; + if (yych <= 'e') goto yy170; + goto yy178; + } else { + if (yych == 'l') goto yy179; + goto yy170; + } + } +yy185: + yyaccept = 5; + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + if (yybm[0+yych] & 1) { + goto yy185; + } + if (yych <= 'L') { + if (yych <= '9') { + if (yych == '.') goto yy168; + if (yych <= '/') goto yy60; + } else { + if (yych <= 'D') { + if (yych <= 'C') goto yy60; + goto yy164; + } else { + if (yych <= 'E') goto yy171; + if (yych <= 'K') goto yy60; + goto yy173; + } + } + } else { + if (yych <= 'e') { + if (yych <= 'U') { + if (yych <= 'T') goto yy60; + goto yy172; + } else { + if (yych <= 'c') goto yy60; + if (yych <= 'd') goto yy164; + goto yy171; + } + } else { + if (yych <= 'l') { + if (yych <= 'k') goto yy60; + goto yy173; + } else { + if (yych == 'u') goto yy172; + goto yy60; + } + } + } +yy187: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 3) YYFILL(3); + yych = *YYCURSOR; + if (yych <= 'C') { + if (yych <= '.') { + if (yych <= '-') goto yy77; + goto yy168; + } else { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy187; + goto yy77; + } + } else { + if (yych <= 'c') { + if (yych <= 'D') goto yy164; + if (yych <= 'E') goto yy171; + goto yy77; + } else { + if (yych <= 'd') goto yy164; + if (yych <= 'e') goto yy171; + goto yy77; + } + } +yy189: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy190; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy190: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= 'T') { + if (yych <= '@') { + if (yych <= '/') goto yy60; + if (yych <= '9') goto yy190; + goto yy60; + } else { + if (yych <= 'F') goto yy190; + if (yych == 'L') goto yy173; + goto yy60; + } + } else { + if (yych <= 'k') { + if (yych <= 'U') goto yy172; + if (yych <= '`') goto yy60; + if (yych <= 'f') goto yy190; + goto yy60; + } else { + if (yych <= 'l') goto yy173; + if (yych == 'u') goto yy172; + goto yy60; + } + } +yy192: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy218; + goto yy77; + } else { + if (yych <= 'F') goto yy218; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy218; + goto yy77; + } +yy193: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy194; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy194: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy195; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy195: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy196; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy196: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy197; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy197: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy198; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy198: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy199; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy199: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy200; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy200: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy201; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy201: + yyaccept = 0; + YYMARKER = ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy202: + if (yybm[0+yych] & 2) { + goto yy201; + } + if (yych == '?') goto yy204; + if (yych != '\\') goto yy5; +yy203: + ++YYCURSOR; + 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); + yych = *YYCURSOR; + if (yych != '?') goto yy77; + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == '/') goto yy203; + goto yy77; +yy206: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy215; + goto yy77; + } else { + if (yych <= 'F') goto yy215; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy215; + goto yy77; + } +yy207: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy208; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy208: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy209; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy209: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy210; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy210: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy211; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy211: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy212; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy212: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy213; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy213: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy214; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy214: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy201; + goto yy77; + } else { + if (yych <= 'F') goto yy201; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy201; + goto yy77; + } +yy215: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy216; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy216: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy217; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy217: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy201; + goto yy77; + } else { + if (yych <= 'F') goto yy201; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy201; + goto yy77; + } +yy218: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy219; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy219: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych >= ':') goto yy77; + } else { + if (yych <= 'F') goto yy220; + if (yych <= '`') goto yy77; + if (yych >= 'g') goto yy77; + } +yy220: + yych = *++YYCURSOR; + if (yych <= '@') { + if (yych <= '/') goto yy77; + if (yych <= '9') goto yy201; + goto yy77; + } else { + if (yych <= 'F') goto yy201; + if (yych <= '`') goto yy77; + if (yych <= 'f') goto yy201; + goto yy77; + } +yy221: + yych = *++YYCURSOR; + if (yych == '\'') goto yy77; + goto yy121; +yy222: + ++YYCURSOR; +#line 59 "idl.re" + { BOOST_WAVE_RET(T_GREATEREQUAL); } +#line 2735 "idl.inc" +yy224: + ++YYCURSOR; +#line 55 "idl.re" + { BOOST_WAVE_RET(T_SHIFTRIGHT); } +#line 2740 "idl.inc" +yy226: + ++YYCURSOR; +#line 58 "idl.re" + { BOOST_WAVE_RET(T_LESSEQUAL); } +#line 2745 "idl.inc" +yy228: + ++YYCURSOR; +#line 54 "idl.re" + { BOOST_WAVE_RET(T_SHIFTLEFT); } +#line 2750 "idl.inc" +yy230: + ++YYCURSOR; +#line 56 "idl.re" + { BOOST_WAVE_RET(T_EQUAL); } +#line 2755 "idl.inc" +yy232: + ++YYCURSOR; +#line 57 "idl.re" + { BOOST_WAVE_RET(T_NOTEQUAL); } +#line 2760 "idl.inc" +yy234: + ++YYCURSOR; +#line 61 "idl.re" + { BOOST_WAVE_RET(T_OROR); } +#line 2765 "idl.inc" +yy236: + ++YYCURSOR; +#line 60 "idl.re" + { BOOST_WAVE_RET(T_ANDAND); } +#line 2770 "idl.inc" +yy238: + ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 7) YYFILL(7); + yych = *YYCURSOR; +yy239: + if (yybm[0+yych] & 4) { + goto yy238; + } + if (yych <= 'k') { + if (yych <= 'd') { + if (yych == '/') goto yy240; + if (yych <= 'c') goto yy77; + goto yy243; + } else { + if (yych <= 'e') goto yy242; + if (yych == 'i') goto yy241; + goto yy77; + } + } else { + if (yych <= 't') { + if (yych <= 'l') goto yy245; + if (yych == 'p') goto yy246; + goto yy77; + } else { + if (yych <= 'u') goto yy244; + if (yych == 'w') goto yy247; + goto yy77; + } + } +yy240: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == '*') goto yy330; + goto yy77; +yy241: + yych = *++YYCURSOR; + if (yych == 'f') goto yy293; + if (yych == 'n') goto yy295; + goto yy77; +yy242: + yych = *++YYCURSOR; + if (yych <= 'm') { + if (yych == 'l') goto yy278; + goto yy77; + } else { + if (yych <= 'n') goto yy277; + if (yych == 'r') goto yy276; + goto yy77; + } +yy243: + yych = *++YYCURSOR; + if (yych == 'e') goto yy270; + goto yy77; +yy244: + yych = *++YYCURSOR; + if (yych == 'n') goto yy265; + goto yy77; +yy245: + yych = *++YYCURSOR; + if (yych == 'i') goto yy261; + goto yy77; +yy246: + yych = *++YYCURSOR; + if (yych == 'r') goto yy255; + goto yy77; +yy247: + yych = *++YYCURSOR; + if (yych != 'a') goto yy77; + yych = *++YYCURSOR; + if (yych != 'r') goto yy77; + yych = *++YYCURSOR; + if (yych != 'n') goto yy77; + yych = *++YYCURSOR; + if (yych != 'i') goto yy77; + yych = *++YYCURSOR; + if (yych != 'n') goto yy77; + yych = *++YYCURSOR; + if (yych != 'g') goto yy77; + ++YYCURSOR; +#line 106 "idl.re" + { BOOST_WAVE_RET(T_PP_WARNING); } +#line 2853 "idl.inc" +yy255: + yych = *++YYCURSOR; + if (yych != 'a') goto yy77; + yych = *++YYCURSOR; + if (yych != 'g') goto yy77; + yych = *++YYCURSOR; + if (yych != 'm') goto yy77; + yych = *++YYCURSOR; + if (yych != 'a') goto yy77; + ++YYCURSOR; +#line 104 "idl.re" + { BOOST_WAVE_RET(T_PP_PRAGMA); } +#line 2866 "idl.inc" +yy261: + yych = *++YYCURSOR; + if (yych != 'n') goto yy77; + yych = *++YYCURSOR; + if (yych != 'e') goto yy77; + ++YYCURSOR; +#line 102 "idl.re" + { BOOST_WAVE_RET(T_PP_LINE); } +#line 2875 "idl.inc" +yy265: + yych = *++YYCURSOR; + if (yych != 'd') goto yy77; + yych = *++YYCURSOR; + if (yych != 'e') goto yy77; + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + ++YYCURSOR; +#line 101 "idl.re" + { BOOST_WAVE_RET(T_PP_UNDEF); } +#line 2886 "idl.inc" +yy270: + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + yych = *++YYCURSOR; + if (yych != 'i') goto yy77; + yych = *++YYCURSOR; + if (yych != 'n') goto yy77; + yych = *++YYCURSOR; + if (yych != 'e') goto yy77; + ++YYCURSOR; +#line 100 "idl.re" + { BOOST_WAVE_RET(T_PP_DEFINE); } +#line 2899 "idl.inc" +yy276: + yych = *++YYCURSOR; + if (yych == 'r') goto yy289; + goto yy77; +yy277: + yych = *++YYCURSOR; + if (yych == 'd') goto yy285; + goto yy77; +yy278: + yych = *++YYCURSOR; + if (yych == 'i') goto yy280; + if (yych != 's') goto yy77; + yych = *++YYCURSOR; + if (yych == 'e') goto yy283; + goto yy77; +yy280: + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + ++YYCURSOR; +#line 98 "idl.re" + { BOOST_WAVE_RET(T_PP_ELIF); } +#line 2921 "idl.inc" +yy283: + ++YYCURSOR; +#line 97 "idl.re" + { BOOST_WAVE_RET(T_PP_ELSE); } +#line 2926 "idl.inc" +yy285: + yych = *++YYCURSOR; + if (yych != 'i') goto yy77; + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + ++YYCURSOR; +#line 99 "idl.re" + { BOOST_WAVE_RET(T_PP_ENDIF); } +#line 2935 "idl.inc" +yy289: + yych = *++YYCURSOR; + if (yych != 'o') goto yy77; + yych = *++YYCURSOR; + if (yych != 'r') goto yy77; + ++YYCURSOR; +#line 103 "idl.re" + { BOOST_WAVE_RET(T_PP_ERROR); } +#line 2944 "idl.inc" +yy293: + yyaccept = 9; + yych = *(YYMARKER = ++YYCURSOR); + if (yych == 'd') goto yy321; + if (yych == 'n') goto yy322; +yy294: +#line 94 "idl.re" + { BOOST_WAVE_RET(T_PP_IF); } +#line 2953 "idl.inc" +yy295: + yych = *++YYCURSOR; + if (yych != 'c') goto yy77; + yych = *++YYCURSOR; + if (yych != 'l') goto yy77; + yych = *++YYCURSOR; + if (yych != 'u') goto yy77; + yych = *++YYCURSOR; + if (yych != 'd') goto yy77; + yych = *++YYCURSOR; + if (yych != 'e') goto yy77; +yy300: + yyaccept = 10; + YYMARKER = ++YYCURSOR; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '!') { + if (yych <= '\t') { + if (yych >= '\t') goto yy300; + } else { + if (yych == ' ') goto yy300; + } + } else { + if (yych <= '/') { + if (yych <= '"') goto yy304; + if (yych >= '/') goto yy303; + } else { + if (yych == '<') goto yy305; + } + } +yy302: +#line 92 "idl.re" + { BOOST_WAVE_RET(T_PP_INCLUDE); } +#line 2987 "idl.inc" +yy303: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych == '*') goto yy314; + goto yy77; +yy304: + yych = *++YYCURSOR; + if (yych == '"') goto yy77; + goto yy311; +yy305: + yych = *++YYCURSOR; + if (yych == '>') goto yy77; + goto yy307; +yy306: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy307: + if (yybm[0+yych] & 8) { + goto yy306; + } + if (yych <= '=') goto yy77; + ++YYCURSOR; +#line 86 "idl.re" + { BOOST_WAVE_RET(T_PP_HHEADER); } +#line 3014 "idl.inc" +yy310: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; +yy311: + if (yybm[0+yych] & 16) { + goto yy310; + } + if (yych <= '!') goto yy77; + ++YYCURSOR; +#line 89 "idl.re" + { BOOST_WAVE_RET(T_PP_QHEADER); } +#line 3027 "idl.inc" +yy314: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy314; + } + if (yych == '\r') goto yy316; + if (yych <= ')') goto yy77; + goto yy318; +yy316: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy314; + } + if (yych == '\r') goto yy316; + if (yych <= ')') goto yy77; +yy318: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 128) { + goto yy318; + } + if (yych <= '\r') { + if (yych <= 0x08) goto yy77; + if (yych <= '\f') goto yy314; + } else { + if (yych <= 0x1F) goto yy77; + if (yych == '/') goto yy300; + goto yy314; + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yybm[0+yych] & 32) { + goto yy314; + } + if (yych == '\r') goto yy316; + if (yych <= ')') goto yy77; + goto yy318; +yy321: + yych = *++YYCURSOR; + if (yych == 'e') goto yy327; + goto yy77; +yy322: + yych = *++YYCURSOR; + if (yych != 'd') goto yy77; + yych = *++YYCURSOR; + if (yych != 'e') goto yy77; + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + ++YYCURSOR; +#line 96 "idl.re" + { BOOST_WAVE_RET(T_PP_IFNDEF); } +#line 3085 "idl.inc" +yy327: + yych = *++YYCURSOR; + if (yych != 'f') goto yy77; + ++YYCURSOR; +#line 95 "idl.re" + { BOOST_WAVE_RET(T_PP_IFDEF); } +#line 3092 "idl.inc" +yy330: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\r') { + if (yych <= 0x08) goto yy77; + if (yych <= '\f') goto yy330; + } else { + if (yych <= 0x1F) goto yy77; + if (yych == '*') goto yy334; + goto yy330; + } +yy332: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\r') { + if (yych <= 0x08) goto yy77; + if (yych <= '\f') goto yy330; + goto yy332; + } else { + if (yych <= 0x1F) goto yy77; + if (yych != '*') goto yy330; + } +yy334: + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= 0x1F) { + if (yych <= 0x08) goto yy77; + if (yych <= '\f') goto yy330; + if (yych >= 0x0E) goto yy77; + } else { + if (yych <= '*') { + if (yych <= ')') goto yy330; + goto yy334; + } else { + if (yych == '/') goto yy238; + goto yy330; + } + } + ++YYCURSOR; + if (YYLIMIT <= YYCURSOR) YYFILL(1); + yych = *YYCURSOR; + if (yych <= '\r') { + if (yych <= 0x08) goto yy77; + if (yych <= '\f') goto yy330; + goto yy332; + } else { + if (yych <= 0x1F) goto yy77; + if (yych == '*') goto yy334; + goto yy330; + } +yy337: + ++YYCURSOR; +#line 63 "idl.re" + { BOOST_WAVE_RET(T_MINUSMINUS); } +#line 3150 "idl.inc" +yy339: + ++YYCURSOR; +#line 62 "idl.re" + { BOOST_WAVE_RET(T_PLUSPLUS); } +#line 3155 "idl.inc" +yy341: + yych = *++YYCURSOR; + if (yych == '/') goto yy342; + if (yych == '=') goto yy238; + goto yy77; +yy342: + yych = *++YYCURSOR; + if (yych == 'U') goto yy193; + if (yych == 'u') goto yy192; + goto yy77; +yy343: + ++YYCURSOR; +#line 34 "idl.re" + { BOOST_WAVE_RET(T_POUND_POUND); } +#line 3170 "idl.inc" +yy345: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych != 'L') goto yy202; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych != 'S') goto yy202; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych != 'E') goto yy202; + yyaccept = 11; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 2) { + goto yy201; + } + if (yych == '?') goto yy204; + if (yych == '\\') goto yy203; +yy349: +#line 27 "idl.re" + { BOOST_WAVE_RET(T_FALSE); } +#line 3191 "idl.inc" +yy350: + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych != 'U') goto yy202; + yyaccept = 0; + yych = *(YYMARKER = ++YYCURSOR); + if (yych != 'E') goto yy202; + yyaccept = 12; + yych = *(YYMARKER = ++YYCURSOR); + if (yybm[0+yych] & 2) { + goto yy201; + } + if (yych == '?') goto yy204; + if (yych == '\\') goto yy203; +yy353: +#line 26 "idl.re" + { BOOST_WAVE_RET(T_TRUE); } +#line 3209 "idl.inc" +yy354: + ++YYCURSOR; +#line 24 "idl.re" + { goto cppcomment; } +#line 3214 "idl.inc" +yy356: + ++YYCURSOR; +#line 23 "idl.re" + { goto ccomment; } +#line 3219 "idl.inc" +} +#line 137 "idl.re" + + +ccomment: + +#line 3226 "idl.inc" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '\f') { + if (yych <= 0x08) { + if (yych <= 0x00) goto yy366; + goto yy368; + } else { + if (yych == '\n') goto yy362; + goto yy365; + } + } else { + if (yych <= 0x1F) { + if (yych <= '\r') goto yy364; + goto yy368; + } else { + if (yych != '*') goto yy365; + } + } + ++YYCURSOR; + if ((yych = *YYCURSOR) == '/') goto yy371; +yy361: +#line 150 "idl.re" + { goto ccomment; } +#line 3252 "idl.inc" +yy362: + ++YYCURSOR; +yy363: +#line 143 "idl.re" + { + /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF);*/ + /*s->tok = cursor; */ + s->line += count_backslash_newlines(s, cursor) +1; + goto ccomment; + } +#line 3263 "idl.inc" +yy364: + yych = *++YYCURSOR; + if (yych == '\n') goto yy370; + goto yy363; +yy365: + yych = *++YYCURSOR; + goto yy361; +yy366: + ++YYCURSOR; +#line 153 "idl.re" + { + using namespace std; // some systems have printf in std + if(cursor == s->eof) + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_warning, + "Unterminated comment"); + else + printf("Error: Unterminated comment\n"); + } + else + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + else + printf("Error: 0 in file"); + } + /* adjust cursor such next call returns T_EOF */ + --YYCURSOR; + /* the comment is unterminated, but nevertheless its a comment */ + BOOST_WAVE_RET(T_CCOMMENT); + } +#line 3299 "idl.inc" +yy368: + ++YYCURSOR; +#line 180 "idl.re" + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "invalid character in input stream"); + else + printf("Error: 0 in file"); + } +#line 3311 "idl.inc" +yy370: + yych = *++YYCURSOR; + goto yy363; +yy371: + ++YYCURSOR; +#line 141 "idl.re" + { BOOST_WAVE_RET(T_CCOMMENT); } +#line 3319 "idl.inc" +} +#line 189 "idl.re" + + +cppcomment: + +#line 3326 "idl.inc" +{ + YYCTYPE yych; + if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); + yych = *YYCURSOR; + if (yych <= '\n') { + if (yych <= 0x00) goto yy381; + if (yych <= 0x08) goto yy375; + if (yych <= '\t') goto yy379; + goto yy376; + } else { + if (yych <= '\f') goto yy379; + if (yych <= '\r') goto yy378; + if (yych >= ' ') goto yy379; + } +yy375: +yy376: + ++YYCURSOR; +yy377: +#line 194 "idl.re" + { + /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF); */ + /*s->tok = cursor; */ + s->line++; + BOOST_WAVE_RET(T_CPPCOMMENT); + } +#line 3352 "idl.inc" +yy378: + yych = *++YYCURSOR; + if (yych == '\n') goto yy383; + goto yy377; +yy379: + ++YYCURSOR; +#line 201 "idl.re" + { goto cppcomment; } +#line 3361 "idl.inc" +yy381: + ++YYCURSOR; +#line 204 "idl.re" + { + using namespace std; // some systems have printf in std + if(cursor != s->eof) + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + else + printf("Error: 0 in file"); + } + /* adjust cursor such next call returns T_EOF */ + --YYCURSOR; + /* the comment is unterminated, but nevertheless its a comment */ + BOOST_WAVE_RET(T_CPPCOMMENT); + } +#line 3381 "idl.inc" +yy383: + ++YYCURSOR; + yych = *YYCURSOR; + goto yy377; +} +#line 220 "idl.re" + diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl.re b/src/boost/libs/wave/samples/waveidl/idllexer/idl.re new file mode 100644 index 000000000..f432f3b2b --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl.re @@ -0,0 +1,235 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +// to build idl.inc from this file: +// re2c -b -o idl.inc idl.re + +/*!re2c +re2c:indent:string = " "; +any = [\t\v\f\r\n\040-\377]; +anyctrl = [\000-\377]; +OctalDigit = [0-7]; +Digit = [0-9]; +HexDigit = [a-fA-F0-9]; +ExponentPart = [Ee] [+-]? Digit+; +FractionalConstant = (Digit* "." Digit+) | (Digit+ "."); +FloatingSuffix = [fF][lL]?|[lL][fF]?; +IntegerSuffix = [uU][lL]?|[lL][uU]?; +FixedPointSuffix = [dD]; +Backslash = [\\]|"??/"; +EscapeSequence = Backslash ([abfnrtv?'"] | Backslash | "x" HexDigit+ | OctalDigit OctalDigit? OctalDigit?); +HexQuad = HexDigit HexDigit HexDigit HexDigit; +UniversalChar = Backslash ("u" HexQuad | "U" HexQuad HexQuad); +Newline = "\r\n" | "\n" | "\r"; +PPSpace = ([ \t]|("/*"(any\[*]|Newline|("*"+(any\[*/]|Newline)))*"*"+"/"))*; +Pound = "#" | "??=" | "%:"; +*/ + +/*!re2c + "/*" { goto ccomment; } + "//" { goto cppcomment; } + + "TRUE" { BOOST_WAVE_RET(T_TRUE); } + "FALSE" { BOOST_WAVE_RET(T_FALSE); } + + "{" { BOOST_WAVE_RET(T_LEFTBRACE); } + "}" { BOOST_WAVE_RET(T_RIGHTBRACE); } + "[" { BOOST_WAVE_RET(T_LEFTBRACKET); } + "]" { BOOST_WAVE_RET(T_RIGHTBRACKET); } + "#" { BOOST_WAVE_RET(T_POUND); } + "##" { BOOST_WAVE_RET(T_POUND_POUND); } + "(" { BOOST_WAVE_RET(T_LEFTPAREN); } + ")" { BOOST_WAVE_RET(T_RIGHTPAREN); } + ";" { BOOST_WAVE_RET(T_SEMICOLON); } + ":" { BOOST_WAVE_RET(T_COLON); } + "?" { BOOST_WAVE_RET(T_QUESTION_MARK); } + "." { BOOST_WAVE_RET(T_DOT); } + "+" { BOOST_WAVE_RET(T_PLUS); } + "-" { BOOST_WAVE_RET(T_MINUS); } + "*" { BOOST_WAVE_RET(T_STAR); } + "/" { BOOST_WAVE_RET(T_DIVIDE); } + "%" { BOOST_WAVE_RET(T_PERCENT); } + "^" { BOOST_WAVE_RET(T_XOR); } + "&" { BOOST_WAVE_RET(T_AND); } + "|" { BOOST_WAVE_RET(T_OR); } + "~" { BOOST_WAVE_RET(T_COMPL); } + "!" { BOOST_WAVE_RET(T_NOT); } + "=" { BOOST_WAVE_RET(T_ASSIGN); } + "<" { BOOST_WAVE_RET(T_LESS); } + ">" { BOOST_WAVE_RET(T_GREATER); } + "<<" { BOOST_WAVE_RET(T_SHIFTLEFT); } + ">>" { BOOST_WAVE_RET(T_SHIFTRIGHT); } + "==" { BOOST_WAVE_RET(T_EQUAL); } + "!=" { BOOST_WAVE_RET(T_NOTEQUAL); } + "<=" { BOOST_WAVE_RET(T_LESSEQUAL); } + ">=" { BOOST_WAVE_RET(T_GREATEREQUAL); } + "&&" { BOOST_WAVE_RET(T_ANDAND); } + "||" { BOOST_WAVE_RET(T_OROR); } + "++" { BOOST_WAVE_RET(T_PLUSPLUS); } + "--" { BOOST_WAVE_RET(T_MINUSMINUS); } + "," { BOOST_WAVE_RET(T_COMMA); } + + ([a-zA-Z_] | UniversalChar) ([a-zA-Z_0-9] | UniversalChar)* + { BOOST_WAVE_RET(T_IDENTIFIER); } + + (("0" [xX] HexDigit+) | ("0" OctalDigit*) | ([1-9] Digit*)) IntegerSuffix? + { BOOST_WAVE_RET(T_INTLIT); } + + ((FractionalConstant ExponentPart?) | (Digit+ ExponentPart)) FloatingSuffix? + { BOOST_WAVE_RET(T_FLOATLIT); } + + (FractionalConstant | Digit+) FixedPointSuffix + { BOOST_WAVE_RET(T_FIXEDPOINTLIT); } + + "L"? (['] (EscapeSequence|any\[\n\r\\']|UniversalChar)+ [']) + { BOOST_WAVE_RET(T_CHARLIT); } + + "L"? (["] (EscapeSequence|any\[\n\r\\"]|UniversalChar)* ["]) + { BOOST_WAVE_RET(T_STRINGLIT); } + + + Pound PPSpace "include" PPSpace "<" (any\[\n\r>])+ ">" + { BOOST_WAVE_RET(T_PP_HHEADER); } + + Pound PPSpace "include" PPSpace "\"" (any\[\n\r"])+ "\"" + { BOOST_WAVE_RET(T_PP_QHEADER); } + + Pound PPSpace "include" PPSpace + { BOOST_WAVE_RET(T_PP_INCLUDE); } + + Pound PPSpace "if" { BOOST_WAVE_RET(T_PP_IF); } + Pound PPSpace "ifdef" { BOOST_WAVE_RET(T_PP_IFDEF); } + Pound PPSpace "ifndef" { BOOST_WAVE_RET(T_PP_IFNDEF); } + Pound PPSpace "else" { BOOST_WAVE_RET(T_PP_ELSE); } + Pound PPSpace "elif" { BOOST_WAVE_RET(T_PP_ELIF); } + Pound PPSpace "endif" { BOOST_WAVE_RET(T_PP_ENDIF); } + Pound PPSpace "define" { BOOST_WAVE_RET(T_PP_DEFINE); } + Pound PPSpace "undef" { BOOST_WAVE_RET(T_PP_UNDEF); } + Pound PPSpace "line" { BOOST_WAVE_RET(T_PP_LINE); } + Pound PPSpace "error" { BOOST_WAVE_RET(T_PP_ERROR); } + Pound PPSpace "pragma" { BOOST_WAVE_RET(T_PP_PRAGMA); } + + Pound PPSpace "warning" { BOOST_WAVE_RET(T_PP_WARNING); } + + [ \t\v\f]+ + { BOOST_WAVE_RET(T_SPACE); } + + Newline + { + s->line++; + BOOST_WAVE_RET(T_NEWLINE); + } + + "\000" + { + if(cursor != s->eof) + { + using namespace std; // some systems have printf in std + if (0 != s->error_proc) { + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + } + else + printf("Error: 0 in file\n"); + } + BOOST_WAVE_RET(T_EOF); + } + + anyctrl + { + BOOST_WAVE_RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); + } +*/ + +ccomment: +/*!re2c + "*/" { BOOST_WAVE_RET(T_CCOMMENT); } + Newline + { + /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF);*/ + /*s->tok = cursor; */ + s->line += count_backslash_newlines(s, cursor) +1; + goto ccomment; + } + + any { goto ccomment; } + + "\000" + { + using namespace std; // some systems have printf in std + if(cursor == s->eof) + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_warning, + "Unterminated comment"); + else + printf("Error: Unterminated comment\n"); + } + else + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + else + printf("Error: 0 in file"); + } + /* adjust cursor such next call returns T_EOF */ + --YYCURSOR; + /* the comment is unterminated, but nevertheless its a comment */ + BOOST_WAVE_RET(T_CCOMMENT); + } + + anyctrl + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "invalid character in input stream"); + else + printf("Error: 0 in file"); + } + +*/ + +cppcomment: +/*!re2c + Newline + { + /*if(cursor == s->eof) BOOST_WAVE_RET(T_EOF); */ + /*s->tok = cursor; */ + s->line++; + BOOST_WAVE_RET(T_CPPCOMMENT); + } + + any { goto cppcomment; } + + "\000" + { + using namespace std; // some systems have printf in std + if(cursor != s->eof) + { + if (s->error_proc) + (*s->error_proc)(s, + cpplexer::lexing_exception::generic_lexing_error, + "'\\000' in input stream"); + else + printf("Error: 0 in file"); + } + /* adjust cursor such next call returns T_EOF */ + --YYCURSOR; + /* the comment is unterminated, but nevertheless its a comment */ + BOOST_WAVE_RET(T_CPPCOMMENT); + } +*/ diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_interface.hpp b/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_interface.hpp new file mode 100644 index 000000000..3ee295d87 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_interface.hpp @@ -0,0 +1,78 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Definition of the abstract lexer interface + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_LEX_INTERFACE_HPP_INCLUDED) +#define IDL_LEX_INTERFACE_HPP_INCLUDED + +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/cpplexer/cpp_lex_interface_generator.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace idllexer { + +/////////////////////////////////////////////////////////////////////////////// +// +// new_lexer_gen: generates a new instance of the required C++ lexer +// +/////////////////////////////////////////////////////////////////////////////// +template < + typename IteratorT, + typename PositionT = boost::wave::util::file_position_type +> +struct 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 cpplexer::lex_input_interface< + cpplexer::lex_token<PositionT> + > * + new_lexer(IteratorT const &first, IteratorT const &last, + PositionT const &pos, boost::wave::language_support language); +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// The lex_input_interface decouples the lex_iterator_shim from the actual +// lexer. This is done to allow compile time reduction. +// Thanks to JCAB for having this idea. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +struct lex_input_interface_generator +: cpplexer::lex_input_interface<TokenT> +{ + typedef typename cpplexer::lex_input_interface<TokenT>::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. + template <typename IteratorT> + static cpplexer::lex_input_interface<TokenT> * + new_lexer(IteratorT const &first, IteratorT const &last, + position_type const &pos, boost::wave::language_support language) + { + return new_lexer_gen<IteratorT, position_type>::new_lexer (first, last, + pos, language); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace cpplexer +} // namespace wave +} // namespace boost + +#endif // !defined(IDL_LEX_INTERFACE_HPP_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_iterator.hpp b/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_iterator.hpp new file mode 100644 index 000000000..1eac09a3c --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl_lex_iterator.hpp @@ -0,0 +1,210 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Re2C based IDL lexer + Definition of the lexer iterator + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_LEX_ITERATOR_HPP_7926F865_E02F_4950_9EB5_5F453C9FF953_INCLUDED) +#define IDL_LEX_ITERATOR_HPP_7926F865_E02F_4950_9EB5_5F453C9FF953_INCLUDED + +#include <string> +#include <iostream> + +#include <boost/assert.hpp> +#include <boost/shared_ptr.hpp> +#include <boost/spirit/include/support_multi_pass.hpp> + +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/util/functor_input.hpp> + +#include "idl_lex_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 { +namespace idllexer { +namespace impl { + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_iterator_functor_shim +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename TokenT> +class lex_iterator_functor_shim +{ + typedef typename TokenT::position_type position_type; + +public: + lex_iterator_functor_shim() +#if /*0 != __DECCXX_VER || */defined(__PGI) + : eof() +#endif // 0 != __DECCXX_VER + {} + +// interface to the boost::spirit::classic::iterator_policies::functor_input +// policy + typedef TokenT result_type; + + BOOST_WAVE_EOF_PREFIX result_type const eof; + typedef lex_iterator_functor_shim unique; + typedef cpplexer::lex_input_interface<TokenT>* shared; + + template <typename MultiPass> + static result_type& get_next(MultiPass& mp, result_type& result) + { + return mp.shared()->ftor->get(result); + } + + // this will be called whenever the last reference to a multi_pass will + // be released + template <typename MultiPass> + static void destroy(MultiPass& mp) + { + delete mp.shared()->ftor; + } + + template <typename MultiPass> + static void set_position(MultiPass& mp, position_type const &pos) + { + mp.shared()->ftor->set_position(pos); + } + +private: + boost::shared_ptr<cpplexer::lex_input_interface<TokenT> > functor_ptr; +}; + +#if 0 != __COMO_VERSION__ || !BOOST_WORKAROUND(BOOST_MSVC, <= 1310) +/////////////////////////////////////////////////////////////////////////////// +// eof token +template <typename TokenT> +typename lex_iterator_functor_shim<TokenT>::result_type const + lex_iterator_functor_shim<TokenT>::eof = + typename lex_iterator_functor_shim<TokenT>::result_type(); +#endif // 0 != __COMO_VERSION__ + +/////////////////////////////////////////////////////////////////////////////// +} // namespace impl + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_iterator +// +// A generic C++ lexer interface class, which allows to plug in different +// lexer implementations (template parameter LexT). The following +// requirement apply: +// +// - the lexer type should have a function implemented, which returnes +// the next lexed token from the input stream: +// typename LexT::token_type get(); +// - at the end of the input stream this function should return the +// eof token equivalent +// - the lexer should implement a constructor taking two iterators +// pointing to the beginning and the end of the input stream and +// a third parameter containing the name of the parsed input file +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Divide the given functor type into its components (unique and shared) +// and build a std::pair from these parts +template <typename FunctorData> +struct make_multi_pass +{ + typedef + std::pair<typename FunctorData::unique, typename FunctorData::shared> + 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<functor_data_type, policy_type> type; +}; + +/////////////////////////////////////////////////////////////////////////////// +template <typename TokenT> +class lex_iterator +: public make_multi_pass<impl::lex_iterator_functor_shim<TokenT> >::type +{ + typedef impl::lex_iterator_functor_shim<TokenT> input_policy_type; + + typedef typename make_multi_pass<input_policy_type>::type base_type; + typedef typename make_multi_pass<input_policy_type>::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 <typename IteratorT> + lex_iterator(IteratorT const &first, IteratorT const &last, + typename TokenT::position_type const &pos, + boost::wave::language_support language) + : base_type( + functor_data_type( + unique_functor_type(), + idllexer::lex_input_interface_generator<TokenT> + ::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 + token_type const& currtoken = this->base_type::dereference(*this); + position_type currpos = currtoken.get_position(); + currpos.set_file(pos.get_file()); + currpos.set_line(pos.get_line()); + const_cast<token_type&>(currtoken).set_position(currpos); + + // set the new position for future tokens as well + unique_functor_type::set_position(*this, currpos); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + // this sample does no include guard detection + bool has_include_guards(std::string&) const { return false; } +#endif +}; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace idllexer +} // namespace wave +} // namespace boost + +#undef BOOST_WAVE_EOF_PREFIX + +#endif // !defined(IDL_LEX_ITERATOR_HPP_7926F865_E02F_4950_9EB5_5F453C9FF953_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.cpp b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.cpp new file mode 100644 index 000000000..256a7eee7 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.cpp @@ -0,0 +1,86 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include <ctime> +#include <cstdlib> +#include <cstdio> +#include <cstring> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <boost/config.hpp> + +#if defined(BOOST_HAS_UNISTD_H) +#include <unistd.h> +#else +#include <io.h> +#endif + +#include <boost/assert.hpp> +#include <boost/detail/workaround.hpp> + +// reuse the token ids and re2c helper functions from the default C++ lexer +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/re2clex/aq.hpp> +#include <boost/wave/cpplexer/re2clex/scanner.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> + +#include "idl_re.hpp" + +#if defined(_MSC_VER) && !defined(__COMO__) +#pragma warning (disable: 4101) // 'foo' : unreferenced local variable +#pragma warning (disable: 4102) // 'foo' : unreferenced label +#endif + +#define YYCTYPE uchar +#define YYCURSOR cursor +#define YYLIMIT s->lim +#define YYMARKER s->ptr +#define YYFILL(n) {cursor = fill(s, cursor);} + +//#define BOOST_WAVE_RET(i) {s->cur = cursor; return (i);} +#define BOOST_WAVE_RET(i) \ + { \ + s->line += count_backslash_newlines(s, cursor); \ + s->cur = cursor; \ + return (i); \ + } \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace idllexer { +namespace re2clex { + +bool is_backslash( + boost::wave::cpplexer::re2clex::uchar *p, + boost::wave::cpplexer::re2clex::uchar *end, int &len) +{ + if (*p == '\\') { + len = 1; + return true; + } + else if (*p == '?' && *(p+1) == '?' && (p+2 < end && *(p+2) == '/')) { + len = 3; + return true; + } + return false; +} + + +/////////////////////////////////////////////////////////////////////////////// +} // namespace re2clex +} // namespace idllexer +} // namespace wave +} // namespace boost diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.hpp b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.hpp new file mode 100644 index 000000000..15f07b70d --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re.hpp @@ -0,0 +1,371 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: Re2C based IDL lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_RE_HPP_BD62775D_1659_4684_872C_03C02543C9A5_INCLUDED) +#define IDL_RE_HPP_BD62775D_1659_4684_872C_03C02543C9A5_INCLUDED + +#include <ctime> +#include <cstdlib> +#include <cstdio> +#include <cstring> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <string> + +#include <boost/config.hpp> + +#if defined(BOOST_HAS_UNISTD_H) +#include <unistd.h> +#else +#include <io.h> +#endif + +#include <boost/assert.hpp> +#include <boost/detail/workaround.hpp> + +// reuse the token ids and re2c helper functions from the default C++ lexer +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/re2clex/aq.hpp> +#include <boost/wave/cpplexer/re2clex/scanner.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> + +#define BOOST_WAVE_BSIZE 196608 + +#define RE2C_ASSERT BOOST_ASSERT + +#if defined(_MSC_VER) && !defined(__COMO__) +#pragma warning (disable: 4101) // 'foo' : unreferenced local variable +#pragma warning (disable: 4102) // 'foo' : unreferenced label +#endif + +#define YYCTYPE uchar +#define YYCURSOR cursor +#define YYLIMIT s->lim +#define YYMARKER s->ptr +#define YYFILL(n) {cursor = fill(s, cursor);} + +//#define BOOST_WAVE_RET(i) {s->cur = cursor; return (i);} +#define BOOST_WAVE_RET(i) \ + { \ + s->line += count_backslash_newlines(s, cursor); \ + s->cur = cursor; \ + return (i); \ + } \ + /**/ + + + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace idllexer { +namespace re2clex { + +template<typename Iterator> +int +get_one_char(boost::wave::cpplexer::re2clex::Scanner<Iterator> *s) +{ + using namespace boost::wave::cpplexer::re2clex; + RE2C_ASSERT(s->first <= s->act && s->act <= s->last); + if (s->act < s->last) + return *(s->act)++; + return -1; +} + +template<typename Iterator> +std::ptrdiff_t +rewind_stream (boost::wave::cpplexer::re2clex::Scanner<Iterator> *s, int cnt) +{ + s->act += cnt; + RE2C_ASSERT(s->first <= s->act && s->act <= s->last); + return s->act - s->first; +} + +template<typename Iterator> +std::size_t +get_first_eol_offset(boost::wave::cpplexer::re2clex::Scanner<Iterator>* s) +{ + if (!AQ_EMPTY(s->eol_offsets)) + { + return s->eol_offsets->queue[s->eol_offsets->head]; + } + else + { + return (unsigned int)-1; + } +} + +template<typename Iterator> +void +adjust_eol_offsets(boost::wave::cpplexer::re2clex::Scanner<Iterator>* s, + std::size_t adjustment) +{ + boost::wave::cpplexer::re2clex::aq_queue q; + std::size_t i; + + if (!s->eol_offsets) + s->eol_offsets = boost::wave::cpplexer::re2clex::aq_create(); + + q = s->eol_offsets; + + if (AQ_EMPTY(q)) + return; + + i = q->head; + while (i != q->tail) + { + if (adjustment > q->queue[i]) + q->queue[i] = 0; + else + q->queue[i] -= adjustment; + ++i; + if (i == q->max_size) + i = 0; + } + if (adjustment > q->queue[i]) + q->queue[i] = 0; + else + q->queue[i] -= adjustment; +} + +template<typename Iterator> +int +count_backslash_newlines(boost::wave::cpplexer::re2clex::Scanner<Iterator> *s, + boost::wave::cpplexer::re2clex::uchar *cursor) +{ + using namespace boost::wave::cpplexer::re2clex; + + 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); + while (offset <= diff && offset != (unsigned int)-1) + { + skipped++; + boost::wave::cpplexer::re2clex::aq_pop(s->eol_offsets); + offset = get_first_eol_offset(s); + } + return skipped; +} + +bool +is_backslash( + boost::wave::cpplexer::re2clex::uchar *p, + boost::wave::cpplexer::re2clex::uchar *end, int &len); + +template<typename Iterator> +boost::wave::cpplexer::re2clex::uchar * +fill(boost::wave::cpplexer::re2clex::Scanner<Iterator> *s, + boost::wave::cpplexer::re2clex::uchar *cursor) +{ + using namespace std; // some systems have memcpy etc. in namespace std + using namespace boost::wave::cpplexer::re2clex; + + if(!s->eof) + { + uchar* p; + std::ptrdiff_t cnt = s->tok - s->bot; + if(cnt) + { + memcpy(s->bot, s->tok, s->lim - s->tok); + s->tok = s->bot; + s->ptr -= cnt; + cursor -= cnt; + s->lim -= cnt; + adjust_eol_offsets(s, cnt); + } + + if((s->top - s->lim) < BOOST_WAVE_BSIZE) + { + uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BOOST_WAVE_BSIZE)*sizeof(uchar)); + if (buf == 0) + { + using namespace std; // some systems have printf in std + if (0 != s->error_proc) { + (*s->error_proc)(s, + cpplexer::lexing_exception::unexpected_error, + "Out of memory!"); + } + else + printf("Out of memory!\n"); + + /* get the scanner to stop */ + *cursor = 0; + return cursor; + } + + memcpy(buf, s->tok, s->lim - s->tok); + s->tok = buf; + s->ptr = &buf[s->ptr - s->bot]; + cursor = &buf[cursor - s->bot]; + s->lim = &buf[s->lim - s->bot]; + s->top = &s->lim[BOOST_WAVE_BSIZE]; + free(s->bot); + s->bot = buf; + } + + cnt = std::distance(s->act, s->last); + if (cnt > BOOST_WAVE_BSIZE) + cnt = BOOST_WAVE_BSIZE; + uchar * dst = s->lim; + for (std::ptrdiff_t idx = 0; idx < cnt; ++idx) + { + *dst++ = *s->act++; + } + if (cnt != BOOST_WAVE_BSIZE) { + s->eof = &s->lim[cnt]; + *(s->eof)++ = '\0'; + } + + /* backslash-newline erasing time */ + + /* first scan for backslash-newline and erase them */ + for (p = s->lim; p < s->lim + cnt - 2; ++p) + { + int len = 0; + if (is_backslash(p, s->lim + cnt, len)) + { + if (*(p+len) == '\n') + { + int offset = len + 1; + memmove(p, p + offset, s->lim + cnt - p - offset); + cnt -= offset; + --p; + aq_enqueue(s->eol_offsets, p - s->bot + 1); + } + else if (*(p+len) == '\r') + { + if (*(p+len+1) == '\n') + { + int offset = len + 2; + memmove(p, p + offset, s->lim + cnt - p - offset); + cnt -= offset; + --p; + } + else + { + int offset = len + 1; + memmove(p, p + offset, s->lim + cnt - p - offset); + cnt -= offset; + --p; + } + aq_enqueue(s->eol_offsets, p - s->bot + 1); + } + } + } + + /* FIXME: the following code should be fixed to recognize correctly the + trigraph backslash token */ + + /* check to see if what we just read ends in a backslash */ + if (cnt >= 2) + { + uchar last = s->lim[cnt-1]; + uchar last2 = s->lim[cnt-2]; + /* check \ EOB */ + if (last == '\\') + { + int next = get_one_char(s); + /* check for \ \n or \ \r or \ \r \n straddling the border */ + if (next == '\n') + { + --cnt; /* chop the final \, we've already read the \n. */ + boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets, + cnt + (s->lim - s->bot)); + } + else if (next == '\r') + { + int next2 = get_one_char(s); + if (next2 == '\n') + { + --cnt; /* skip the backslash */ + } + else + { + /* rewind one, and skip one char */ + rewind_stream(s, -1); + --cnt; + } + boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets, + cnt + (s->lim - s->bot)); + } + else if (next != -1) /* -1 means end of file */ + { + /* next was something else, so rewind the stream */ + rewind_stream(s, -1); + } + } + /* check \ \r EOB */ + else if (last == '\r' && last2 == '\\') + { + int next = get_one_char(s); + if (next == '\n') + { + cnt -= 2; /* skip the \ \r */ + } + else + { + /* rewind one, and skip two chars */ + rewind_stream(s, -1); + cnt -= 2; + } + boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets, + cnt + (s->lim - s->bot)); + } + /* check \ \n EOB */ + else if (last == '\n' && last2 == '\\') + { + cnt -= 2; + boost::wave::cpplexer::re2clex::aq_enqueue(s->eol_offsets, + cnt + (s->lim - s->bot)); + } + } + + s->lim += cnt; + if (s->eof) /* eof needs adjusting if we erased backslash-newlines */ + { + s->eof = s->lim; + *(s->eof)++ = '\0'; + } + } + return cursor; +} + +/////////////////////////////////////////////////////////////////////////////// +// The scanner function to call whenever a new token is requested +template<typename Iterator> +BOOST_WAVE_DECL boost::wave::token_id scan( + boost::wave::cpplexer::re2clex::Scanner<Iterator> *s) +{ + + using namespace boost::wave::cpplexer::re2clex; + + uchar *cursor = s->tok = s->cur; + +#include "idl.inc" + + +} /* end of scan */ + +/////////////////////////////////////////////////////////////////////////////// +} // namespace re2clex +} // namespace idllexer +} // namespace wave +} // namespace boost + +#undef RE2C_ASSERT + +#endif // !defined(IDL_RE_HPP_BD62775D_1659_4684_872C_03C02543C9A5_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/idllexer/idl_re2c_lexer.hpp b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re2c_lexer.hpp new file mode 100644 index 000000000..e5d9a3a03 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/idllexer/idl_re2c_lexer.hpp @@ -0,0 +1,271 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Re2C based IDL lexer + + http://www.boost.org/ + + Copyright (c) 2001-2010 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(IDL_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED) +#define IDL_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED + +#include <string> +#include <cstdio> +#include <cstdarg> +#if defined(BOOST_SPIRIT_DEBUG) +#include <iostream> +#endif // defined(BOOST_SPIRIT_DEBUG) + +#include <boost/concept_check.hpp> +#include <boost/assert.hpp> +#include <boost/spirit/include/classic_core.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/util/file_position.hpp> +#include <boost/wave/cpplexer/validate_universal_char.hpp> +#include <boost/wave/cpplexer/cpplexer_exceptions.hpp> + +// reuse the default token type and re2c lexer helpers +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_interface.hpp> +#include <boost/wave/cpplexer/re2clex/scanner.hpp> + +#include "idl_re.hpp" + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace idllexer { +namespace re2clex { + +/////////////////////////////////////////////////////////////////////////////// +// +// encapsulation of the re2c based idl lexer +// +/////////////////////////////////////////////////////////////////////////////// + +template < + typename IteratorT, + typename PositionT = boost::wave::util::file_position_type +> +class lexer +{ + typedef boost::wave::cpplexer::re2clex::Scanner<IteratorT> scanner_t; + +public: + + typedef char char_t; + typedef boost::wave::cpplexer::re2clex::Scanner<IteratorT> base_t; + typedef boost::wave::cpplexer::lex_token<PositionT> 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(); + + token_type& get(token_type& t); + void set_position(PositionT const &pos) + { + // set position has to change the file name and line number only + filename = pos.get_file(); + scanner.line = pos.get_line(); + scanner.file_name = filename.c_str(); + } + +// error reporting from the re2c generated lexer + static int report_error(scanner_t const *s, int code, char const *, ...); + +private: + static char const *tok_names[]; + + scanner_t scanner; + string_type filename; + bool at_eof; + boost::wave::language_support language; +}; + +/////////////////////////////////////////////////////////////////////////////// +// initialize cpp lexer +template <typename IteratorT, typename PositionT> +inline +lexer<IteratorT, PositionT>::lexer(IteratorT const &first, + IteratorT const &last, PositionT const &pos, + boost::wave::language_support language) + : scanner(first, last), filename(pos.get_file()), at_eof(false), language(language) +{ + using namespace std; // some systems have memset in std + using namespace boost::wave::cpplexer::re2clex; + + scanner.line = pos.get_line(); + scanner.error_proc = report_error; + scanner.file_name = filename.c_str(); + +// not used by the lexer + scanner.enable_ms_extensions = 0; + scanner.act_in_c99_mode = 0; + + boost::ignore_unused_variable_warning(language); +} + +template <typename IteratorT, typename PositionT> +inline +lexer<IteratorT, PositionT>::~lexer() +{ + free(scanner.bot); +} + +/////////////////////////////////////////////////////////////////////////////// +// get the next token from the input stream +template <typename IteratorT, typename PositionT> +inline boost::wave::cpplexer::lex_token<PositionT>& +lexer<IteratorT, PositionT>::get(boost::wave::cpplexer::lex_token<PositionT>& t) +{ + using namespace boost::wave; // to import token ids to this scope + + if (at_eof) + return t = boost::wave::cpplexer::lex_token<PositionT>(); // 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)) { + boost::wave::cpplexer::impl::validate_identifier_name(value, + scanner.line, -1, filename); + } + } + else if (T_STRINGLIT == id || T_CHARLIT == id) { + // test literal characters for validity (throws if invalid chars found) + if (!boost::wave::need_no_character_validation(language)) { + boost::wave::cpplexer::impl::validate_literal(value, scanner.line, + -1, filename); + } + } + else if (T_EOF == id) { + // 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(); + } + return t = boost::wave::cpplexer::lex_token<PositionT>(id, value, + PositionT(filename, scanner.line, -1)); +} + +template <typename IteratorT, typename PositionT> +inline int +lexer<IteratorT, PositionT>::report_error(scanner_t 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(boost::wave::cpplexer::lexing_exception, + errcode, buffer, s->line, -1, s->file_name); + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// lex_functor +// +/////////////////////////////////////////////////////////////////////////////// + +template < + typename IteratorT, + typename PositionT = boost::wave::util::file_position_type +> +class lex_functor +: public lex_input_interface_generator< + typename lexer<IteratorT, PositionT>::token_type + > +{ +public: + + typedef typename lexer<IteratorT, PositionT>::token_type 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& t) { return re2c_lexer.get(t); } + void set_position(PositionT const &pos) + { re2c_lexer.set_position(pos); } +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + bool has_include_guards(std::string&) const { return false; } +#endif + +private: + lexer<IteratorT, PositionT> re2c_lexer; +}; + +} // namespace re2clex + +/////////////////////////////////////////////////////////////////////////////// +// +// The new_lexer_gen<>::new_lexer function (declared in cpp_slex_token.hpp) +// should be defined inline, if the lex_functor shouldn't be instantiated +// separately from the lex_iterator. +// +// Separate (explicit) instantiation helps to reduce compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 +#define BOOST_WAVE_RE2C_NEW_LEXER_INLINE +#else +#define BOOST_WAVE_RE2C_NEW_LEXER_INLINE inline +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// The 'new_lexer' function allows the opaque generation of a new lexer object. +// It is coupled to the iterator type to allow to decouple the lexer/iterator +// configurations at compile time. +// +// This function is declared inside the cpp_slex_token.hpp file, which is +// referenced by the source file calling the lexer and the source file, which +// instantiates the lex_functor. But it is defined here, so it will be +// instantiated only while compiling the source file, which instantiates the +// lex_functor. While the cpp_re2c_token.hpp file may be included everywhere, +// this file (cpp_re2c_lexer.hpp) should be included only once. This allows +// to decouple the lexer interface from the lexer implementation and reduces +// compilation time. +// +/////////////////////////////////////////////////////////////////////////////// + +template <typename IteratorT, typename PositionT> +BOOST_WAVE_RE2C_NEW_LEXER_INLINE +cpplexer::lex_input_interface<cpplexer::lex_token<PositionT> > * +new_lexer_gen<IteratorT, PositionT>::new_lexer(IteratorT const &first, + IteratorT const &last, PositionT const &pos, + wave::language_support language) +{ + return new re2clex::lex_functor<IteratorT, PositionT>(first, last, pos, + language); +} + +#undef BOOST_WAVE_RE2C_NEW_LEXER_INLINE + +/////////////////////////////////////////////////////////////////////////////// +} // namespace idllexer +} // namespace wave +} // namespace boost + +#endif // !defined(IDL_RE2C_LEXER_HPP_B81A2629_D5B1_4944_A97D_60254182B9A8_INCLUDED) diff --git a/src/boost/libs/wave/samples/waveidl/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/samples/waveidl/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..5647a44d5 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/instantiate_cpp_grammar.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Explicit instantiation of the cpp_grammar template + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "idllexer/idl_lex_iterator.hpp" + +#include <boost/wave/grammars/cpp_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::idllexer::lex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/waveidl/instantiate_defined_grammar.cpp b/src/boost/libs/wave/samples/waveidl/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..89db2dd65 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/instantiate_defined_grammar.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Explicit instantiation of the defined_grammar template + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "idllexer/idl_lex_iterator.hpp" + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::idllexer::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lexer_type; +template struct boost::wave::grammars::defined_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/waveidl/instantiate_predef_macros.cpp b/src/boost/libs/wave/samples/waveidl/instantiate_predef_macros.cpp new file mode 100644 index 000000000..904f77bfd --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/instantiate_predef_macros.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Explicit instantiation of the predefined_macros_grammar template + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "idllexer/idl_lex_iterator.hpp" + +#include <boost/wave/grammars/cpp_predef_macros_grammar.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the predefined_macros_grammar_gen template +// with the correct token type. This instantiates the corresponding pt_parse +// function, which in turn instantiates the cpp_predefined_macros_grammar +// object (see wave/grammars/cpp_predef_macros_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::idllexer::lex_iterator< + boost::wave::cpplexer::lex_token<> > + lexer_type; +template struct boost::wave::grammars::predefined_macros_grammar_gen<lexer_type>; + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer.cpp b/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer.cpp new file mode 100644 index 000000000..bc0873a4d --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "idllexer/idl_lex_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include "idllexer/idl_re2c_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. You will have to instantiate the +// new_lexer_gen<> template with the same iterator type, as you have used for +// instantiating the boost::wave::context<> object. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::idllexer::new_lexer_gen< + BOOST_WAVE_STRINGTYPE::iterator>; + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer_str.cpp b/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer_str.cpp new file mode 100644 index 000000000..7f9029082 --- /dev/null +++ b/src/boost/libs/wave/samples/waveidl/instantiate_re2c_lexer_str.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Sample: IDL oriented preprocessor + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2010 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) +=============================================================================*/ + +#include "idl.hpp" + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> + +#include "idllexer/idl_lex_iterator.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include "idllexer/idl_re2c_lexer.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// +// If you've used another iterator type as std::string::iterator, you have to +// instantiate the new_lexer_gen<> template for this iterator type too. +// The reason is, that the library internally uses the new_lexer_gen<> +// template with a std::string::iterator. (You just have to undefine the +// following line.) +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +template struct boost::wave::idllexer::new_lexer_gen<std::string::iterator>; + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/src/cpplexer/re2clex/aq.cpp b/src/boost/libs/wave/src/cpplexer/re2clex/aq.cpp new file mode 100644 index 000000000..61d01f411 --- /dev/null +++ b/src/boost/libs/wave/src/cpplexer/re2clex/aq.cpp @@ -0,0 +1,236 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001 Daniel C. Nuffer. + Copyright (c) 2001-2012 Hartmut Kaiser. + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +#include <cstdlib> +#include <cstring> + +#include <boost/wave/wave_config.hpp> // configuration data +#include <boost/wave/cpplexer/re2clex/aq.hpp> + +#include <boost/assert.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace re2clex { + +int aq_grow(aq_queue q) +{ + using namespace std; // some systems have memcpy/realloc in std + std::size_t new_size = q->max_size << 1; + aq_stdelement* new_queue = (aq_stdelement*)realloc(q->queue, + new_size * sizeof(aq_stdelement)); + + BOOST_ASSERT(NULL != q); + BOOST_ASSERT(q->max_size < 100000); + BOOST_ASSERT(q->size <= q->max_size); + +#define ASSERT_SIZE BOOST_ASSERT( \ + ((q->tail + q->max_size + 1) - q->head) % q->max_size == \ + q->size % q->max_size) + + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + if (!new_queue) + { + BOOST_ASSERT(0); + return 0; + } + + q->queue = new_queue; + if (q->tail <= q->head) /* tail has wrapped around */ + { + /* move the tail from the beginning to the end */ + memcpy(q->queue + q->max_size, q->queue, + (q->tail + 1) * sizeof(aq_stdelement)); + q->tail += q->max_size; + } + q->max_size = new_size; + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + return 1; +} + +int aq_enqueue(aq_queue q, aq_stdelement e) +{ + BOOST_ASSERT(NULL != q); + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + + if (AQ_FULL(q)) + if (!aq_grow(q)) + return 0; + + ++q->tail; + if (q->tail == q->max_size) + q->tail = 0; + + q->queue[q->tail] = e; + ++q->size; + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + return 1; +} + +int aq_enqueue_front(aq_queue q, aq_stdelement e) +{ + BOOST_ASSERT(NULL != q); + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + + if (AQ_FULL(q)) + if (!aq_grow(q)) + return 0; + + if (q->head == 0) + q->head = q->max_size - 1; + else + --q->head; + + q->queue[q->head] = e; + ++q->size; + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + return 1; +} + +int aq_serve(aq_queue q, aq_stdelement *e) +{ + + BOOST_ASSERT(NULL != q); + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + + if (AQ_EMPTY(q)) + return 0; + + *e = q->queue[q->head]; + return aq_pop(q); +} + +int aq_pop(aq_queue q) +{ + + BOOST_ASSERT(NULL != q); + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + + if (AQ_EMPTY(q)) + return 0; + + ++q->head; + if (q->head == q->max_size) + q->head = 0; + --q->size; + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + return 1; +} + +aq_queue aq_create(void) +{ + aq_queue q; + + using namespace std; // some systems have malloc in std + q = (aq_queue)malloc(sizeof(aq_queuetype)); + if (!q) + { + return 0; + } + + q->max_size = 8; /* initial size */ + q->queue = (aq_stdelement*)malloc( + sizeof(aq_stdelement) * q->max_size); + if (!q->queue) + { + free(q); + return 0; + } + + q->head = 0; + q->tail = q->max_size - 1; + q->size = 0; + + + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + return q; +} + +void aq_terminate(aq_queue q) +{ + using namespace std; // some systems have free in std + + BOOST_ASSERT(NULL != q); + BOOST_ASSERT(q->size <= q->max_size); + ASSERT_SIZE; + BOOST_ASSERT(q->head <= q->max_size); + BOOST_ASSERT(q->tail <= q->max_size); + + free(q->queue); + free(q); +} + +/////////////////////////////////////////////////////////////////////////////// +} // namespace re2clex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + diff --git a/src/boost/libs/wave/src/cpplexer/re2clex/cpp_re.cpp b/src/boost/libs/wave/src/cpplexer/re2clex/cpp_re.cpp new file mode 100644 index 000000000..844425a44 --- /dev/null +++ b/src/boost/libs/wave/src/cpplexer/re2clex/cpp_re.cpp @@ -0,0 +1,118 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + Copyright (c) 2001 Daniel C. Nuffer + Copyright (c) 2001-2012 Hartmut Kaiser. + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + TODO: + It also may be necessary to add $ to identifiers, for asm. + handle errors better. + have some easier way to parse strings instead of files (done) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +#include <ctime> +#include <cstdlib> +#include <cstdio> +#include <cstring> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <boost/wave/wave_config.hpp> // configuration data + +#if defined(BOOST_HAS_UNISTD_H) +#include <unistd.h> +#else +#include <io.h> +#endif + +#include <boost/detail/workaround.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/re2clex/aq.hpp> +#include <boost/wave/cpplexer/re2clex/scanner.hpp> +#include <boost/wave/cpplexer/re2clex/cpp_re.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +#if defined(BOOST_MSVC) +#pragma warning (disable: 4101) // 'foo' : unreferenced local variable +#pragma warning (disable: 4102) // 'foo' : unreferenced label +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { +namespace cpplexer { +namespace re2clex { + +bool is_backslash(uchar *p, uchar *end, int &len) +{ + if (*p == '\\') { + len = 1; + return true; + } + else if (*p == '?' && *(p+1) == '?' && (p+2 < end && *(p+2) == '/')) { + len = 3; + return true; + } + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// Special wrapper class holding the current cursor position +uchar_wrapper::uchar_wrapper (uchar *base_cursor, std::size_t column) + : base_cursor(base_cursor), column(column) +{} + +uchar_wrapper& uchar_wrapper::operator++() +{ + ++base_cursor; + ++column; + return *this; +} + +uchar_wrapper& uchar_wrapper::operator--() +{ + --base_cursor; + --column; + return *this; +} + +uchar uchar_wrapper::operator* () const +{ + return *base_cursor; +} + +uchar_wrapper::operator uchar *() const +{ + return base_cursor; +} + +std::ptrdiff_t +operator- (uchar_wrapper const& lhs, uchar_wrapper const& rhs) +{ + return lhs.base_cursor - rhs.base_cursor; +} + +} // namespace re2clex +} // namespace cpplexer +} // namespace wave +} // namespace boost + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + diff --git a/src/boost/libs/wave/src/instantiate_cpp_exprgrammar.cpp b/src/boost/libs/wave/src/instantiate_cpp_exprgrammar.cpp new file mode 100644 index 000000000..7026be00f --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_cpp_exprgrammar.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <utility> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +#include <boost/wave/grammars/cpp_expression_grammar.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the expression_grammar_gen template with the +// correct lexer iterator type. This instantiates the corresponding parse +// function, which in turn instantiates the expression_grammar object (see +// wave/grammars/cpp_expression_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +// if you want to use your own token type the following line must be adjusted +typedef boost::wave::cpplexer::lex_token<> token_type; + +// no need to change anything below +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::expression_grammar_gen<token_type>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/src/instantiate_cpp_grammar.cpp b/src/boost/libs/wave/src/instantiate_cpp_grammar.cpp new file mode 100644 index 000000000..be5c29c03 --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_cpp_grammar.cpp @@ -0,0 +1,56 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> +#include <list> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +#include <boost/wave/grammars/cpp_grammar.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the cpp_grammar_gen template with the correct +// token type. This instantiates the corresponding pt_parse function, which +// in turn instantiates the cpp_grammar object +// (see wave/grammars/cpp_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +// if you want to use your own token type the following line must be adjusted +typedef boost::wave::cpplexer::lex_token<> token_type; + +// no need to change anything below +typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; +typedef std::list<token_type, boost::fast_pool_allocator<token_type> > + token_sequence_type; + +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::cpp_grammar_gen<lexer_type, token_sequence_type>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/src/instantiate_cpp_literalgrs.cpp b/src/boost/libs/wave/src/instantiate_cpp_literalgrs.cpp new file mode 100644 index 000000000..f7ed6067b --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_cpp_literalgrs.cpp @@ -0,0 +1,56 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +#include <boost/wave/grammars/cpp_literal_grammar_gen.hpp> +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the intlit_grammar_gen and chlit_grammar_gen +// templates with the correct token type. This instantiates the corresponding +// parse function, which in turn instantiates the corresponding parser object. +// +/////////////////////////////////////////////////////////////////////////////// + +typedef boost::wave::cpplexer::lex_token<> token_type; + +// no need to change anything below +template struct boost::wave::grammars::intlit_grammar_gen<token_type>; +#if BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_AUTOSELECT || \ + BOOST_WAVE_WCHAR_T_SIGNEDNESS == BOOST_WAVE_WCHAR_T_FORCE_SIGNED +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::chlit_grammar_gen<int, token_type>; +#endif +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::chlit_grammar_gen<unsigned int, token_type>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/src/instantiate_defined_grammar.cpp b/src/boost/libs/wave/src/instantiate_defined_grammar.cpp new file mode 100644 index 000000000..899be68e9 --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_defined_grammar.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +#include <boost/wave/grammars/cpp_defined_grammar.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the defined_grammar_gen template +// with the correct token type. This instantiates the corresponding parse +// function, which in turn instantiates the defined_grammar +// object (see wave/grammars/cpp_defined_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +// if you want to use your own token type the following line must be adjusted +typedef boost::wave::cpplexer::lex_token<> token_type; + +// no need to change anything below +typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::defined_grammar_gen<lexer_type>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/src/instantiate_predef_macros.cpp b/src/boost/libs/wave/src/instantiate_predef_macros.cpp new file mode 100644 index 000000000..eaf4563fc --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_predef_macros.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> + +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +#include <boost/wave/grammars/cpp_predef_macros_grammar.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Explicit instantiation of the predefined_macros_grammar_gen template +// with the correct token type. This instantiates the corresponding pt_parse +// function, which in turn instantiates the cpp_predefined_macros_grammar +// object (see wave/grammars/cpp_predef_macros_grammar.hpp) +// +/////////////////////////////////////////////////////////////////////////////// + +// if you want to use your own token type the following line must be adjusted +typedef boost::wave::cpplexer::lex_token<> token_type; + +// no need to change anything below +typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; +template struct BOOST_SYMBOL_VISIBLE boost::wave::grammars::predefined_macros_grammar_gen<lexer_type>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 + diff --git a/src/boost/libs/wave/src/instantiate_re2c_lexer.cpp b/src/boost/libs/wave/src/instantiate_re2c_lexer.cpp new file mode 100644 index 000000000..ae9c02517 --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_re2c_lexer.cpp @@ -0,0 +1,65 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> // configuration data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this sample. You will have to instantiate the +// new_lexer_gen<> template with the same iterator type, as you have used for +// instantiating the boost::wave::context<> object. +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +// if you want to use another iterator type for the underlying input stream +// a corresponding explicit template instantiation needs to be added below +template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen< + BOOST_WAVE_STRINGTYPE::iterator>; +template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen< + BOOST_WAVE_STRINGTYPE::const_iterator>; + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/src/instantiate_re2c_lexer_str.cpp b/src/boost/libs/wave/src/instantiate_re2c_lexer_str.cpp new file mode 100644 index 000000000..2ddb30f93 --- /dev/null +++ b/src/boost/libs/wave/src/instantiate_re2c_lexer_str.cpp @@ -0,0 +1,64 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Explicit instantiation of the lex_functor generation function + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> +#include <boost/wave/wave_config.hpp> // configuration data + +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 + +#include <string> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// The following file needs to be included only once throughout the whole +// program. +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// If you've used another iterator type as std::string::iterator, you have to +// instantiate the new_lexer_gen<> template for this iterator type too. +// The reason is, that the library internally uses the new_lexer_gen<> +// template with a std::string::iterator. (You just have to undefine the +// following line.) +// +// This is moved into a separate compilation unit to decouple the compilation +// of the C++ lexer from the compilation of the other modules, which helps to +// reduce compilation time. +// +// The template parameter(s) supplied should be identical to the first +// parameter supplied while instantiating the boost::wave::context<> template +// (see the file cpp.cpp). +// +/////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_WAVE_STRINGTYPE_USE_STDSTRING) +template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen<std::string::iterator>; +template struct BOOST_SYMBOL_VISIBLE boost::wave::cpplexer::new_lexer_gen<std::string::const_iterator>; +#endif + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + +#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/boost/libs/wave/src/token_ids.cpp b/src/boost/libs/wave/src/token_ids.cpp new file mode 100644 index 000000000..a1261c9ac --- /dev/null +++ b/src/boost/libs/wave/src/token_ids.cpp @@ -0,0 +1,447 @@ +/*============================================================================= + 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-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +#include <string> +#include <boost/assert.hpp> +#include <boost/static_assert.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/token_ids.hpp> + +// this must occur after all of the includes and before any code appears +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_PREFIX +#endif + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { +namespace wave { + +/////////////////////////////////////////////////////////////////////////////// +// return a token name +BOOST_WAVE_STRINGTYPE +get_token_name(token_id tokid) +{ +// Table of token names +// +// Please note that the sequence of token names must match the sequence of +// token id's defined in then enum token_id above. +static char const *tok_names[] = { + /* 256 */ "AND", + /* 257 */ "ANDAND", + /* 258 */ "ASSIGN", + /* 259 */ "ANDASSIGN", + /* 260 */ "OR", + /* 261 */ "ORASSIGN", + /* 262 */ "XOR", + /* 263 */ "XORASSIGN", + /* 264 */ "COMMA", + /* 265 */ "COLON", + /* 266 */ "DIVIDE", + /* 267 */ "DIVIDEASSIGN", + /* 268 */ "DOT", + /* 269 */ "DOTSTAR", + /* 270 */ "ELLIPSIS", + /* 271 */ "EQUAL", + /* 272 */ "GREATER", + /* 273 */ "GREATEREQUAL", + /* 274 */ "LEFTBRACE", + /* 275 */ "LESS", + /* 276 */ "LESSEQUAL", + /* 277 */ "LEFTPAREN", + /* 278 */ "LEFTBRACKET", + /* 279 */ "MINUS", + /* 280 */ "MINUSASSIGN", + /* 281 */ "MINUSMINUS", + /* 282 */ "PERCENT", + /* 283 */ "PERCENTASSIGN", + /* 284 */ "NOT", + /* 285 */ "NOTEQUAL", + /* 286 */ "OROR", + /* 287 */ "PLUS", + /* 288 */ "PLUSASSIGN", + /* 289 */ "PLUSPLUS", + /* 290 */ "ARROW", + /* 291 */ "ARROWSTAR", + /* 292 */ "QUESTION_MARK", + /* 293 */ "RIGHTBRACE", + /* 294 */ "RIGHTPAREN", + /* 295 */ "RIGHTBRACKET", + /* 296 */ "COLON_COLON", + /* 297 */ "SEMICOLON", + /* 298 */ "SHIFTLEFT", + /* 299 */ "SHIFTLEFTASSIGN", + /* 300 */ "SHIFTRIGHT", + /* 301 */ "SHIFTRIGHTASSIGN", + /* 302 */ "STAR", + /* 303 */ "COMPL", + /* 304 */ "STARASSIGN", + /* 305 */ "ASM", + /* 306 */ "AUTO", + /* 307 */ "BOOL", + /* 308 */ "FALSE", + /* 309 */ "TRUE", + /* 310 */ "BREAK", + /* 311 */ "CASE", + /* 312 */ "CATCH", + /* 313 */ "CHAR", + /* 314 */ "CLASS", + /* 315 */ "CONST", + /* 316 */ "CONSTCAST", + /* 317 */ "CONTINUE", + /* 318 */ "DEFAULT", + /* 319 */ "DELETE", + /* 320 */ "DO", + /* 321 */ "DOUBLE", + /* 322 */ "DYNAMICCAST", + /* 323 */ "ELSE", + /* 324 */ "ENUM", + /* 325 */ "EXPLICIT", + /* 326 */ "EXPORT", + /* 327 */ "EXTERN", + /* 328 */ "FLOAT", + /* 329 */ "FOR", + /* 330 */ "FRIEND", + /* 331 */ "GOTO", + /* 332 */ "IF", + /* 333 */ "INLINE", + /* 334 */ "INT", + /* 335 */ "LONG", + /* 336 */ "MUTABLE", + /* 337 */ "NAMESPACE", + /* 338 */ "NEW", + /* 339 */ "OPERATOR", + /* 340 */ "PRIVATE", + /* 341 */ "PROTECTED", + /* 342 */ "PUBLIC", + /* 343 */ "REGISTER", + /* 344 */ "REINTERPRETCAST", + /* 345 */ "RETURN", + /* 346 */ "SHORT", + /* 347 */ "SIGNED", + /* 348 */ "SIZEOF", + /* 349 */ "STATIC", + /* 350 */ "STATICCAST", + /* 351 */ "STRUCT", + /* 352 */ "SWITCH", + /* 353 */ "TEMPLATE", + /* 354 */ "THIS", + /* 355 */ "THROW", + /* 356 */ "TRY", + /* 357 */ "TYPEDEF", + /* 358 */ "TYPEID", + /* 359 */ "TYPENAME", + /* 360 */ "UNION", + /* 361 */ "UNSIGNED", + /* 362 */ "USING", + /* 363 */ "VIRTUAL", + /* 364 */ "VOID", + /* 365 */ "VOLATILE", + /* 366 */ "WCHART", + /* 367 */ "WHILE", + /* 368 */ "PP_DEFINE", + /* 369 */ "PP_IF", + /* 370 */ "PP_IFDEF", + /* 371 */ "PP_IFNDEF", + /* 372 */ "PP_ELSE", + /* 373 */ "PP_ELIF", + /* 374 */ "PP_ENDIF", + /* 375 */ "PP_ERROR", + /* 376 */ "PP_LINE", + /* 377 */ "PP_PRAGMA", + /* 378 */ "PP_UNDEF", + /* 379 */ "PP_WARNING", + /* 380 */ "IDENTIFIER", + /* 381 */ "OCTALINT", + /* 382 */ "DECIMALINT", + /* 383 */ "HEXAINT", + /* 384 */ "INTLIT", + /* 385 */ "LONGINTLIT", + /* 386 */ "FLOATLIT", + /* 387 */ "CCOMMENT", + /* 388 */ "CPPCOMMENT", + /* 389 */ "CHARLIT", + /* 390 */ "STRINGLIT", + /* 391 */ "CONTLINE", + /* 392 */ "SPACE", + /* 393 */ "SPACE2", + /* 394 */ "NEWLINE", + /* 395 */ "POUND_POUND", + /* 396 */ "POUND", + /* 397 */ "ANY", + /* 398 */ "PP_INCLUDE", + /* 399 */ "PP_QHEADER", + /* 400 */ "PP_HHEADER", + /* 401 */ "EOF", + /* 402 */ "EOI", + /* 403 */ "PP_NUMBER", + + // MS extensions + /* 404 */ "MSEXT_INT8", + /* 405 */ "MSEXT_INT16", + /* 406 */ "MSEXT_INT32", + /* 407 */ "MSEXT_INT64", + /* 408 */ "MSEXT_BASED", + /* 409 */ "MSEXT_DECLSPEC", + /* 410 */ "MSEXT_CDECL", + /* 411 */ "MSEXT_FASTCALL", + /* 412 */ "MSEXT_STDCALL", + /* 413 */ "MSEXT_TRY", + /* 414 */ "MSEXT_EXCEPT", + /* 415 */ "MSEXT_FINALLY", + /* 416 */ "MSEXT_LEAVE", + /* 417 */ "MSEXT_INLINE", + /* 418 */ "MSEXT_ASM", + /* 419 */ "MSEXT_REGION", + /* 420 */ "MSEXT_ENDREGION", + + /* 421 */ "IMPORT", + + /* 422 */ "ALIGNAS", + /* 423 */ "ALIGNOF", + /* 424 */ "CHAR16_T", + /* 425 */ "CHAR32_T", + /* 426 */ "CONSTEXPR", + /* 427 */ "DECLTYPE", + /* 428 */ "NOEXCEPT", + /* 429 */ "NULLPTR", + /* 430 */ "STATIC_ASSERT", + /* 431 */ "THREADLOCAL", + /* 432 */ "RAWSTRINGLIT", + }; + + // make sure, I have not forgotten any commas (as I did more than once) + BOOST_STATIC_ASSERT( + sizeof(tok_names)/sizeof(tok_names[0]) == T_LAST_TOKEN-T_FIRST_TOKEN + ); + + unsigned int id = BASEID_FROM_TOKEN(tokid)-T_FIRST_TOKEN; + return (id < T_LAST_TOKEN-T_FIRST_TOKEN) ? tok_names[id] : "<UnknownToken>"; +} + +/////////////////////////////////////////////////////////////////////////////// +// return a token name +char const * +get_token_value(token_id tokid) +{ +// Table of token values +// +// Please note that the sequence of token names must match the sequence of +// token id's defined in then enum token_id above. +static char const *tok_values[] = { + /* 256 */ "&", + /* 257 */ "&&", + /* 258 */ "=", + /* 259 */ "&=", + /* 260 */ "|", + /* 261 */ "|=", + /* 262 */ "^", + /* 263 */ "^=", + /* 264 */ ",", + /* 265 */ ":", + /* 266 */ "/", + /* 267 */ "/=", + /* 268 */ ".", + /* 269 */ ".*", + /* 270 */ "...", + /* 271 */ "==", + /* 272 */ ">", + /* 273 */ ">=", + /* 274 */ "{", + /* 275 */ "<", + /* 276 */ "<=", + /* 277 */ "(", + /* 278 */ "[", + /* 279 */ "-", + /* 280 */ "-=", + /* 281 */ "--", + /* 282 */ "%", + /* 283 */ "%=", + /* 284 */ "!", + /* 285 */ "!=", + /* 286 */ "||", + /* 287 */ "+", + /* 288 */ "+=", + /* 289 */ "++", + /* 290 */ "->", + /* 291 */ "->*", + /* 292 */ "?", + /* 293 */ "}", + /* 294 */ ")", + /* 295 */ "]", + /* 296 */ "::", + /* 297 */ ";", + /* 298 */ "<<", + /* 299 */ "<<=", + /* 300 */ ">>", + /* 301 */ ">>=", + /* 302 */ "*", + /* 303 */ "~", + /* 304 */ "*=", + /* 305 */ "asm", + /* 306 */ "auto", + /* 307 */ "bool", + /* 308 */ "false", + /* 309 */ "true", + /* 310 */ "break", + /* 311 */ "case", + /* 312 */ "catch", + /* 313 */ "char", + /* 314 */ "class", + /* 315 */ "const", + /* 316 */ "const_cast", + /* 317 */ "continue", + /* 318 */ "default", + /* 319 */ "delete", + /* 320 */ "do", + /* 321 */ "double", + /* 322 */ "dynamic_cast", + /* 323 */ "else", + /* 324 */ "enum", + /* 325 */ "explicit", + /* 326 */ "export", + /* 327 */ "extern", + /* 328 */ "float", + /* 329 */ "for", + /* 330 */ "friend", + /* 331 */ "goto", + /* 332 */ "if", + /* 333 */ "inline", + /* 334 */ "int", + /* 335 */ "long", + /* 336 */ "mutable", + /* 337 */ "namespace", + /* 338 */ "new", + /* 339 */ "operator", + /* 340 */ "private", + /* 341 */ "protected", + /* 342 */ "public", + /* 343 */ "register", + /* 344 */ "reinterpret_cast", + /* 345 */ "return", + /* 346 */ "short", + /* 347 */ "signed", + /* 348 */ "sizeof", + /* 349 */ "static", + /* 350 */ "static_cast", + /* 351 */ "struct", + /* 352 */ "switch", + /* 353 */ "template", + /* 354 */ "this", + /* 355 */ "throw", + /* 356 */ "try", + /* 357 */ "typedef", + /* 358 */ "typeid", + /* 359 */ "typename", + /* 360 */ "union", + /* 361 */ "unsigned", + /* 362 */ "using", + /* 363 */ "virtual", + /* 364 */ "void", + /* 365 */ "volatile", + /* 366 */ "wchar_t", + /* 367 */ "while", + /* 368 */ "#define", + /* 369 */ "#if", + /* 370 */ "#ifdef", + /* 371 */ "#ifndef", + /* 372 */ "#else", + /* 373 */ "#elif", + /* 374 */ "#endif", + /* 375 */ "#error", + /* 376 */ "#line", + /* 377 */ "#pragma", + /* 378 */ "#undef", + /* 379 */ "#warning", + /* 380 */ "", // identifier + /* 381 */ "", // octalint + /* 382 */ "", // decimalint + /* 383 */ "", // hexlit + /* 384 */ "", // intlit + /* 385 */ "", // longintlit + /* 386 */ "", // floatlit + /* 387 */ "", // ccomment + /* 388 */ "", // cppcomment + /* 389 */ "", // charlit + /* 390 */ "", // stringlit + /* 391 */ "", // contline + /* 392 */ "", // space + /* 393 */ "", // space2 + /* 394 */ "\n", + /* 395 */ "##", + /* 396 */ "#", + /* 397 */ "", // any + /* 398 */ "#include", + /* 399 */ "#include", + /* 400 */ "#include", + /* 401 */ "", // eof + /* 402 */ "", // eoi + /* 403 */ "", // pp-number + + // MS extensions + /* 404 */ "__int8", + /* 405 */ "__int16", + /* 406 */ "__int32", + /* 407 */ "__int64", + /* 408 */ "__based", + /* 409 */ "__declspec", + /* 410 */ "__cdecl", + /* 411 */ "__fastcall", + /* 412 */ "__stdcall", + /* 413 */ "__try", + /* 414 */ "__except", + /* 415 */ "__finally", + /* 416 */ "__leave", + /* 417 */ "__inline", + /* 418 */ "__asm", + /* 419 */ "#region", + /* 420 */ "#endregion", + + /* 421 */ "import", + + /* 422 */ "alignas", + /* 423 */ "alignof", + /* 424 */ "char16_t", + /* 425 */ "char32_t", + /* 426 */ "constexpr", + /* 427 */ "decltype", + /* 428 */ "noexcept", + /* 429 */ "nullptr", + /* 430 */ "static_assert", + /* 431 */ "threadlocal", + /* 432 */ "", // extrawstringlit + }; + + // make sure, I have not forgotten any commas (as I did more than once) + BOOST_STATIC_ASSERT( + sizeof(tok_values)/sizeof(tok_values[0]) == T_LAST_TOKEN-T_FIRST_TOKEN + ); + + unsigned int id = BASEID_FROM_TOKEN(tokid)-T_FIRST_TOKEN; + return (id < T_LAST_TOKEN-T_FIRST_TOKEN) ? tok_values[id] : "<UnknownToken>"; +} + +/////////////////////////////////////////////////////////////////////////////// +} // namespace wave +} // namespace boost + +// the suffix header occurs after all of the code +#ifdef BOOST_HAS_ABI_HEADERS +#include BOOST_ABI_SUFFIX +#endif + + diff --git a/src/boost/libs/wave/src/wave_config_constant.cpp b/src/boost/libs/wave/src/wave_config_constant.cpp new file mode 100644 index 000000000..2b4e750a8 --- /dev/null +++ b/src/boost/libs/wave/src/wave_config_constant.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Persistent application configuration + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SOURCE 1 + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +#include <cstring> +#include <boost/preprocessor/stringize.hpp> + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/wave_config_constant.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace wave { + + /////////////////////////////////////////////////////////////////////////// + // Call this function to test the configuration of the calling application + // against the configuration of the linked library. + BOOST_WAVE_DECL bool + test_configuration(unsigned int config, char const* pragma_keyword, + char const* string_type_str) + { + if (NULL == pragma_keyword || NULL == string_type_str) + return false; + + using namespace std;; // some systems have strcmp in namespace std + if (config != BOOST_WAVE_CONFIG || + strcmp(pragma_keyword, BOOST_WAVE_PRAGMA_KEYWORD) || + strcmp(string_type_str, BOOST_PP_STRINGIZE((BOOST_WAVE_STRINGTYPE)))) + { + return false; + } + return true; + } + +/////////////////////////////////////////////////////////////////////////////// +}} // namespace boost::wave + diff --git a/src/boost/libs/wave/test/Jamfile b/src/boost/libs/wave/test/Jamfile new file mode 100644 index 000000000..d840874d4 --- /dev/null +++ b/src/boost/libs/wave/test/Jamfile @@ -0,0 +1,3 @@ +import testing ; + +build-project build ; diff --git a/src/boost/libs/wave/test/build/Jamfile.v2 b/src/boost/libs/wave/test/build/Jamfile.v2 new file mode 100644 index 000000000..ddbd5d666 --- /dev/null +++ b/src/boost/libs/wave/test/build/Jamfile.v2 @@ -0,0 +1,177 @@ +# Boost.Wave: A Standard compliant C++ preprocessor library +# +# Boost Wave Library Test Jamfile +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2011 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) + + +# +# These are the sources to compile for the testwave application +# +SOURCES_STATIC = testwave testwave_app + ; + +SOURCES_DYNAMIC = testwave_dll testwave_app_dll + ; + +SOURCES = $(SOURCE_STATIC) $(SOURCES_DYNAMIC) + ; + +path-constant TESTWAVE_DIR : $(BOOST_ROOT)/libs/wave/test/testwave/testfiles + ; + +# +# This are the arguments for the testwave executable +# +TESTWAVE_ARGUMENTS = + -d4 # use -d4 for verbose results + --hooks=1 # test hooks as well + -S$(TESTWAVE_DIR) + -S$(BOOST_ROOT) -I$(BOOST_ROOT) + ; + +# +# These are the names of the different unit tests to run +# +TESTWAVE_FILES = test.cfg + ; + +project wave/test + ; + +for local source in $(SOURCES) +{ + local requirements ; + requirements += <toolset-msvc:version>7.1:<rtti>off ; # workaround for compiler bug + requirements += <toolset-msvc:version>7.1_stlport4:<rtti>off ; + obj $(source) : ../testwave/$(source).cpp : $(requirements) ; +} + +# +# Wave test suite +# +test-suite wave + : + [ + run + # sources + ../testwave/$(SOURCES_DYNAMIC).cpp + /boost/wave//boost_wave + /boost/program_options//boost_program_options + /boost/filesystem//boost_filesystem + /boost/system//boost_system + /boost/thread//boost_thread + /boost/date_time//boost_date_time + : + # arguments + $(TESTWAVE_ARGUMENTS) + --config-file $(TESTWAVE_DIR)/$(TESTWAVE_FILES) + : + # input files + : + # requirements + <threading>multi + <variant>debug + <link>shared:<define>BOOST_ALL_DYN_LINK=1 + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE +# <define>BOOST_LIB_DIAGNOSTIC=1 + : + # name + testwave_dll + ] + + [ + run + # sources + ../testwave/$(SOURCES_STATIC).cpp + /boost/wave//boost_wave/<link>static + /boost/program_options//boost_program_options/<link>static + /boost/filesystem//boost_filesystem/<link>static + /boost/system//boost_system/<link>static + /boost/thread//boost_thread/<link>static + /boost/date_time//boost_date_time/<link>static + : + # arguments + $(TESTWAVE_ARGUMENTS) + --config-file $(TESTWAVE_DIR)/$(TESTWAVE_FILES) + : + # input files + : + # requirements + <threading>multi + <variant>debug + <link>static # Linking to DLL tested by testwave_dll + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE +# <define>BOOST_LIB_DIAGNOSTIC=1 + : + # name + testwave + ] + + # test the Slex wave lexing component + [ + run + # sources + ../testlexers/test_slex_lexer.cpp + /boost/wave//boost_wave + /boost/program_options//boost_program_options + /boost/filesystem//boost_filesystem + /boost/thread//boost_thread + /boost/system//boost_system + /boost/date_time//boost_date_time + : + # arguments + : + # input files + : + # requirements + <threading>multi + <variant>debug + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE + : + # name + test_slex_lexer + ] + # test the Re2C wave lexing component + [ + run + # sources + ../testlexers/test_re2c_lexer.cpp + /boost/wave//boost_wave + /boost/program_options//boost_program_options + /boost/filesystem//boost_filesystem + /boost/thread//boost_thread + /boost/system//boost_system + /boost/date_time//boost_date_time + : + # arguments + : + # input files + : + # requirements + <threading>multi + <variant>debug + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE + : + # name + test_re2c_lexer + ] + + [ + run + # sources + ../testwave/quick.cpp + /boost/wave//boost_wave + /boost/thread//boost_thread + /boost/filesystem//boost_filesystem + ] + ; + diff --git a/src/boost/libs/wave/test/testlexers/cpp_tokens.hpp b/src/boost/libs/wave/test/testlexers/cpp_tokens.hpp new file mode 100644 index 000000000..8d3ce37e9 --- /dev/null +++ b/src/boost/libs/wave/test/testlexers/cpp_tokens.hpp @@ -0,0 +1,254 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#include <boost/wave/wave_config.hpp> +#include <boost/wave/token_ids.hpp> + +/////////////////////////////////////////////////////////////////////////////// +struct lexem +{ + char const*token; + boost::wave::token_id id; +}; + +/////////////////////////////////////////////////////////////////////////////// +lexem const lexems[] = +{ + { "bitand", boost::wave::T_AND_ALT }, + { "and", boost::wave::T_ANDAND_ALT }, + { "and_eq", boost::wave::T_ANDASSIGN_ALT }, + { "bitor", boost::wave::T_OR_ALT }, + { "or_eq", boost::wave::T_ORASSIGN_ALT }, + { "or", boost::wave::T_OROR_ALT }, + { "xor", boost::wave::T_XOR_ALT }, + { "xor_eq", boost::wave::T_XORASSIGN_ALT }, + { "not", boost::wave::T_NOT_ALT }, + { "not_eq", boost::wave::T_NOTEQUAL_ALT }, + { "compl", boost::wave::T_COMPL_ALT }, + { "->*", boost::wave::T_ARROWSTAR }, + { ".*", boost::wave::T_DOTSTAR }, + { "::", boost::wave::T_COLON_COLON }, + + { "/* some C comment */", boost::wave::T_CCOMMENT }, + { "/* some multiline \n C comment \n */", boost::wave::T_CCOMMENT }, + { "// some c++ comment\n", boost::wave::T_CPPCOMMENT }, + { " ", boost::wave::T_SPACE }, + { "\t\v\f", boost::wave::T_SPACE }, + { "'c'", boost::wave::T_CHARLIT }, + { "'\\n'", boost::wave::T_CHARLIT }, + { "'\\u1234'", boost::wave::T_CHARLIT }, + { "'\\U12345678'", boost::wave::T_CHARLIT }, + { "\"string literal\"", boost::wave::T_STRINGLIT }, + { "\"string literal \\n \\u1234 \\U12345678\"", boost::wave::T_STRINGLIT }, + { "&&", boost::wave::T_ANDAND }, + { "&=", boost::wave::T_ANDASSIGN }, + { "==", boost::wave::T_EQUAL }, + { "=", boost::wave::T_ASSIGN }, + { "|=", boost::wave::T_ORASSIGN }, + { "\?\?!=", boost::wave::T_ORASSIGN_TRIGRAPH }, + { "||", boost::wave::T_OROR }, + { "|\?\?!", boost::wave::T_OROR_TRIGRAPH }, + { "\?\?!|", boost::wave::T_OROR_TRIGRAPH }, + { "\?\?!\?\?!", boost::wave::T_OROR_TRIGRAPH }, + { "|", boost::wave::T_OR }, + { "\?\?!", boost::wave::T_OR_TRIGRAPH }, + { "^=", boost::wave::T_XORASSIGN }, + { "\?\?'=", boost::wave::T_XORASSIGN_TRIGRAPH }, + { "^", boost::wave::T_XOR }, + { "\?\?'", boost::wave::T_XOR_TRIGRAPH }, + { ",", boost::wave::T_COMMA }, + { ":>", boost::wave::T_RIGHTBRACKET_ALT }, + { ":", boost::wave::T_COLON }, + { "/=", boost::wave::T_DIVIDEASSIGN }, + { "/", boost::wave::T_DIVIDE }, + { "...", boost::wave::T_ELLIPSIS }, + { ".", boost::wave::T_DOT }, + { ">>=", boost::wave::T_SHIFTRIGHTASSIGN }, + { ">>", boost::wave::T_SHIFTRIGHT }, + { ">=", boost::wave::T_GREATEREQUAL }, + { ">", boost::wave::T_GREATER }, + { "{", boost::wave::T_LEFTBRACE }, + { "<<=", boost::wave::T_SHIFTLEFTASSIGN }, + { "<<", boost::wave::T_SHIFTLEFT }, + { "<=", boost::wave::T_LESSEQUAL }, + { "<%", boost::wave::T_LEFTBRACE_ALT }, + { "<:", boost::wave::T_LEFTBRACKET_ALT }, + { "<", boost::wave::T_LESS }, + { "\?\?<", boost::wave::T_LEFTBRACE_TRIGRAPH }, + { "(", boost::wave::T_LEFTPAREN }, + { "[", boost::wave::T_LEFTBRACKET }, + { "\?\?(", boost::wave::T_LEFTBRACKET_TRIGRAPH }, + { "--", boost::wave::T_MINUSMINUS }, + { "-=", boost::wave::T_MINUSASSIGN }, + { "->", boost::wave::T_ARROW }, + { "-", boost::wave::T_MINUS }, + { "%:%:", boost::wave::T_POUND_POUND_ALT }, + { "%=", boost::wave::T_PERCENTASSIGN }, + { "%>", boost::wave::T_RIGHTBRACE_ALT }, + { "%:", boost::wave::T_POUND_ALT }, + { "%", boost::wave::T_PERCENT }, + { "!=", boost::wave::T_NOTEQUAL }, + { "!", boost::wave::T_NOT }, + { "+=", boost::wave::T_PLUSASSIGN }, + { "++", boost::wave::T_PLUSPLUS }, + { "+", boost::wave::T_PLUS }, + { "}", boost::wave::T_RIGHTBRACE }, + { "\?\?>", boost::wave::T_RIGHTBRACE_TRIGRAPH }, + { ")", boost::wave::T_RIGHTPAREN }, + { "]", boost::wave::T_RIGHTBRACKET }, + { "\?\?)", boost::wave::T_RIGHTBRACKET_TRIGRAPH }, + { ";", boost::wave::T_SEMICOLON }, + { "*=", boost::wave::T_STARASSIGN }, + { "*", boost::wave::T_STAR }, + { "~", boost::wave::T_COMPL }, + { "\?\?-", boost::wave::T_COMPL_TRIGRAPH }, + { "asm", boost::wave::T_ASM }, + { "auto", boost::wave::T_AUTO }, + { "bool", boost::wave::T_BOOL }, + { "false", boost::wave::T_FALSE }, + { "true", boost::wave::T_TRUE }, + { "break", boost::wave::T_BREAK }, + { "case", boost::wave::T_CASE }, + { "catch", boost::wave::T_CATCH }, + { "char", boost::wave::T_CHAR }, + { "class", boost::wave::T_CLASS }, + { "const_cast", boost::wave::T_CONSTCAST }, + { "const", boost::wave::T_CONST }, + { "continue", boost::wave::T_CONTINUE }, + { "default", boost::wave::T_DEFAULT }, + { "delete", boost::wave::T_DELETE }, + { "do", boost::wave::T_DO }, + { "double", boost::wave::T_DOUBLE }, + { "dynamic_cast", boost::wave::T_DYNAMICCAST }, + { "else", boost::wave::T_ELSE }, + { "enum", boost::wave::T_ENUM }, + { "explicit", boost::wave::T_EXPLICIT }, + { "export", boost::wave::T_EXPORT }, + { "extern", boost::wave::T_EXTERN }, + { "float", boost::wave::T_FLOAT }, + { "for", boost::wave::T_FOR }, + { "friend", boost::wave::T_FRIEND }, + { "goto", boost::wave::T_GOTO }, + { "if", boost::wave::T_IF }, +#if BOOST_WAVE_SUPPORT_IMPORT_KEYWORD != 0 + { "import", boost::wave::T_IMPORT}, +#endif + { "inline", boost::wave::T_INLINE }, + { "int", boost::wave::T_INT }, + { "long", boost::wave::T_LONG }, + { "mutable", boost::wave::T_MUTABLE }, + { "namespace", boost::wave::T_NAMESPACE }, + { "new", boost::wave::T_NEW }, + { "operator", boost::wave::T_OPERATOR }, + { "private", boost::wave::T_PRIVATE }, + { "protected", boost::wave::T_PROTECTED }, + { "public", boost::wave::T_PUBLIC }, + { "register", boost::wave::T_REGISTER }, + { "reinterpret_cast", boost::wave::T_REINTERPRETCAST }, + { "return", boost::wave::T_RETURN }, + { "short", boost::wave::T_SHORT }, + { "signed", boost::wave::T_SIGNED }, + { "sizeof", boost::wave::T_SIZEOF }, + { "static_cast", boost::wave::T_STATICCAST }, + { "static", boost::wave::T_STATIC }, + { "struct", boost::wave::T_STRUCT }, + { "switch", boost::wave::T_SWITCH }, + { "template", boost::wave::T_TEMPLATE }, + { "this", boost::wave::T_THIS }, + { "throw", boost::wave::T_THROW }, + { "try", boost::wave::T_TRY }, + { "typedef", boost::wave::T_TYPEDEF }, + { "typeid", boost::wave::T_TYPEID }, + { "typename", boost::wave::T_TYPENAME }, + { "union", boost::wave::T_UNION }, + { "unsigned", boost::wave::T_UNSIGNED }, + { "using", boost::wave::T_USING }, + { "virtual", boost::wave::T_VIRTUAL }, + { "void", boost::wave::T_VOID }, + { "volatile", boost::wave::T_VOLATILE }, + { "wchar_t", boost::wave::T_WCHART }, + { "while", boost::wave::T_WHILE }, +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + { "__int8", boost::wave::T_MSEXT_INT8 }, + { "__int16", boost::wave::T_MSEXT_INT16 }, + { "__int32", boost::wave::T_MSEXT_INT32 }, + { "__int64", boost::wave::T_MSEXT_INT64 }, + { "__based", boost::wave::T_MSEXT_BASED }, + { "_based", boost::wave::T_MSEXT_BASED }, + { "__declspec", boost::wave::T_MSEXT_DECLSPEC }, + { "_declspec", boost::wave::T_MSEXT_DECLSPEC }, + { "__fastcall", boost::wave::T_MSEXT_FASTCALL }, + { "_fastcall", boost::wave::T_MSEXT_FASTCALL }, + { "__stdcall", boost::wave::T_MSEXT_STDCALL }, + { "_stdcall", boost::wave::T_MSEXT_STDCALL }, + { "__try", boost::wave::T_MSEXT_TRY }, + { "__except", boost::wave::T_MSEXT_EXCEPT }, + { "__finally", boost::wave::T_MSEXT_FINALLY }, + { "__leave", boost::wave::T_MSEXT_LEAVE }, + { "__inline", boost::wave::T_MSEXT_INLINE }, + { "_inline", boost::wave::T_MSEXT_INLINE }, + { "__asm", boost::wave::T_MSEXT_ASM }, + { "_asm", boost::wave::T_MSEXT_ASM }, + { "#region", boost::wave::T_MSEXT_PP_REGION }, + { "#endregion", boost::wave::T_MSEXT_PP_ENDREGION }, +#endif // BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + { "#define", boost::wave::T_PP_DEFINE }, + { "#ifdef", boost::wave::T_PP_IFDEF }, + { "#ifndef", boost::wave::T_PP_IFNDEF }, + { "#if", boost::wave::T_PP_IF }, + { "#else", boost::wave::T_PP_ELSE }, + { "#elif", boost::wave::T_PP_ELIF }, + { "#endif", boost::wave::T_PP_ENDIF }, + { "#error", boost::wave::T_PP_ERROR }, + { "#include \"some_header\"", boost::wave::T_PP_QHEADER }, + { "#include <some_header>", boost::wave::T_PP_HHEADER }, +// { "#include SOME_HEADER", boost::wave::T_PP_INCLUDE }, + { "#line", boost::wave::T_PP_LINE }, + { "#pragma", boost::wave::T_PP_PRAGMA }, + { "#undef", boost::wave::T_PP_UNDEF }, + { "#warning", boost::wave::T_PP_WARNING }, + { "some_identifier_1234", boost::wave::T_IDENTIFIER }, + { "some_identifier_\\u00d4", boost::wave::T_IDENTIFIER }, + { "some_identifier_\\U000000d4", boost::wave::T_IDENTIFIER }, + { ".1", boost::wave::T_FLOATLIT }, + { "1.1", boost::wave::T_FLOATLIT }, + { "1.", boost::wave::T_FLOATLIT }, + { ".1e+1", boost::wave::T_FLOATLIT }, + { ".1E-1", boost::wave::T_FLOATLIT }, + { ".1e1", boost::wave::T_FLOATLIT }, + { "1e1", boost::wave::T_FLOATLIT }, + { "1e1f", boost::wave::T_FLOATLIT }, + { "1e1L", boost::wave::T_FLOATLIT }, + { "1.1e1fl", boost::wave::T_FLOATLIT }, + { "1.e1LF", boost::wave::T_FLOATLIT }, + { "1234LL", boost::wave::T_LONGINTLIT }, + { "1234Ll", boost::wave::T_LONGINTLIT }, + { "1234ll", boost::wave::T_LONGINTLIT }, + { "1234llu", boost::wave::T_LONGINTLIT }, + { "1234ull", boost::wave::T_LONGINTLIT }, +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + { "1234i64", boost::wave::T_LONGINTLIT }, +#endif + { "1234L", boost::wave::T_INTLIT }, + { "1234l", boost::wave::T_INTLIT }, + { "1234ul", boost::wave::T_INTLIT }, + { "1234LU", boost::wave::T_INTLIT }, + { "1234", boost::wave::T_INTLIT }, + { " ", boost::wave::T_SPACE }, + { "\t", boost::wave::T_SPACE }, + { "\n", boost::wave::T_NEWLINE }, + { "##", boost::wave::T_POUND_POUND }, + { "\?\?=\?\?=", boost::wave::T_POUND_POUND_TRIGRAPH }, + { "#", boost::wave::T_POUND }, + { "\?\?=", boost::wave::T_POUND_TRIGRAPH }, + { "\?\?/", boost::wave::T_ANY_TRIGRAPH }, + { "?", boost::wave::T_QUESTION_MARK }, + { NULL, boost::wave::token_id(0) } +}; + diff --git a/src/boost/libs/wave/test/testlexers/test_lexertl_lexer.cpp b/src/boost/libs/wave/test/testlexers/test_lexertl_lexer.cpp new file mode 100644 index 000000000..bef602f97 --- /dev/null +++ b/src/boost/libs/wave/test/testlexers/test_lexertl_lexer.cpp @@ -0,0 +1,91 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// system headers +#include <string> +#include <iostream> +#include <limits> + +#include <boost/wave/wave_config.hpp> +#undef BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION + +#include <boost/detail/lightweight_test.hpp> +#if defined(TESTLEXERS_TIMING) +#include "high_resolution_timer.hpp" +#endif + +// include the lexertl lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include <libs/wave/samples/list_includes/lexertl/lexertl_lexer.hpp> // lexer type + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::cpplexer::lexertl::lex_iterator<token_type> lexer_type; + +/////////////////////////////////////////////////////////////////////////////// +// include test data +#include "cpp_tokens.hpp" + +/////////////////////////////////////////////////////////////////////////////// +int +main(int argc, char *argv[]) +{ + try { + token_type::position_type pos("<testdata>"); + +#if defined(TESTLEXERS_TIMING) + boost::high_resolution_timer tim; + for (int i = 0; i < 1000; ++i) { +#endif + + for (lexem const* data = lexems; NULL != data->token; ++data) { + // feed the token to the lexer + token_type::string_type instr(data->token); + + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, + boost::wave::support_option_long_long); + lexer_type end = lexer_type(); + + // verify the correct outcome of the tokenization +#if defined(TESTLEXERS_VERBOSE) + std::cerr << boost::wave::get_token_name(data->id) << std::endl; +#endif + + if (data->id != boost::wave::token_id(*it)) { + BOOST_TEST(data->id == boost::wave::token_id(*it)); + std::cerr << data->token << ": expected: " + << boost::wave::get_token_name(data->id); + std::cerr << ", found: " + << boost::wave::get_token_name(boost::wave::token_id(*it)) + << std::endl; + } + BOOST_TEST(++it != end); + if (boost::wave::T_EOF != boost::wave::token_id(*it)) { + BOOST_TEST(boost::wave::T_EOF == boost::wave::token_id(*it)); + std::cerr << data->token << ": not fully matched, " + << "first non-matched token was: " << (*it).get_value() + << std::endl; + } + } + +#if defined(TESTLEXERS_TIMING) + } + std::cout << tim.elapsed() << " [s]" << std::endl; +#endif + } + catch (boost::wave::cpplexer::lexing_exception &e) { + // some lexing error + std::cerr + << "test_lexertl_lexer: " + << e.description() << std::endl; + return (std::numeric_limits<int>::max)() - 1; + } + + return boost::report_errors(); +} + diff --git a/src/boost/libs/wave/test/testlexers/test_re2c_lexer.cpp b/src/boost/libs/wave/test/testlexers/test_re2c_lexer.cpp new file mode 100644 index 000000000..344d8c487 --- /dev/null +++ b/src/boost/libs/wave/test/testlexers/test_re2c_lexer.cpp @@ -0,0 +1,97 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +// system headers +#include <string> +#include <iostream> +#include <limits> + +#include <boost/wave/wave_config.hpp> +#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) +#undef BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION +#endif + +#include <boost/detail/lightweight_test.hpp> +#if defined(TESTLEXERS_TIMING) +#include "high_resolution_timer.hpp" +#endif + +// include the Re2C lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> // lexer type + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; + +/////////////////////////////////////////////////////////////////////////////// +// include test data +#include "cpp_tokens.hpp" + +/////////////////////////////////////////////////////////////////////////////// +int +main(int argc, char *argv[]) +{ + try { + token_type::position_type pos("<testdata>"); + +#if defined(TESTLEXERS_TIMING) + boost::high_resolution_timer tim; + for (int i = 0; i < 1000; ++i) { +#endif + + for (lexem const* data = lexems; NULL != data->token; ++data) { + // feed the token to the lexer + token_type::string_type instr(data->token); + + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, + boost::wave::support_option_long_long); + lexer_type end = lexer_type(); + + // verify the correct outcome of the tokenization +#if defined(TESTLEXERS_VERBOSE) + std::cerr << boost::wave::get_token_name(data->id) << std::endl; +#endif + + if (data->id != boost::wave::token_id(*it)) { + BOOST_TEST(data->id == boost::wave::token_id(*it)); + std::cerr << data->token << ": expected: " + << boost::wave::get_token_name(data->id); + std::cerr << ", found: " + << boost::wave::get_token_name(boost::wave::token_id(*it)) + << std::endl; + } + BOOST_TEST(++it != end); + if (boost::wave::T_EOF != boost::wave::token_id(*it)) { + BOOST_TEST(boost::wave::T_EOF == boost::wave::token_id(*it)); + std::cerr << data->token << ": not fully matched, " + << "first non-matched token was: " << (*it).get_value() + << std::endl; + } + } + +#if defined(TESTLEXERS_TIMING) + } + std::cout << tim.elapsed() << " [s]" << std::endl; +#endif + } + catch (boost::wave::cpplexer::lexing_exception &e) { + // some lexing error + std::cerr + << "test_re2c_lexer: " + << e.description() << std::endl; + return (std::numeric_limits<int>::max)() - 1; + } + + return boost::report_errors(); +} + diff --git a/src/boost/libs/wave/test/testlexers/test_slex_lexer.cpp b/src/boost/libs/wave/test/testlexers/test_slex_lexer.cpp new file mode 100644 index 000000000..a0754a36d --- /dev/null +++ b/src/boost/libs/wave/test/testlexers/test_slex_lexer.cpp @@ -0,0 +1,100 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +// system headers +#include <string> +#include <iostream> +#include <limits> + +#include <boost/wave/wave_config.hpp> +#undef BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION + +#include <boost/detail/lightweight_test.hpp> +#if defined(TESTLEXERS_TIMING) +#include "high_resolution_timer.hpp" +#endif + +/////////////////////////////////////////////////////////////////////////////// +// include the Slex lexer related stuff +#include <libs/wave/samples/cpp_tokens/slex_token.hpp> // token type +#include <libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp> // lexer type + +typedef boost::wave::cpplexer::slex_token<> token_type; +typedef boost::wave::cpplexer::slex::slex_iterator<token_type> lexer_type; + +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this test. +template struct boost::wave::cpplexer::slex::new_lexer_gen< + std::string::iterator>; + +/////////////////////////////////////////////////////////////////////////////// +// include test data +#include "cpp_tokens.hpp" + +/////////////////////////////////////////////////////////////////////////////// +int +main(int argc, char *argv[]) +{ + try { + token_type::position_type pos("<testdata>"); + +#if defined(TESTLEXERS_TIMING) + boost::high_resolution_timer tim; + for (int i = 0; i < 1000; ++i) { +#endif + + for (lexem const* data = lexems; NULL != data->token; ++data) { + // feed the token to the lexer + token_type::string_type instr(data->token); + + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, + boost::wave::support_option_long_long); + lexer_type end = lexer_type(); + + // verify the correct outcome of the tokenization +#if defined(TESTLEXERS_VERBOSE) + std::cerr << boost::wave::get_token_name(data->id) << std::endl; +#endif + + if (data->id != boost::wave::token_id(*it)) { + BOOST_TEST(data->id == boost::wave::token_id(*it)); + std::cerr << data->token << ": expected: " + << boost::wave::get_token_name(data->id); + std::cerr << ", found: " + << boost::wave::get_token_name(boost::wave::token_id(*it)) + << std::endl; + } + BOOST_TEST(++it != end); + if (boost::wave::T_EOF != boost::wave::token_id(*it)) { + BOOST_TEST(boost::wave::T_EOF == boost::wave::token_id(*it)); + std::cerr << data->token << ": not fully matched, " + << "first non-matched token was: " << (*it).get_value() + << std::endl; + } + } + +#if defined(TESTLEXERS_TIMING) + } + std::cout << tim.elapsed() << " [s]" << std::endl; +#endif + } + catch (boost::wave::cpplexer::lexing_exception &e) { + // some lexing error + std::cerr + << "test_slex_lexer: " + << e.description() << std::endl; + return (std::numeric_limits<int>::max)() - 1; + } + + return boost::report_errors(); +} + diff --git a/src/boost/libs/wave/test/testlexers/test_xlex_lexer.cpp b/src/boost/libs/wave/test/testlexers/test_xlex_lexer.cpp new file mode 100644 index 000000000..12eb76428 --- /dev/null +++ b/src/boost/libs/wave/test/testlexers/test_xlex_lexer.cpp @@ -0,0 +1,92 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +// system headers +#include <string> +#include <iostream> +#include <limits> + +#include <boost/wave/wave_config.hpp> +#include <boost/detail/lightweight_test.hpp> +#if defined(TESTLEXERS_TIMING) +#include "high_resolution_timer.hpp" +#endif + +/////////////////////////////////////////////////////////////////////////////// +// include the Xpressive lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include <libs/wave/samples/token_statistics/xlex/xlex_lexer.hpp> // lexer type + +typedef boost::wave::cpplexer::lex_token<> token_type; +typedef boost::wave::cpplexer::xlex::xlex_iterator<token_type> lexer_type; + +// This instantiates the correct 'new_lexer' function, which generates the +// C++ lexer used in this test. +template struct boost::wave::cpplexer::xlex::new_lexer_gen<std::string::iterator>; + +/////////////////////////////////////////////////////////////////////////////// +// include test data +#include "cpp_tokens.hpp" + +/////////////////////////////////////////////////////////////////////////////// +int +main(int argc, char *argv[]) +{ + try { + token_type::position_type pos("<testdata>"); + +#if defined(TESTLEXERS_TIMING) + boost::high_resolution_timer tim; + for (int i = 0; i < 10; ++i) { +#endif + + for (lexem const* data = lexems; NULL != data->token; ++data) { + // feed the token to the lexer + token_type::string_type instr(data->token); + + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, + boost::wave::support_option_long_long); + lexer_type end = lexer_type(); + + // verify the correct outcome of the tokenisation +#if defined(TESTLEXERS_VERBOSE) + std::cerr << boost::wave::get_token_name(data->id) << std::endl; +#endif + + if (data->id != boost::wave::token_id(*it)) { + BOOST_TEST(data->id == boost::wave::token_id(*it)); + std::cerr << data->token << ": expected: " + << boost::wave::get_token_name(data->id); + std::cerr << ", found: " + << boost::wave::get_token_name(boost::wave::token_id(*it)) + << std::endl; + } + BOOST_TEST(++it != end); + BOOST_TEST(boost::wave::T_EOF == boost::wave::token_id(*it)); + } + +#if defined(TESTLEXERS_TIMING) + } + std::cout << tim.elapsed() << " [s]" << std::endl; +#endif + } + catch (boost::wave::cpplexer::lexing_exception &e) { + // some lexing error + std::cerr + << "test_xlex_lexer: " + << e.description() << std::endl; + return (std::numeric_limits<int>::max)() - 1; + } + + return boost::report_errors(); +} + diff --git a/src/boost/libs/wave/test/testwave/cmd_line_utils.hpp b/src/boost/libs/wave/test/testwave/cmd_line_utils.hpp new file mode 100644 index 000000000..8d674aefe --- /dev/null +++ b/src/boost/libs/wave/test/testwave/cmd_line_utils.hpp @@ -0,0 +1,235 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LIBS_WAVE_TEST_CMD_LINE_UTILS_HPP) +#define BOOST_WAVE_LIBS_WAVE_TEST_CMD_LINE_UTILS_HPP + +#include <string> +#include <fstream> +#include <vector> + +#include <boost/config.hpp> +#include <boost/assert.hpp> +#include <boost/any.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// forward declarations only +namespace cmd_line_utils +{ + class include_paths; +} + +namespace boost { namespace program_options +{ + void validate(boost::any &v, std::vector<std::string> const &s, + cmd_line_utils::include_paths *, int); +}} // boost::program_options + +/////////////////////////////////////////////////////////////////////////////// +#include <boost/program_options.hpp> + +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_utils { + + namespace po = boost::program_options; + + /////////////////////////////////////////////////////////////////////////// + // Additional command line parser which interprets '@something' as an + // option "config-file" with the value "something". + inline std::pair<std::string, std::string> + at_option_parser(std::string const& s) + { + if ('@' == s[0]) + return std::make_pair(std::string("config-file"), s.substr(1)); + else + return std::pair<std::string, std::string>(); + } + + /////////////////////////////////////////////////////////////////////////// + // class, which keeps the include file information read from the options + class include_paths + { + public: + include_paths() : seen_separator(false) {} + + std::vector<std::string> paths; // stores user paths + std::vector<std::string> syspaths; // stores system paths + bool seen_separator; // options contain a '-I-' option + + // Function which validates additional tokens from the given option. + static void + validate(boost::any &v, std::vector<std::string> const &tokens) + { + if (v.empty()) + v = boost::any(include_paths()); + + include_paths *p = boost::any_cast<include_paths>(&v); + BOOST_ASSERT(NULL != p); + + // Assume only one path per '-I' occurrence. + std::string const& t = po::validators::get_single_string(tokens); + if (t == "-") { + // found -I- option, so switch behaviour + p->seen_separator = true; + } + else if (p->seen_separator) { + // store this path as a system path + p->syspaths.push_back(t); + } + else { + // store this path as an user path + p->paths.push_back(t); + } + } + }; + + /////////////////////////////////////////////////////////////////////////// + // Read all options from a given config string, parse and add them to the + // given variables_map + inline void + read_config_options(int debuglevel, std::string const &indata, + po::options_description const &desc, po::variables_map &vm) + { + if (9 == debuglevel) { + std::cerr << "read_config_options: reading config options" + << std::endl; + } + + std::istringstream istrm(indata); + + std::vector<std::string> options; + std::string line; + + while (std::getline(istrm, line)) { + // skip empty lines + std::string::size_type pos = line.find_first_not_of(" \t"); + if (pos == std::string::npos) + continue; + + // skip comment lines + if ('#' != line[pos]) + options.push_back(line); + } + + if (options.size() > 0) { + if (9 == debuglevel) { + std::cerr << "read_config_options: options size is: " + << (int)options.size() << std::endl; + } + + // (the (int) cast is to make the True64 compiler happy) + using namespace boost::program_options::command_line_style; + po::store(po::command_line_parser(options) + .options(desc).style((int)unix_style).run(), vm); + po::notify(vm); + } + + if (9 == debuglevel) { + std::cerr << "read_config_options: succeeded to read config options" + << std::endl; + } + } + + /////////////////////////////////////////////////////////////////////////// + // Read all options from a given config file, parse and add them to the + // given variables_map + inline bool + read_config_file(int debuglevel, std::string const &filename, + po::options_description const &desc, po::variables_map &vm) + { + if (9 == debuglevel) { + std::cerr << "read_config_file: reading config options" + << std::endl; + } + + std::ifstream ifs(filename.c_str()); + + if (!ifs.is_open()) { + std::cerr + << "testwave: " << filename + << ": command line warning: config file not found" + << std::endl; + return false; + } + + // parse the file and extract all given arguments and options + std::vector<std::string> options; + std::string line; + + while (std::getline(ifs, line)) { + // skip empty lines + std::string::size_type pos = line.find_first_not_of(" \t"); + if (pos == std::string::npos) + continue; + + // skip comment lines + if ('#' != line[pos]) + options.push_back(line); + } + + if (options.size() > 0) { + if (9 == debuglevel) { + std::cerr << "read_config_file: options size is: " + << (int)options.size() << std::endl; + } + + // treat positional arguments as --input parameters + po::positional_options_description p; + p.add("input", -1); + + // parse the vector of lines and store the results into the given + // variables map + // (the (int) cast is to make the True64 compiler happy) + using namespace boost::program_options::command_line_style; + po::store(po::command_line_parser(options) + .options(desc).positional(p).style((int)unix_style).run(), vm); + po::notify(vm); + } + + + if (9 == debuglevel) { + std::cerr << "read_config_file: succeeded to read config options" + << std::endl; + } + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // predicate to extract all positional arguments from the command line + struct is_argument + { + bool operator()(po::option const &opt) + { + return (opt.position_key == -1) ? true : false; + } + }; + +/////////////////////////////////////////////////////////////////////////////// +} // namespace cmd_line_utils + +/////////////////////////////////////////////////////////////////////////////// +// +// Special validator overload, which allows to handle the -I- syntax for +// switching the semantics of an -I option. +// +// This must be injected into the boost::program_options namespace +// +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace program_options { + + inline void + validate(boost::any &v, std::vector<std::string> const &s, + cmd_line_utils::include_paths *, int) + { + cmd_line_utils::include_paths::validate(v, s); + } + +}} // namespace boost::program_options + +#endif // !defined(BOOST_WAVE_LIBS_WAVE_TEST_CMD_LINE_UTILS_HPP) diff --git a/src/boost/libs/wave/test/testwave/collect_hooks_information.hpp b/src/boost/libs/wave/test/testwave/collect_hooks_information.hpp new file mode 100644 index 000000000..17f17adee --- /dev/null +++ b/src/boost/libs/wave/test/testwave/collect_hooks_information.hpp @@ -0,0 +1,873 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LIBS_WAVE_TEST_COLLECT_HOOKS_INFORMATION_HPP) +#define BOOST_WAVE_LIBS_WAVE_TEST_COLLECT_HOOKS_INFORMATION_HPP + +#include <boost/config.hpp> +#include <boost/lexical_cast.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// workaround for missing ostringstream +#ifdef BOOST_NO_STRINGSTREAM +#include <strstream> +#define BOOST_WAVETEST_OSSTREAM std::ostrstream +std::string BOOST_WAVETEST_GETSTRING(std::ostrstream& ss) +{ + ss << ends; + std::string rval = ss.str(); + ss.freeze(false); + return rval; +} +#else +#include <sstream> +#define BOOST_WAVETEST_GETSTRING(ss) ss.str() +#define BOOST_WAVETEST_OSSTREAM std::ostringstream +#endif + +/////////////////////////////////////////////////////////////////////////////// +template <typename String> +String handle_filepath(String const &name) +{ + using boost::wave::util::impl::unescape_lit; + + String unesc_name (unescape_lit(name)); + typename String::size_type p = unesc_name.find_last_of("/\\"); + if (p != unesc_name.npos) + unesc_name = unesc_name.substr(p+1); + return unesc_name; +} + +/////////////////////////////////////////////////////////////////////////////// +template <typename String> +inline String repr(boost::wave::util::file_position<String> const& pos) +{ + std::string linenum = boost::lexical_cast<std::string>(pos.get_line()); + return handle_filepath(pos.get_file()) + String("(") + linenum.c_str() + ")"; +} + +template <typename String> +inline String repr(String const& value) +{ + String result; + typename String::const_iterator end = value.end(); + for (typename String::const_iterator it = value.begin(); it != end; ++it) + { + typedef typename String::value_type char_type; + char_type c = *it; + if (c == static_cast<char_type>('\a')) + result.append("\\a"); + else if (c == static_cast<char_type>('\b')) + result.append("\\b"); + else if (c == static_cast<char_type>('\f')) + result.append("\\f"); + else if (c == static_cast<char_type>('\n')) + result.append("\\n"); + else if (c == static_cast<char_type>('\r')) + result.append("\\r"); + else if (c == static_cast<char_type>('\t')) + result.append("\\t"); + else if (c == static_cast<char_type>('\v')) + result.append("\\v"); + else + result += static_cast<char_type>(c); + } + return result; +} + +#if defined(BOOST_WINDOWS) +template <typename String> +inline String replace_slashes(String value, char const* lookfor = "\\", + char replace_with = '/') +{ + typename String::size_type p = value.find_first_of(lookfor); + while (p != value.npos) { + value[p] = replace_with; + p = value.find_first_of(lookfor, p+1); + } + return value; +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +template <typename Token> +class collect_hooks_information + : public boost::wave::context_policies::eat_whitespace<Token> +{ + typedef boost::wave::context_policies::eat_whitespace<Token> base_type; + +public: + collect_hooks_information(std::string& trace) + : hooks_trace(trace), skipped_token_hooks(false) + {} + + void set_skipped_token_hooks(bool flag) + { + skipped_token_hooks = flag; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanding_function_like_macro' is called, whenever a + // function-like macro is to be expanded. + // + // The parameter 'macrodef' marks the position, where the macro to expand + // is defined. + // + // The parameter 'formal_args' holds the formal arguments used during the + // definition of the macro. + // + // The parameter 'definition' holds the macro definition for the macro to + // trace. + // + // The parameter 'macro_call' marks the position, where this macro invoked. + // + // The parameter 'arguments' holds the macro arguments used during the + // invocation of the macro + // + // The parameters 'seqstart' and 'seqend' point into the input token + // stream allowing to access the whole token sequence comprising the macro + // invocation (starting with the opening parenthesis and ending after the + // closing one). + // + // The return value defines, whether the corresponding macro will be + // expanded (return false) or will be copied to the output (return true). + // Note: the whole argument list is copied unchanged to the output as well + // without any further processing. + // + /////////////////////////////////////////////////////////////////////////// + + template <typename Context, typename Container, typename Iterator> + bool + expanding_function_like_macro(Context const& ctx, + Token const& macro, std::vector<Token> const& formal_args, + Container const& definition, + Token const& macrocall, std::vector<Container> const& arguments, + Iterator const& seqstart, Iterator const& seqend) + { + BOOST_WAVETEST_OSSTREAM strm; + // trace real macro call + strm << "00: " << repr(macrocall.get_position()) << ": " + << macrocall.get_value() << "("; + for (typename std::vector<Token>::size_type i = 0; + i < arguments.size(); ++i) + { + strm << boost::wave::util::impl::as_string(arguments[i]); + if (i < arguments.size()-1) + strm << ","; + } + strm << "), "; + + // trace macro definition + strm << "[" << repr(macro.get_position()) << ": " + << macro.get_value() << "("; + for (typename std::vector<Token>::size_type i = 0; + i < formal_args.size(); ++i) + { + strm << formal_args[i].get_value(); + if (i < formal_args.size()-1) + strm << ", "; + } + strm << ")=" << boost::wave::util::impl::as_string(definition) << "]" + << std::endl; + + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; // default is to normally expand the macro + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanding_object_like_macro' is called, whenever a + // object-like macro is to be expanded . + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'macro' marks the position, where the macro to expand + // is defined. + // + // The definition 'definition' holds the macro definition for the macro to + // trace. + // + // The parameter 'macrocall' marks the position, where this macro invoked. + // + // The return value defines, whether the corresponding macro will be + // expanded (return false) or will be copied to the output (return true). + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + expanding_object_like_macro(Context const& ctx, Token const& macro, + Container const& definition, Token const& macrocall) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "01: " << repr(macro.get_position()) << ": " + << macro.get_value() << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; // default is to normally expand the macro + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanded_macro' is called, whenever the expansion of a + // macro is finished but before the rescanning process starts. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'result' contains the token sequence generated as the + // result of the macro expansion. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + void expanded_macro(Context const& ctx, Container const& result) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "02: " << boost::wave::util::impl::as_string(result) << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'rescanned_macro' is called, whenever the rescanning of a + // macro is finished. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'result' contains the token sequence generated as the + // result of the rescanning. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + void rescanned_macro(Context const& ctx, Container const& result) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "03: " << boost::wave::util::impl::as_string(result) << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_include_directive' is called, whenever a #include + // directive was located. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'filename' contains the (expanded) file name found after + // the #include directive. This has the format '<file>', '"file"' or + // 'file'. + // The formats '<file>' or '"file"' are used for #include directives found + // in the preprocessed token stream, the format 'file' is used for files + // specified through the --force_include command line argument. + // + // The parameter 'include_next' is set to true if the found directive was + // a #include_next directive and the BOOST_WAVE_SUPPORT_INCLUDE_NEXT + // preprocessing constant was defined to something != 0. + // + // The return value defines, whether the found file will be included + // (return false) or will be skipped (return true). + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + bool + found_include_directive(Context const& ctx, std::string filename, + bool include_next) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "04: " << filename; + if (include_next) + strm << " (include_next)"; + strm << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; // ok to include this file + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'opened_include_file' is called, whenever a file referred + // by an #include directive was successfully located and opened. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'filename' contains the file system path of the + // opened file (this is relative to the directory of the currently + // processed file or a absolute path depending on the paths given as the + // include search paths). + // + // The include_depth parameter contains the current include file depth. + // + // The is_system_include parameter denotes, whether the given file was + // found as a result of a #include <...> directive. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + void + opened_include_file(Context const& ctx, std::string relname, + std::string absname, bool is_system_include) + { + using boost::wave::util::impl::escape_lit; + +#if defined(BOOST_WINDOWS) + relname = replace_slashes(relname); + absname = replace_slashes(absname); +#endif + + BOOST_WAVETEST_OSSTREAM strm; + strm << "05: " << escape_lit(relname) + << " (" << escape_lit(absname) << ")" << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'returning_from_include_file' is called, whenever an + // included file is about to be closed after it's processing is complete. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + void + returning_from_include_file(Context const& ctx) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "06: " << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'interpret_pragma' is called, whenever a #pragma command + // directive is found which isn't known to the core Wave library, where + // command is the value defined as the BOOST_WAVE_PRAGMA_KEYWORD constant + // which defaults to "wave". + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used as the replacement text for the whole + // #pragma directive. + // + // The parameter 'option' contains the name of the interpreted pragma. + // + // The parameter 'values' holds the values of the parameter provided to + // the pragma operator. + // + // The parameter 'act_token' contains the actual #pragma token, which may + // be used for error output. + // + // 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. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + interpret_pragma(Context const& ctx, Container &pending, + Token const& option, Container const& values, Token const& act_token) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "07: " << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'defined_macro' is called, whenever a macro was defined + // successfully. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // 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 initialization phase of the library. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + void + defined_macro(Context const& ctx, Token const& macro, + bool is_functionlike, std::vector<Token> const& pars, + Container const& definition, bool is_predefined) + { + // do not trace the definition of the internal helper macros + if (!is_predefined) { + BOOST_WAVETEST_OSSTREAM strm; + strm << "08: " << repr(macro.get_position()) << ": " + << macro.get_value(); + if (is_functionlike) { + // list the parameter names for function style macros + strm << "("; + for (typename std::vector<Token>::size_type i = 0; + i < pars.size(); ++i) + { + strm << pars[i].get_value(); + if (i < pars.size()-1) + strm << ", "; + } + strm << ")"; + } + strm << "=" << boost::wave::util::impl::as_string(definition) + << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'undefined_macro' is called, whenever a macro definition + // was removed successfully. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'name' holds the name of the macro, which definition was + // removed. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + void + undefined_macro(Context const& ctx, Token const& macro) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "09: " << repr(macro.get_position()) << ": " + << macro.get_value() << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_directive' is called, whenever a preprocessor + // directive was encountered, but before the corresponding action is + // executed. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'directive' is a reference to the token holding the + // preprocessing directive. + // + // The return value defines, whether the given expression has to be + // to be executed in a normal way (return 'false'), or if it has to be + // skipped altogether (return 'true'), which means it gets replaced in the + // output by a single newline. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + bool + found_directive(Context const& ctx, Token const& directive) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "10: " << repr(directive.get_position()) << ": " + << directive.get_value() << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; // by default we never skip any directives + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'evaluated_conditional_expression' is called, whenever a + // conditional preprocessing expression was evaluated (the expression + // given to a #if, #elif, #ifdef or #ifndef directive) + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'directive' is a reference to the token holding the + // corresponding preprocessing directive. + // + // The parameter 'expression' holds the non-expanded token sequence + // comprising the evaluated expression. + // + // The parameter expression_value contains the result of the evaluation of + // the expression in the current preprocessing context. + // + // The return value defines, whether the given expression has to be + // evaluated again, allowing to decide which of the conditional branches + // should be expanded. You need to return 'true' from this hook function + // to force the expression to be re-evaluated. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + evaluated_conditional_expression(Context const& ctx, + Token const& directive, Container const& expression, + bool expression_value) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "11: " << repr(directive.get_position()) << ": " + << directive.get_value() << " " + << boost::wave::util::impl::as_string(expression) << ": " + << expression_value << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; // ok to continue, do not re-evaluate expression + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'skipped_token' is called, whenever a token is about to be + // skipped due to a false preprocessor condition (code fragments to be + // skipped inside the not evaluated conditional #if/#else/#endif branches). + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'token' refers to the token to be skipped. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + void + skipped_token(Context const& ctx, Token const& token) + { + // this normally generates a lot of noise + if (skipped_token_hooks) { + BOOST_WAVETEST_OSSTREAM strm; + strm << "12: " << repr(token.get_position()) << ": >" + << repr(token.get_value()) << "<" << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'generated_token' will be called by the library whenever a + // token is about to be returned from the library. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 't' is the token about to be returned from the library. + // This function may alter the token, but in this case it must be + // implemented with a corresponding signature: + // + // Token const& + // generated_token(Context const& ctx, Token& t); + // + // which makes it possible to modify the token in place. + // + // The default behavior is to return the token passed as the parameter + // without modification. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + Token const& + generated_token(Context const& ctx, Token const& t) + { +// this generates a lot of noise +// BOOST_WAVETEST_OSSTREAM strm; +// strm << "13: " << std::endl; +// hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return t; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'may_skip_whitespace' will be called by the + // library, whenever it must be tested whether a specific token refers to + // whitespace and this whitespace has to be skipped. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The 'token' parameter holds a reference to the current token. The policy + // is free to change this token if needed. + // + // The 'skipped_newline' parameter holds a reference to a boolean value + // which should be set to true by the policy function whenever a newline + // is going to be skipped. + // + // If the return value is true, the given token is skipped and the + // preprocessing continues to the next token. If the return value is + // false, the given token is returned to the calling application. + // + // ATTENTION! + // Caution has to be used, because by returning true the policy function + // is able to force skipping even significant tokens, not only whitespace. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context> + bool + may_skip_whitespace(Context const& ctx, Token& token, bool& skipped_newline) + { +// this generates a lot of noise +// BOOST_WAVETEST_OSSTREAM strm; +// strm << "14: " << std::endl; +// hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return this->base_type::may_skip_whitespace(ctx, token, skipped_newline); + } + +#if BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE != 0 + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_warning_directive' will be called by the library + // whenever a #warning directive is found. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'message' references the argument token sequence of the + // encountered #warning directive. + // + // If the return value is false, the library throws a preprocessor + // exception of the type 'warning_directive', if the return value is true + // the execution continues as if no #warning directive has been found. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + found_warning_directive(Context const& ctx, Container const& message) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "15: " << boost::wave::util::impl::as_string(message) + << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; + } +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_error_directive' will be called by the library + // whenever a #error directive is found. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'message' references the argument token sequence of the + // encountered #error directive. + // + // If the return value is false, the library throws a preprocessor + // exception of the type 'error_directive', if the return value is true + // the execution continues as if no #error directive has been found. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + bool + found_error_directive(Context const& ctx, Container const& message) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "16: " << boost::wave::util::impl::as_string(message) + << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_line_directive' will be called by the library + // whenever a #line directive is found. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'arguments' references the argument token sequence of the + // encountered #line directive. + // + // The parameter 'line' contains the recognized line number from the #line + // directive. + // + // The parameter 'filename' references the recognized file name from the + // #line directive (if there was one given). + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Container> + void + found_line_directive(Context const& ctx, Container const& arguments, + unsigned int line, std::string const& filename) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "17: " << boost::wave::util::impl::as_string(arguments) + << " (" << line << ", \"" << filename << "\")" << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'throw_exception' will be called by the library whenever a + // preprocessing exception occurs. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'e' is the exception object containing detailed error + // information. + // + // The default behavior is to call the function boost::throw_exception. + // + /////////////////////////////////////////////////////////////////////////// + template <typename Context, typename Exception> + void + throw_exception(Context const& ctx, Exception const& e) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "18: " << e.what() << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return this->base_type::throw_exception(ctx, e); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + /////////////////////////////////////////////////////////////////////////// + // + // The function 'detected_include_guard' is called whenever either a + // include file is about to be added to the list of #pragma once headers. + // That means this header file will not be opened and parsed again even + // if it is specified in a later #include directive. + // This function is called as the result of a detected include guard + // scheme. + // + // The implemented heuristics for include guards 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 + // ... + // #endif + // + // 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. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'filename' contains the file system path of the + // opened file (this is relative to the directory of the currently + // processed file or a absolute path depending on the paths given as the + // include search paths). + // + // The parameter contains the name of the detected include guard. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT> + void + detected_include_guard(ContextT const& ctx, std::string filename, + std::string const& include_guard) + { + using boost::wave::util::impl::escape_lit; + +#if defined(BOOST_WINDOWS) + filename = replace_slashes(filename); +#endif + + BOOST_WAVETEST_OSSTREAM strm; + strm << "19: " << escape_lit(filename) << ": " + << include_guard << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'detected_pragma_once' is called whenever either a + // include file is about to be added to the list of #pragma once headers. + // That means this header file will not be opened and parsed again even + // if it is specified in a later #include directive. + // This function is called as the result of a detected directive + // #pragma once. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter pragma_token refers to the token "#pragma" triggering + // this preprocessing hook. + // + // The parameter 'filename' contains the file system path of the + // opened file (this is relative to the directory of the currently + // processed file or a absolute path depending on the paths given as the + // include search paths). + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename TokenT> + void + detected_pragma_once(ContextT const& ctx, TokenT const& pragma_token, + std::string filename) + { + using boost::wave::util::impl::escape_lit; + +#if defined(BOOST_WINDOWS) + filename = replace_slashes(filename); +#endif + + BOOST_WAVETEST_OSSTREAM strm; + strm << "20: " << repr(pragma_token.get_position()) << ": " + << pragma_token.get_value() << ": " + << escape_lit(filename) << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + } +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'found_unknown_directive' is called, whenever an unknown + // preprocessor directive was encountered. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'line' holds the tokens of the entire source line + // containing the unknown directive. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used as the replacement text for the whole + // line containing the unknown directive. + // + // The return value defines, whether the given expression has been + // properly interpreted by the hook function or not. If this function + // returns 'false', the library will raise an 'ill_formed_directive' + // preprocess_exception. Otherwise the tokens pushed back into 'pending' + // are passed on to the user program. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename ContainerT> + bool + found_unknown_directive(ContextT const& ctx, ContainerT const& line, + ContainerT& pending) + { + BOOST_WAVETEST_OSSTREAM strm; + strm << "21: " << repr((*line.begin()).get_position()) << ": " + << boost::wave::util::impl::as_string(line) << std::endl; + hooks_trace += BOOST_WAVETEST_GETSTRING(strm); + return false; + } + +private: + std::string& hooks_trace; + bool skipped_token_hooks; +}; + +#endif + + + diff --git a/src/boost/libs/wave/test/testwave/quick.cpp b/src/boost/libs/wave/test/testwave/quick.cpp new file mode 100644 index 000000000..47bd9f224 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/quick.cpp @@ -0,0 +1,49 @@ + +// Copyright 2018 Peter Dimov. +// +// 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 + +#include <boost/wave.hpp> +#include <boost/wave/cpplexer/cpp_lex_token.hpp> +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> +#include <iostream> + +int main() +{ + std::string input( + "#if 0\n" + "6.28\n" + "#else\n" + "3.14\n" + "#endif\n" + ); + + try + { + typedef boost::wave::cpplexer::lex_token<> token_type; + typedef boost::wave::cpplexer::lex_iterator<token_type> lex_iterator_type; + typedef boost::wave::context<std::string::iterator, lex_iterator_type> context_type; + + context_type ctx( input.begin(), input.end(), "input.cpp" ); + + for( context_type::iterator_type first = ctx.begin(), last = ctx.end(); first != last; ++first ) + { + std::cout << first->get_value(); + } + + return 0; + } + catch( boost::wave::cpp_exception const & x ) + { + std::cerr << x.file_name() << "(" << x.line_no() << "): " << x.description() << std::endl; + return 1; + } + catch( std::exception const & x ) + { + std::cerr << "Exception: " << x.what() << std::endl; + return 2; + } +} diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_001.cpp new file mode 100644 index 000000000..89c8a342a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_001.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test macro expansion order +#define A(x, y) x,y +#define B(x, y) [x][y] +#define C(x) B(x) + +//R #line 16 "t_1_001.cpp" +C(A(2,3)) //R [2][3] +C( A(2 , 3) ) //R [ 2 ][ 3 ] + +//H 10: t_1_001.cpp(11): #define +//H 08: t_1_001.cpp(11): A(x, y)=x,y +//H 10: t_1_001.cpp(12): #define +//H 08: t_1_001.cpp(12): B(x, y)=[x][y] +//H 10: t_1_001.cpp(13): #define +//H 08: t_1_001.cpp(13): C(x)=B(x) +//H 00: t_1_001.cpp(16): C(A(2,3)), [t_1_001.cpp(13): C(x)=B(x)] +//H 00: t_1_001.cpp(16): A(2,3), [t_1_001.cpp(11): A(x, y)=x,y] +//H 02: 2,3 +//H 03: 2,3 +//H 02: B(2,3) +//H 00: t_1_001.cpp(13): B(2,3), [t_1_001.cpp(12): B(x, y)=[x][y]] +//H 02: [2][3] +//H 03: [2][3] +//H 03: [2][3] +//H 00: t_1_001.cpp(17): C( A(2 , 3) ), [t_1_001.cpp(13): C(x)=B(x)] +//H 00: t_1_001.cpp(17): A(2 , 3), [t_1_001.cpp(11): A(x, y)=x,y] +//H 02: 2 , 3 +//H 03: 2 , 3 +//H 02: B( 2 , 3 ) +//H 00: t_1_001.cpp(13): B( 2 , 3 ), [t_1_001.cpp(12): B(x, y)=[x][y]] +//H 02: [ 2 ][ 3 ] +//H 03: [ 2 ][ 3 ] +//H 03: [ 2 ][ 3 ] diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_002.cpp new file mode 100644 index 000000000..315adc6a2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_002.cpp @@ -0,0 +1,25 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O -DTEST +#if defined(TEST) +#define ABC() 1 +#endif + +//R #line 16 "t_1_002.cpp" +ABC() //R 1 + +//H 10: t_1_002.cpp(11): #if +//H 11: t_1_002.cpp(11): #if defined(TEST): 1 +//H 10: t_1_002.cpp(12): #define +//H 08: t_1_002.cpp(12): ABC()=1 +//H 10: t_1_002.cpp(13): #endif +//H 00: t_1_002.cpp(16): ABC(), [t_1_002.cpp(12): ABC()=1] +//H 02: 1 +//H 03: 1 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_003.cpp new file mode 100644 index 000000000..28e01c833 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_003.cpp @@ -0,0 +1,60 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion order in conjunction with the need to skip expansion +// of the same macro as it is currently expanded. + +#define CONCAT(a, b) a ## b +#define CONCAT_INDIRECT() CONCAT + +//R #line 18 "t_1_003.cpp" +//R CONCAT(1, 2) +CONCAT(CON, CAT)(1, 2) +//R #line 21 "t_1_003.cpp" +//R CONCAT(1, 2) +CONCAT(CON, CAT(1, 2)) +//R #line 24 "t_1_003.cpp" +//R 12 +CONCAT(CONCAT_, INDIRECT)()(1, 2) +//R #line 27 "t_1_003.cpp" +//R CONCAT(1, 2) +CONCAT(CONCAT_, INDIRECT())(1, 2) + +//R #line 31 "t_1_003.cpp" +//R 1 CONCAT(2, 3) +CONCAT(1, CONCAT(2, 3)) + +//H 10: t_1_003.cpp(13): #define +//H 08: t_1_003.cpp(13): CONCAT(a, b)=a ## b +//H 10: t_1_003.cpp(14): #define +//H 08: t_1_003.cpp(14): CONCAT_INDIRECT()=CONCAT +//H 00: t_1_003.cpp(18): CONCAT(CON, CAT), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: CONCAT +//H 03: CONCAT +//H 00: t_1_003.cpp(21): CONCAT(CON, CAT(1, 2)), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: CONCAT(1, 2) +//H 03: CONCAT(1, 2) +//H 00: t_1_003.cpp(24): CONCAT(CONCAT_, INDIRECT), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: CONCAT_INDIRECT +//H 03: CONCAT_INDIRECT +//H 00: t_1_003.cpp(24): CONCAT_INDIRECT(), [t_1_003.cpp(14): CONCAT_INDIRECT()=CONCAT] +//H 02: CONCAT +//H 03: CONCAT +//H 00: t_1_003.cpp(14): CONCAT(1, 2), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: 12 +//H 03: 12 +//H 00: t_1_003.cpp(27): CONCAT(CONCAT_, INDIRECT()), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: CONCAT_INDIRECT() +//H 00: t_1_003.cpp(27): CONCAT_INDIRECT(), [t_1_003.cpp(14): CONCAT_INDIRECT()=CONCAT] +//H 02: CONCAT +//H 03: CONCAT +//H 03: CONCAT +//H 00: t_1_003.cpp(31): CONCAT(1, CONCAT(2, 3)), [t_1_003.cpp(13): CONCAT(a, b)=a ## b] +//H 02: 1CONCAT(2, 3) +//H 03: 1CONCAT(2, 3) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_004.cpp new file mode 100644 index 000000000..bfcd320cc --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_004.cpp @@ -0,0 +1,88 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --variadics + +// Tests macro expansion order in conjunction with the need to skip expansion +// of the same macro as it is currently expanded. + +#define CONCAT(a, b) a ## b +#define CONCAT_INDIRECT() CONCAT + +//R #line 20 "t_1_004.cpp" +//R CONCAT(1, 2) +CONCAT(CON, CAT)(1, 2) +//R #line 23 "t_1_004.cpp" +//R CONCAT(1, 2) +CONCAT(CON, CAT(1, 2)) +//R #line 26 "t_1_004.cpp" +//R 12 +CONCAT(CONCAT_, INDIRECT)()(1, 2) +//R #line 29 "t_1_004.cpp" +//R CONCAT(1, 2) +CONCAT(CONCAT_, INDIRECT())(1, 2) +//R #line 32 "t_1_004.cpp" +//R 1 CONCAT(2, 3) +CONCAT(1, CONCAT(2, 3)) + +//H 10: t_1_004.cpp(15): #define +//H 08: t_1_004.cpp(15): CONCAT(a, b)=a ## b +//H 10: t_1_004.cpp(16): #define +//H 08: t_1_004.cpp(16): CONCAT_INDIRECT()=CONCAT +//H 00: t_1_004.cpp(20): CONCAT(CON, CAT), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: CONCAT +//H 03: CONCAT +//H 00: t_1_004.cpp(23): CONCAT(CON, CAT(1, 2)), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: CONCAT(1, 2) +//H 03: CONCAT(1, 2) +//H 00: t_1_004.cpp(26): CONCAT(CONCAT_, INDIRECT), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: CONCAT_INDIRECT +//H 03: CONCAT_INDIRECT +//H 00: t_1_004.cpp(26): CONCAT_INDIRECT(), [t_1_004.cpp(16): CONCAT_INDIRECT()=CONCAT] +//H 02: CONCAT +//H 03: CONCAT +//H 00: t_1_004.cpp(16): CONCAT(1, 2), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: 12 +//H 03: 12 +//H 00: t_1_004.cpp(29): CONCAT(CONCAT_, INDIRECT()), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: CONCAT_INDIRECT() +//H 00: t_1_004.cpp(29): CONCAT_INDIRECT(), [t_1_004.cpp(16): CONCAT_INDIRECT()=CONCAT] +//H 02: CONCAT +//H 03: CONCAT +//H 03: CONCAT +//H 00: t_1_004.cpp(32): CONCAT(1, CONCAT(2, 3)), [t_1_004.cpp(15): CONCAT(a, b)=a ## b] +//H 02: 1CONCAT(2, 3) +//H 03: 1CONCAT(2, 3) + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_005.cpp new file mode 100644 index 000000000..d8e880789 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_005.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion order. + +#define A() B +#define B(x) x + +//R #line 16 "t_1_005.cpp" +A()(123) //R 123 + +//H 10: t_1_005.cpp(12): #define +//H 08: t_1_005.cpp(12): A()=B +//H 10: t_1_005.cpp(13): #define +//H 08: t_1_005.cpp(13): B(x)=x +//H 00: t_1_005.cpp(16): A(), [t_1_005.cpp(12): A()=B] +//H 02: B +//H 03: B +//H 00: t_1_005.cpp(12): B(123), [t_1_005.cpp(13): B(x)=x] +//H 02: 123 +//H 03: 123 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_006.cpp new file mode 100644 index 000000000..063518105 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_006.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the correctness of parameter replacement, if the parameter is +// adjacent to an operator '##'. + +#define CONCAT(a, b) PRIMITIVE_CONCAT(a, b) +#define PRIMITIVE_CONCAT(a, b) a ## b + +//R #line 18 "t_1_006.cpp" +//R 123 +CONCAT(1, PRIMITIVE_CONCAT(2, 3)) +//R #line 21 "t_1_006.cpp" +//R 123 +CONCAT(1, CONCAT(2, 3)) +// E t_1_006.cpp(23): error: pasting the following two tokens does not give a valid preprocessing token: "1" and "CONCAT" +//R #line 25 "t_1_006.cpp" +//R 1 CONCAT(2, 3) +PRIMITIVE_CONCAT(1, CONCAT(2, 3)) + +//H 10: t_1_006.cpp(13): #define +//H 08: t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b) +//H 10: t_1_006.cpp(14): #define +//H 08: t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b +//H 00: t_1_006.cpp(18): CONCAT(1, PRIMITIVE_CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 00: t_1_006.cpp(18): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 23 +//H 03: 23 +//H 02: PRIMITIVE_CONCAT(1, 23) +//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 123 +//H 03: 123 +//H 03: 123 +//H 00: t_1_006.cpp(21): CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 00: t_1_006.cpp(21): CONCAT(2, 3), [t_1_006.cpp(13): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 02: PRIMITIVE_CONCAT(2, 3) +//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(2, 3), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 23 +//H 03: 23 +//H 03: 23 +//H 02: PRIMITIVE_CONCAT(1, 23) +//H 00: t_1_006.cpp(13): PRIMITIVE_CONCAT(1, 23), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 123 +//H 03: 123 +//H 03: 123 +//H 00: t_1_006.cpp(25): PRIMITIVE_CONCAT(1, CONCAT(2, 3)), [t_1_006.cpp(14): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 1CONCAT(2, 3) +//H 03: 1CONCAT(2, 3) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_007.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_007.cpp new file mode 100644 index 000000000..57e796f8f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_007.cpp @@ -0,0 +1,55 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --variadics + +// Tests the correctness of parameter replacement, if the parameter is +// adjacent to an operator '##'. + +#define CONCAT(a, b) PRIMITIVE_CONCAT(a, b) +#define PRIMITIVE_CONCAT(a, b) a ## b + +//R #line 20 "t_1_007.cpp" +//R 123 +CONCAT(1, PRIMITIVE_CONCAT(2, 3)) +//R #line 23 "t_1_007.cpp" +//R 123 +CONCAT(1, CONCAT(2, 3)) +//R #line 26 "t_1_007.cpp" +//R 1 CONCAT(2, 3) +PRIMITIVE_CONCAT(1, CONCAT(2, 3)) + +//H 10: t_1_007.cpp(15): #define +//H 08: t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b) +//H 10: t_1_007.cpp(16): #define +//H 08: t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b +//H 00: t_1_007.cpp(20): CONCAT(1, PRIMITIVE_CONCAT(2, 3)), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 00: t_1_007.cpp(20): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 23 +//H 03: 23 +//H 02: PRIMITIVE_CONCAT(1, 23) +//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 123 +//H 03: 123 +//H 03: 123 +//H 00: t_1_007.cpp(23): CONCAT(1, CONCAT(2, 3)), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 00: t_1_007.cpp(23): CONCAT(2, 3), [t_1_007.cpp(15): CONCAT(a, b)=PRIMITIVE_CONCAT(a, b)] +//H 02: PRIMITIVE_CONCAT(2, 3) +//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(2, 3), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 23 +//H 03: 23 +//H 03: 23 +//H 02: PRIMITIVE_CONCAT(1, 23) +//H 00: t_1_007.cpp(15): PRIMITIVE_CONCAT(1, 23), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 123 +//H 03: 123 +//H 03: 123 +//H 00: t_1_007.cpp(26): PRIMITIVE_CONCAT(1, CONCAT(2, 3)), [t_1_007.cpp(16): PRIMITIVE_CONCAT(a, b)=a ## b] +//H 02: 1CONCAT(2, 3) +//H 03: 1CONCAT(2, 3) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_008.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_008.cpp new file mode 100644 index 000000000..99034f3b3 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_008.cpp @@ -0,0 +1,145 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// The follwoing is a parametized partially expanding concatenation macro. +// It is a extremly good test of expansion order and the order of operations +// during macro expansion in general. + +#define CAT(a, b) a ## b + +#define PARTIAL_CAT(i) CAT(PARTIAL_CAT_, i) + +#define PARTIAL_CAT_0(a, b) CAT(a, b) +#define PARTIAL_CAT_1(a, b) CAT(PARTIAL ## a, b) +#define PARTIAL_CAT_2(a, b) CAT(a, b ## PARTIAL) +#define PARTIAL_CAT_3(a, b) CAT(PARTIAL ## a, b ## PARTIAL) + +#define PARTIAL +#define PARTIALPARTIAL + +#define X Token1 +#define Y Token2 + +//R #line 31 "t_1_008.cpp" +//R Token1Token2 +PARTIAL_CAT(0)( PARTIAL X, Y PARTIAL ) +//R #line 34 "t_1_008.cpp" +//R XToken2 +PARTIAL_CAT(1)( PARTIAL X, Y PARTIAL ) +//R #line 37 "t_1_008.cpp" +//R Token1Y +PARTIAL_CAT(2)( PARTIAL X, Y PARTIAL ) +//R #line 40 "t_1_008.cpp" +//R XY +PARTIAL_CAT(3)( PARTIAL X, Y PARTIAL ) + +//H 10: t_1_008.cpp(14): #define +//H 08: t_1_008.cpp(14): CAT(a, b)=a ## b +//H 10: t_1_008.cpp(16): #define +//H 08: t_1_008.cpp(16): PARTIAL_CAT(i)=CAT(PARTIAL_CAT_, i) +//H 10: t_1_008.cpp(18): #define +//H 08: t_1_008.cpp(18): PARTIAL_CAT_0(a, b)=CAT(a, b) +//H 10: t_1_008.cpp(19): #define +//H 08: t_1_008.cpp(19): PARTIAL_CAT_1(a, b)=CAT(PARTIAL ## a, b) +//H 10: t_1_008.cpp(20): #define +//H 08: t_1_008.cpp(20): PARTIAL_CAT_2(a, b)=CAT(a, b ## PARTIAL) +//H 10: t_1_008.cpp(21): #define +//H 08: t_1_008.cpp(21): PARTIAL_CAT_3(a, b)=CAT(PARTIAL ## a, b ## PARTIAL) +//H 10: t_1_008.cpp(23): #define +//H 08: t_1_008.cpp(23): PARTIAL= +//H 10: t_1_008.cpp(24): #define +//H 08: t_1_008.cpp(24): PARTIALPARTIAL= +//H 10: t_1_008.cpp(26): #define +//H 08: t_1_008.cpp(26): X=Token1 +//H 10: t_1_008.cpp(27): #define +//H 08: t_1_008.cpp(27): Y=Token2 +//H 00: t_1_008.cpp(31): PARTIAL_CAT(0), [t_1_008.cpp(16): PARTIAL_CAT(i)=CAT(PARTIAL_CAT_, i)] +//H 02: CAT(PARTIAL_CAT_, 0) +//H 00: t_1_008.cpp(16): CAT(PARTIAL_CAT_, 0), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIAL_CAT_0 +//H 03: PARTIAL_CAT_0 +//H 03: PARTIAL_CAT_0 +//H 00: t_1_008.cpp(16): PARTIAL_CAT_0( PARTIAL X, Y PARTIAL ), [t_1_008.cpp(18): PARTIAL_CAT_0(a, b)=CAT(a, b)] +//H 01: t_1_008.cpp(23): PARTIAL +//H 02: +//H 03: _ +//H 01: t_1_008.cpp(26): X +//H 02: Token1 +//H 03: Token1 +//H 01: t_1_008.cpp(27): Y +//H 02: Token2 +//H 03: Token2 +//H 01: t_1_008.cpp(23): PARTIAL +//H 02: +//H 03: _ +//H 02: CAT( Token1, Token2 ) +//H 00: t_1_008.cpp(18): CAT( Token1, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: Token1Token2 +//H 03: Token1Token2 +//H 03: Token1Token2 +//H 00: t_1_008.cpp(34): PARTIAL_CAT(1), [t_1_008.cpp(16): PARTIAL_CAT(i)=CAT(PARTIAL_CAT_, i)] +//H 02: CAT(PARTIAL_CAT_, 1) +//H 00: t_1_008.cpp(16): CAT(PARTIAL_CAT_, 1), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIAL_CAT_1 +//H 03: PARTIAL_CAT_1 +//H 03: PARTIAL_CAT_1 +//H 00: t_1_008.cpp(16): PARTIAL_CAT_1( PARTIAL X, Y PARTIAL ), [t_1_008.cpp(19): PARTIAL_CAT_1(a, b)=CAT(PARTIAL ## a, b)] +//H 01: t_1_008.cpp(27): Y +//H 02: Token2 +//H 03: Token2 +//H 01: t_1_008.cpp(23): PARTIAL +//H 02: +//H 03: _ +//H 02: CAT(PARTIALPARTIAL X, Token2 ) +//H 00: t_1_008.cpp(19): CAT(PARTIALPARTIAL X, Token2 ), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIALPARTIAL XToken2 +//H 01: t_1_008.cpp(24): PARTIALPARTIAL +//H 02: +//H 03: _ +//H 03: XToken2 +//H 03: XToken2 +//H 00: t_1_008.cpp(37): PARTIAL_CAT(2), [t_1_008.cpp(16): PARTIAL_CAT(i)=CAT(PARTIAL_CAT_, i)] +//H 02: CAT(PARTIAL_CAT_, 2) +//H 00: t_1_008.cpp(16): CAT(PARTIAL_CAT_, 2), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIAL_CAT_2 +//H 03: PARTIAL_CAT_2 +//H 03: PARTIAL_CAT_2 +//H 00: t_1_008.cpp(16): PARTIAL_CAT_2( PARTIAL X, Y PARTIAL ), [t_1_008.cpp(20): PARTIAL_CAT_2(a, b)=CAT(a, b ## PARTIAL)] +//H 01: t_1_008.cpp(23): PARTIAL +//H 02: +//H 03: _ +//H 01: t_1_008.cpp(26): X +//H 02: Token1 +//H 03: Token1 +//H 02: CAT( Token1, Y PARTIALPARTIAL) +//H 00: t_1_008.cpp(20): CAT( Token1, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: Token1Y PARTIALPARTIAL +//H 01: t_1_008.cpp(24): PARTIALPARTIAL +//H 02: +//H 03: _ +//H 03: Token1Y_ +//H 03: Token1Y_ +//H 00: t_1_008.cpp(40): PARTIAL_CAT(3), [t_1_008.cpp(16): PARTIAL_CAT(i)=CAT(PARTIAL_CAT_, i)] +//H 02: CAT(PARTIAL_CAT_, 3) +//H 00: t_1_008.cpp(16): CAT(PARTIAL_CAT_, 3), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIAL_CAT_3 +//H 03: PARTIAL_CAT_3 +//H 03: PARTIAL_CAT_3 +//H 00: t_1_008.cpp(16): PARTIAL_CAT_3( PARTIAL X, Y PARTIAL ), [t_1_008.cpp(21): PARTIAL_CAT_3(a, b)=CAT(PARTIAL ## a, b ## PARTIAL)] +//H 02: CAT(PARTIALPARTIAL X, Y PARTIALPARTIAL) +//H 00: t_1_008.cpp(21): CAT(PARTIALPARTIAL X, Y PARTIALPARTIAL), [t_1_008.cpp(14): CAT(a, b)=a ## b] +//H 02: PARTIALPARTIAL XY PARTIALPARTIAL +//H 01: t_1_008.cpp(24): PARTIALPARTIAL +//H 02: +//H 03: _ +//H 01: t_1_008.cpp(24): PARTIALPARTIAL +//H 02: +//H 03: _ +//H 03: XY_ +//H 03: XY_ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_009.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_009.cpp new file mode 100644 index 000000000..914ec6b72 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_009.cpp @@ -0,0 +1,29 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test, if wrongly placed '##' operators are detected + +#define TEST1() A ## B +#define TEST2() ## A + +//R #line 17 "t_1_009.cpp" +//R AB +TEST1() +//E t_1_009.cpp(19): error: ill formed preprocessing operator: concat ('##') +TEST2() // error + +//H 10: t_1_009.cpp(12): #define +//H 08: t_1_009.cpp(12): TEST1()=A ## B +//H 10: t_1_009.cpp(13): #define +//H 08: t_1_009.cpp(13): TEST2()=## A +//H 00: t_1_009.cpp(17): TEST1(), [t_1_009.cpp(12): TEST1()=A ## B] +//H 02: AB +//H 03: AB +//H 00: t_1_009.cpp(19): TEST2(), [t_1_009.cpp(13): TEST2()=## A] +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_010.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_010.cpp new file mode 100644 index 000000000..fda84df66 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_010.cpp @@ -0,0 +1,29 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test, if wrongly placed '##' operators are detected + +#define TEST1() A ## B +#define TEST2() A ## + +//R #line 17 "t_1_010.cpp" +//R AB +TEST1() +//E t_1_010.cpp(19): error: ill formed preprocessing operator: concat ('##') +TEST2() // error + +//H 10: t_1_010.cpp(12): #define +//H 08: t_1_010.cpp(12): TEST1()=A ## B +//H 10: t_1_010.cpp(13): #define +//H 08: t_1_010.cpp(13): TEST2()=A ## +//H 00: t_1_010.cpp(17): TEST1(), [t_1_010.cpp(12): TEST1()=A ## B] +//H 02: AB +//H 03: AB +//H 00: t_1_010.cpp(19): TEST2(), [t_1_010.cpp(13): TEST2()=A ##] +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_011.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_011.cpp new file mode 100644 index 000000000..ed1b7b6c4 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_011.cpp @@ -0,0 +1,32 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test if macros at not used parameter positions are expanded correctly + +#define MACRO() /**/ +#define ID(x) // parameter not used at all +#define CAT(x) X ## x // expanded parameter not used + +ID( MACRO(*) ) +//R #line 19 "t_1_011.cpp" +//R XMACRO(*) +CAT( MACRO(*) ) + +//H 10: t_1_011.cpp(12): #define +//H 08: t_1_011.cpp(12): MACRO()= +//H 10: t_1_011.cpp(13): #define +//H 08: t_1_011.cpp(13): ID(x)= +//H 10: t_1_011.cpp(14): #define +//H 08: t_1_011.cpp(14): CAT(x)=X ## x +//H 00: t_1_011.cpp(16): ID( MACRO(*) ), [t_1_011.cpp(13): ID(x)=] +//H 02: +//H 03: _ +//H 00: t_1_011.cpp(19): CAT( MACRO(*) ), [t_1_011.cpp(14): CAT(x)=X ## x] +//H 02: XMACRO(*) +//H 03: XMACRO(*) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_012.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_012.cpp new file mode 100644 index 000000000..c42a06909 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_012.cpp @@ -0,0 +1,57 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test, if function like macros are correctly expanded if used as object like +// macros + +#define CAT(a, b) a ## b +#define ARGS (1, 2) + +//R #line 18 "t_1_012.cpp" +//R CAT (1, 2) +CAT ARGS + +#define INVOKE(macro) macro ARGS + +//R #line 24 "t_1_012.cpp" +//R CAT (1, 2) +INVOKE(CAT) + +#define EXPAND(x) x + +//R #line 30 "t_1_012.cpp" +//R 12 +EXPAND(CAT ARGS) + +//H 10: t_1_012.cpp(13): #define +//H 08: t_1_012.cpp(13): CAT(a, b)=a ## b +//H 10: t_1_012.cpp(14): #define +//H 08: t_1_012.cpp(14): ARGS=(1, 2) +//H 01: t_1_012.cpp(14): ARGS +//H 02: (1, 2) +//H 03: (1, 2) +//H 10: t_1_012.cpp(20): #define +//H 08: t_1_012.cpp(20): INVOKE(macro)=macro ARGS +//H 00: t_1_012.cpp(24): INVOKE(CAT), [t_1_012.cpp(20): INVOKE(macro)=macro ARGS] +//H 02: CAT ARGS +//H 01: t_1_012.cpp(14): ARGS +//H 02: (1, 2) +//H 03: (1, 2) +//H 03: CAT (1, 2) +//H 10: t_1_012.cpp(26): #define +//H 08: t_1_012.cpp(26): EXPAND(x)=x +//H 00: t_1_012.cpp(30): EXPAND(CAT ARGS), [t_1_012.cpp(26): EXPAND(x)=x] +//H 01: t_1_012.cpp(14): ARGS +//H 02: (1, 2) +//H 03: (1, 2) +//H 02: CAT (1, 2) +//H 00: t_1_012.cpp(30): CAT(1, 2), [t_1_012.cpp(13): CAT(a, b)=a ## b] +//H 02: 12 +//H 03: 12 +//H 03: 12 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_013.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_013.cpp new file mode 100644 index 000000000..1746afb82 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_013.cpp @@ -0,0 +1,89 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// This sample is taken from the C++ standard 16.3.5.6 [cpp.scope] and was +// slightly modified (removed the '#include' directive) + +#define str(s) # s +#define xstr(s) str(s) +#define debug(s, t) printf("x" # s "= %d, x" # t "= %s", \ +x ## s, x ## t) +#define INCFILE(n) vers ## n /* from previous #include example */ +#define glue(a, b) a ## b +#define xglue(a, b) glue(a, b) +#define HIGHLOW "hello" +#define LOW LOW ", world" +debug(1, 2); +fputs(str(strncmp("abc\0d?", "abc", '\4', "\u1234") /* this goes away */ +== 0) str(: @\n), s); +/*#include*/ xstr(INCFILE(2).hpp) +glue(HIGH, LOW); +xglue(HIGH, LOW) + +// should expand to +//R #line 22 "t_1_013.cpp" +//R printf("x" "1" "= %d, x" "2" "= %s", x1, x2); +//R fputs("strncmp(\"abc\\0d\?\", \"abc\", '\\4', \"\\u1234\") == 0" ": @\n", s); +//R +//R "vers2.hpp" +//R "hello"; +//R "hello" ", world" + +//H 10: t_1_013.cpp(13): #define +//H 08: t_1_013.cpp(13): str(s)=# s +//H 10: t_1_013.cpp(14): #define +//H 08: t_1_013.cpp(14): xstr(s)=str(s) +//H 10: t_1_013.cpp(15): #define +//H 08: t_1_013.cpp(15): debug(s, t)=printf("x" # s "= %d, x" # t "= %s", x ## s, x ## t) +//H 10: t_1_013.cpp(17): #define +//H 08: t_1_013.cpp(17): INCFILE(n)=vers ## n +//H 10: t_1_013.cpp(18): #define +//H 08: t_1_013.cpp(18): glue(a, b)=a ## b +//H 10: t_1_013.cpp(19): #define +//H 08: t_1_013.cpp(19): xglue(a, b)=glue(a, b) +//H 10: t_1_013.cpp(20): #define +//H 08: t_1_013.cpp(20): HIGHLOW="hello" +//H 10: t_1_013.cpp(21): #define +//H 08: t_1_013.cpp(21): LOW=LOW ", world" +//H 00: t_1_013.cpp(22): debug(1, 2), [t_1_013.cpp(15): debug(s, t)=printf("x" # s "= %d, x" # t "= %s", x ## s, x ## t)] +//H 02: printf("x" "1" "= %d, x" "2" "= %s", x1, x2) +//H 03: printf("x" "1" "= %d, x" "2" "= %s", x1, x2) +//H 00: t_1_013.cpp(23): str(strncmp("abc\0d?", "abc", '\4', "\u1234") == 0), [t_1_013.cpp(13): str(s)=# s] +//H 02: "strncmp(\"abc\\0d\?\", \"abc\", '\\4', \"\\u1234\") == 0" +//H 03: "strncmp(\"abc\\0d\?\", \"abc\", '\\4', \"\\u1234\") == 0" +//H 00: t_1_013.cpp(24): str(: @\n), [t_1_013.cpp(13): str(s)=# s] +//H 02: ": @\n" +//H 03: ": @\n" +//H 00: t_1_013.cpp(25): xstr(INCFILE(2).hpp), [t_1_013.cpp(14): xstr(s)=str(s)] +//H 00: t_1_013.cpp(25): INCFILE(2), [t_1_013.cpp(17): INCFILE(n)=vers ## n] +//H 02: vers2 +//H 03: vers2 +//H 02: str(vers2.hpp) +//H 00: t_1_013.cpp(14): str(vers2.hpp), [t_1_013.cpp(13): str(s)=# s] +//H 02: "vers2.hpp" +//H 03: "vers2.hpp" +//H 03: "vers2.hpp" +//H 00: t_1_013.cpp(26): glue(HIGH, LOW), [t_1_013.cpp(18): glue(a, b)=a ## b] +//H 02: HIGHLOW +//H 01: t_1_013.cpp(20): HIGHLOW +//H 02: "hello" +//H 03: "hello" +//H 03: "hello" +//H 00: t_1_013.cpp(27): xglue(HIGH, LOW), [t_1_013.cpp(19): xglue(a, b)=glue(a, b)] +//H 01: t_1_013.cpp(21): LOW +//H 02: LOW ", world" +//H 03: LOW ", world" +//H 02: glue(HIGH, LOW ", world") +//H 00: t_1_013.cpp(19): glue(HIGH, LOW ", world"), [t_1_013.cpp(18): glue(a, b)=a ## b] +//H 02: HIGHLOW ", world" +//H 01: t_1_013.cpp(20): HIGHLOW +//H 02: "hello" +//H 03: "hello" +//H 03: "hello" ", world" +//H 03: "hello" ", world" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_014.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_014.cpp new file mode 100644 index 000000000..32df363d4 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_014.cpp @@ -0,0 +1,35 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// This sample is taken from the C++ standard 16.3.5.5 [cpp.scope] + +// Currently this test fails due to a pathologic border case, which is included +// here. Wave currently does not support expanding macros, where the +// replacement-list terminates in partial macro expansion (such as the +// definition of the macro h below). This will be fixed in a future release. + +#define x 3 +#define f(a) f(x * (a)) +#undef x +#define x 2 +#define g f +#define z z[0] +#define h g( ~ +#define m(a) a(w) +#define w 0,1 +#define t(a) a +f(y+1) + f(f(z)) % t(t(g)(0) + t)(1); +g(x+(3,4)-w) +h 5) & m(f)^m(m); + +//R #line 27 "t_1_014.cpp" +//R f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1); +//R f(2 * (2+(3,4)-0,1)) +//E t_1_014.cpp(29): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')' +// should expand to: f(2 * g( ~ 5)) & f(2 * (0,1))^m(0,1); diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_015.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_015.cpp new file mode 100644 index 000000000..6a20c5b49 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_015.cpp @@ -0,0 +1,25 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, if the recursive replacement of a macro is correctly handled + +#define f(x) (4-f(x)) + +//R #line 16 "t_1_015.cpp" +//R (4-f((4-f(1)))) +f(f(1)) + +//H 10: t_1_015.cpp(12): #define +//H 08: t_1_015.cpp(12): f(x)=(4-f(x)) +//H 00: t_1_015.cpp(16): f(f(1)), [t_1_015.cpp(12): f(x)=(4-f(x))] +//H 00: t_1_015.cpp(16): f(1), [t_1_015.cpp(12): f(x)=(4-f(x))] +//H 02: (4-f(1)) +//H 03: (4-f(1)) +//H 02: (4-f((4-f(1)))) +//H 03: (4-f((4-f(1)))) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_016.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_016.cpp new file mode 100644 index 000000000..d389e3c08 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_016.cpp @@ -0,0 +1,29 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests continuing scanning into the underlying input stream after expanding +// a macro, if this is appropriate + +#define A Token1 B +#define B() Token2 + +//R #line 18 "t_1_016.cpp" +//R Token1 Token2 +A() + +//H 10: t_1_016.cpp(13): #define +//H 08: t_1_016.cpp(13): A=Token1 B +//H 10: t_1_016.cpp(14): #define +//H 08: t_1_016.cpp(14): B()=Token2 +//H 01: t_1_016.cpp(13): A +//H 02: Token1 B +//H 03: Token1 B +//H 00: t_1_016.cpp(13): B(), [t_1_016.cpp(14): B()=Token2] +//H 02: Token2 +//H 03: Token2 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_017.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_017.cpp new file mode 100644 index 000000000..9d025d2f8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_017.cpp @@ -0,0 +1,31 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion sequence and proper rescanning + +#define macro() end + +#define par() () + +#define expr macro par par par() + +#define scan(x) x + +//R #line 22 "t_1_017.cpp" +//R macro par par () +expr +//R #line 25 "t_1_017.cpp" +//R macro par () +scan(expr) +//R #line 28 "t_1_017.cpp" +//R macro () +scan(scan(expr)) +//R #line 31 "t_1_017.cpp" +//R end +scan(scan(scan(expr))) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_018.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_018.cpp new file mode 100644 index 000000000..8e8444885 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_018.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion sequence and proper rescanning + +#define macro() expr_2 +#define macro_2() expr + +#define par() () + +#define expr macro par () +#define expr_2 macro_2 par par par() + +#define scan(x) x + +//R #line 24 "t_1_018.cpp" +//R macro () +expr +//R #line 27 "t_1_018.cpp" +//R macro_2 par par () +scan(expr) +//R #line 30 "t_1_018.cpp" +//R macro_2 par () +scan(scan(expr)) +//R #line 33 "t_1_018.cpp" +//R macro_2 () +scan(scan(scan(expr))) +//R #line 36 "t_1_018.cpp" +//R macro () +scan(scan(scan(scan(expr)))) +//R #line 39 "t_1_018.cpp" +//R macro_2 par par () +scan(scan(scan(scan(scan(expr))))) +//R #line 42 "t_1_018.cpp" +//R macro_2 par () +scan(scan(scan(scan(scan(scan(expr)))))) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_019.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_019.cpp new file mode 100644 index 000000000..1585bcdda --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_019.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion sequence and proper rescanning + +#define macro() expr_2 +#define macro_2() expr + +#define par() () + +#define expr macro () +#define expr_2 macro_2 par par par() + +#define scan(x) x + +//R #line 24 "t_1_019.cpp" +//R macro_2 par par () +expr +//R #line 27 "t_1_019.cpp" +//R macro_2 par () +scan(expr) +//R #line 30 "t_1_019.cpp" +//R macro_2 () +scan(scan(expr)) +//R #line 33 "t_1_019.cpp" +//R macro_2 par par () +scan(scan(scan(expr))) +//R #line 36 "t_1_019.cpp" +//R macro_2 par () +scan(scan(scan(scan(expr)))) +//R #line 39 "t_1_019.cpp" +//R macro_2 () +scan(scan(scan(scan(scan(expr))))) +//R #line 42 "t_1_019.cpp" +//R macro_2 () +scan(scan(scan(scan(scan(scan(expr)))))) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_020.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_020.cpp new file mode 100644 index 000000000..8c2673af7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_020.cpp @@ -0,0 +1,34 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the handling of placeholder tokens, which have to be inserted, when +// some macro expands into nothing (certainly these have to be ignored +// afterwards :-) + +#define NIL + +#define A B NIL +#define B() anything + +//R #line 21 "t_1_020.cpp" +//R B() +A() // not 'anything'! + +//H 10: t_1_020.cpp(14): #define +//H 08: t_1_020.cpp(14): NIL= +//H 10: t_1_020.cpp(16): #define +//H 08: t_1_020.cpp(16): A=B NIL +//H 10: t_1_020.cpp(17): #define +//H 08: t_1_020.cpp(17): B()=anything +//H 01: t_1_020.cpp(16): A +//H 02: B NIL +//H 01: t_1_020.cpp(14): NIL +//H 02: +//H 03: _ +//H 03: B_ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_021.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_021.cpp new file mode 100644 index 000000000..0c3bdcbfc --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_021.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests continuing scanning into the underlying input stream after expanding +// a macro, if this is appropriate + +#define MACRO() X + Y NEXT +#define X 1 +#define Y 2 +#define NEXT() ... + +//R #line 20 "t_1_021.cpp" +//R 1 + 2 ... +MACRO()() + +//H 10: t_1_021.cpp(13): #define +//H 08: t_1_021.cpp(13): MACRO()=X + Y NEXT +//H 10: t_1_021.cpp(14): #define +//H 08: t_1_021.cpp(14): X=1 +//H 10: t_1_021.cpp(15): #define +//H 08: t_1_021.cpp(15): Y=2 +//H 10: t_1_021.cpp(16): #define +//H 08: t_1_021.cpp(16): NEXT()=... +//H 00: t_1_021.cpp(20): MACRO(), [t_1_021.cpp(13): MACRO()=X + Y NEXT] +//H 02: X + Y NEXT +//H 01: t_1_021.cpp(14): X +//H 02: 1 +//H 03: 1 +//H 01: t_1_021.cpp(15): Y +//H 02: 2 +//H 03: 2 +//H 03: 1 + 2 NEXT +//H 00: t_1_021.cpp(13): NEXT(), [t_1_021.cpp(16): NEXT()=...] +//H 02: ... +//H 03: ... diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_022.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_022.cpp new file mode 100644 index 000000000..809cd67b6 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_022.cpp @@ -0,0 +1,36 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the validity of whitespace handling during macro expansion + +#define MACRO() 123 + +//R #line 16 "t_1_022.cpp" +//R 123 +MACRO() +//R #line 19 "t_1_022.cpp" +//R 123 +MACRO +() +//R #line 23 "t_1_022.cpp" +//R 123 +MACRO( +) + +//H 10: t_1_022.cpp(12): #define +//H 08: t_1_022.cpp(12): MACRO()=123 +//H 00: t_1_022.cpp(16): MACRO(), [t_1_022.cpp(12): MACRO()=123] +//H 02: 123 +//H 03: 123 +//H 00: t_1_022.cpp(19): MACRO(), [t_1_022.cpp(12): MACRO()=123] +//H 02: 123 +//H 03: 123 +//H 00: t_1_022.cpp(23): MACRO(), [t_1_022.cpp(12): MACRO()=123] +//H 02: 123 +//H 03: 123 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_023.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_023.cpp new file mode 100644 index 000000000..a54adbd26 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_023.cpp @@ -0,0 +1,33 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, if function-like macros buried deep inside a macro expansion of the +// same name as an object-like macro do not eat up more tokens, than expected. + +#define PRIMITIVE_CAT(a, b) a ## b + +#define EAT(n) PRIMITIVE_CAT(EAT_, n) +#define EAT_1(a) + +//R #line 20 "t_1_023.cpp" +//R EAT_1... +EAT(1)... + +//H 10: t_1_023.cpp(13): #define +//H 08: t_1_023.cpp(13): PRIMITIVE_CAT(a, b)=a ## b +//H 10: t_1_023.cpp(15): #define +//H 08: t_1_023.cpp(15): EAT(n)=PRIMITIVE_CAT(EAT_, n) +//H 10: t_1_023.cpp(16): #define +//H 08: t_1_023.cpp(16): EAT_1(a)= +//H 00: t_1_023.cpp(20): EAT(1), [t_1_023.cpp(15): EAT(n)=PRIMITIVE_CAT(EAT_, n)] +//H 02: PRIMITIVE_CAT(EAT_, 1) +//H 00: t_1_023.cpp(15): PRIMITIVE_CAT(EAT_, 1), [t_1_023.cpp(13): PRIMITIVE_CAT(a, b)=a ## b] +//H 02: EAT_1 +//H 03: EAT_1 +//H 03: EAT_1 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_024.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_024.cpp new file mode 100644 index 000000000..b07cb9cc0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_024.cpp @@ -0,0 +1,112 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests more complex macro expansion. + +// token-pasting macro +#define CAT(a, b) PRIMITIVE_CAT(a, b) +#define PRIMITIVE_CAT(a, b) a ## b + +// splits a value that is about to expand into two parameters and returns +// either the zero-th or one-th element. +#define SPLIT(n, im) PRIMITIVE_CAT(SPLIT_, n)(im) +#define SPLIT_0(a, b) a +#define SPLIT_1(a, b) b + +// detects if the parameter is nullary parentheses () or something else. +// passing non-nullary parenthesis is invalid input. +#define IS_NULLARY(expr) \ + SPLIT( \ + 0, \ + CAT(IS_NULLARY_R_, IS_NULLARY_T expr) \ + ) \ + /**/ +#define IS_NULLARY_T() 1 +#define IS_NULLARY_R_1 1, ? +#define IS_NULLARY_R_IS_NULLARY_T 0, ? + +// expands to a macro that eats an n-element parenthesized expression. +#define EAT(n) PRIMITIVE_CAT(EAT_, n) +#define EAT_0() +#define EAT_1(a) +#define EAT_2(a, b) +#define EAT_3(a, b, c) + +// expands to a macro that removes the parentheses from an n-element +// parenthesized expression +#define REM(n) PRIMITIVE_CAT(REM_, n) +#define REM_0() +#define REM_1(a) a +#define REM_2(a, b) a, b +#define REM_3(a, b, c) a, b, c + +// expands to nothing +#define NIL + +// expands to 1 if x is less than y otherwise, it expands to 0 +#define LESS(x, y) \ + IS_NULLARY( \ + PRIMITIVE_CAT(LESS_, y)( \ + EAT(1), PRIMITIVE_CAT(LESS_, x) \ + )() \ + ) \ + /**/ + +#define LESS_0(a, b) a(EAT(2)) b(REM(1), NIL) +#define LESS_1(a, b) a(LESS_0) b(REM(1), NIL) +#define LESS_2(a, b) a(LESS_1) b(REM(1), NIL) +#define LESS_3(a, b) a(LESS_2) b(REM(1), NIL) +#define LESS_4(a, b) a(LESS_3) b(REM(1), NIL) +#define LESS_5(a, b) a(LESS_4) b(REM(1), NIL) + +// expands to the binary one's compliment of a binary input value. i.e. 0 or 1 +#define COMPL(n) PRIMITIVE_CAT(COMPL_, n) +#define COMPL_0 1 +#define COMPL_1 0 + +// these do the obvious... +#define GREATER(x, y) LESS(y, x) +#define LESS_EQUAL(x, y) COMPL(LESS(y, x)) +#define GREATER_EQUAL(x, y) COMPL(LESS(x, y)) + +// causes another rescan... +#define SCAN(x) x + +// expands to 1 if x is not equal to y. this one contains a workaround... +#define NOT_EQUAL(x, y) \ + IS_NULLARY( \ + SCAN( \ + PRIMITIVE_CAT(LESS_, x)( \ + EAT(1), \ + PRIMITIVE_CAT(LESS_, y) EAT(2) \ + )((), ...) \ + ) \ + ) \ + /**/ +#define EQUAL(x, y) COMPL(NOT_EQUAL(x, y)) + +//R #line 95 "t_1_024.cpp" +LESS(2, 3) //R 1 +LESS(3, 2) //R 0 +LESS(3, 3) //R 0 +GREATER(2, 3) //R 0 +GREATER(3, 2) //R 1 +GREATER(3, 3) //R 0 +LESS_EQUAL(2, 3) //R 1 +LESS_EQUAL(3, 2) //R 0 +LESS_EQUAL(3, 3) //R 1 +GREATER_EQUAL(2, 3) //R 0 +GREATER_EQUAL(3, 2) //R 1 +GREATER_EQUAL(3, 3) //R 1 +NOT_EQUAL(2, 3) //R 1 +NOT_EQUAL(3, 2) //R 1 +NOT_EQUAL(3, 3) //R 0 +EQUAL(2, 3) //R 0 +EQUAL(3, 2) //R 0 +EQUAL(3, 3) //R 1 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_025.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_025.cpp new file mode 100644 index 000000000..37a2409f9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_025.cpp @@ -0,0 +1,35 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, if macro expansion eats up follow up tokens under certain conditions +// (which it shouldn't). + +#define SCAN(x) x + +#define BUG BUG_2 +#define BUG_2 + +//R #line 19 "t_1_025.cpp" +SCAN(BUG) 1 2 3 4 5 //R 1 2 3 4 5 + +//H 10: t_1_025.cpp(13): #define +//H 08: t_1_025.cpp(13): SCAN(x)=x +//H 10: t_1_025.cpp(15): #define +//H 08: t_1_025.cpp(15): BUG=BUG_2 +//H 10: t_1_025.cpp(16): #define +//H 08: t_1_025.cpp(16): BUG_2= +//H 00: t_1_025.cpp(19): SCAN(BUG), [t_1_025.cpp(13): SCAN(x)=x] +//H 01: t_1_025.cpp(15): BUG +//H 02: BUG_2 +//H 01: t_1_025.cpp(16): BUG_2 +//H 02: +//H 03: _ +//H 03: _ +//H 02: +//H 03: _ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_026.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_026.cpp new file mode 100644 index 000000000..df0cdcaa7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_026.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test error reporting for non-unique parameter names + +//E t_1_026.cpp(13): error: duplicate macro parameter name: x +#define MACRO(x, x) x + // ^ ^ this is illegal + +MACRO(1, 2) + +//H 10: t_1_026.cpp(13): #define +//H 18: boost::wave::macro_handling_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_027.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_027.cpp new file mode 100644 index 000000000..39ccb3acc --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_027.cpp @@ -0,0 +1,41 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests delayed macro expansion (rescanning) + +#define CONCAT_1(A, B) A ## B +#define CONCAT_2(A, B) CONCAT_1(A, B) + +#define DELAY(NAME) NAME + +#define A1 a +#define B1 b + +#define A2() a +#define B2() b + +#define LHS ( +#define RHS ) + +//R #line 27 "t_1_027.cpp" +DELAY(CONCAT_1)( a, b ) (); //R ab (); +DELAY(CONCAT_1)(A1, B1)(); //R A1B1(); +DELAY(CONCAT_1) LHS A1, B1 RHS (); //R CONCAT_1 ( a, b )(); +CONCAT_1 ( a, b ) (); //R ab (); +CONCAT_1 ( A1, B1 ) (); //R A1B1 (); +CONCAT_1 LHS a, b RHS (); //R CONCAT_1 ( a, b )(); +//R +DELAY(CONCAT_2)( a, b ) (); //R ab (); +DELAY(CONCAT_2)(A1, B1)(); //R ab(); +DELAY(CONCAT_2) LHS A1, B1 RHS (); //R CONCAT_2 ( a, b )(); +DELAY(CONCAT_2)(A2(), B2())(); //R ab(); +CONCAT_2 ( a, b ) (); //R ab (); +CONCAT_2 ( A1, B1 ) (); //R ab (); +CONCAT_2 LHS a, b RHS (); //R CONCAT_2 ( a, b )(); +CONCAT_2(A2(), B2())(); //R ab(); diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_028.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_028.cpp new file mode 100644 index 000000000..67def4af9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_028.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests delayed macro expansion (rescanning) + +//O --variadics + +#define CONCAT_1(A, B) A ## B +#define CONCAT_2(A, B) CONCAT_1(A, B) + +#define DELAY(NAME) NAME + +#define A1 a +#define B1 b + +#define A2() a +#define B2() b + +#define LHS ( +#define RHS ) + +//R #line 29 "t_1_028.cpp" +DELAY(CONCAT_1)( a, b ) (); //R ab (); +DELAY(CONCAT_1)(A1, B1)(); //R A1B1(); +DELAY(CONCAT_1) LHS A1, B1 RHS (); //R CONCAT_1 ( a, b )(); +DELAY(CONCAT_1)(A2(), B2())(); //R a b(); +CONCAT_1 ( a, b ) (); //R ab (); +CONCAT_1 ( A1, B1 ) (); //R A1B1 (); +CONCAT_1 LHS a, b RHS (); //R CONCAT_1 ( a, b )(); +CONCAT_1(A2(), B2())(); //R a b(); +//R +DELAY(CONCAT_2)( a, b ) (); //R ab (); +DELAY(CONCAT_2)(A1, B1)(); //R ab(); +DELAY(CONCAT_2) LHS A1, B1 RHS (); //R CONCAT_2 ( a, b )(); +DELAY(CONCAT_2)(A2(), B2())(); //R ab(); +CONCAT_2 ( a, b ) (); //R ab (); +CONCAT_2 ( A1, B1 ) (); //R ab (); +CONCAT_2 LHS a, b RHS (); //R CONCAT_2 ( a, b )(); +CONCAT_2(A2(), B2())(); //R ab(); diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_029.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_029.cpp new file mode 100644 index 000000000..2cb1beb98 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_029.cpp @@ -0,0 +1,44 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests concatination of more than two parameters + +#define CAT3_1(a, b, c) a##b##c +#define CAT3_2(a, b, c) a ## b ## c + +#define CAT4_1(a, b, c, d) a##b##c##d +#define CAT4_2(a, b, c, d) a ## b ## c ## d + +//R #line 19 "t_1_029.cpp" +CAT3_1(1, 0, 0) //R 100 +CAT3_2(1, 0, 0) //R 100 +//R +CAT4_1(1, 0, 0, 2) //R 1002 +CAT4_2(1, 0, 0, 2) //R 1002 + +//H 10: t_1_029.cpp(12): #define +//H 08: t_1_029.cpp(12): CAT3_1(a, b, c)=a##b##c +//H 10: t_1_029.cpp(13): #define +//H 08: t_1_029.cpp(13): CAT3_2(a, b, c)=a ## b ## c +//H 10: t_1_029.cpp(15): #define +//H 08: t_1_029.cpp(15): CAT4_1(a, b, c, d)=a##b##c##d +//H 10: t_1_029.cpp(16): #define +//H 08: t_1_029.cpp(16): CAT4_2(a, b, c, d)=a ## b ## c ## d +//H 00: t_1_029.cpp(19): CAT3_1(1, 0, 0), [t_1_029.cpp(12): CAT3_1(a, b, c)=a##b##c] +//H 02: 100 +//H 03: 100 +//H 00: t_1_029.cpp(20): CAT3_2(1, 0, 0), [t_1_029.cpp(13): CAT3_2(a, b, c)=a ## b ## c] +//H 02: 100 +//H 03: 100 +//H 00: t_1_029.cpp(22): CAT4_1(1, 0, 0, 2), [t_1_029.cpp(15): CAT4_1(a, b, c, d)=a##b##c##d] +//H 02: 1002 +//H 03: 1002 +//H 00: t_1_029.cpp(23): CAT4_2(1, 0, 0, 2), [t_1_029.cpp(16): CAT4_2(a, b, c, d)=a ## b ## c ## d] +//H 02: 1002 +//H 03: 1002 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_030.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_030.cpp new file mode 100644 index 000000000..bde34e3ec --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_030.cpp @@ -0,0 +1,33 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether an empty macro prevents another macro from expansion + +#define EMPTY() +#define SCAN(x) x +#define MACRO(x) (x) + +//R #line 17 "t_1_030.cpp" +SCAN( MACRO EMPTY() )(1) //R (1) + +//H 10: t_1_030.cpp(12): #define +//H 08: t_1_030.cpp(12): EMPTY()= +//H 10: t_1_030.cpp(13): #define +//H 08: t_1_030.cpp(13): SCAN(x)=x +//H 10: t_1_030.cpp(14): #define +//H 08: t_1_030.cpp(14): MACRO(x)=(x) +//H 00: t_1_030.cpp(17): SCAN( MACRO EMPTY() ), [t_1_030.cpp(13): SCAN(x)=x] +//H 00: t_1_030.cpp(17): EMPTY(), [t_1_030.cpp(12): EMPTY()=] +//H 02: +//H 03: _ +//H 02: MACRO +//H 03: MACRO +//H 00: t_1_030.cpp(17): MACRO(1), [t_1_030.cpp(14): MACRO(x)=(x)] +//H 02: (1) +//H 03: (1) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_031.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_031.cpp new file mode 100644 index 000000000..876795dcf --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_031.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests macro expansion using variadic macros + +//O --variadics + +#define is_empty(...) is_empty_ ## __VA_ARGS__ ## other + +//R #line 17 "t_1_031.cpp" +is_empty( + ) //R is_empty_+other +is_empty( +text ) //R is_empty_+textother + +//H 10: t_1_031.cpp(14): #define +//H 08: t_1_031.cpp(14): is_empty(...)=is_empty_ ## __VA_ARGS__ ## other +//H 00: t_1_031.cpp(17): is_empty( + ), [t_1_031.cpp(14): is_empty(...)=is_empty_ ## __VA_ARGS__ ## other] +//H 02: is_empty_+other +//H 03: is_empty_+other +//H 00: t_1_031.cpp(18): is_empty( +text ), [t_1_031.cpp(14): is_empty(...)=is_empty_ ## __VA_ARGS__ ## other] +//H 02: is_empty_+textother +//H 03: is_empty_+textother diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_032.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_032.cpp new file mode 100644 index 000000000..e523bb27c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_032.cpp @@ -0,0 +1,37 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test partial macro evaluation using varidic macros + +//O --variadics + +#define cat(...) cat_i(__VA_ARGS__,,,,,) +#define cat_i(a, b, c, d, e, ...) \ + a ## b ## c ## d ## e \ + /**/ + +#define primitive_cat(a, b) a ## b + +#define partial_cat(x, y) cat(partial_cat_, x, y) + +#define partial_cat_00(a, b) partial_cat_f(, ## a, b ## ,) +#define partial_cat_01(a, b) partial_cat_f(, ## a, b ,) +#define partial_cat_10(a, b) partial_cat_f(, a, b ## ,) +#define partial_cat_11(a, b) partial_cat_f(, a, b ,) + +#define partial_cat_f(a, b, c, d) b ## c + +#define X Token1 +#define Y Token2 + +//R #line 34 "t_1_032.cpp" +partial_cat(0, 0)(X, Y) //R XY +partial_cat(0, 1)(X, Y) //R XToken2 +partial_cat(1, 0)(X, Y) //R Token1Y +partial_cat(1, 1)(X, Y) //R Token1Token2 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_033.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_033.cpp new file mode 100644 index 000000000..9b7ccd2ca --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_033.cpp @@ -0,0 +1,35 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the stringize operator in conjunction with varidic macros + +//O --variadics + +#define STR(...) #__VA_ARGS__ + +//R #line 17 "t_1_033.cpp" +STR(1, 2, 3) //R "1, 2, 3" +STR(1,2,3) //R "1,2,3" +STR(1 , 2 , 3) //R "1 , 2 , 3" +STR( 1 , 2 , 3 ) //R "1 , 2 , 3" + +//H 10: t_1_033.cpp(14): #define +//H 08: t_1_033.cpp(14): STR(...)=#__VA_ARGS__ +//H 00: t_1_033.cpp(17): STR(1, 2, 3), [t_1_033.cpp(14): STR(...)=#__VA_ARGS__] +//H 02: "1, 2, 3" +//H 03: "1, 2, 3" +//H 00: t_1_033.cpp(18): STR(1,2,3), [t_1_033.cpp(14): STR(...)=#__VA_ARGS__] +//H 02: "1,2,3" +//H 03: "1,2,3" +//H 00: t_1_033.cpp(19): STR(1 , 2 , 3), [t_1_033.cpp(14): STR(...)=#__VA_ARGS__] +//H 02: "1 , 2 , 3" +//H 03: "1 , 2 , 3" +//H 00: t_1_033.cpp(20): STR( 1 , 2 , 3 ), [t_1_033.cpp(14): STR(...)=#__VA_ARGS__] +//H 02: "1 , 2 , 3" +//H 03: "1 , 2 , 3" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_034.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_034.cpp new file mode 100644 index 000000000..d908c13e2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_034.cpp @@ -0,0 +1,39 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests empty __VA_ARGS__ expansion + +//O --variadics + +#define MACRO1(x, ...) x -> __VA_ARGS__ +#define MACRO2(...) __VA_ARGS__ +#define STR(...) #__VA_ARGS__ + +//R #line 19 "t_1_034.cpp" +MACRO1(1,) //R 1 -> +MACRO2(1, 2) //R 1, 2 +STR() //R "" + +//H 10: t_1_034.cpp(14): #define +//H 08: t_1_034.cpp(14): MACRO1(x, ...)=x -> __VA_ARGS__ +//H 10: t_1_034.cpp(15): #define +//H 08: t_1_034.cpp(15): MACRO2(...)=__VA_ARGS__ +//H 10: t_1_034.cpp(16): #define +//H 08: t_1_034.cpp(16): STR(...)=#__VA_ARGS__ +//H 00: t_1_034.cpp(19): MACRO1(1,§), [t_1_034.cpp(14): MACRO1(x, ...)=x -> __VA_ARGS__] +//H 02: 1 -> +//H 03: 1 -> +//H 00: t_1_034.cpp(20): MACRO2(1, 2), [t_1_034.cpp(15): MACRO2(...)=__VA_ARGS__] +//H 02: 1, 2 +//H 03: 1, 2 +//H 00: t_1_034.cpp(21): STR(§), [t_1_034.cpp(16): STR(...)=#__VA_ARGS__] +//H 02: "" +//H 03: "" + +// boostinspect:noascii this file needs to contain non-ASCII characters diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_035.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_035.cpp new file mode 100644 index 000000000..449dbfdd5 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_035.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests token pasting with empty empty arguments + +//O --variadics + +#define PASTE1(a, b, c, d) a ## b ## c ## d +#define PASTE2(a, b, c, d) a##b##c##d + +//R #line 18 "t_1_035.cpp" +PASTE1(1, ,3,4) //R 134 +PASTE1(1,,3,4) //R 134 +PASTE1(1, , , 4) //R 14 +//R +PASTE2(1, ,3,4) //R 134 +PASTE2(1,,3,4) //R 134 +PASTE2(1, , , 4) //R 14 + +//H 10: t_1_035.cpp(14): #define +//H 08: t_1_035.cpp(14): PASTE1(a, b, c, d)=a ## b ## c ## d +//H 10: t_1_035.cpp(15): #define +//H 08: t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d +//H 00: t_1_035.cpp(18): PASTE1(1, §,3,4), [t_1_035.cpp(14): PASTE1(a, b, c, d)=a ## b ## c ## d] +//H 02: 134 +//H 03: 134 +//H 00: t_1_035.cpp(19): PASTE1(1,§,3,4), [t_1_035.cpp(14): PASTE1(a, b, c, d)=a ## b ## c ## d] +//H 02: 134 +//H 03: 134 +//H 00: t_1_035.cpp(20): PASTE1(1, §, §, 4), [t_1_035.cpp(14): PASTE1(a, b, c, d)=a ## b ## c ## d] +//H 02: 14 +//H 03: 14 +//H 00: t_1_035.cpp(22): PASTE2(1, §,3,4), [t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d] +//H 02: 134 +//H 03: 134 +//H 00: t_1_035.cpp(23): PASTE2(1,§,3,4), [t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d] +//H 02: 134 +//H 03: 134 +//H 00: t_1_035.cpp(24): PASTE2(1, §, §, 4), [t_1_035.cpp(15): PASTE2(a, b, c, d)=a##b##c##d] +//H 02: 14 +//H 03: 14 + +// boostinspect:noascii this file needs to contain non-ASCII characters diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_036.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_036.cpp new file mode 100644 index 000000000..d798f523b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_036.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the concatination operator in object like macros + +#define OBJECT a ## b + +//R #line 15 "t_1_036.cpp" +OBJECT //R ab + +//H 10: t_1_036.cpp(12): #define +//H 08: t_1_036.cpp(12): OBJECT=a ## b +//H 01: t_1_036.cpp(12): OBJECT +//H 02: ab +//H 03: ab diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_037.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_037.cpp new file mode 100644 index 000000000..49b7da15c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_037.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// the following concatenation needs to fail (even if this construct is used +// in some MS headers) + +//R +//E t_1_037.cpp(16): error: pasting the following two tokens does not give a valid preprocessing token: "/" and "/" +#define _VARIANT_BOOL /##/ +_VARIANT_BOOL bool; + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_1_038.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_1_038.cpp new file mode 100644 index 000000000..526f1a25f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_1_038.cpp @@ -0,0 +1,37 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// make sure newlines inside of macro invocations get accounted for correctly + +#define BAZ(T, E) T E + +struct foo +{ + BAZ + (bool, + value = true + ); +}; + +struct bar {}; + +//R #line 14 "t_1_038.cpp" +//R struct foo +//R { +//R bool value = true; +//R #line 20 "t_1_038.cpp" +//R }; +//R +//R struct bar {}; + +//H 10: t_1_038.cpp(12): #define +//H 08: t_1_038.cpp(12): BAZ(T, E)=T E +//H 00: t_1_038.cpp(16): BAZ(bool, value = true ), [t_1_038.cpp(12): BAZ(T, E)=T E] +//H 02: bool value = true +//H 03: bool value = true diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_001.cpp new file mode 100644 index 000000000..a300672c0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_001.cpp @@ -0,0 +1,32 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the #warning directive (note: only available, if enabled during +// compilation, the macro expansion is available only, when enabled separately +// during the compilation too) + +//R +//E t_2_001.cpp(18): warning: encountered #warning directive: This is a warning +#define WARNING1 This is a +#define WARNING2 warning +#warning WARNING1 WARNING2 + +//H 10: t_2_001.cpp(16): #define +//H 08: t_2_001.cpp(16): WARNING1=This is a +//H 10: t_2_001.cpp(17): #define +//H 08: t_2_001.cpp(17): WARNING2=warning +//H 10: t_2_001.cpp(18): #warning +//H 01: t_2_001.cpp(16): WARNING1 +//H 02: This is a +//H 03: This is a +//H 01: t_2_001.cpp(17): WARNING2 +//H 02: warning +//H 03: warning +//H 15: WARNING1 WARNING2 +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_002.cpp new file mode 100644 index 000000000..797f865ee --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_002.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests simple #line functionality + +#line 5 "a_nonexisting_file.cpp" + +//R +//E a_nonexisting_file.cpp(8): fatal error: encountered #error directive or #pragma wave stop(): This error should occur at line 8 of "a_nonexisting_file.cpp" +#error This error should occur at line 8 of "a_nonexisting_file.cpp" + +//H 10: t_2_002.cpp(12): #line +//H 17: 5 "a_nonexisting_file.cpp" (5, "a_nonexisting_file.cpp") +//H 10: a_nonexisting_file.cpp(8): #error +//H 16: This error should occur at line 8 of "a_nonexisting_file.cpp" +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_003.cpp new file mode 100644 index 000000000..c0f76ba3f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_003.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests #line functionality with out a given file name + +#line 5 + +//R +//E t_2_003.cpp(8): fatal error: encountered #error directive or #pragma wave stop(): This error should occur at line 8 of "t_2_003.cpp" +#error This error should occur at line 8 of "t_2_003.cpp" + +//H 10: t_2_003.cpp(12): #line +//H 17: 5 (5, "") +//H 10: t_2_003.cpp(8): #error +//H 16: This error should occur at line 8 of "t_2_003.cpp" +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_004.cpp new file mode 100644 index 000000000..df66a5cbc --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_004.cpp @@ -0,0 +1,34 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests #line functionality with macro expansion required + +#define LINE_NO 5 +#define FILE_NAME "a_nonexisting_file.cpp" +#line LINE_NO FILE_NAME + +//R +//E a_nonexisting_file.cpp(8): fatal error: encountered #error directive or #pragma wave stop(): This error should occur at line 8 of "a_nonexisting_file.cpp" +#error This error should occur at line 8 of "a_nonexisting_file.cpp" + +//H 10: t_2_004.cpp(12): #define +//H 08: t_2_004.cpp(12): LINE_NO=5 +//H 10: t_2_004.cpp(13): #define +//H 08: t_2_004.cpp(13): FILE_NAME="a_nonexisting_file.cpp" +//H 10: t_2_004.cpp(14): #line +//H 01: t_2_004.cpp(12): LINE_NO +//H 02: 5 +//H 03: 5 +//H 01: t_2_004.cpp(13): FILE_NAME +//H 02: "a_nonexisting_file.cpp" +//H 03: "a_nonexisting_file.cpp" +//H 17: 5 "a_nonexisting_file.cpp" (5, "a_nonexisting_file.cpp") +//H 10: a_nonexisting_file.cpp(8): #error +//H 16: This error should occur at line 8 of "a_nonexisting_file.cpp" +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_005.cpp new file mode 100644 index 000000000..80d114aaf --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_005.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// test the error reporting for unknown directives + +//R +//E t_2_005.cpp(14): error: ill formed preprocessor directive: #this_is_a_unknown_pp_directive with some parameter +#this_is_a_unknown_pp_directive with some parameter + +//H 21: t_2_005.cpp(14): #this_is_a_unknown_pp_directive with some parameter +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_006.cpp new file mode 100644 index 000000000..918c1ed6d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_006.cpp @@ -0,0 +1,38 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests correctness of macro expansion inside #pragma directives + +#define PRAGMA_BODY preprocessed pragma body + +//R #line 16 "t_2_006.cpp" +//R #pragma some pragma body +#pragma some pragma body +//R #line 19 "t_2_006.cpp" +//R #pragma preprocessed pragma body +#pragma PRAGMA_BODY +//R #line 22 "t_2_006.cpp" +//R #pragma STDC some C99 standard pragma body +#pragma STDC some C99 standard pragma body +//R #line 25 "t_2_006.cpp" +//R #pragma STDC preprocessed pragma body +#pragma STDC PRAGMA_BODY + +//H 10: t_2_006.cpp(12): #define +//H 08: t_2_006.cpp(12): PRAGMA_BODY=preprocessed pragma body +//H 10: t_2_006.cpp(16): #pragma +//H 10: t_2_006.cpp(19): #pragma +//H 01: t_2_006.cpp(12): PRAGMA_BODY +//H 02: preprocessed pragma body +//H 03: preprocessed pragma body +//H 10: t_2_006.cpp(22): #pragma +//H 10: t_2_006.cpp(25): #pragma +//H 01: t_2_006.cpp(12): PRAGMA_BODY +//H 02: preprocessed pragma body +//H 03: preprocessed pragma body diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_007.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_007.cpp new file mode 100644 index 000000000..ccd0cbcce --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_007.cpp @@ -0,0 +1,38 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --c99 + +// Tests correctness of macro expansion inside #pragma directives +// Note: in C99 mode the STDC prefix in pragma's suppresses macro expansion + +#define PRAGMA_BODY preprocessed pragma body + +//R #line 19 "t_2_007.cpp" +//R #pragma some pragma body +#pragma some pragma body +//R #line 22 "t_2_007.cpp" +//R #pragma preprocessed pragma body +#pragma PRAGMA_BODY +//R #line 25 "t_2_007.cpp" +//R #pragma STDC some C99 standard pragma body +#pragma STDC some C99 standard pragma body +//R #line 28 "t_2_007.cpp" +//R #pragma STDC PRAGMA_BODY +#pragma STDC PRAGMA_BODY + +//H 10: t_2_007.cpp(15): #define +//H 08: t_2_007.cpp(15): PRAGMA_BODY=preprocessed pragma body +//H 10: t_2_007.cpp(19): #pragma +//H 10: t_2_007.cpp(22): #pragma +//H 01: t_2_007.cpp(15): PRAGMA_BODY +//H 02: preprocessed pragma body +//H 03: preprocessed pragma body +//H 10: t_2_007.cpp(25): #pragma +//H 10: t_2_007.cpp(28): #pragma diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_008.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_008.cpp new file mode 100644 index 000000000..6fc61559c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_008.cpp @@ -0,0 +1,24 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests #include statements with macros as arguments + +//R +//E t_2_008.cpp(15): error: could not find include file: some_include_file.h +#define INCLUDE_FILE "some_include_file.h" +#include INCLUDE_FILE + +//H 10: t_2_008.cpp(14): #define +//H 08: t_2_008.cpp(14): INCLUDE_FILE="some_include_file.h" +//H 10: t_2_008.cpp(15): #include +//H 01: t_2_008.cpp(14): INCLUDE_FILE +//H 02: "some_include_file.h" +//H 03: "some_include_file.h" +//H 04: "some_include_file.h" +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_009.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_009.cpp new file mode 100644 index 000000000..b72ca45d4 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_009.cpp @@ -0,0 +1,56 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// The result of macro expansion must be re-tokenized to find header-name +// tokens of either <file> or "file" + +//O -S. + +#if !defined(FILE_002_009_CPP) // avoid #include recursion +#define FILE_002_009_CPP + +#define SYSTEM_HEADER <t_2_009.cpp> +#define USER_HEADER "t_2_009.cpp" + +//R #line 23 "t_2_009.cpp" +//R including <t_2_009.cpp> +including <t_2_009.cpp> +#include SYSTEM_HEADER + +//R #line 28 "t_2_009.cpp" +//R including "t_2_009.cpp" +including "t_2_009.cpp" +#include USER_HEADER + +#endif // FILE_002_009_CPP + +//H 10: t_2_009.cpp(15): #if +//H 11: t_2_009.cpp(15): #if !defined(FILE_002_009_CPP) : 1 +//H 10: t_2_009.cpp(16): #define +//H 08: t_2_009.cpp(16): FILE_002_009_CPP= +//H 10: t_2_009.cpp(18): #define +//H 08: t_2_009.cpp(18): SYSTEM_HEADER=<t_2_009.cpp> +//H 10: t_2_009.cpp(19): #define +//H 08: t_2_009.cpp(19): USER_HEADER="t_2_009.cpp" +//H 10: t_2_009.cpp(24): #include +//H 01: t_2_009.cpp(18): SYSTEM_HEADER +//H 02: <t_2_009.cpp> +//H 03: <t_2_009.cpp> +//H 04: <t_2_009.cpp> +//H 05: $B(t_2_009.cpp) ($B(t_2_009.cpp)) +//H 10: t_2_009.cpp(15): #if +//H 11: t_2_009.cpp(15): #if !defined(FILE_002_009_CPP) : 0 +//H 06: +//H 19: $B(t_2_009.cpp): FILE_002_009_CPP +//H 10: t_2_009.cpp(29): #include +//H 01: t_2_009.cpp(19): USER_HEADER +//H 02: "t_2_009.cpp" +//H 03: "t_2_009.cpp" +//H 04: "t_2_009.cpp" +//H 10: t_2_009.cpp(31): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_010.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_010.cpp new file mode 100644 index 000000000..bdc92a741 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_010.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests error reporting for missing #endif + +//E t_2_010.cpp(22): error: detected at least one missing #endif directive +#if 1 +#if 0 +#endif + +//H 10: t_2_010.cpp(13): #if +//H 11: t_2_010.cpp(13): #if 1: 1 +//H 10: t_2_010.cpp(14): #if +//H 11: t_2_010.cpp(14): #if 0: 0 +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_011.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_011.cpp new file mode 100644 index 000000000..8f8dfedf3 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_011.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests error reporting for missing #if + +//E t_2_011.cpp(15): error: the #if for this directive is missing: #endif +#if 1 +#endif +#endif + +//H 10: t_2_011.cpp(13): #if +//H 11: t_2_011.cpp(13): #if 1: 1 +//H 10: t_2_011.cpp(14): #endif +//H 10: t_2_011.cpp(15): #endif +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_012.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_012.cpp new file mode 100644 index 000000000..67ff1fe7d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_012.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests error reporting for missing #if + +//E t_2_012.cpp(13): error: the #if for this directive is missing: #else +#else +#endif + +//H 10: t_2_012.cpp(13): #else +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_013.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_013.cpp new file mode 100644 index 000000000..e44893f1d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_013.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests error reporting for missing #if + +//E t_2_013.cpp(20): error: detected at least one missing #endif directive +#if 1 +#else + +//H 10: t_2_013.cpp(13): #if +//H 11: t_2_013.cpp(13): #if 1: 1 +//H 10: t_2_013.cpp(14): #else +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_014.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_014.cpp new file mode 100644 index 000000000..9a6df37a1 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_014.cpp @@ -0,0 +1,111 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether alternative tokens are interpreted inside of conditional +// expressions + +//R #line 16 "t_2_014.cpp" +//R true +#if compl 1 +true +#else +false +#endif + +//R #line 26 "t_2_014.cpp" +//R true +#if not 1 +false +#else +true +#endif + +//R #line 32 "t_2_014.cpp" +//R true +#if 1 or 2 +true +#else +false +#endif + +//R #line 40 "t_2_014.cpp" +//R true +#if 1 and 2 +true +#else +false +#endif + +//R #line 50 "t_2_014.cpp" +//R true +#if not 1 +false +#else +true +#endif + +//R #line 56 "t_2_014.cpp" +//R true +#if 1 xor 2 +true +#else +false +#endif + +//R #line 66 "t_2_014.cpp" +//R true +#if 1 bitand 2 +false +#else +true +#endif + +//R #line 72 "t_2_014.cpp" +//R true +#if 1 bitor 2 +true +#else +false +#endif + +//R #line 80 "t_2_014.cpp" +//R true +#if 1 not_eq 2 +true +#else +false +#endif + +//H 10: t_2_014.cpp(15): #if +//H 11: t_2_014.cpp(15): #if compl 1: 1 +//H 10: t_2_014.cpp(17): #else +//H 10: t_2_014.cpp(23): #if +//H 11: t_2_014.cpp(23): #if not 1: 0 +//H 10: t_2_014.cpp(27): #endif +//H 10: t_2_014.cpp(31): #if +//H 11: t_2_014.cpp(31): #if 1 or 2: 1 +//H 10: t_2_014.cpp(33): #else +//H 10: t_2_014.cpp(39): #if +//H 11: t_2_014.cpp(39): #if 1 and 2: 1 +//H 10: t_2_014.cpp(41): #else +//H 10: t_2_014.cpp(47): #if +//H 11: t_2_014.cpp(47): #if not 1: 0 +//H 10: t_2_014.cpp(51): #endif +//H 10: t_2_014.cpp(55): #if +//H 11: t_2_014.cpp(55): #if 1 xor 2: 1 +//H 10: t_2_014.cpp(57): #else +//H 10: t_2_014.cpp(63): #if +//H 11: t_2_014.cpp(63): #if 1 bitand 2: 0 +//H 10: t_2_014.cpp(67): #endif +//H 10: t_2_014.cpp(71): #if +//H 11: t_2_014.cpp(71): #if 1 bitor 2: 1 +//H 10: t_2_014.cpp(73): #else +//H 10: t_2_014.cpp(79): #if +//H 11: t_2_014.cpp(79): #if 1 not_eq 2: 1 +//H 10: t_2_014.cpp(81): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_015.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_015.cpp new file mode 100644 index 000000000..67d7bb42e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_015.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether #if works when the expression is surrounded by parenthesis + +#define WINVER 0x0500 + +//R #line 17 "t_2_015.cpp" +//R true +#if(WINVER >= 0x0500) +true +#endif + +//H 10: t_2_015.cpp(12): #define +//H 08: t_2_015.cpp(12): WINVER=0x0500 +//H 10: t_2_015.cpp(16): #if +//H 01: t_2_015.cpp(12): WINVER +//H 02: 0x0500 +//H 03: 0x0500 +//H 11: t_2_015.cpp(16): #if (WINVER >= 0x0500): 1 +//H 10: t_2_015.cpp(18): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_016.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_016.cpp new file mode 100644 index 000000000..43169d0f9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_016.cpp @@ -0,0 +1,26 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// if _MSC_VER was defined through the command line, the pp expression was +// garbled + +//O -D_MSC_VER=1200 + +//R #line 18 "t_2_016.cpp" +//R true +#if defined (_MSC_VER) && (_MSC_VER >= 1020) +true +#endif + +//H 10: t_2_016.cpp(17): #if +//H 01: <command line>(1): _MSC_VER +//H 02: 1200 +//H 03: 1200 +//H 11: t_2_016.cpp(17): #if defined (_MSC_VER) && (_MSC_VER >= 1020): 1 +//H 10: t_2_016.cpp(19): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_017.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_017.cpp new file mode 100644 index 000000000..a69083c10 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_017.cpp @@ -0,0 +1,36 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// The result of macro expansion must be retokenized to find header-name tokens +// of either <file> or "file". Test inclusion using absolute names. + +#if !defined(FILE_002_017_CPP) // avoid #include recursion +#define FILE_002_017_CPP + +#include __FILE__ + +#endif // FILE_002_017_CPP + +//R #line 24 "t_2_017.cpp" +//R file t_2_017.cpp +//R #line 24 "t_2_017.cpp" +//R file t_2_017.cpp +file t_2_017.cpp + +//H 10: t_2_017.cpp(13): #if +//H 11: t_2_017.cpp(13): #if !defined(FILE_002_017_CPP) : 1 +//H 10: t_2_017.cpp(14): #define +//H 08: t_2_017.cpp(14): FILE_002_017_CPP= +//H 10: t_2_017.cpp(16): #include +//H 04: "$P(t_2_017.cpp)" +//H 05: $B(t_2_017.cpp) ($B(t_2_017.cpp)) +//H 10: t_2_017.cpp(13): #if +//H 11: t_2_017.cpp(13): #if !defined(FILE_002_017_CPP) : 0 +//H 06: +//H 10: t_2_017.cpp(18): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_018.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_018.cpp new file mode 100644 index 000000000..8ca07c42b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_018.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Check if regression reported by ticket #1752 has been fixed + +//R #line 17 "t_2_018.cpp" +//R "__FILE__ is defined" +#ifndef __FILE__ +"No __FILE__" +#else +"__FILE__ is defined" +#endif + +//H 10: t_2_018.cpp(14): #ifndef +//H 11: t_2_018.cpp(14): #ifndef __FILE__: 1 +//H 10: t_2_018.cpp(18): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_019.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_019.cpp new file mode 100644 index 000000000..9a4729d01 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_019.cpp @@ -0,0 +1,61 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Check if #pragma once, include guard detection, and related hooks work as +// expected + +#include "t_2_019_001.hpp" // #pragma once +#include "t_2_019_002.hpp" // include guard style 1 +#include "t_2_019_003.hpp" // include guard style 2 + +// repeat inclusion, should do nothing +#include "t_2_019_001.hpp" +#include "t_2_019_002.hpp" +#include "t_2_019_003.hpp" + +//R #line 11 "t_2_019_001.hpp" +//R t_2_019_001 +//R #line 16 "t_2_019_002.hpp" +//R t_2_019_002 +//R #line 16 "t_2_019_003.hpp" +//R t_2_019_003 + +//H 10: t_2_019.cpp(13): #include "t_2_019_001.hpp" +//H 04: "t_2_019_001.hpp" +//H 05: $S(t_2_019_001.hpp) ($B(t_2_019_001.hpp)) +//H 10: t_2_019_001.hpp(10): #pragma +//H 20: t_2_019_001.hpp(10): #pragma: $B(t_2_019_001.hpp) +//H 06: +//H 10: t_2_019.cpp(14): #include "t_2_019_002.hpp" +//H 04: "t_2_019_002.hpp" +//H 05: t_2_019_002.hpp ($B(t_2_019_002.hpp)) +//H 10: t_2_019_002.hpp(12): #if +//H 11: t_2_019_002.hpp(12): #if !defined(T_2_019_002): 1 +//H 10: t_2_019_002.hpp(14): #define +//H 08: t_2_019_002.hpp(14): T_2_019_002= +//H 10: t_2_019_002.hpp(18): #endif +//H 06: +//H 19: $B(t_2_019_002.hpp): T_2_019_002 +//H 10: t_2_019.cpp(15): #include "t_2_019_003.hpp" +//H 04: "t_2_019_003.hpp" +//H 05: t_2_019_003.hpp ($B(t_2_019_003.hpp)) +//H 10: t_2_019_003.hpp(12): #ifndef +//H 11: t_2_019_003.hpp(12): #ifndef T_2_019_003: 0 +//H 10: t_2_019_003.hpp(14): #define +//H 08: t_2_019_003.hpp(14): T_2_019_003= +//H 10: t_2_019_003.hpp(18): #endif +//H 06: +//H 19: $B(t_2_019_003.hpp): T_2_019_003 +//H 10: t_2_019.cpp(18): #include "t_2_019_001.hpp" +//H 04: "t_2_019_001.hpp" +//H 10: t_2_019.cpp(19): #include "t_2_019_002.hpp" +//H 04: "t_2_019_002.hpp" +//H 10: t_2_019.cpp(20): #include "t_2_019_003.hpp" +//H 04: "t_2_019_003.hpp" + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_019_001.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_001.hpp new file mode 100644 index 000000000..281621c3d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_001.hpp @@ -0,0 +1,11 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#pragma once +t_2_019_001 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_019_002.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_002.hpp new file mode 100644 index 000000000..778b8e0fa --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_002.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +# + +#if !defined(T_2_019_002) +# // more comments here +#define T_2_019_002 + +t_2_019_002 + +#endif +# // and here + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_019_003.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_003.hpp new file mode 100644 index 000000000..ab9e5635e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_019_003.hpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +# + +#ifndef T_2_019_003 +# // more comments here +#define T_2_019_003 + +t_2_019_003 + +#endif +# // and here + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_020.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_020.cpp new file mode 100644 index 000000000..7691ffe36 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_020.cpp @@ -0,0 +1,261 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// check called hooks during conditional preprocessing +//O --skipped_token_hooks + +#ifdef FOO +int foo; +#else +float foo; +#endif + +#if defined BAR +int bar; +#elif defined BAR2 +float bar; +#endif + +#define BAZ +#ifdef BAZ +int baz; +#else +float baz; +#endif + +#if defined BAZ +int baz1; +#elif defined BAZ +float baz1; +#endif + +#ifndef BAZ +int baz2; +#else +float baz2; +#endif + +#if 1 +int w1; +#elif 1 +int w2; +#else +int w3; +#endif + +#if 0 +int x1; +#elif 1 +int x2; +#else +int x3; +#endif + +#if 1 +int y1; +#elif 0 +int y2; +#else +int y3; +#endif + +#if 0 +int z1; +#elif 0 +int z2; +#else +int z3; +#endif + +//R #line 16 "t_2_020.cpp" +//R float foo; +//R #line 27 "t_2_020.cpp" +//R int baz; +//R #line 33 "t_2_020.cpp" +//R int baz1; +//R #line 41 "t_2_020.cpp" +//R float baz2; +//R #line 45 "t_2_020.cpp" +//R int w1; +//R #line 55 "t_2_020.cpp" +//R int x2; +//R #line 61 "t_2_020.cpp" +//R int y1; +//R #line 73 "t_2_020.cpp" +//R int z3; + +//H 10: t_2_020.cpp(13): #ifdef +//H 11: t_2_020.cpp(13): #ifdef FOO: 0 +//H 12: t_2_020.cpp(13): >\n< +//H 12: t_2_020.cpp(14): >int< +//H 12: t_2_020.cpp(14): > < +//H 12: t_2_020.cpp(14): >foo< +//H 12: t_2_020.cpp(14): >;< +//H 12: t_2_020.cpp(14): >\n< +//H 12: t_2_020.cpp(15): >#else< +//H 12: t_2_020.cpp(15): >\n< +//H 10: t_2_020.cpp(17): #endif +//H 12: t_2_020.cpp(17): >#endif< +//H 12: t_2_020.cpp(17): >\n< +//H 10: t_2_020.cpp(19): #if +//H 12: t_2_020.cpp(19): > < +//H 11: t_2_020.cpp(19): #if defined BAR: 0 +//H 12: t_2_020.cpp(19): >\n< +//H 12: t_2_020.cpp(20): >int< +//H 12: t_2_020.cpp(20): > < +//H 12: t_2_020.cpp(20): >bar< +//H 12: t_2_020.cpp(20): >;< +//H 12: t_2_020.cpp(20): >\n< +//H 10: t_2_020.cpp(21): #elif +//H 12: t_2_020.cpp(21): > < +//H 11: t_2_020.cpp(21): #elif defined BAR2: 0 +//H 12: t_2_020.cpp(21): >\n< +//H 12: t_2_020.cpp(22): >float< +//H 12: t_2_020.cpp(22): > < +//H 12: t_2_020.cpp(22): >bar< +//H 12: t_2_020.cpp(22): >;< +//H 12: t_2_020.cpp(22): >\n< +//H 12: t_2_020.cpp(23): >#endif< +//H 12: t_2_020.cpp(23): >\n< +//H 10: t_2_020.cpp(25): #define +//H 08: t_2_020.cpp(25): BAZ= +//H 12: t_2_020.cpp(25): >\n< +//H 10: t_2_020.cpp(26): #ifdef +//H 11: t_2_020.cpp(26): #ifdef BAZ: 1 +//H 12: t_2_020.cpp(26): >\n< +//H 10: t_2_020.cpp(28): #else +//H 12: t_2_020.cpp(28): >#else< +//H 12: t_2_020.cpp(28): >\n< +//H 12: t_2_020.cpp(29): >float< +//H 12: t_2_020.cpp(29): > < +//H 12: t_2_020.cpp(29): >baz< +//H 12: t_2_020.cpp(29): >;< +//H 12: t_2_020.cpp(29): >\n< +//H 12: t_2_020.cpp(30): >#endif< +//H 12: t_2_020.cpp(30): >\n< +//H 10: t_2_020.cpp(32): #if +//H 12: t_2_020.cpp(32): > < +//H 11: t_2_020.cpp(32): #if defined BAZ: 1 +//H 12: t_2_020.cpp(32): >\n< +//H 10: t_2_020.cpp(34): #elif +//H 12: t_2_020.cpp(34): > < +//H 12: t_2_020.cpp(34): >defined< +//H 12: t_2_020.cpp(34): > < +//H 12: t_2_020.cpp(34): >BAZ< +//H 12: t_2_020.cpp(34): >\n< +//H 12: t_2_020.cpp(35): >float< +//H 12: t_2_020.cpp(35): > < +//H 12: t_2_020.cpp(35): >baz1< +//H 12: t_2_020.cpp(35): >;< +//H 12: t_2_020.cpp(35): >\n< +//H 12: t_2_020.cpp(36): >#endif< +//H 12: t_2_020.cpp(36): >\n< +//H 10: t_2_020.cpp(38): #ifndef +//H 11: t_2_020.cpp(38): #ifndef BAZ: 1 +//H 12: t_2_020.cpp(38): >\n< +//H 12: t_2_020.cpp(39): >int< +//H 12: t_2_020.cpp(39): > < +//H 12: t_2_020.cpp(39): >baz2< +//H 12: t_2_020.cpp(39): >;< +//H 12: t_2_020.cpp(39): >\n< +//H 12: t_2_020.cpp(40): >#else< +//H 12: t_2_020.cpp(40): >\n< +//H 10: t_2_020.cpp(42): #endif +//H 12: t_2_020.cpp(42): >#endif< +//H 12: t_2_020.cpp(42): >\n< +//H 10: t_2_020.cpp(44): #if +//H 12: t_2_020.cpp(44): > < +//H 11: t_2_020.cpp(44): #if 1: 1 +//H 12: t_2_020.cpp(44): >\n< +//H 10: t_2_020.cpp(46): #elif +//H 12: t_2_020.cpp(46): > < +//H 12: t_2_020.cpp(46): >1< +//H 12: t_2_020.cpp(46): >\n< +//H 12: t_2_020.cpp(47): >int< +//H 12: t_2_020.cpp(47): > < +//H 12: t_2_020.cpp(47): >w2< +//H 12: t_2_020.cpp(47): >;< +//H 12: t_2_020.cpp(47): >\n< +//H 12: t_2_020.cpp(48): >#else< +//H 12: t_2_020.cpp(48): >\n< +//H 12: t_2_020.cpp(49): >int< +//H 12: t_2_020.cpp(49): > < +//H 12: t_2_020.cpp(49): >w3< +//H 12: t_2_020.cpp(49): >;< +//H 12: t_2_020.cpp(49): >\n< +//H 12: t_2_020.cpp(50): >#endif< +//H 12: t_2_020.cpp(50): >\n< +//H 10: t_2_020.cpp(52): #if +//H 12: t_2_020.cpp(52): > < +//H 11: t_2_020.cpp(52): #if 0: 0 +//H 12: t_2_020.cpp(52): >\n< +//H 12: t_2_020.cpp(53): >int< +//H 12: t_2_020.cpp(53): > < +//H 12: t_2_020.cpp(53): >x1< +//H 12: t_2_020.cpp(53): >;< +//H 12: t_2_020.cpp(53): >\n< +//H 10: t_2_020.cpp(54): #elif +//H 12: t_2_020.cpp(54): > < +//H 11: t_2_020.cpp(54): #elif 1: 1 +//H 12: t_2_020.cpp(54): >\n< +//H 10: t_2_020.cpp(56): #else +//H 12: t_2_020.cpp(56): >#else< +//H 12: t_2_020.cpp(56): >\n< +//H 12: t_2_020.cpp(57): >int< +//H 12: t_2_020.cpp(57): > < +//H 12: t_2_020.cpp(57): >x3< +//H 12: t_2_020.cpp(57): >;< +//H 12: t_2_020.cpp(57): >\n< +//H 12: t_2_020.cpp(58): >#endif< +//H 12: t_2_020.cpp(58): >\n< +//H 10: t_2_020.cpp(60): #if +//H 12: t_2_020.cpp(60): > < +//H 11: t_2_020.cpp(60): #if 1: 1 +//H 12: t_2_020.cpp(60): >\n< +//H 10: t_2_020.cpp(62): #elif +//H 12: t_2_020.cpp(62): > < +//H 12: t_2_020.cpp(62): >0< +//H 12: t_2_020.cpp(62): >\n< +//H 12: t_2_020.cpp(63): >int< +//H 12: t_2_020.cpp(63): > < +//H 12: t_2_020.cpp(63): >y2< +//H 12: t_2_020.cpp(63): >;< +//H 12: t_2_020.cpp(63): >\n< +//H 12: t_2_020.cpp(64): >#else< +//H 12: t_2_020.cpp(64): >\n< +//H 12: t_2_020.cpp(65): >int< +//H 12: t_2_020.cpp(65): > < +//H 12: t_2_020.cpp(65): >y3< +//H 12: t_2_020.cpp(65): >;< +//H 12: t_2_020.cpp(65): >\n< +//H 12: t_2_020.cpp(66): >#endif< +//H 12: t_2_020.cpp(66): >\n< +//H 10: t_2_020.cpp(68): #if +//H 12: t_2_020.cpp(68): > < +//H 11: t_2_020.cpp(68): #if 0: 0 +//H 12: t_2_020.cpp(68): >\n< +//H 12: t_2_020.cpp(69): >int< +//H 12: t_2_020.cpp(69): > < +//H 12: t_2_020.cpp(69): >z1< +//H 12: t_2_020.cpp(69): >;< +//H 12: t_2_020.cpp(69): >\n< +//H 10: t_2_020.cpp(70): #elif +//H 12: t_2_020.cpp(70): > < +//H 11: t_2_020.cpp(70): #elif 0: 0 +//H 12: t_2_020.cpp(70): >\n< +//H 12: t_2_020.cpp(71): >int< +//H 12: t_2_020.cpp(71): > < +//H 12: t_2_020.cpp(71): >z2< +//H 12: t_2_020.cpp(71): >;< +//H 12: t_2_020.cpp(71): >\n< +//H 12: t_2_020.cpp(72): >#else< +//H 12: t_2_020.cpp(72): >\n< +//H 10: t_2_020.cpp(74): #endif +//H 12: t_2_020.cpp(74): >#endif< +//H 12: t_2_020.cpp(74): >\n< diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_021.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_021.cpp new file mode 100644 index 000000000..ceef8e8a2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_021.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define SIX (4 + 2.0) + +//R #line 14 "t_2_021.cpp" +//R #pragma command option +#pragma command option +//R #line 17 "t_2_021.cpp" +//R #pragma command option (4 + 2.0) +#pragma command option SIX +//R #line 20 "t_2_021.cpp" +//R #pragma command option[(4 + 2.0)] +#pragma command option[SIX] +//R #line 23 "t_2_021.cpp" +//R #pragma command option(5) +#pragma command option(5) +//R #line 26 "t_2_021.cpp" +//R #pragma command option((4 + 2.0)) +#pragma command option(SIX) +//R #line 29 "t_2_021.cpp" +//R #pragma command (4 + 2.0) +#pragma command SIX + +//H 10: t_2_021.cpp(10): #define +//H 08: t_2_021.cpp(10): SIX=(4 + 2.0) +//H 10: t_2_021.cpp(14): #pragma +//H 10: t_2_021.cpp(17): #pragma +//H 01: t_2_021.cpp(10): SIX +//H 02: (4 + 2.0) +//H 03: (4 + 2.0) +//H 10: t_2_021.cpp(20): #pragma +//H 01: t_2_021.cpp(10): SIX +//H 02: (4 + 2.0) +//H 03: (4 + 2.0) +//H 10: t_2_021.cpp(23): #pragma +//H 10: t_2_021.cpp(26): #pragma +//H 01: t_2_021.cpp(10): SIX +//H 02: (4 + 2.0) +//H 03: (4 + 2.0) +//H 10: t_2_021.cpp(29): #pragma +//H 01: t_2_021.cpp(10): SIX +//H 02: (4 + 2.0) +//H 03: (4 + 2.0) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_022.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_022.cpp new file mode 100644 index 000000000..a25f3be34 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_022.cpp @@ -0,0 +1,23 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Verify fix of regression #6838: Adding include file with force_include makes +// Wave fail to emit #line directive + +//O --forceinclude=t_2_022.hpp + +//R #line 12 "t_2_022.hpp" +//R int func() { return 42; } +//R #line 19 "t_2_022.cpp" +//R int main() { return func(); } +int main() { return func(); } + +//H 04: t_2_022.hpp +//H 05: $B(t_2_022.hpp) ($B(t_2_022.hpp)) +//H 06: diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_2_022.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_2_022.hpp new file mode 100644 index 000000000..6b7c52f68 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_2_022.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Verify fix of regression #6838: Adding include file with force_include makes +// Wave fail to emit #line directive +int func() { return 42; } diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_3_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_3_001.cpp new file mode 100644 index 000000000..1718a5ddf --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_3_001.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, if a diagnostic is emitted, if a predefined macro is to be undefined. + +//R +//E t_3_001.cpp(14): warning: #undef may not be used on this predefined name: __cplusplus +#undef __cplusplus // should emit a warning + +//H 10: t_3_001.cpp(14): #undef +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_3_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_3_002.cpp new file mode 100644 index 000000000..cb9825948 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_3_002.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests predefined macros + +//R #line 13 "t_3_002.cpp" +__STDC__ //R 1 +__STDC_VERSION__ //R __STDC_VERSION__ +__cplusplus //R 199711L +__STDC_HOSTED__ //R __STDC_HOSTED__ +__LINE__ //R 17 +__FILE__ //R "$P" +__BASE_FILE__ //R "$F" +__WAVE_HAS_VARIADICS__ //R __WAVE_HAS_VARIADICS__ +__INCLUDE_LEVEL__ //R 0 +//R #line 50 "test.cpp" +#line 50 "test.cpp" +__LINE__ //R 50 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + + +//R #line 56 "test.cpp" +__LINE__ //R 56 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + +//H 01: <built-in>(1): __STDC__ +//H 02: 1 +//H 03: 1 +//H 01: <built-in>(1): __cplusplus +//H 02: 199711L +//H 03: 199711L +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 10: t_3_002.cpp(23): #line +//H 17: 50 "test.cpp" (50, "test.cpp") +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_3_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_3_003.cpp new file mode 100644 index 000000000..63c17b55a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_3_003.cpp @@ -0,0 +1,55 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --variadics + +// Tests predefined macros + +//R #line 15 "t_3_003.cpp" +__STDC__ //R 1 +__STDC_VERSION__ //R __STDC_VERSION__ +__cplusplus //R 199711L +__STDC_HOSTED__ //R __STDC_HOSTED__ +__LINE__ //R 19 +__FILE__ //R "$P" +__BASE_FILE__ //R "$F" +__WAVE_HAS_VARIADICS__ //R 1 +__INCLUDE_LEVEL__ //R 0 +//R #line 50 "test.cpp" +#line 50 "test.cpp" +__LINE__ //R 50 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + + +//R #line 56 "test.cpp" +__LINE__ //R 56 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + +//H 01: <built-in>(1): __STDC__ +//H 02: 1 +//H 03: 1 +//H 01: <built-in>(1): __cplusplus +//H 02: 199711L +//H 03: 199711L +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 01: <built-in>(1): __WAVE_HAS_VARIADICS__ +//H 02: 1 +//H 03: 1 +//H 10: t_3_003.cpp(25): #line +//H 17: 50 "test.cpp" (50, "test.cpp") +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_3_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_3_004.cpp new file mode 100644 index 000000000..a5a0dc3ea --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_3_004.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --c99 + +// Tests predefined macros + +//R #line 15 "t_3_004.cpp" +__STDC__ //R 1 +__STDC_VERSION__ //R 199901L +__cplusplus //R __cplusplus +__STDC_HOSTED__ //R 0 +__LINE__ //R 19 +__FILE__ //R "$P" +__BASE_FILE__ //R "$F" +__WAVE_HAS_VARIADICS__ //R 1 +__INCLUDE_LEVEL__ //R 0 +//R #line 50 "test.cpp" +#line 50 "test.cpp" +__LINE__ //R 50 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + + +//R #line 56 "test.cpp" +__LINE__ //R 56 +__FILE__ //R "test.cpp" +__BASE_FILE__ //R "$F" + +//H 01: <built-in>(1): __STDC__ +//H 02: 1 +//H 03: 1 +//H 01: <built-in>(1): __STDC_VERSION__ +//H 02: 199901L +//H 03: 199901L +//H 01: <built-in>(1): __STDC_HOSTED__ +//H 02: 0 +//H 03: 0 +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 01: <built-in>(1): __WAVE_HAS_VARIADICS__ +//H 02: 1 +//H 03: 1 +//H 10: t_3_004.cpp(25): #line +//H 17: 50 "test.cpp" (50, "test.cpp") +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" +//H 01: <built-in>(1): __BASE_FILE__ +//H 02: "$F" +//H 03: "$F" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_4_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_4_001.cpp new file mode 100644 index 000000000..dbb52f7f8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_4_001.cpp @@ -0,0 +1,22 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether integer arithmetic results get truncated correctly + +//R #line 15 "t_4_001.cpp" +//R true +#if 1 / 10 == 0 +true +#else +false +#endif + +//H 10: t_4_001.cpp(14): #if +//H 11: t_4_001.cpp(14): #if 1 / 10 == 0: 1 +//H 10: t_4_001.cpp(16): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_4_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_4_002.cpp new file mode 100644 index 000000000..71feb4311 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_4_002.cpp @@ -0,0 +1,28 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether ecursively defined macros get expanded correctly in the +// context of an #if expression + +#define C C + +//R #line 18 "t_4_002.cpp" +//R true +#if !C +true +#endif + +//H 10: t_4_002.cpp(13): #define +//H 08: t_4_002.cpp(13): C=C +//H 10: t_4_002.cpp(17): #if +//H 01: t_4_002.cpp(13): C +//H 02: C +//H 03: C +//H 11: t_4_002.cpp(17): #if !C: 1 +//H 10: t_4_002.cpp(19): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_4_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_4_003.cpp new file mode 100644 index 000000000..ec0566af0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_4_003.cpp @@ -0,0 +1,100 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests simple expression arithmetics + +# define CAT(a, b) PRIMITIVE_CAT(a, b) +# define PRIMITIVE_CAT(a, b) a ## b + +# define OFFSET(n) OFFSET_ ## n + +# define OFFSET_1 OFFSET_2 % 10 +# define OFFSET_2 OFFSET_3 % 100 +# define OFFSET_3 OFFSET_4 % 1000 +# define OFFSET_4 + +# define FACTOR(n) FACTOR_ ## n + +# define FACTOR_1 / 1 +# define FACTOR_2 CAT(FACTOR_1, 0) +# define FACTOR_3 CAT(FACTOR_2, 0) +# define FACTOR_4 CAT(FACTOR_3, 0) + +# define DIGIT(n) OFFSET(n) FACTOR(n) + +# define x 987 + +# if (x) DIGIT(3) == 0 +# define D3 0 +# elif (x) DIGIT(3) == 1 +# define D3 1 +# elif (x) DIGIT(3) == 2 +# define D3 2 +# elif (x) DIGIT(3) == 3 +# define D3 3 +# elif (x) DIGIT(3) == 4 +# define D3 4 +# elif (x) DIGIT(3) == 5 +# define D3 5 +# elif (x) DIGIT(3) == 6 +# define D3 6 +# elif (x) DIGIT(3) == 7 +# define D3 7 +# elif (x) DIGIT(3) == 8 +# define D3 8 +# elif (x) DIGIT(3) == 9 +# define D3 9 +# endif + +# if (x) DIGIT(2) == 0 +# define D2 0 +# elif (x) DIGIT(2) == 1 +# define D2 1 +# elif (x) DIGIT(2) == 2 +# define D2 2 +# elif (x) DIGIT(2) == 3 +# define D2 3 +# elif (x) DIGIT(2) == 4 +# define D2 4 +# elif (x) DIGIT(2) == 5 +# define D2 5 +# elif (x) DIGIT(2) == 6 +# define D2 6 +# elif (x) DIGIT(2) == 7 +# define D2 7 +# elif (x) DIGIT(2) == 8 +# define D2 8 +# elif (x) DIGIT(2) == 9 +# define D2 9 +# endif + +# if (x) DIGIT(1) == 0 +# define D1 0 +# elif (x) DIGIT(1) == 1 +# define D1 1 +# elif (x) DIGIT(1) == 2 +# define D1 2 +# elif (x) DIGIT(1) == 3 +# define D1 3 +# elif (x) DIGIT(1) == 4 +# define D1 4 +# elif (x) DIGIT(1) == 5 +# define D1 5 +# elif (x) DIGIT(1) == 6 +# define D1 6 +# elif (x) DIGIT(1) == 7 +# define D1 7 +# elif (x) DIGIT(1) == 8 +# define D1 8 +# elif (x) DIGIT(1) == 9 +# define D1 9 +# endif + +//R #line 100 "t_4_003.cpp" +D3 D2 D1 //R 9 8 7 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_4_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_4_004.cpp new file mode 100644 index 000000000..15f66e70f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_4_004.cpp @@ -0,0 +1,61 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether invalid expression errors get ignored for 'passive' #elif +// expressions +#define USHRT_MAX 0xffffU + +// The number of bytes in a short. +# if !defined (SIZEOF_SHORT) +# if (USHRT_MAX) == 255U +# define SIZEOF_SHORT 1 +# elif (USHRT_MAX) == 65535U +# define SIZEOF_SHORT 2 +# elif (USHRT_MAX) == 4294967295U +# define SIZEOF_SHORT 4 +# elif (USHRT_MAX) == 18446744073709551615U +# define SIZEOF_SHORT 8 +# else +# error: unsupported short size, must be updated for this platform! +# endif /* USHRT_MAX */ +# endif /* !defined (SIZEOF_SHORT) */ + +//R #line 32 "t_4_004.cpp" +//R true +#if SIZEOF_SHORT == 2 +true +#else +false +#endif + +//H 10: t_4_004.cpp(12): #define +//H 08: t_4_004.cpp(12): USHRT_MAX=0xffffU +//H 10: t_4_004.cpp(15): # if +//H 11: t_4_004.cpp(15): # if !defined (SIZEOF_SHORT): 1 +//H 10: t_4_004.cpp(16): # if +//H 01: t_4_004.cpp(12): USHRT_MAX +//H 02: 0xffffU +//H 03: 0xffffU +//H 11: t_4_004.cpp(16): # if (USHRT_MAX) == 255U: 0 +//H 10: t_4_004.cpp(18): # elif +//H 01: t_4_004.cpp(12): USHRT_MAX +//H 02: 0xffffU +//H 03: 0xffffU +//H 11: t_4_004.cpp(18): # elif (USHRT_MAX) == 65535U: 1 +//H 10: t_4_004.cpp(19): #define +//H 08: t_4_004.cpp(19): SIZEOF_SHORT=2 +//H 10: t_4_004.cpp(20): # elif +//H 10: t_4_004.cpp(22): # elif +//H 10: t_4_004.cpp(27): # endif +//H 10: t_4_004.cpp(31): #if +//H 01: t_4_004.cpp(19): SIZEOF_SHORT +//H 02: 2 +//H 03: 2 +//H 11: t_4_004.cpp(31): #if SIZEOF_SHORT == 2: 1 +//H 10: t_4_004.cpp(33): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_001.cpp new file mode 100644 index 000000000..7a2114229 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_001.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the conversion of trigraph sequences. + +// 1.1: The following 9 sequences are valid trigraph sequences. +//R #line 20 "t_5_001.cpp" +"??( ??) ??/??/ ??' ??< ??> ??! ??- ??=" //R "[ ] \\ ^ { } | ~ #" +??( ??) ??/??/ ??' ??< ??> ??! ??- ??= //R [ ] \\ ^ { } | ~ # + +// 1.2: In directive line. +//R #line 26 "t_5_001.cpp" +??= define OR(a, b) a ??! b +OR(1, 2) //R 1 | 2 + +// 1.3: Any sequence other than above 9 is not a trigraph sequence. +//R #line 30 "t_5_001.cpp" +"?? ??? ??% ??^ ???=" //R "?? ??? ??% ??^ ?#" +?? ??? ??% ??^ ???= //R ? ? ? ? ? ? ?% ? ?^ ?# + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_002.cpp new file mode 100644 index 000000000..1e265095c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_002.cpp @@ -0,0 +1,76 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the line splicing by <backslash><newline> sequence. + +// 2.1: In a #define directive line, between the parameter list and the +// replacement text. +//R #line 23 "t_5_002.cpp" +#define FUNC(a, b, c) \ + a ## b ## c +FUNC(ab, cd, ef) //R abcdef + +// 2.2: In a #define directive line, among the parameter list and among the +// replacement text. +//R #line 33 "t_5_002.cpp" +#undef FUNC +#define FUNC(a, b \ + , c) \ + a ## b \ + ## c +FUNC(ab, cd, ef) //R abcdef + +// 2.3: In a string literal. +//R #line 37 "t_5_002.cpp" +"abc\ +de" //R "abcde" + +// 2.4: <backslash><newline> in midst of an identifier. +//R #line 43 "t_5_002.cpp" +#define ABCDE 5 +ABC\ +DE //R 5 + +// 2.5: <backslash><newline> by trigraph. +//R #line 48 "t_5_002.cpp" +ABC??/ +DE //R 5 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_003.cpp new file mode 100644 index 000000000..55d249d6a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_003.cpp @@ -0,0 +1,68 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the handling of comments. + +#define STR(x) #x + +// 3.1: A comment is converted to one space. +//R #line 22 "t_5_003.cpp" +STR(abc/* comment */de) //R "abc de" +abc/* comment */de //R abc de + +// 3.2: // is not a comment of C. +// Wave always treats the '//' style as comments (even in C99 mode) +/* assert( strcmp( str( //), "//") == 0); */ + +// 3.3: Comments are parsed prior to the parsing of preprocessing directives. +//R #line 41 "t_5_003.cpp" +#if 0 + "nonsence"; /* +#else + still in + comment */ +#else +#define MACRO_abcd /* + in comment + */ abcd +#endif +MACRO_abcd //R abcd + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_004.cpp new file mode 100644 index 000000000..e2b1db60c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_004.cpp @@ -0,0 +1,59 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the handling of comments and <backslash><newline>. + +// This test is currently disabled, because of the known problem in Wave, that +// causes multiple __LINE__ macros on splitted lines after preprocessing +// directives are expanded as the line number of the directive itself. + +// Note: This unit test passes only if Wave was compiled with a defined +// BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY compile time constant +// (which is the default). +#define STR(x) #x + +// 3.4: Comment and <backslash><newline> in #error line. +//E t_5_004.cpp(29): fatal error: encountered #error directive or #pragma wave stop(): (29) Message of first physical line. (30) Message of second physical and first logical line. (32) Message of forth physical and third logical line. +#error (__LINE__) Message of first physical line. \ + (__LINE__) Message of second physical and first logical line. /* + this comment splices the lines + */ (__LINE__) Message of forth physical and third logical line. + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_005.cpp new file mode 100644 index 000000000..87b3ee182 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_005.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the handling of special tokens. + +// 4.1: Digraph spellings in directive line. +//R #line 21 "t_5_005.cpp" +%: define STR(a) %: a +STR(abc) //R "abc" + +// 4.2: Digraph spellings are retained in stringization. +//R #line 25 "t_5_005.cpp" +STR(<:) //R "<:" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_006.cpp new file mode 100644 index 000000000..6f03d5897 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_006.cpp @@ -0,0 +1,53 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// boostinspect:notab this file needs to contain tabs + +// Tests, whether spaces or tabs are allowed at any place in a pp-directive +// lines, including between the top of a pp-directive line and '#', and between +// the '#' and the directive. + +// /**/[TAB]# /**/[TAB]define /**/[TAB]MACRO[TAB]/**/ abcde /**/ + /**/ # /**/ define /**/ MACRO /**/ abcde /**/ + +//R #line 26 "t_5_006.cpp" +MACRO //R abcde + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_007.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_007.cpp new file mode 100644 index 000000000..be08d5c35 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_007.cpp @@ -0,0 +1,70 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + Some of the tests included in this file were initially taken from the mcpp + V2.5 preprocessor validation suite and were modified to fit into the + Boost.Wave unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the #include directive (need to switch off include guard detection). +//O --noguard + +// 6.1: Header-name quoted by " and " as well as by < and > can include +// standard headers. +//R #line 23 "t_5_007.cpp" +#include "boost/version.hpp" +BOOST_LIB_VERSION //R "$V" + +//R #line 29 "t_5_007.cpp" +#undef BOOST_VERSION_HPP +#undef BOOST_LIB_VERSION +#include <boost/version.hpp> +BOOST_LIB_VERSION //R "$V" + +// 6.2: Macro is allowed in #include line. +//R #line 36 "t_5_007.cpp" +#undef MACRO_005_007 +#define HEADER "t_5_007.hpp" +#include HEADER +MACRO_005_007 //R abc + +// 6.3: With macro nonsense but legal. +//R #line 43 "t_5_007.cpp" +#undef MACRO_005_007 +#define ZERO_TOKEN +#include ZERO_TOKEN HEADER ZERO_TOKEN +MACRO_005_007 //R abc + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_007.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_007.hpp new file mode 100644 index 000000000..5534d768c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_007.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests the #include directive. +#define MACRO_005_007 abc + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_008.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_008.cpp new file mode 100644 index 000000000..c934d1192 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_008.cpp @@ -0,0 +1,62 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the #line directive. + +// 7.1: Line number and filename. +//R #line 1234 "cpp" +#line 1234 "cpp" +__LINE__ //R 1234 +__FILE__ //R "cpp" + +// 7.2: Filename argument is optional. +//R #line 2345 "cpp" +#line 2345 +__LINE__ //R 2345 +__FILE__ //R "cpp" + +// 7.3: Argument with macro. +//R #line 1234 "t_5_008.cpp" +#define LINE_AND_FILENAME 1234 "t_5_008.cpp" +#line LINE_AND_FILENAME +__LINE__ //R 1234 +__FILE__ //R "t_5_008.cpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_009.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_009.cpp new file mode 100644 index 000000000..b3141c977 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_009.cpp @@ -0,0 +1,57 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the #error directive. + +// 8.1: The original mcpp validation suite claims: +// Argument of #error directive is not a subject of macro expansion. +// +// But the Standard doesn't say anything about this (neither the C99 nor +// the C++ Standard), so Wave allows to be configured at compile time +// whether to macro expand the arguments to an #error directive. +// This test assumes that macro expansion is enabled. + +//E t_5_009.cpp(29): fatal error: encountered #error directive or #pragma wave stop(): 0 is not a positive number. +#define MACRO 0 +#if MACRO <= 0 +#error MACRO is not a positive number. +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_010.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_010.cpp new file mode 100644 index 000000000..40d4609e3 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_010.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests, whether the argument of #error is optional + +// 8.2: #error should be executed even without argument. +//E t_5_010.cpp(20): fatal error: encountered #error directive or #pragma wave stop() +#error + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_011.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_011.cpp new file mode 100644 index 000000000..2805a63be --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_011.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests, whether the argument of #error is optional + +// 9.1: Any #pragma directive should be processed or ignored, should not +// be diagnosed as an error. +// Wave allows to be configured at compile time, whether unknown #pragmas +// are left untouched or skipped entirely (see the +// BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES pp constant) + +//R #line 27 "t_5_011.cpp" +//R #pragma who knows ? +#pragma once +#pragma who knows ? + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_012.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_012.cpp new file mode 100644 index 000000000..d10107493 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_012.cpp @@ -0,0 +1,74 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests #if, #elif, #else and #endif pp-directives. + +#define MACRO_0 0 +#define MACRO_1 1 + +// 10.1: +// Note: an undefined identifier in #if expression is replaced to 0. +//R #line 30 "t_5_012.cpp" +//R true +#if a +false +#elif MACRO_0 +false +#elif MACRO_1 /* Valid block */ +true +#else +false +#endif + +// 10.2: Comments must be processed even if in skipped #if block. +// At least tokenization of string literal and character constant is +// necessary to process comments, e.g. /* is not a comment mark in string +// literal. + +//R #line 46 "t_5_012.cpp" +//R true +#ifdef UNDEFINED + /* Comment */ + "in literal /* is not a comment" +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_013.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_013.cpp new file mode 100644 index 000000000..3245bbd0b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_013.cpp @@ -0,0 +1,82 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests operator "defined" in #if or #elif directives. + +#define MACRO_abc abc +#define MACRO_0 2 +#define ZERO_TOKEN + +// 11.1: +//R #line 28 "t_5_013.cpp" +//R true +#if defined a +false +#else +true +#endif + +//R #line 34 "t_5_013.cpp" +//R true +#if defined (MACRO_abc) +true +#else +false +#endif + +// 11.2: "defined" is an unary operator whose result is 1 or 0. + +//R #line 46 "t_5_013.cpp" +//R true +#if defined MACRO_0 * 3 != 3 +false +#else +true +#endif + +//R #line 54 "t_5_013.cpp" +//R true +#if (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1) +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_014.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_014.cpp new file mode 100644 index 000000000..c955d8f9d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_014.cpp @@ -0,0 +1,114 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests integer preprocessing number token and type of #if expression. + +// 12.1: +//R #line 24 "t_5_014.cpp" +//R true +#if __TESTWAVE_LONG_MAX__ <= __TESTWAVE_LONG_MIN__ + "Bad evaluation of long." +#else +true +#endif + +//R #line 32 "t_5_014.cpp" +//R true +#if __TESTWAVE_LONG_MAX__ <= (__TESTWAVE_LONG_MAX__ / 2) /* 0x3FFFFFFF */ + "Bad evaluation of long." +#else +true +#endif + +// 12.2: +//R #line 41 "t_5_014.cpp" +//R true +#if __TESTWAVE_ULONG_MAX__ / 2 < __TESTWAVE_LONG_MAX__ + "Bad evaluation of unsigned long." +#else +true +#endif + +// 12.3: Octal number. +//R #line 50 "t_5_014.cpp" +//R true +#if 0177777 != 65535 + "Bad evaluation of octal number." +#else +true +#endif + +// 12.4: Hexadecimal number. +//R #line 59 "t_5_014.cpp" +//R true +#if 0Xffff != 65535 || 0xFfFf != 65535 + "Bad evaluation of hexadecimal number." +#else +true +#endif + +// 12.5: Suffix 'L' or 'l'. +//R #line 68 "t_5_014.cpp" +//R true +#if 0L != 0 || 0l != 0 + "Bad evaluation of 'L' suffix." +#else +true +#endif + +// 12.6: Suffix 'U' or 'u'. +//R #line 77 "t_5_014.cpp" +//R true +#if 1U != 1 || 1u != 1 + "Bad evaluation of 'U' suffix." +#else +true +#endif + +// 12.7: Negative integer. +//R #line 86 "t_5_014.cpp" +//R true +#if 0 <= -1 + "Bad evaluation of negative number." +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_015.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_015.cpp new file mode 100644 index 000000000..49e4fd496 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_015.cpp @@ -0,0 +1,93 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests valid operators in #if expression. + +// Valid operators are (precedence in this order) : +// defined, (unary)+, (unary)-, ~, !, +// *, /, %, +// +, -, +// <<, >>, +// <, >, <=, >=, +// ==, !=, +// &, +// ^, +// |, +// &&, +// ||, +// ? : + +// 13.1: Bit shift. +//R #line 38 "t_5_015.cpp" +//R true +#if 1 << 2 != 4 || 8 >> 1 != 4 + "Bad arithmetic of <<, >> operators." +#else +true +#endif + +// 13.2: Bitwise operators. +//R #line 47 "t_5_015.cpp" +//R true +#if (3 ^ 5) != 6 || (3 | 5) != 7 || (3 & 5) != 1 + "Bad arithmetic of ^, |, & operators." +#else +true +#endif + +// 13.3: Result of ||, && operators is either of 1 or 0. +//R #line 56 "t_5_015.cpp" +//R true +#if (2 || 3) != 1 || (2 && 3) != 1 || (0 || 4) != 1 || (0 && 5) != 0 + "Bad arithmetic of ||, && operators." +#else +true +#endif + +// 13.4: ?, : operator. +//R #line 65 "t_5_015.cpp" +//R true +#if (0 ? 1 : 2) != 2 + "Bad arithmetic of ?: operator."; +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_016.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_016.cpp new file mode 100644 index 000000000..f7bcc0f11 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_016.cpp @@ -0,0 +1,79 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests arithmetic conversion in #if expressions. + +// 13.5: The usual arithmetic conversion is not performed on bit shift. +//R #line 24 "t_5_016.cpp" +//R true +#if -1 << 3U > 0 + "Bad conversion of bit shift operands." +#else +true +#endif + +// 13.6: Usual arithmetic conversions. +//R #line 33 "t_5_016.cpp" +//R true +#if -1 <= 0U /* -1 is converted to unsigned long. */ + "Bad arithmetic conversion." +#else +true +#endif + +//R #line 41 "t_5_016.cpp" +//R true +#if -1 * 1U <= 0 + "Bad arithmetic conversion." +#else +true +#endif + +// Second and third operands of conditional operator are converted to the +// same type, thus -1 is converted to unsigned long. +//R #line 51 "t_5_016.cpp" +//R true +#if (1 ? -1 : 0U) <= 0 + "Bad arithmetic conversion."; +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_017.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_017.cpp new file mode 100644 index 000000000..6a3679494 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_017.cpp @@ -0,0 +1,88 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests short-circuit evaluation of #if expression. + +#define MACRO_0 0 + +// 13.7: 10/0 or 10/MACRO_0 are never evaluated, "divide by zero" error +// cannot occur. + +//R #line 28 "t_5_017.cpp" +//R true +#if 0 && 10 / 0 +false +#else +true +#endif + +//R #line 36 "t_5_017.cpp" +//R true +#if not_defined && 10 / not_defined +false +#else +true +#endif + +//R #line 44 "t_5_017.cpp" +//R true +#if MACRO_0 && 10 / MACRO_0 > 1 +false +#else +true +#endif + +//R #line 52 "t_5_017.cpp" +//R true +#if MACRO_0 ? 10 / MACRO_0 : 0 +false +#else +true +#endif + +//R #line 58 "t_5_017.cpp" +//R true +#if MACRO_0 == 0 || 10 / MACRO_0 > 1 /* Valid block */ +true +#else +false +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_018.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_018.cpp new file mode 100644 index 000000000..8683accaa --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_018.cpp @@ -0,0 +1,91 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests grouping of sub-expressions in #if expression. + +// 13.8: Unary operators are grouped from right to left. +//R #line 24 "t_5_018.cpp" +//R true +#if (- -1 != 1) || (!!9 != 1) || (-!+!9 != -1) || (~~1 != 1) + "Bad grouping of -, +, !, ~ in #if expression." +#else +true +#endif + +// 13.9: ?: operators are grouped from right to left. +//R #line 33 "t_5_018.cpp" +//R true +#if (1 ? 2 ? 3 ? 3 : 2 : 1 : 0) != 3 + "Bad grouping of ? : in #if expression." +#else +true +#endif + +// 13.10: Other operators are grouped from left to right. +//R #line 42 "t_5_018.cpp" +//R true +#if (15 >> 2 >> 1 != 1) || (3 << 2 << 1 != 24) + "Bad grouping of >>, << in #if expression." +#else +true +#endif + +// 13.11: Test of precedence. +//R #line 51 "t_5_018.cpp" +//R true +#if 3*10/2 >> !0*2 >> !+!-9 != 1 + "Bad grouping of -, +, !, *, /, >> in #if expression." +#else +true +#endif + +// 13.12: Overall test. Grouped as: +// ((((((+1 - -1 - ~~1 - -!0) & 6) | ((8 % 9) ^ (-2 * -2))) >> 1) == 7) +// ? 7 : 0) != 7 +// evaluates to false. +//R #line 63 "t_5_018.cpp" +//R true +#if (((+1- -1-~~1- -!0&6|8%9^-2*-2)>>1)==7?7:0)!=7 + "Bad arithmetic of #if expression." +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_019.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_019.cpp new file mode 100644 index 000000000..e5bbf1a84 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_019.cpp @@ -0,0 +1,72 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests #if expressions with macros. + +#define ZERO_TOKEN +#define MACRO_0 0 +#define MACRO_1 1 + +#define and_op && +#define or_op || +#define not_eq_op != +#define bitor_op | + +// 13.13: With macros expanding to operators. +//R #line 32 "t_5_019.cpp" +//R true +#if (1 bitor_op 2) == 3 and_op 4 not_eq_op 5 or_op 0 +// #if (1 | 2) == 3 && 4 != 5 || 0 +true +#else + "Bad evaluation of macros expanding to operators in #if expression." +#endif + +// 13.14: With macros expanding to nothing, nonsence but legal. +//R #line 42 "t_5_019.cpp" +//R true +#if ZERO_TOKEN MACRO_1 ZERO_TOKEN > ZERO_TOKEN MACRO_0 ZERO_TOKEN +// #if 1 > 0 +true +#else + "Bad evaluation of macros expanding to 0 token in #if expression." +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_020.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_020.cpp new file mode 100644 index 000000000..877a8a7ea --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_020.cpp @@ -0,0 +1,64 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests #ifdef, #ifndef directives. + +#define MACRO_0 0 +#define MACRO_1 1 + +// 15.1: #ifdef directive. +//R #line 25 "t_5_020.cpp" +//R true +#ifdef MACRO_1 /* Valid block */ +true +#else +false +#endif + +// 15.2: #ifndef directive. +//R #line 36 "t_5_020.cpp" +//R true +#ifndef MACRO_1 +false +#else /* Valid block */ +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_021.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_021.cpp new file mode 100644 index 000000000..1edd2d041 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_021.cpp @@ -0,0 +1,69 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests #define directive. + +// Excerpts from ISO C 6.8.3 "Examples". +#define OBJ_LIKE (1-1) +#define FTN_LIKE(a) ( a ) + +// 18.1: Definition of an object-like macro. +//R #line 24 "t_5_021.cpp" +OBJ_LIKE //R (1-1) + +//R #line 32 "t_5_021.cpp" +//R true +#define ZERO_TOKEN +#ifndef ZERO_TOKEN + "Can't define macro to 0-token." +#else +true +#endif + +// 18.2: Definition of a function-like macro. +//R #line 37 "t_5_021.cpp" +FTN_LIKE(3) //R ( 3 ) + +// 18.3: Spelling in string identical to parameter is not a parameter. +//R #line 42 "t_5_021.cpp" +#define STR(n1, n2) "n1:n2" +STR(1, 2) //R "n1:n2" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_022.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_022.cpp new file mode 100644 index 000000000..fd287dba2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_022.cpp @@ -0,0 +1,59 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests valid re-definitions of macros. + +/* Excerpts from ISO C 6.8.3 "Examples". */ +#define OBJ_LIKE (1-1) +#define FTN_LIKE(a) ( a ) + +// 19.1: +//R #line 25 "t_5_022.cpp" +#define OBJ_LIKE /* white space */ (1-1) /* other */ +OBJ_LIKE //R (1-1) + +// 19.2: +//R #line 32 "t_5_022.cpp" +#define FTN_LIKE( a )( /* note the white space */ \ + a /* other stuff on this line + */ ) +FTN_LIKE(3) //R ( 3 ) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_023.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_023.cpp new file mode 100644 index 000000000..6450af6c0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_023.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests macro lexically identical to keyword. + +// 20.1: +//R #line 21 "t_5_023.cpp" +#define float double +float //R double + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_024.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_024.cpp new file mode 100644 index 000000000..64c9b849a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_024.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests tokenization (No preprocessing tokens are merged implicitly). + +// 21.1: +//R #line 21 "t_5_024.cpp" +#define MINUS - +-MINUS-1 //R - - -1 + +// 21.2: +//R #line 27 "t_5_024.cpp" +#define sub(a, b) a-b /* '(a)-(b)' would be better */ +#define Y -y /* '(-y)' would be better */ +sub(x, Y) //R x- -y + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_025.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_025.cpp new file mode 100644 index 000000000..3243fc885 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_025.cpp @@ -0,0 +1,64 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests tokenization of preprocessing numbers. + +// Note: Wave curently fails the tests 22.1 and 22.2 because of Wave's design +// choice to act on C++ tokens and not on the raw inut stream. +// This limitation will be removed in a future release. + +#define STR1(a) # a +#define STR(a) STR1(a) +#define EXP 1 + +// 22.1: 12E+EXP is a preprocessing number, EXP is not expanded. +//R #line 28 "t_5_025.cpp" +STR(12E+EXP) //R "12E+EXP" + +// 22.2: .2e-EXP is also a preprocessing number. +//R #line 32 "t_5_025.cpp" +STR(.2e-EXP) //R ".2e-EXP" + +// 22.3: + or - is allowed only following E or e, 12+EXP is not +// a preprocessing number. +//R #line 37 "t_5_025.cpp" +STR(12+EXP) //R "12+1" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_026.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_026.cpp new file mode 100644 index 000000000..a70da086d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_026.cpp @@ -0,0 +1,60 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests ## operator in macro definition. + +// TODO: revise the --variadics mode +//O --variadics + +#define GLUE(a, b) a ## b +#define XGLUE(a, b) GLUE(a, b) +#define MACRO_0 0 +#define MACRO_1 1 + +// 23.1: +//R #line 28 "t_5_026.cpp" +GLUE(x, y) //R xy + +// 23.2: Generate a preprocessing number. +//R #line 33 "t_5_026.cpp" +#define EXP 2 +XGLUE(.12e+, EXP) //R .12e+2 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_027.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_027.cpp new file mode 100644 index 000000000..84066c5ae --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_027.cpp @@ -0,0 +1,70 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests # operator in macro definition. + +// 24.1: +//R #line 21 "t_5_027.cpp" +#define STR(a) # a +STR(a+b) //R "a+b" + +// 24.2: White spaces between tokens of operand are converted to one space. +//R #line 25 "t_5_027.cpp" +STR( ab /* comment */ + + cd ) //R "ab + cd" + +// 24.3: \ is inserted before \ and " in or surrounding literals and no +// other character is inserted to anywhere. +//R #line 31 "t_5_027.cpp" +STR( '"' + "' \"") //R "'\"' + \"' \\\"\"" + +// 24.4: Line splicing by <backslash><newline> is done prior to token parsing. +//R #line 35 "t_5_027.cpp" +STR( "ab\ +c") //R "\"abc\"" + +// 24.5: Token separator inserted by macro expansion should be removed. +// (Meanwhile, tokens should not be merged. See 21.2.) +//R #line 43 "t_5_027.cpp" +#define XSTR(a) STR(a) +#define f(a) a +XSTR(x-f(y)) //R "x-y" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_028.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_028.cpp new file mode 100644 index 000000000..15888794c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_028.cpp @@ -0,0 +1,75 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests whether macro arguments are pre-expanded (unless the argument is an +// operand of # or ## operator) separately, that is, are macro-replaced +// completely prior to rescanning. + +#define ZERO_TOKEN +#define MACRO_0 0 +#define MACRO_1 1 +#define TWO_ARGS a,b +#define SUB(x, y) (x - y) +#define GLUE(a, b) a ## b +#define XGLUE(a, b) GLUE( a, b) +#define STR(a) # a + +// 25.1: "TWO_ARGS" is read as one argument to "SUB", then expanded to +// "a,b", then "x" is substituted by "a,b". +//R #line 32 "t_5_028.cpp" +SUB(TWO_ARGS, 1) //R (a,b - 1) + +// 25.2: An argument pre-expanded to 0-token. */ +//R #line 36 "t_5_028.cpp" +SUB(ZERO_TOKEN, a) //R ( - a) + +// 25.3: "glue( a, b)" is pre-expanded. */ +//R #line 40 "t_5_028.cpp" +XGLUE(GLUE(a, b), c) //R abc + +// 25.4: Operands of ## operator are not pre-expanded. +//R #line 44 "t_5_028.cpp" +GLUE(MACRO_0, MACRO_1) //R MACRO_0MACRO_1 + +// 25.5: Operand of # operator is not pre-expanded. +//R #line 48 "t_5_028.cpp" +STR(ZERO_TOKEN) //R "ZERO_TOKEN" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_029.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_029.cpp new file mode 100644 index 000000000..202529c6b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_029.cpp @@ -0,0 +1,69 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests whether the name once replaced is not further replaced. + +// 26.1: Directly recursive object-like macro definition. +//R #line 21 "t_5_029.cpp" +#define Z Z[0] +Z //R Z[0] + +// 26.2: Intermediately recursive object-like macro definition. +//R #line 27 "t_5_029.cpp" +#define AB BA +#define BA AB +AB //R AB + +// 26.3: Directly recursive function-like macro definition. +//R #line 32 "t_5_029.cpp" +#define f(a) a + f(a) +f(x) //R x + f(x) + +// 26.4: Intermediately recursive function-like macro definition. +//R #line 38 "t_5_029.cpp" +#define g(a) a + h(a) +#define h(a) a + g(a) +g(x) //R x + x + g(x) + +// 26.5: Rescanning encounters the non-replaced macro name. +//R #line 42 "t_5_029.cpp" +f(Z) //R Z[0] + f(Z[0]) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_030.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_030.cpp new file mode 100644 index 000000000..338467aee --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_030.cpp @@ -0,0 +1,93 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests whether rescanning of a macro replace any macro call in the replacement +// text after substitution of parameters by pre-expanded-arguments. This +// re-examination may involve the succeeding sequences from the source +// file (what a queer thing!). + +// Note: The tests 27.4 and 27.5 are currently disabled because of Wave's +// problem with replacement-list terminating in partial macro expansion. + +// 27.1: Cascaded use of object-like macros. +//R #line 34 "t_5_030.cpp" +#define NEST8 NEST7 + 8 +#define NEST7 NEST6 + 7 +#define NEST6 NEST5 + 6 +#define NEST5 NEST4 + 5 +#define NEST4 NEST3 + 4 +#define NEST3 NEST2 + 3 +#define NEST2 NEST1 + 2 +#define NEST1 1 +NEST8 //R 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + +// 27.2: Cascaded use of function-like macros. +//R #line 42 "t_5_030.cpp" +#define FUNC4(a, b) FUNC3(a, b) + NEST4 +#define FUNC3(a, b) FUNC2(a, b) + NEST3 +#define FUNC2(a, b) FUNC1(a, b) + NEST2 +#define FUNC1(a, b) (a) + (b) +FUNC4(NEST1, NEST2) //R (1) + ( 1 + 2) + 1 + 2 + 1 + 2 + 3 + 1 + 2 + 3 + 4 + +// 27.3: An identifier generated by ## operator is subject to expansion. +//R #line 48 "t_5_030.cpp" +#define GLUE( a, b) a ## b +#define MACRO_1 1 +GLUE(MACRO_, 1) //R 1 + +// 27.4: 'SUB' as an argument of math() is not pre-expanded, since '(' +// missing. +//R #line 55 "t_5_030.cpp" +#define SUB(x, y) (x - y) +#define MATH(op, a, b) op( (a), (b)) +MATH(SUB, a, b) //R ( ( a) - ( b)) + +// 27.5: Queer thing. +// R #line 28 "t_5_030.cpp" +//#define HEAD SUB( +// HEAD a,b ) // R + +// 27.6: Recursive macro. +//R #line 66 "t_5_030.cpp" +#define M N +#define N(a) a +M(m) //R m + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_031.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_031.cpp new file mode 100644 index 000000000..7c1453c07 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_031.cpp @@ -0,0 +1,78 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests whether __FILE__, __LINE__, __DATE__, __TIME__, __STDC__ and +// __STDC_VERSION__ are predefined. + +// The tests 28.3 and 28.4 are disabled because it is nearly impossible to +// verify the __DATE__ and __TIME__ macro expansion (at least I have no idea +// how to achieve this reliably). + +// 28.1: +//R #line 25 "t_5_031.cpp" +__FILE__ //R "$F" + +// 28.2: +//R #line 29 "t_5_031.cpp" +__LINE__ //R 29 + +// 28.3: +// R #line 29 "t_5_031.cpp" +//__DATE__ + +// 28.4: +// R #line 33 "t_5_031.cpp" +//__TIME__ + +// 28.5: +//R #line 41 "t_5_031.cpp" +__STDC__ //R 1 + +// 28.6: +//R #line 45 "t_5_031.cpp" +__STDC_VERSION__ //R __STDC_VERSION__ + +// 28.7: +//R #line 16 "t_5_031.hpp" +//R "$P(t_5_031.hpp)" +//R 17 +#include "t_5_031.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_031.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_031.hpp new file mode 100644 index 000000000..43f1d3984 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_031.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +__FILE__ +__LINE__ + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_032.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_032.cpp new file mode 100644 index 000000000..f04f05cf9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_032.cpp @@ -0,0 +1,72 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests the #undef directive. + +// 29.1: Undefined macro is not a macro. +//R #line 23 "t_5_032.cpp" +//R true +#define DEFINED +#if defined(DEFINED) +true +#else +false +#endif + +//R #line 34 "t_5_032.cpp" +//R true +#undef DEFINED +#if defined(DEFINED) +false +#else +true +#endif + +// 29.2: Undefining undefined name is not an error. +//R #line 44 "t_5_032.cpp" +//R true +#undef UNDEFINED +#if defined(UNDEFINED) +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_033.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_033.cpp new file mode 100644 index 000000000..672ebd92c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_033.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests macro calls. + +// 30.1: A macro call crossing lines. +//R #line 22 "t_5_033.cpp" +//R a + b + c +#define FUNC(a, b, c) a + b + c +FUNC +( + a, + b, + c +) + +// 30.2: A macro call containing additional parenthesises +//R #line 31 "t_5_033.cpp" +FUNC(a, (b + c), d) //R a + (b + c) + d + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_034.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_034.cpp new file mode 100644 index 000000000..92f609f6d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_034.cpp @@ -0,0 +1,61 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests escape sequence in character constant in #if expression. + +// 32.1: Character octal escape sequence. +//R #line 24 "t_5_034.cpp" +//R true +#if '\123' != 83 + "Bad evaluation of octal escape sequence." +#else +true +#endif + +// 32.2: Character hexadecimal escape sequence. +//R #line 33 "t_5_034.cpp" +//R true +#if '\x1b' != '\033' + "Bad evaluation of hexadecimal escape sequence." +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035.cpp new file mode 100644 index 000000000..5c5d6bc15 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035.cpp @@ -0,0 +1,137 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#define ABCDEFGHIJKLMNOPQRSTUVWXYZabcde 0 +#define ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ 1 + +// 37.1: Number of parameters in macro: at least 31. +#define GLUE31(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E) \ + a##b##c##d##e##f##g##h##i##j##k##l##m##n##o##p##q##r##s##t##u##v##w##x##y##z##A##B##C##D##E + +// 37.2: Number of arguments in macro call: at least 31. +//R #line 28 "t_5_035.cpp" +//R 0 +GLUE31( A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, + S, T, U, V, W, X, Y, Z, a, b, c, d, e) + +// 37.3: Significant initial characters in an internal identifier or +// macro name: at least 31. +//R #line 34 "t_5_035.cpp" +ABCDEFGHIJKLMNOPQRSTUVWXYZabcd_ //R 1 + +// 37.4: Nested conditional inclusion: at least 8 levels. +//R #line 65 "t_5_035.cpp" +#define NEST 0 +#ifdef A +#else +# ifdef B +# else +# ifdef C +# else +# ifdef D +# else +# ifdef E +# else +# ifdef F +# else +# ifdef G +# else +# ifdef H +# else +#undef NEST +#define NEST 1 +# endif +# endif +# endif +# endif +# endif +# endif +# endif +#endif +NEST //R 1 + +// 37.5: Nested source file inclusion: at least 8 levels. +//R #line 70 "t_5_035.cpp" +#include "t_5_035_01.hpp" +NEST //R 8 + +// 37.6: Parenthesized expression: at least 32 levels. +//R #line 81 "t_5_035.cpp" +#if 0 + (1 - (2 + (3 - (4 + (5 - (6 + (7 - (8 + (9 - (10 + (11 - (12 + \ + (13 - (14 + (15 - (16 + (17 - (18 + (19 - (20 + (21 - (22 + (23 - \ + (24 + (25 - (26 + (27 - (28 + (29 - (30 + (31 - (32 + 0)))))))))) \ + )))))))))))))))))))))) == 0 +#undef NEST +#define NEST 32 +#endif +NEST //R 32 + +// 37.7: Characters in a string (after concatenation): at least 509. +//R #line 86 "t_5_035.cpp" +//R "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" +"123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +012345678901234567" + +// 37.8: Characters in a logical source line: at least 509. +//R #line 98 "t_5_035.cpp" +//R 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567 +123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +0123456789012345678901234567890123456789012345678901234567890123456789\ +012345678901234567 + +// 37.9: Macro definitions: at least 1024. +//R #line 110 "t_5_035.cpp" +#include "t_5_035.hpp" +ZX //R 1 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035.hpp new file mode 100644 index 000000000..2a48af765 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035.hpp @@ -0,0 +1,1069 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits (number of possible macro definitions should be at +// least 1024). + +#define AA +#define AB +#define AC +#define AD +#define AE +#define AF +#define AG +#define AH +#define AI +#define AJ +#define AK +#define AL +#define AM +#define AN +#define AO +#define AP +#define AQ +#define AR +#define AS +#define AT +#define AU +#define AV +#define AW +#define AX +#define AY +#define AZ +#define Aa +#define Ab +#define Ac +#define Ad +#define Ae +#define Af +#define Ag +#define Ah +#define Ai +#define Aj +#define Ak +#define Al +#define Am +#define An +#define BA +#define BB +#define BC +#define BD +#define BE +#define BF +#define BG +#define BH +#define BI +#define BJ +#define BK +#define BL +#define BM +#define BN +#define BO +#define BP +#define BQ +#define BR +#define BS +#define BT +#define BU +#define BV +#define BW +#define BX +#define BY +#define BZ +#define Ba +#define Bb +#define Bc +#define Bd +#define Be +#define Bf +#define Bg +#define Bh +#define Bi +#define Bj +#define Bk +#define Bl +#define Bm +#define Bn +#define CA +#define CB +#define CC +#define CD +#define CE +#define CF +#define CG +#define CH +#define CI +#define CJ +#define CK +#define CL +#define CM +#define CN +#define CO +#define CP +#define CQ +#define CR +#define CS +#define CT +#define CU +#define CV +#define CW +#define CX +#define CY +#define CZ +#define Ca +#define Cb +#define Cc +#define Cd +#define Ce +#define Cf +#define Cg +#define Ch +#define Ci +#define Cj +#define Ck +#define Cl +#define Cm +#define Cn +#define DA +#define DB +#define DC +#define DD +#define DE +#define DF +#define DG +#define DH +#define DI +#define DJ +#define DK +#define DL +#define DM +#define DN +#define DO +#define DP +#define DQ +#define DR +#define DS +#define DT +#define DU +#define DV +#define DW +#define DX +#define DY +#define DZ +#define Da +#define Db +#define Dc +#define Dd +#define De +#define Df +#define Dg +#define Dh +#define Di +#define Dj +#define Dk +#define Dl +#define Dm +#define Dn +#define EA +#define EB +#define EC +#define ED +#define EE +#define EF +#define EG +#define EH +#define EI +#define EJ +#define EK +#define EL +#define EM +#define EN +#define EO +#define EP +#define EQ +#define ER +#define ES +#define ET +#define EU +#define EV +#define EW +#define EX +#define EY +#define EZ +#define Ea +#define Eb +#define Ec +#define Ed +#define Ee +#define Ef +#define Eg +#define Eh +#define Ei +#define Ej +#define Ek +#define El +#define Em +#define En +#define FA +#define FB +#define FC +#define FD +#define FE +#define FF +#define FG +#define FH +#define FI +#define FJ +#define FK +#define FL +#define FM +#define FN +#define FO +#define FP +#define FQ +#define FR +#define FS +#define FT +#define FU +#define FV +#define FW +#define FX +#define FY +#define FZ +#define Fa +#define Fb +#define Fc +#define Fd +#define Fe +#define Ff +#define Fg +#define Fh +#define Fi +#define Fj +#define Fk +#define Fl +#define Fm +#define Fn +#define GA +#define GB +#define GC +#define GD +#define GE +#define GF +#define GG +#define GH +#define GI +#define GJ +#define GK +#define GL +#define GM +#define GN +#define GO +#define GP +#define GQ +#define GR +#define GS +#define GT +#define GU +#define GV +#define GW +#define GX +#define GY +#define GZ +#define Ga +#define Gb +#define Gc +#define Gd +#define Ge +#define Gf +#define Gg +#define Gh +#define Gi +#define Gj +#define Gk +#define Gl +#define Gm +#define Gn +#define HA +#define HB +#define HC +#define HD +#define HE +#define HF +#define HG +#define HH +#define HI +#define HJ +#define HK +#define HL +#define HM +#define HN +#define HO +#define HP +#define HQ +#define HR +#define HS +#define HT +#define HU +#define HV +#define HW +#define HX +#define HY +#define HZ +#define Ha +#define Hb +#define Hc +#define Hd +#define He +#define Hf +#define Hg +#define Hh +#define Hi +#define Hj +#define Hk +#define Hl +#define Hm +#define Hn +#define IA +#define IB +#define IC +#define ID +#define IE +#define IF +#define IG +#define IH +#define II +#define IJ +#define IK +#define IL +#define IM +#define IN +#define IO +#define IP +#define IQ +#define IR +#define IS +#define IT +#define IU +#define IV +#define IW +#define IX +#define IY +#define IZ +#define Ia +#define Ib +#define Ic +#define Id +#define Ie +#define If +#define Ig +#define Ih +#define Ii +#define Ij +#define Ik +#define Il +#define Im +#define In +#define JA +#define JB +#define JC +#define JD +#define JE +#define JF +#define JG +#define JH +#define JI +#define JJ +#define JK +#define JL +#define JM +#define JN +#define JO +#define JP +#define JQ +#define JR +#define JS +#define JT +#define JU +#define JV +#define JW +#define JX +#define JY +#define JZ +#define Ja +#define Jb +#define Jc +#define Jd +#define Je +#define Jf +#define Jg +#define Jh +#define Ji +#define Jj +#define Jk +#define Jl +#define Jm +#define Jn +#define KA +#define KB +#define KC +#define KD +#define KE +#define KF +#define KG +#define KH +#define KI +#define KJ +#define KK +#define KL +#define KM +#define KN +#define KO +#define KP +#define KQ +#define KR +#define KS +#define KT +#define KU +#define KV +#define KW +#define KX +#define KY +#define KZ +#define Ka +#define Kb +#define Kc +#define Kd +#define Ke +#define Kf +#define Kg +#define Kh +#define Ki +#define Kj +#define Kk +#define Kl +#define Km +#define Kn +#define LA +#define LB +#define LC +#define LD +#define LE +#define LF +#define LG +#define LH +#define LI +#define LJ +#define LK +#define LL +#define LM +#define LN +#define LO +#define LP +#define LQ +#define LR +#define LS +#define LT +#define LU +#define LV +#define LW +#define LX +#define LY +#define LZ +#define La +#define Lb +#define Lc +#define Ld +#define Le +#define Lf +#define Lg +#define Lh +#define Li +#define Lj +#define Lk +#define Ll +#define Lm +#define Ln +#define MA +#define MB +#define MC +#define MD +#define ME +#define MF +#define MG +#define MH +#define MI +#define MJ +#define MK +#define ML +#define MM +#define MN +#define MO +#define MP +#define MQ +#define MR +#define MS +#define MT +#define MU +#define MV +#define MW +#define MX +#define MY +#define MZ +#define Ma +#define Mb +#define Mc +#define Md +#define Me +#define Mf +#define Mg +#define Mh +#define Mi +#define Mj +#define Mk +#define Ml +#define Mm +#define Mn +#define NA +#define NB +#define NC +#define ND +#define NE +#define NF +#define NG +#define NH +#define NI +#define NJ +#define NK +#define NL +#define NM +#define NN +#define NO +#define NP +#define NQ +#define NR +#define NS +#define NT +#define NU +#define NV +#define NW +#define NX +#define NY +#define NZ +#define Na +#define Nb +#define Nc +#define Nd +#define Ne +#define Nf +#define Ng +#define Nh +#define Ni +#define Nj +#define Nk +#define Nl +#define Nm +#define Nn +#define OA +#define OB +#define OC +#define OD +#define OE +#define OF +#define OG +#define OH +#define OI +#define OJ +#define OK +#define OL +#define OM +#define ON +#define OO +#define OP +#define OQ +#define OR +#define OS +#define OT +#define OU +#define OV +#define OW +#define OX +#define OY +#define OZ +#define Oa +#define Ob +#define Oc +#define Od +#define Oe +#define Of +#define Og +#define Oh +#define Oi +#define Oj +#define Ok +#define Ol +#define Om +#define On +#define PA +#define PB +#define PC +#define PD +#define PE +#define PF +#define PG +#define PH +#define PI +#define PJ +#define PK +#define PL +#define PM +#define PN +#define PO +#define PP +#define PQ +#define PR +#define PS +#define PT +#define PU +#define PV +#define PW +#define PX +#define PY +#define PZ +#define Pa +#define Pb +#define Pc +#define Pd +#define Pe +#define Pf +#define Pg +#define Ph +#define Pi +#define Pj +#define Pk +#define Pl +#define Pm +#define Pn +#define QA +#define QB +#define QC +#define QD +#define QE +#define QF +#define QG +#define QH +#define QI +#define QJ +#define QK +#define QL +#define QM +#define QN +#define QO +#define QP +#define QQ +#define QR +#define QS +#define QT +#define QU +#define QV +#define QW +#define QX +#define QY +#define QZ +#define Qa +#define Qb +#define Qc +#define Qd +#define Qe +#define Qf +#define Qg +#define Qh +#define Qi +#define Qj +#define Qk +#define Ql +#define Qm +#define Qn +#define RA +#define RB +#define RC +#define RD +#define RE +#define RF +#define RG +#define RH +#define RI +#define RJ +#define RK +#define RL +#define RM +#define RN +#define RO +#define RP +#define RQ +#define RR +#define RS +#define RT +#define RU +#define RV +#define RW +#define RX +#define RY +#define RZ +#define Ra +#define Rb +#define Rc +#define Rd +#define Re +#define Rf +#define Rg +#define Rh +#define Ri +#define Rj +#define Rk +#define Rl +#define Rm +#define Rn +#define SA +#define SB +#define SC +#define SD +#define SE +#define SF +#define SG +#define SH +#define SI +#define SJ +#define SK +#define SL +#define SM +#define SN +#define SO +#define SP +#define SQ +#define SR +#define SS +#define ST +#define SU +#define SV +#define SW +#define SX +#define SY +#define SZ +#define Sa +#define Sb +#define Sc +#define Sd +#define Se +#define Sf +#define Sg +#define Sh +#define Si +#define Sj +#define Sk +#define Sl +#define Sm +#define Sn +#define TA +#define TB +#define TC +#define TD +#define TE +#define TF +#define TG +#define TH +#define TI +#define TJ +#define TK +#define TL +#define TM +#define TN +#define TO +#define TP +#define TQ +#define TR +#define TS +#define TT +#define TU +#define TV +#define TW +#define TX +#define TY +#define TZ +#define Ta +#define Tb +#define Tc +#define Td +#define Te +#define Tf +#define Tg +#define Th +#define Ti +#define Tj +#define Tk +#define Tl +#define Tm +#define Tn +#define UA +#define UB +#define UC +#define UD +#define UE +#define UF +#define UG +#define UH +#define UI +#define UJ +#define UK +#define UL +#define UM +#define UN +#define UO +#define UP +#define UQ +#define UR +#define US +#define UT +#define UU +#define UV +#define UW +#define UX +#define UY +#define UZ +#define Ua +#define Ub +#define Uc +#define Ud +#define Ue +#define Uf +#define Ug +#define Uh +#define Ui +#define Uj +#define Uk +#define Ul +#define Um +#define Un +#define VA +#define VB +#define VC +#define VD +#define VE +#define VF +#define VG +#define VH +#define VI +#define VJ +#define VK +#define VL +#define VM +#define VN +#define VO +#define VP +#define VQ +#define VR +#define VS +#define VT +#define VU +#define VV +#define VW +#define VX +#define VY +#define VZ +#define Va +#define Vb +#define Vc +#define Vd +#define Ve +#define Vf +#define Vg +#define Vh +#define Vi +#define Vj +#define Vk +#define Vl +#define Vm +#define Vn +#define WA +#define WB +#define WC +#define WD +#define WE +#define WF +#define WG +#define WH +#define WI +#define WJ +#define WK +#define WL +#define WM +#define WN +#define WO +#define WP +#define WQ +#define WR +#define WS +#define WT +#define WU +#define WV +#define WW +#define WX +#define WY +#define WZ +#define Wa +#define Wb +#define Wc +#define Wd +#define We +#define Wf +#define Wg +#define Wh +#define Wi +#define Wj +#define Wk +#define Wl +#define Wm +#define Wn +#define XA +#define XB +#define XC +#define XD +#define XE +#define XF +#define XG +#define XH +#define XI +#define XJ +#define XK +#define XL +#define XM +#define XN +#define XO +#define XP +#define XQ +#define XR +#define XS +#define XT +#define XU +#define XV +#define XW +#define XX +#define XY +#define XZ +#define Xa +#define Xb +#define Xc +#define Xd +#define Xe +#define Xf +#define Xg +#define Xh +#define Xi +#define Xj +#define Xk +#define Xl +#define Xm +#define Xn +#define YA +#define YB +#define YC +#define YD +#define YE +#define YF +#define YG +#define YH +#define YI +#define YJ +#define YK +#define YL +#define YM +#define YN +#define YO +#define YP +#define YQ +#define YR +#define YS +#define YT +#define YU +#define YV +#define YW +#define YX +#define YY +#define YZ +#define Ya +#define Yb +#define Yc +#define Yd +#define Ye +#define Yf +#define Yg +#define Yh +#define Yi +#define Yj +#define Yk +#define Yl +#define Ym +#define Yn +#define ZA +#define ZB +#define ZC +#define ZD +#define ZE +#define ZF +#define ZG +#define ZH +#define ZI +#define ZJ +#define ZK +#define ZL +#define ZM +#define ZN +#define ZO +#define ZP +#define ZQ +#define ZR +#define ZS +#define ZT +#define ZU +#define ZV +#define ZW +#define ZX 1 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_01.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_01.hpp new file mode 100644 index 000000000..ec93622bb --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_01.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 1 + +#include "t_5_035_02.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_02.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_02.hpp new file mode 100644 index 000000000..e43a593d9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_02.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 2 + +#include "t_5_035_03.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_03.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_03.hpp new file mode 100644 index 000000000..b721c89e9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_03.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 3 + +#include "t_5_035_04.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_04.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_04.hpp new file mode 100644 index 000000000..c754d4277 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_04.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 4 + +#include "t_5_035_05.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_05.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_05.hpp new file mode 100644 index 000000000..3a07b6f42 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_05.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 5 + +#include "t_5_035_06.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_06.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_06.hpp new file mode 100644 index 000000000..5c2a6859c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_06.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 6 + +#include "t_5_035_07.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_07.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_07.hpp new file mode 100644 index 000000000..d95d6a070 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_07.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 7 + +#include "t_5_035_08.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_08.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_08.hpp new file mode 100644 index 000000000..2a346da78 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_08.hpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#ifndef X0F + +#undef NEST +#define NEST 8 + +#else + +#include "t_5_035_09.hpp" + +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_09.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_09.hpp new file mode 100644 index 000000000..134c8814e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_09.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 9 + +#include "t_5_035_10.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_10.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_10.hpp new file mode 100644 index 000000000..957bc88e3 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_10.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 10 + +#include "t_5_035_11.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_11.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_11.hpp new file mode 100644 index 000000000..9c8c566d9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_11.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 11 + +#include "t_5_035_12.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_12.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_12.hpp new file mode 100644 index 000000000..46e695e11 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_12.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 12 + +#include "t_5_035_13.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_13.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_13.hpp new file mode 100644 index 000000000..aaa28275d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_13.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 13 + +#include "t_5_035_14.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_14.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_14.hpp new file mode 100644 index 000000000..5840831c1 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_14.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#undef NEST +#define NEST 14 + +#include "t_5_035_15.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_5_035_15.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_15.hpp new file mode 100644 index 000000000..9989b95ca --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_5_035_15.hpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests translation limits. + +#ifdef X0F + +#undef NEST +#define NEST 0xf + +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_001.cpp new file mode 100644 index 000000000..154c26797 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_001.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: out of range of integer pp-token in #if expression. + +// 12.8: Preprocessing number perhaps out of range of unsigned long. +//E t_6_001.cpp(20): error: ill formed integer literal or integer constant too large: 123456789012345678901 +#if 123456789012345678901 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_002.cpp new file mode 100644 index 000000000..4109983d7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_002.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.1: String literal is not allowed in #if expression. +//E t_6_002.cpp(20): error: ill formed preprocessor expression: "string" +#if "string" +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_003.cpp new file mode 100644 index 000000000..e6548b4d7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_003.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +#define A 1 +#define B 1 + +// 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. +//E t_6_003.cpp(23): error: ill formed preprocessor expression: 1 = 1 +#if A = B +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_004.cpp new file mode 100644 index 000000000..af948a51b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_004.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +#define A 1 +#define B 1 + +// 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. +//E t_6_004.cpp(23): error: ill formed preprocessor expression: 1++ 1 +#if A++ B +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_005.cpp new file mode 100644 index 000000000..d0865bf3a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_005.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +#define A 1 +#define B 1 + +// 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. +//E t_6_005.cpp(23): error: ill formed preprocessor expression: 1 --1 +#if A --B +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_006.cpp new file mode 100644 index 000000000..5062602e0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_006.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +#define A 1 +#define B 1 + +// 14.2: Operators =, +=, ++, etc. are not allowed in #if expression. +//E t_6_006.cpp(23): error: ill formed preprocessor expression: 1.1 +#if A.B +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_007.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_007.cpp new file mode 100644 index 000000000..8c158ae69 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_007.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.3: Unterminated #if expression. +//E t_6_007.cpp(20): error: ill formed preprocessor expression: 0 < +#if 0 < +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_008.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_008.cpp new file mode 100644 index 000000000..3b0cff5ac --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_008.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +#define A 1 +#define B 1 + +// 14.3: Unterminated #if expression. +//E t_6_008.cpp(23): error: ill formed preprocessor expression: ( (1 == 1) +#if ( (A == B) +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_009.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_009.cpp new file mode 100644 index 000000000..2ecff36d1 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_009.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.4: Unbalanced parenthesis in #if defined operator. +//E t_6_009.cpp(20): error: ill formed preprocessor expression: defined(): defined ( MACRO +#if defined ( MACRO +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_010.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_010.cpp new file mode 100644 index 000000000..4c32afaad --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_010.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.5: No argument. +//E t_6_010.cpp(20): error: ill formed preprocessor directive: #if +#if +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_011.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_011.cpp new file mode 100644 index 000000000..4773fe3a2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_011.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.6: Macro expanding to 0 token in #if expression. +//E t_6_011.cpp(21): error: ill formed preprocessor expression: <empty expression> +#define ZERO_TOKEN +#if ZERO_TOKEN +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_012.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_012.cpp new file mode 100644 index 000000000..2ed7de72f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_012.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: there is no keyword allowed in #if expression. + +// 14.7: sizeof operator is disallowed. +// Evaluated as: 0 (0), Constant expression syntax error. */ +//E t_6_012.cpp(21): error: ill formed preprocessor expression: 0 (0) +#if sizeof (int) +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_013.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_013.cpp new file mode 100644 index 000000000..e039439d7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_013.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: illegal #if expressions. + +// 14.8: type cast is disallowed. +// Evaluated as: (0)0x8000, constant expression error. +//E t_6_013.cpp(21): error: ill formed preprocessor expression: (0)0x8000 < 0 +#if (int)0x8000 < 0 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_014.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_014.cpp new file mode 100644 index 000000000..5e44dcef6 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_014.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: out of range in #if expression (division by 0). + +// 14.9: Division by 0. +//E t_6_014.cpp(20): fatal error: division by zero in preprocessor expression: 1 / 0 +#if 1 / 0 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_015.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_015.cpp new file mode 100644 index 000000000..f072c9c88 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_015.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: overflow of constant expression in #if directive. + +// 14.10: +//E t_6_015.cpp(20): error: integer overflow in preprocessor expression: $E(__TESTWAVE_LONG_MAX__) - $E(__TESTWAVE_LONG_MIN__) +#if __TESTWAVE_LONG_MAX__ - __TESTWAVE_LONG_MIN__ +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_016.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_016.cpp new file mode 100644 index 000000000..ec3d57a00 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_016.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: overflow of constant expression in #if directive. + +// 14.10: +//E t_6_016.cpp(20): error: integer overflow in preprocessor expression: $E(__TESTWAVE_LONG_MAX__) + 1 +#if __TESTWAVE_LONG_MAX__ + 1 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_017.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_017.cpp new file mode 100644 index 000000000..1617fc0d7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_017.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: overflow of constant expression in #if directive. + +// 14.10: +//E t_6_017.cpp(20): error: integer overflow in preprocessor expression: $E(__TESTWAVE_LONG_MIN__) - 1 +#if __TESTWAVE_LONG_MIN__ - 1 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_018.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_018.cpp new file mode 100644 index 000000000..878274bce --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_018.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: overflow of constant expression in #if directive. + +// 14.10: +//E t_6_018.cpp(20): error: integer overflow in preprocessor expression: $E(__TESTWAVE_LONG_MAX__) * 2 +#if __TESTWAVE_LONG_MAX__ * 2 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_019.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_019.cpp new file mode 100644 index 000000000..7a30e8e9b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_019.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #ifdef, #ifndef syntax errors. + +// 15.3: Not an identifier. +//E t_6_019.cpp(20): error: ill formed preprocessor directive: #ifdef "string" +#ifdef "string" +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_020.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_020.cpp new file mode 100644 index 000000000..7eafd389a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_020.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #ifdef, #ifndef syntax errors. + +// 15.3: Not an identifier. +//E t_6_020.cpp(20): error: ill formed preprocessor directive: #ifdef 123 +#ifdef 123 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_021.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_021.cpp new file mode 100644 index 000000000..ff697cd25 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_021.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #ifdef, #ifndef syntax errors. + +// 15.4: Excessive token sequence. +//E t_6_021.cpp(20): error: ill formed preprocessor directive: #ifdef MACRO Junk +#ifdef MACRO Junk +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_022.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_022.cpp new file mode 100644 index 000000000..f0d0061b2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_022.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #ifdef, #ifndef syntax errors. + +// 15.5: No argument. +//E t_6_022.cpp(20): error: ill formed preprocessor directive: #ifndef +#ifndef +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_023.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_023.cpp new file mode 100644 index 000000000..f40b52035 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_023.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Trailing junk of #else, #endif. + +// 16.1: Trailing junk of #else. +//E t_6_023.cpp(22): error: ill formed preprocessor directive: #else MACRO_0 +#define MACRO_0 0 +#if MACRO_0 +#else MACRO_0 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_024.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_024.cpp new file mode 100644 index 000000000..118d50ed0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_024.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Trailing junk of #else, #endif. + +// 16.2: Trailing junk of #endif. +//E t_6_024.cpp(23): error: ill formed preprocessor directive: #endif MACRO_0 +#define MACRO_0 0 +#if MACRO_0 +#else +#endif MACRO_0 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_025.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_025.cpp new file mode 100644 index 000000000..b9f3e546a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_025.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.1: Errorneous #endif without #if. +//E t_6_025.cpp(20): error: the #if for this directive is missing: #endif +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_026.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_026.cpp new file mode 100644 index 000000000..c22424309 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_026.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.2: Errorneous #else without #if. +//E t_6_026.cpp(20): error: the #if for this directive is missing: #else +#else + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_027.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_027.cpp new file mode 100644 index 000000000..04c6f94c8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_027.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.3: Errorneous #else after #else (missing #if). +//E t_6_027.cpp(22): error: the #if for this directive is missing: #else +#if MACRO_1 +#else +#else +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_028.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_028.cpp new file mode 100644 index 000000000..6a5d2bac2 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_028.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.4: Errorneous #elif after #else (missing #if). +//E t_6_028.cpp(22): error: the #if for this directive is missing: #elif +#if MACRO_1 == 1 +#else +#elif MACRO_1 == 0 +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_029.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_029.cpp new file mode 100644 index 000000000..8261b4c01 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_029.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.5: Errorneous #endif without #if in an included file. +//E t_6_029.hpp(47): warning: unbalanced #if/#endif in include file: $P(t_6_029.hpp) +#if 1 +#include "t_6_029.hpp" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_029.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_029.hpp new file mode 100644 index 000000000..3333ec490 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_029.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.5: Errorneous #endif without #if in an included file. +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_030.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_030.cpp new file mode 100644 index 000000000..0459b8d62 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_030.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.6: Errorneous unterminated #if section in an included file. +//E t_6_030.hpp(49): warning: unbalanced #if/#endif in include file: $P(t_6_030.hpp) +#include "t_6_030.hpp" +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_030.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_030.hpp new file mode 100644 index 000000000..8ea0b22ab --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_030.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.6: Errorneous unterminated #if section in an included file. +#define UNBAL2 1 +#if UNBAL2 +#else + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_031.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_031.cpp new file mode 100644 index 000000000..d39525c3b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_031.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: ill-formed group in a source file. + +// 17.7: Errorneous unterminated #if section (missing #endif). +//E t_6_031.cpp(49): error: detected at least one missing #endif directive +#if MACRO_1 == 0 +#else + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_032.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_032.cpp new file mode 100644 index 000000000..27777b258 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_032.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.4: Not an identifier. +//E t_6_032.cpp(20): error: ill formed preprocessor directive: #define "string" +#define "string" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_033.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_033.cpp new file mode 100644 index 000000000..fd2b63272 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_033.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.4: Not an identifier. +//E t_6_033.cpp(20): error: ill formed preprocessor directive: #define 123 +#define 123 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_034.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_034.cpp new file mode 100644 index 000000000..eecb88f2d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_034.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.5: No argument. +//E t_6_034.cpp(20): error: ill formed preprocessor directive: #define +#define + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_035.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_035.cpp new file mode 100644 index 000000000..c785b931f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_035.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.6: Empty parameter list. +//E t_6_035.cpp(20): error: ill formed preprocessor directive: #define math( op, a, ) op( (a), (b)) +#define math( op, a, ) op( (a), (b)) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_036.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_036.cpp new file mode 100644 index 000000000..a168ddaa5 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_036.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.7: Duplicate parameter names. +//E t_6_036.cpp(20): error: duplicate macro parameter name: a +#define math( op, a, a) op( (a), (b)) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_037.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_037.cpp new file mode 100644 index 000000000..36ee92052 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_037.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.8: Argument is not an identifier. +//E t_6_037.cpp(20): error: ill formed preprocessor directive: #define NUMARGS( 1, +, 2) (1 + 2) +#define NUMARGS( 1, +, 2) (1 + 2) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_038.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_038.cpp new file mode 100644 index 000000000..5e764d454 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_038.cpp @@ -0,0 +1,58 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #define syntax errors. + +// 18.9: No space between macro name and replacement text. +// C90 (Corrigendum 1) forbids this if and only if the replacement text +// begins with a non-basic-character. +// C99 forbids this even when the replacement text begins with basic- +// character. + +// From ISO 9899:1990 / Corrigendum 1. +#if defined(__TESTWAVE_HAS_STRICT_LEXER__) +//E(__TESTWAVE_HAS_STRICT_LEXER__) t_6_038.cpp(27): error: ill formed preprocessor directive: #define +#define THIS$AND$THAT(a, b) ((a) + (b)) +#endif + +// Note: the following definition is legal (object-like macro). +// #define THIS $AND$THAT(a, b) ((a) + (b)) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_039.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_039.cpp new file mode 100644 index 000000000..75adf8eef --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_039.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Redefinitions of macros. +#define OBJ_LIKE (1-1) + +// 19.3: different token sequence +//E t_6_039.cpp(21): warning: illegal macro redefinition: OBJ_LIKE +#define OBJ_LIKE (0) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_040.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_040.cpp new file mode 100644 index 000000000..647b41912 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_040.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Redefinitions of macros. +#define OBJ_LIKE (1-1) + +// 19.4: different white space +//E t_6_040.cpp(21): warning: illegal macro redefinition: OBJ_LIKE +#define OBJ_LIKE (1 - 1) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_041.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_041.cpp new file mode 100644 index 000000000..371612b87 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_041.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Redefinitions of macros. +#define FTN_LIKE(a) ( a ) + +// 19.5: different parameter usage +//E t_6_041.cpp(21): warning: illegal macro redefinition: FTN_LIKE +#define FTN_LIKE(b) ( a ) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_042.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_042.cpp new file mode 100644 index 000000000..237da9112 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_042.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Redefinitions of macros. +#define FTN_LIKE(a) ( a ) + +// 19.6: different parameter spelling +//E t_6_042.cpp(21): warning: illegal macro redefinition: FTN_LIKE +#define FTN_LIKE(b) ( b ) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_043.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_043.cpp new file mode 100644 index 000000000..c446129f3 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_043.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Redefinitions of macros. +#define FTN_LIKE(a) ( a ) + +// 19.7 +//E t_6_043.cpp(21): warning: illegal macro redefinition: FTN_LIKE +#define FTN_LIKE OBJ_LIKE + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_044.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_044.cpp new file mode 100644 index 000000000..802742f9a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_044.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: The ## operator shall not occur at the beginning or at +// the end of replacement list for either form of macro +// definition. + +// 23.3: In object-like macro (left). +#define CON ## name + +//E t_6_044.cpp(24): error: ill formed preprocessing operator: concat ('##') +CON + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_045.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_045.cpp new file mode 100644 index 000000000..fd605025c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_045.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: The ## operator shall not occur at the beginning or at +// the end of replacement list for either form of macro +// definition. + +// 23.3: In object-like macro (right). +#define CAT 12 ## + +//E t_6_045.cpp(24): error: ill formed preprocessing operator: concat ('##') +CAT + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_046.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_046.cpp new file mode 100644 index 000000000..53a3e8590 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_046.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: The ## operator shall not occur at the beginning or at +// the end of replacement list for either form of macro +// definition. + +// 23.4: In function-like macro (left). +#define CON(a, b) ## a ## b + +//E t_6_046.cpp(24): error: ill formed preprocessing operator: concat ('##') +CON(1, 2) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_047.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_047.cpp new file mode 100644 index 000000000..02c12f34f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_047.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: The ## operator shall not occur at the beginning or at +// the end of replacement list for either form of macro +// definition. + +// 23.4: In function-like macro (right). +#define CON(a, b) a ## b ## + +//E t_6_047.cpp(24): error: ill formed preprocessing operator: concat ('##') +CON(1, 2) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_048.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_048.cpp new file mode 100644 index 000000000..07db985e1 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_048.cpp @@ -0,0 +1,50 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: The operand of the # operator in function-like macro +// definition should be a parameter. + +// 24.6: In function-like macro (right). +#define FUNC(a) # b + +//E t_6_048.cpp(23): error: ill formed preprocessing operator: stringize ('#') +FUNC(1) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_049.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_049.cpp new file mode 100644 index 000000000..6abaf7d1c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_049.cpp @@ -0,0 +1,56 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Macro arguments are pre-expanded separately. + +// 25.6: +#define SUB(x, y) (x - y) +#define HEAD SUB( +#define BODY(x,y) x,y +#define TAIL ) +#define HEAD_BODY_TAIL(a, b, c) a b c + +// "HEAD" is once expanded to "SUB(", then rescanning of "SUB(" causes an +// uncompleted macro call. Expansion of an argument should complete +// within the argument. +//E t_6_049.cpp(29): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')' +HEAD_BODY_TAIL(HEAD, BODY(a,b), TAIL) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_050.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_050.cpp new file mode 100644 index 000000000..aff380a2f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_050.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Error of rescanning. + +// 27.7 +#define SUB1(x, y) (x - y) +#define TWO_TOKENS a,b +#define SUB(x, y) SUB1(x, y) + +// Too many arguments error while rescanning after once replaced to: +// SUB(a, b, 1) + +//E t_6_050.cpp(27): warning: too many macro arguments: SUB1 +SUB(TWO_TOKENS, 1) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_051.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_051.cpp new file mode 100644 index 000000000..4dd98335a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_051.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #undef errors. + +// 29.3: Not an identifier. +//E t_6_051.cpp(20): error: ill formed preprocessor directive: #undef "string" +#undef "string" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_052.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_052.cpp new file mode 100644 index 000000000..943f398bd --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_052.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #undef errors. + +// 29.3: Not an identifier. +//E t_6_052.cpp(20): error: ill formed preprocessor directive: #undef 123 +#undef 123 + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_053.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_053.cpp new file mode 100644 index 000000000..84f1e282d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_053.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #undef errors. + +// 29.4: Excessive token sequence. +//E t_6_053.cpp(20): error: ill formed preprocessor directive: #undef MACRO_0 Junk +#undef MACRO_0 Junk + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_054.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_054.cpp new file mode 100644 index 000000000..1f55f1648 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_054.cpp @@ -0,0 +1,47 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #undef errors. + +// 29.5: No argument. +//E t_6_054.cpp(20): error: ill formed preprocessor directive: #undef +#undef + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_055.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_055.cpp new file mode 100644 index 000000000..413fe8aef --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_055.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Illegal macro calls. + +#define SUB(x, y) (x - y) + +// 31.1: Too many arguments error. +//E t_6_055.cpp(22): warning: too many macro arguments: SUB +SUB(x, y, z); + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_056.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_056.cpp new file mode 100644 index 000000000..dafe05b06 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_056.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Illegal macro calls. + +#define SUB(x, y) (x - y) + +// 31.2: Too few arguments error. +//E t_6_056.cpp(22): warning: too few macro arguments: SUB +SUB(x); + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_057.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_057.cpp new file mode 100644 index 000000000..d2efa5ecd --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_057.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Macro call in control line should complete in the line. + +#define GLUE(a, b) a ## b +#define STR(s) # s +#define XSTR(s) STR(s) + +// 31.3: Unterminated macro call. +//E t_6_057.cpp(24): error: improperly terminated macro invocation or replacement-list terminates in partial macro expansion (not supported yet): missing ')' +#include XSTR(GLUE(header, + .h)) + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_058.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_058.cpp new file mode 100644 index 000000000..e4c969be9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_058.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Range error of character constant. + +// 32.5: Value of a numerical escape sequence in character constant should +// be in the range of char. +//E t_6_058.cpp(21): warning: expression contains out of range character literal: '\x123' == 0x123 +#if '\x123' == 0x123 +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_059.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_059.cpp new file mode 100644 index 000000000..e36b19826 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_059.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Out of range of numerical escape sequence in wide-char. + +// 32.5: Value of a numerical escape sequence in character constant should +// be in the range of char. +//E t_6_059.cpp(21): warning: expression contains out of range character literal: L'\xabcdef012' == 0xbcdef012 +#if L'\xabcdef012' == 0xbcdef012 +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_060.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_060.cpp new file mode 100644 index 000000000..7ec2ef85e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_060.cpp @@ -0,0 +1,52 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Out of range of character constant. + +// In ASCII character set. +// 35.2: +//E t_6_060.cpp(21): warning: expression contains out of range character literal: 'abcdefghi' == '\x61\x62\x63\x64\x65\x66\x67\x68\x69' +#if 'abcdefghi' == '\x61\x62\x63\x64\x65\x66\x67\x68\x69' +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_061.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_061.cpp new file mode 100644 index 000000000..25c6f4630 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_061.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Illegal pp-token. + +// 4.3: Empty character constant is an error. +//E t_6_061.cpp(20): error: ill formed preprocessor expression: '' == 0 +#if '' == 0 +false +#else +true +#endif + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_062.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_062.cpp new file mode 100644 index 000000000..1f1514110 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_062.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: #line error. + +// 7.4: string literal in #line directive shall be a character string +// literal. +//E t_6_062.cpp(21): warning: filename argument of #line directive should be a narrow string literal: 123 L"wide" +#line 123 L"wide" + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_063.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_063.cpp new file mode 100644 index 000000000..776561a7c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_063.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file without a +// <newline>. + +//E t_6_063.hpp(45): warning: last line of file ends without a newline +#include "t_6_063.hpp" + +//R #line 19 "t_6_063.hpp" +//R int dummy = 0; + +//H 10: t_6_063.cpp(20): #include "t_6_063.hpp" +//H 04: "t_6_063.hpp" +//H 05: $S(t_6_063.hpp) ($B(t_6_063.hpp)) +//H 18: boost::wave::preprocess_exception + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_063.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_063.hpp new file mode 100644 index 000000000..bd1faee1a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_063.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file without a +// <newline>: boostinspect:noend + +int dummy = 0; + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_064.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_064.cpp new file mode 100644 index 000000000..ebf8918b6 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_064.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.6.1 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Undefined behavior on out-of-range #line number. + +//O --variadics + +// C99: Line number argument of #line directive should be in range of +// [1..2147483647] + +//E t_6_064.cpp(24): warning: line number argument of #line directive should consist out of decimal digits only and must be in range of [1..INT_MAX] +#line 0 + +/*- + * Copyright (c) 1998, 2002-2006 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_065.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_065.cpp new file mode 100644 index 000000000..819add33a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_065.cpp @@ -0,0 +1,51 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.6.1 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: Undefined behavior on out-of-range #line number. + +//O --variadics + +// C99: Line number argument of #line directive should be in range of +// [1..2147483647] + +//E t_6_065.cpp(24): warning: line number argument of #line directive should consist out of decimal digits only and must be in range of [1..INT_MAX] +#line 2147483648 + +/*- + * Copyright (c) 1998, 2002-2006 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_066.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_066.cpp new file mode 100644 index 000000000..4f9868ec5 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_066.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file is +// <backslash><newline>. + +//E t_6_066.hpp(46): warning: last line of file ends without a newline +#include "t_6_066.hpp" + +//R #line 19 "t_6_066.hpp" +//R int dummy = 0; + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_066.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_066.hpp new file mode 100644 index 000000000..c0e7d8856 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_066.hpp @@ -0,0 +1,46 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file is +// <backslash><newline>: boostinspect:noend + +int dummy = 0; + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ \ +
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_067.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_067.cpp new file mode 100644 index 000000000..b5cdbd538 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_067.cpp @@ -0,0 +1,54 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file with an +// unterminated comment. + +//E t_6_067.hpp(48): warning: generic lexer warning: Unterminated 'C' style comment +#include "t_6_067.hpp" + +//R #line 19 "t_6_067.hpp" +//R int dummy = 0; + +//H 10: t_6_067.cpp(20): #include "t_6_067.hpp" +//H 04: "t_6_067.hpp" +//H 05: $S(t_6_067.hpp) ($B(t_6_067.hpp)) +//H 18: boost::wave::lexing_exception + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_067.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_067.hpp new file mode 100644 index 000000000..ae0adec1a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_067.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: End of a source file with an +// unterminated comment: boostinspect:noend + +int dummy = 0; + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + + /* unterminated comment ... +
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_068.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_068.cpp new file mode 100644 index 000000000..e24d77c7a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_068.cpp @@ -0,0 +1,46 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: Argument of #include other than +// header-name + +//E t_6_068.cpp(20): error: ill formed #include directive: filename +#include filename + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_6_069.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_6_069.cpp new file mode 100644 index 000000000..a2edaa0c5 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_6_069.cpp @@ -0,0 +1,45 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + + The tests included in this file were initially taken from the mcpp V2.5 + preprocessor validation suite and were modified to fit into the Boost.Wave + unit test requirements. + The original files of the mcpp preprocessor are distributed under the + license reproduced at the end of this file. +=============================================================================*/ + +// Tests error reporting: undefined behavior: trailing junk of #include + +//E t_6_069.cpp(19): error: ill formed preprocessor directive: #include <boost/assert.hpp> Junk +#include <boost/assert.hpp> Junk + +/*- + * Copyright (c) 1998, 2002-2005 Kiyoshi Matsui <kmatsui@t3.rim.or.jp> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_001.cpp new file mode 100644 index 000000000..226bca4f5 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_001.cpp @@ -0,0 +1,49 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --c++11 +//O -Werror + +//R #line 17 "t_7_001.cpp" +//R R"(de +//R fg +//R h)" +R"(de +fg +h)" + +//R #line 22 "t_7_001.cpp" +"abc" //R "abc" +R"(abc)" //R R"(abc)" + +//R #line 28 "t_7_001.cpp" +//R uR"(de fg +//R h)" +uR"(de \ +fg +h)" + +//R #line 33 "t_7_001.cpp" +u"abc" //R u"abc" +U"def" //R U"def" +u8"ghi" //R u8"ghi" + +//R #line 40 "t_7_001.cpp" +//R R"delim("quoted text +//R with newline")delim" +R"delim("quoted text +with newline")delim" + +//R #line 45 "t_7_001.cpp" +//R R"de"lim(some text)de"lim" +R"de"lim(some text)de"lim" + +//R #line 49 "t_7_001.cpp" +//R no_newline_at_end_of_file +no_newline_at_end_of_file
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_002.cpp new file mode 100644 index 000000000..390ddc952 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_002.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +//O --c++11 +//O -Werror +//R + +#if 0 +#endif
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_003.cpp new file mode 100644 index 000000000..a8cab32ee --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_003.cpp @@ -0,0 +1,13 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +//O --c++11 +//O -Werror + +#line 7
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_004.cpp new file mode 100644 index 000000000..dde43b13e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_004.cpp @@ -0,0 +1,14 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +//O --c++11 + +//E t_7_004.cpp(14): error: detected at least one missing #endif directive + +#if 0
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_005.cpp new file mode 100644 index 000000000..776d7fbfe --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_005.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +//O --c++11 + +//E t_7_005.cpp(15): error: detected at least one missing #endif directive + +#if 0 +#else
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_006.cpp new file mode 100644 index 000000000..0d9ec951b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_006.cpp @@ -0,0 +1,17 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +//O --c++11 +//R #line 10 "t_7_006.hpp" +//R header +//R #line 17 "t_7_006.cpp" +//R cpp_content + +#include "t_7_006.hpp" +cpp_content
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_7_006.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_7_006.hpp new file mode 100644 index 000000000..061bf2ed8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_7_006.hpp @@ -0,0 +1,10 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2017 Abel Sinkovics. 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) +=============================================================================*/ + +header
\ No newline at end of file diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_001.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_001.cpp new file mode 100644 index 000000000..0732c71d6 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_001.cpp @@ -0,0 +1,23 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + + /* + + Expose bug + + */ + +#if 1 +//R #line 18 "t_9_001.cpp" + void exposed() {} //R void exposed() {} +#endif + +//H 10: t_9_001.cpp(16): #if +//H 11: t_9_001.cpp(16): #if 1: 1 +//H 10: t_9_001.cpp(19): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_002.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_002.cpp new file mode 100644 index 000000000..9c0b0ca6a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_002.cpp @@ -0,0 +1,23 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if 0 + // + // some comment + // +#endif + + // another comment + // ---------------------------------------------------- +1 +//R #line 18 "t_9_002.cpp" +//R 1 + +//H 10: t_9_002.cpp(10): #if +//H 11: t_9_002.cpp(10): #if 0: 0 diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_003.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_003.cpp new file mode 100644 index 000000000..845eeb8c7 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_003.cpp @@ -0,0 +1,61 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test, if additional whitespace is inserted at appropriate places. + +#define STRINGIZE(x) STRINGIZE_D(x) +#define STRINGIZE_D(x) #x + +#define X() 1 +#define PLUS() + +#define MINUS() - +#define DOT() . +#define GREATER() > +#define LESS() < + +//R #line 23 "t_9_003.cpp" +X()2 //R 1 2 +STRINGIZE( X()2 ) //R "12" +//R +X() 2 //R 1 2 +STRINGIZE( X() 2 ) //R "1 2" +//R +PLUS()MINUS() //R +- +STRINGIZE( PLUS()MINUS() ) //R "+-" +//R +PLUS()PLUS() //R + + +STRINGIZE( PLUS()PLUS() ) //R "++" +//R +MINUS()MINUS() //R - - +STRINGIZE( MINUS()MINUS() ) //R "--" +//R +DOT()DOT()DOT() //R .. . +STRINGIZE( DOT()DOT()DOT() ) //R "..." + +// the following are regressions reported by Stefan Seefeld +//R #line 43 "t_9_003.cpp" +GREATER()GREATER() //R > > +STRINGIZE( GREATER()GREATER() ) //R ">>" +//R +LESS()LESS() //R < < +STRINGIZE( LESS()LESS() ) //R "<<" + +#define COMMA() , +#define AND() & +#define CHAR() char +#define STAR() * + +// Make sure no whitespace gets inserted in between the operator symbols +//R #line 56 "t_9_003.cpp" +void foo(char&, char) //R void foo(char&, char) +void foo(char *) //R void foo(char *) +void foo(char *&) //R void foo(char *&) +void foo(CHAR()AND()COMMA() CHAR()) //R void foo(char&, char) +void foo(CHAR() STAR()) //R void foo(char *) +void foo(CHAR() STAR()AND()) //R void foo(char *&) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_004.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_004.cpp new file mode 100644 index 000000000..0a5fc6e9e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_004.cpp @@ -0,0 +1,28 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test if invalid or not allowed universal characters are rejected + +#define \u00ff ... + +//R #line 16 "t_9_004.cpp" +//R ... +\u00ff + +//E t_9_004.cpp(19): error: a universal character name cannot designate a character in the basic character set: \u0061 +#define \u0061 weird // 0x61 == 'a' + +\u0061 + +//H 10: t_9_004.cpp(12): #define +//H 08: t_9_004.cpp(12): \u00ff=... +//H 01: t_9_004.cpp(12): \u00ff +//H 02: ... +//H 03: ... +//H 18: boost::wave::lexing_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_005.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_005.cpp new file mode 100644 index 000000000..f3e414dd4 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_005.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, if no universal character values are to be generated accidently by +// concatenation + +#define CONCAT(a, b) PRIMITIVE_CONCAT(a, b) +#define PRIMITIVE_CONCAT(a, b) a ## b +#define STRINGIZE(x) STRINGIZE_D(x) +#define STRINGIZE_D(x) # x + +//R #line 19 "t_9_005.cpp" +STRINGIZE( CONCAT(\, u00ff) ) //R "\u00ff" +STRINGIZE( CONCAT(\u00, ff) ) //R "\u00ff" +STRINGIZE( CONCAT(\u00ff, 56) ) //R "\u00ff56" +CONCAT(\, u00ff) //R \u00ff +CONCAT(\u00, ff) //R \ u00ff +CONCAT(\u00ff, 56) //R \u00ff56 + +//E t_9_005.cpp(27): error: a universal character name cannot designate a character in the basic character set: \u0061 +STRINGIZE( CONCAT(\, u0061) ) // reports an error diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_006.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_006.cpp new file mode 100644 index 000000000..d96b464bb --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_006.cpp @@ -0,0 +1,46 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// syntax for defined operator +// is either: +// +// defined X +// +// -or- +// +// defined(X) +// +// i.e. the parenthesis are optional (ala sizeof) + +#define X + +//R #line 26 "t_9_006.cpp" +//R "X" is defined. +#if defined(X) +"X" is defined. +#else +"X" is not defined. +#endif + +//R #line 34 "t_9_006.cpp" +//R "X" is defined. +#if defined X +"X" is defined. +#else +"X" is not defined. +#endif + +//H 10: t_9_006.cpp(21): #define +//H 08: t_9_006.cpp(21): X= +//H 10: t_9_006.cpp(25): #if +//H 11: t_9_006.cpp(25): #if defined(X): 1 +//H 10: t_9_006.cpp(27): #else +//H 10: t_9_006.cpp(33): #if +//H 11: t_9_006.cpp(33): #if defined X: 1 +//H 10: t_9_006.cpp(35): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_007.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_007.cpp new file mode 100644 index 000000000..c5348e6d8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_007.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test error reporting during redefinition of 'defined' + +//E t_9_007.cpp(13): warning: this predefined name may not be redefined: defined +#define defined 1 // undefined in C++ (16.8/3), error in C99 (6.10.8/4) + +#if defined // error +<error> +#endif + +//H 10: t_9_007.cpp(13): #define +//H 18: boost::wave::macro_handling_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_008.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_008.cpp new file mode 100644 index 000000000..fa0b557d0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_008.cpp @@ -0,0 +1,16 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test error reporting during redefinition of 'defined' + +//E t_9_008.cpp(13): warning: #undef may not be used on this predefined name: defined +#undef defined + +//H 10: t_9_008.cpp(13): #undef +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_009.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_009.cpp new file mode 100644 index 000000000..6022034e8 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_009.cpp @@ -0,0 +1,27 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests for a problem wrt preprocessing tokens (preprocessing numbers) + +#define X() X_ ## 0R() +#define X_0R() ... + +//R #line 16 "t_9_009.cpp" +X() //R ... + +//H 10: t_9_009.cpp(12): #define +//H 08: t_9_009.cpp(12): X()=X_ ## 0R() +//H 10: t_9_009.cpp(13): #define +//H 08: t_9_009.cpp(13): X_0R()=... +//H 00: t_9_009.cpp(16): X(), [t_9_009.cpp(12): X()=X_ ## 0R()] +//H 02: X_0R() +//H 00: t_9_009.cpp(12): X_0R(), [t_9_009.cpp(13): X_0R()=...] +//H 02: ... +//H 03: ... +//H 03: ... diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_010.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_010.cpp new file mode 100644 index 000000000..d4740440c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_010.cpp @@ -0,0 +1,70 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether adjacent tokens are separated by whitespace if the adjacency +// is created by macro expansion + +#define A(x) x + +//R #line 16 "t_9_010.cpp" +A(1)1 //R 1 1 +A(1)X //R 1 X +A(X)1 //R X 1 +A(X)X //R X X + +#define CAT(a, b) PRIMITIVE_CAT(a, b) +#define PRIMITIVE_CAT(a, b) a ## b + +#define X() B +#define ABC 1 + +//R #line 28 "t_9_010.cpp" +CAT(A, X() C) //R AB C +CAT(A, X()C) //R AB C + +//H 10: t_9_010.cpp(13): #define +//H 08: t_9_010.cpp(13): A(x)=x +//H 00: t_9_010.cpp(16): A(1), [t_9_010.cpp(13): A(x)=x] +//H 02: 1 +//H 03: 1 +//H 00: t_9_010.cpp(17): A(1), [t_9_010.cpp(13): A(x)=x] +//H 02: 1 +//H 03: 1 +//H 00: t_9_010.cpp(18): A(X), [t_9_010.cpp(13): A(x)=x] +//H 02: X +//H 03: X +//H 00: t_9_010.cpp(19): A(X), [t_9_010.cpp(13): A(x)=x] +//H 02: X +//H 03: X +//H 10: t_9_010.cpp(21): #define +//H 08: t_9_010.cpp(21): CAT(a, b)=PRIMITIVE_CAT(a, b) +//H 10: t_9_010.cpp(22): #define +//H 08: t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b +//H 10: t_9_010.cpp(24): #define +//H 08: t_9_010.cpp(24): X()=B +//H 10: t_9_010.cpp(25): #define +//H 08: t_9_010.cpp(25): ABC=1 +//H 00: t_9_010.cpp(28): CAT(A, X() C), [t_9_010.cpp(21): CAT(a, b)=PRIMITIVE_CAT(a, b)] +//H 00: t_9_010.cpp(28): X(), [t_9_010.cpp(24): X()=B] +//H 02: B +//H 03: B +//H 02: PRIMITIVE_CAT(A, B C) +//H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, B C), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b] +//H 02: AB C +//H 03: AB C +//H 03: AB C +//H 00: t_9_010.cpp(29): CAT(A, X()C), [t_9_010.cpp(21): CAT(a, b)=PRIMITIVE_CAT(a, b)] +//H 00: t_9_010.cpp(29): X(), [t_9_010.cpp(24): X()=B] +//H 02: B +//H 03: B +//H 02: PRIMITIVE_CAT(A, BC) +//H 00: t_9_010.cpp(21): PRIMITIVE_CAT(A, BC), [t_9_010.cpp(22): PRIMITIVE_CAT(a, b)=a ## b] +//H 02: ABC +//H 03: ABC +//H 03: ABC diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_011.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_011.cpp new file mode 100644 index 000000000..fb2e06b55 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_011.cpp @@ -0,0 +1,30 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Test, if additional whitespace is inserted at appropriate places. + +//O --variadics + +#define PRIMITIVE_CAT(a, b) a ## b +#define PRIMITIVE_CAT3(a, b, c) a ## b ## c + +//R #line 18 "t_9_011.cpp" +PRIMITIVE_CAT(1, ABC) //R 1 ABC +PRIMITIVE_CAT3(ABC, 1, ABC) //R ABC1ABC + +//H 10: t_9_011.cpp(14): #define +//H 08: t_9_011.cpp(14): PRIMITIVE_CAT(a, b)=a ## b +//H 10: t_9_011.cpp(15): #define +//H 08: t_9_011.cpp(15): PRIMITIVE_CAT3(a, b, c)=a ## b ## c +//H 00: t_9_011.cpp(18): PRIMITIVE_CAT(1, ABC), [t_9_011.cpp(14): PRIMITIVE_CAT(a, b)=a ## b] +//H 02: 1ABC +//H 03: 1ABC +//H 00: t_9_011.cpp(19): PRIMITIVE_CAT3(ABC, 1, ABC), [t_9_011.cpp(15): PRIMITIVE_CAT3(a, b, c)=a ## b ## c] +//H 02: ABC1ABC +//H 03: ABC1ABC diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_012.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_012.cpp new file mode 100644 index 000000000..36cf5a885 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_012.cpp @@ -0,0 +1,25 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests, whether macro definition works when there is no whitespace in between +// the macro name and the defined expansion list + +#define CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)\ +CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,\ +nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) + +//R #line 19 "t_9_012.cpp" +CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) //R CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) + +//H 10: t_9_012.cpp(13): #define +//H 08: t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam) +//H 00: t_9_012.cpp(19): CreateWindowA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11), [t_9_012.cpp(13): CreateWindowA(lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)=CreateWindowExA(0L, lpClassName, lpWindowName, dwStyle, x, y,nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)] +//H 02: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) +//H 03: CreateWindowExA(0L, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_013.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_013.cpp new file mode 100644 index 000000000..6a8e21d8c --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_013.cpp @@ -0,0 +1,19 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests error reporting of C99 features in C++ mode (without variadics) + +#define MACRO(a, b, c) a ## b ## c + +//E t_9_013.cpp(15): warning: empty macro arguments are not supported in pure C++ mode, use variadics mode to allow these: MACRO +MACRO(1,, 3) + +//H 10: t_9_013.cpp(12): #define +//H 08: t_9_013.cpp(12): MACRO(a, b, c)=a ## b ## c +//H 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_014.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_014.cpp new file mode 100644 index 000000000..35c80e05a --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_014.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O --long_long +// Tests 'LL' suffix + +//R #line 14 "t_9_014.cpp" +1000LL //R 1000LL + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_015.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_015.cpp new file mode 100644 index 000000000..3c1c21255 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_015.cpp @@ -0,0 +1,15 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Tests 'LL' suffix + +//R #line 14 "t_9_015.cpp" +//E t_9_015.cpp(14): warning: long long suffixes are not allowed in pure C++ mode, enable long_long mode to allow these: 1000LL +1000LL + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_016.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_016.cpp new file mode 100644 index 000000000..3b4106601 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_016.cpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(inclusion) +# define inclusion +# include __FILE__ +# include "t_9_016.hpp" +#else +//R #line 18 "t_9_016.cpp" +//R # define later +#define EXPAND(x) x +EXPAND(#) define later +#endif + +//H 10: t_9_016.cpp(10): #if +//H 11: t_9_016.cpp(10): #if !defined(inclusion): 1 +//H 10: t_9_016.cpp(11): #define +//H 08: t_9_016.cpp(11): inclusion= +//H 10: t_9_016.cpp(12): # include +//H 04: "$P(t_9_016.cpp)" +//H 05: $B(t_9_016.cpp) ($B(t_9_016.cpp)) +//H 10: t_9_016.cpp(10): #if +//H 11: t_9_016.cpp(10): #if !defined(inclusion): 0 +//H 10: t_9_016.cpp(17): #define +//H 08: t_9_016.cpp(17): EXPAND(x)=x +//H 00: t_9_016.cpp(18): EXPAND(#), [t_9_016.cpp(17): EXPAND(x)=x] +//H 02: # +//H 03: # +//H 10: t_9_016.cpp(19): #endif +//H 06: +//H 19: $B(t_9_016.cpp): inclusion +//H 10: t_9_016.cpp(13): # include "t_9_016.hpp" +//H 04: "t_9_016.hpp" +//H 05: t_9_016.hpp ($B(t_9_016.hpp)) +//H 06: +//H 10: t_9_016.cpp(14): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_016.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_016.hpp new file mode 100644 index 000000000..ef3aaa249 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_016.hpp @@ -0,0 +1,11 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +/* intentionally left empty */ + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_017.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_017.cpp new file mode 100644 index 000000000..bb1c431dc --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_017.cpp @@ -0,0 +1,75 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// tests, whether true and false are usable a 'normal' identifiers + +#define true 1 +#define false 0 + +//R #line 18 "t_9_017.cpp" +//R 1 is defined +#if defined(true) +true is defined +#else +true is not defined +#endif + +//R #line 26 "t_9_017.cpp" +//R 0 is defined +#if defined(false) +false is defined +#else +false is not defined +#endif + +#undef true +#undef false + +//R #line 37 "t_9_017.cpp" +//R true is not defined +#ifndef true +true is not defined +#else +true is defined +#endif + +//R #line 45 "t_9_017.cpp" +//R false is not defined +#ifndef false +false is not defined +#else +false is defined +#endif + +//H 10: t_9_017.cpp(12): #define +//H 08: t_9_017.cpp(12): true=1 +//H 10: t_9_017.cpp(13): #define +//H 08: t_9_017.cpp(13): false=0 +//H 10: t_9_017.cpp(17): #if +//H 11: t_9_017.cpp(17): #if defined(true): 1 +//H 01: t_9_017.cpp(12): true +//H 02: 1 +//H 03: 1 +//H 10: t_9_017.cpp(19): #else +//H 10: t_9_017.cpp(25): #if +//H 11: t_9_017.cpp(25): #if defined(false): 1 +//H 01: t_9_017.cpp(13): false +//H 02: 0 +//H 03: 0 +//H 10: t_9_017.cpp(27): #else +//H 10: t_9_017.cpp(31): #undef +//H 09: t_9_017.cpp(31): true +//H 10: t_9_017.cpp(32): #undef +//H 09: t_9_017.cpp(32): false +//H 10: t_9_017.cpp(36): #ifndef +//H 11: t_9_017.cpp(36): #ifndef true: 0 +//H 10: t_9_017.cpp(38): #else +//H 10: t_9_017.cpp(44): #ifndef +//H 11: t_9_017.cpp(44): #ifndef false: 0 +//H 10: t_9_017.cpp(46): #else diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_018.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_018.cpp new file mode 100644 index 000000000..a6d3818a9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_018.cpp @@ -0,0 +1,20 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// tests, whether macro redefinition does not crash anymore, even if the new +// replacement list is shorter, than the initial one. + +//E t_9_018.cpp(15): warning: illegal macro redefinition: M1 +#define M1 1 +#define M1 + +//H 10: t_9_018.cpp(14): #define +//H 08: t_9_018.cpp(14): M1=1 +//H 10: t_9_018.cpp(15): #define +//H 18: boost::wave::macro_handling_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_019.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_019.cpp new file mode 100644 index 000000000..1141aa9e9 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_019.cpp @@ -0,0 +1,21 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// tests, whether regression causing #include_next to infinitely recurse is +// fixed + +//E t_9_019.hpp(11): error: could not find include file: t_9_019.hpp +#include "t_9_019.hpp" + +// 10: t_9_019.cpp(14): #include "t_9_019.hpp" +// 04: "t_9_019.hpp" +// 05: $B(t_9_019.hpp) ($B(t_9_019.hpp)) +// 10: t_9_019.hpp(11): #include_next "t_9_019.hpp" +// 04: "t_9_019.hpp" (include_next) +// 18: boost::wave::preprocess_exception diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_019.hpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_019.hpp new file mode 100644 index 000000000..39685a26b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_019.hpp @@ -0,0 +1,11 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// this shouldn't give an recursion +#include_next "t_9_019.hpp" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_020.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_020.cpp new file mode 100644 index 000000000..f78ef776b --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_020.cpp @@ -0,0 +1,48 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// tests whether whitespace is correctly handled in macro arguments + +//O --variadics + +#define STRINGIZE1(x) #x +#define STRINGIZE(x) STRINGIZE1(x) + +#define MACRO(...) (__VA_ARGS__) - STRINGIZE((__VA_ARGS__)) + +//R #line 20 "t_9_020.cpp" +MACRO() //R () - "()" +MACRO( ) //R () - "()" +MACRO(a) //R (a) - "(a)" +MACRO( a ) //R ( a ) - "( a )" +MACRO( a ) //R ( a ) - "( a )" +MACRO(a,b) //R (a,b) - "(a,b)" +MACRO(a, b) //R (a, b) - "(a, b)" +MACRO(a ,b) //R (a ,b) - "(a ,b)" +MACRO( a ,b, c ) //R ( a ,b, c ) - "( a ,b, c )" +MACRO( a ,b, c ) //R ( a ,b, c ) - "( a ,b, c )" + +#undef MACRO +#define MACRO(x) [x] + +//R #line 35 "t_9_020.cpp" +MACRO() //R [] +MACRO( ) //R [] +MACRO(123) //R [123] +MACRO( 123 ) //R [ 123 ] +MACRO( 123 ) //R [ 123 ] + +#define A(x) 1 x 3 +#define B(x) (1)x(3) + +//R #line 45 "t_9_020.cpp" +A(2) //R 1 2 3 +STRINGIZE(A(2)) //R "1 2 3" +STRINGIZE(B(2)) //R "(1)2(3)" +STRINGIZE(B( 2 )) //R "(1) 2 (3)" diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_021.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_021.cpp new file mode 100644 index 000000000..84b0e3314 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_021.cpp @@ -0,0 +1,24 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Verifies that preprocessing directives are properly recognized only if +// the '#' is really the first character on a line before macro expansion. +// See http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_144.html. + +#define EMPTY +EMPTY # define M 1 + +//R #line 15 "t_9_021.cpp" +//R #define M 1 + +//H 10: t_9_021.cpp(14): #define +//H 08: t_9_021.cpp(14): EMPTY= +//H 01: t_9_021.cpp(14): EMPTY +//H 02: +//H 03: _ diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_022.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_022.cpp new file mode 100644 index 000000000..119018e29 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_022.cpp @@ -0,0 +1,18 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Verifies that preprocessing directives are properly recognized only if +// the '#' is really the first character on a line before macro expansion. +// See http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_144.html. + +#define EMPTY +# EMPTY define M 1 + +//E t_9_022.cpp(15): error: ill formed preprocessor directive: # EMPTY define M 1 + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_023.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_023.cpp new file mode 100644 index 000000000..de6c4565f --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_023.cpp @@ -0,0 +1,31 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// Verifies that preprocessing directives are properly recognized only if +// the '#' is really the first character on a line before macro expansion. +// See http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_144.html. + +#define _C_STD_BEGIN + +_C_STD_BEGIN +#ifndef _M_CEE_PURE +_C_LIB_DECL +#endif + +//R #line 18 "t_9_023.cpp" +//R _C_LIB_DECL + +//H 10: t_9_023.cpp(14): #define +//H 08: t_9_023.cpp(14): _C_STD_BEGIN= +//H 01: t_9_023.cpp(14): _C_STD_BEGIN +//H 02: +//H 03: _ +//H 10: t_9_023.cpp(17): #ifndef +//H 11: t_9_023.cpp(17): #ifndef _M_CEE_PURE: 0 +//H 10: t_9_023.cpp(19): #endif diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_024.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_024.cpp new file mode 100644 index 000000000..a57989b5e --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_024.cpp @@ -0,0 +1,35 @@ +/*============================================================================= + 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) +=============================================================================*/ + +// Verifies resolution of #8848: Wave driver improperly processes 0xFFFFui64 +// token + +//O --long_long +//D __TESTWAVE_SUPPORT_MS_EXTENSIONS__ + +#if defined(__TESTWAVE_SUPPORT_MS_EXTENSIONS__) + +#define TEST 0xFFFFFui64 + +TEST + +//R #line 19 "t_9_024.cpp" +//R 0xFFFFFui64 + +//H 10: t_9_024.cpp(15): #if +//H 11: t_9_024.cpp(15): #if defined(__TESTWAVE_SUPPORT_MS_EXTENSIONS__): 1 +//H 10: t_9_024.cpp(17): #define +//H 08: t_9_024.cpp(17): TEST=0xFFFFFui64 +//H 01: t_9_024.cpp(17): TEST +//H 02: 0xFFFFFui64 +//H 03: 0xFFFFFui64 +//H 10: t_9_024.cpp(33): #endif + +#endif + diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_025.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_025.cpp new file mode 100644 index 000000000..579ffc2d4 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_025.cpp @@ -0,0 +1,13 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//U yes +//R #line 10 "file.hpp" +//R "$P(utf8-test-ßµ™∃/file.hpp)" +#include <utf8-test-ßµ™∃/file.hpp> diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_026.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_026.cpp new file mode 100644 index 000000000..b4accc624 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_026.cpp @@ -0,0 +1,14 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//U yes +//O -S$P(utf8-test-ßµ™∃) +//R #line 10 "file.hpp" +//R "$P(utf8-test-ßµ™∃/file.hpp)" +#include <file.hpp> diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_027.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_027.cpp new file mode 100644 index 000000000..0755acacf --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_027.cpp @@ -0,0 +1,12 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +//O -S$P(utf8-test-ßµ™∃) +//E t_9_027.cpp(12): error: could not find include file: file.hpp +#include <file.hpp> diff --git a/src/boost/libs/wave/test/testwave/testfiles/t_9_028.cpp b/src/boost/libs/wave/test/testwave/testfiles/t_9_028.cpp new file mode 100644 index 000000000..959c6f2ba --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/t_9_028.cpp @@ -0,0 +1,13 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + + +//E t_9_028.cpp(12): error: could not find include file: utf8-test-ßµ™∃/file.hpp +#include <utf8-test-ßµ™∃/file.hpp> + diff --git a/src/boost/libs/wave/test/testwave/testfiles/test.cfg b/src/boost/libs/wave/test/testwave/testfiles/test.cfg new file mode 100644 index 000000000..ffe1a20a6 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/test.cfg @@ -0,0 +1,251 @@ +# +# Boost.Wave: A Standard compliant C++ preprocessor library +# http://www.boost.org/ +# +# Copyright (c) 2003-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) +# + +# +# t_1: Macro expansion +# +t_1_001.cpp +t_1_002.cpp +t_1_003.cpp +t_1_004.cpp +t_1_005.cpp +t_1_006.cpp +t_1_007.cpp +t_1_008.cpp +t_1_009.cpp +t_1_010.cpp +t_1_011.cpp +t_1_012.cpp +t_1_013.cpp +# t_1_014 currently disabled because of a known problem in the Wave library +#t_1_014.cpp +t_1_015.cpp +t_1_016.cpp +t_1_017.cpp +t_1_018.cpp +t_1_019.cpp +t_1_020.cpp +t_1_021.cpp +t_1_022.cpp +t_1_023.cpp +t_1_024.cpp +t_1_025.cpp +t_1_026.cpp +t_1_027.cpp +t_1_028.cpp +t_1_029.cpp +t_1_030.cpp +t_1_031.cpp +t_1_032.cpp +t_1_033.cpp +t_1_034.cpp +t_1_035.cpp +t_1_036.cpp +t_1_037.cpp +t_1_038.cpp + +# +# t_2: Preprocessing directives +# +t_2_001.cpp +t_2_002.cpp +t_2_003.cpp +t_2_004.cpp +t_2_005.cpp +t_2_006.cpp +t_2_007.cpp +t_2_008.cpp +t_2_009.cpp +t_2_010.cpp +t_2_011.cpp +t_2_012.cpp +t_2_013.cpp +t_2_014.cpp +t_2_015.cpp +t_2_016.cpp +t_2_017.cpp +t_2_018.cpp +t_2_019.cpp +t_2_020.cpp +t_2_021.cpp +t_2_022.cpp + +# +# t_3: Predefined macros +# +t_3_001.cpp +t_3_002.cpp +t_3_003.cpp +t_3_004.cpp + +# +# Preprocessing expressions +# +t_4_001.cpp +t_4_002.cpp +t_4_003.cpp +t_4_004.cpp + +# +# unit tests from the mcpp preprocessor validation suite +# (general functionality) +# +t_5_001.cpp +t_5_002.cpp +t_5_003.cpp +# t_5_004 is currently disabled because of a known problem in the Wave library +#t_5_004.cpp +t_5_005.cpp +t_5_006.cpp +t_5_007.cpp +t_5_008.cpp +t_5_009.cpp +t_5_010.cpp +t_5_011.cpp +t_5_012.cpp +t_5_013.cpp +t_5_014.cpp +t_5_015.cpp +t_5_016.cpp +t_5_017.cpp +t_5_018.cpp +t_5_019.cpp +t_5_020.cpp +t_5_021.cpp +t_5_022.cpp +t_5_023.cpp +t_5_024.cpp +t_5_025.cpp +t_5_026.cpp +t_5_027.cpp +t_5_028.cpp +t_5_029.cpp +# t_5_030 contains one disabled test +t_5_030.cpp +t_5_031.cpp +t_5_032.cpp +t_5_033.cpp +t_5_034.cpp +t_5_035.cpp + +# +# unit tests from the mcpp preprocessor validation suite +# (error reporting) +# +t_6_001.cpp +t_6_002.cpp +t_6_003.cpp +t_6_004.cpp +t_6_005.cpp +t_6_006.cpp +t_6_007.cpp +t_6_008.cpp +t_6_009.cpp +t_6_010.cpp +t_6_011.cpp +t_6_012.cpp +t_6_013.cpp +t_6_014.cpp +t_6_015.cpp +t_6_016.cpp +t_6_017.cpp +t_6_018.cpp +t_6_019.cpp +t_6_020.cpp +t_6_021.cpp +t_6_022.cpp +t_6_023.cpp +t_6_024.cpp +t_6_025.cpp +t_6_026.cpp +t_6_027.cpp +t_6_028.cpp +t_6_029.cpp +t_6_030.cpp +t_6_031.cpp +t_6_032.cpp +t_6_033.cpp +t_6_034.cpp +t_6_035.cpp +t_6_036.cpp +t_6_037.cpp +t_6_038.cpp +t_6_039.cpp +t_6_040.cpp +t_6_041.cpp +t_6_042.cpp +t_6_043.cpp +t_6_044.cpp +t_6_045.cpp +t_6_046.cpp +t_6_047.cpp +t_6_048.cpp +t_6_049.cpp +t_6_050.cpp +t_6_051.cpp +t_6_052.cpp +t_6_053.cpp +t_6_054.cpp +t_6_055.cpp +t_6_056.cpp +t_6_057.cpp +t_6_058.cpp +t_6_059.cpp +t_6_060.cpp +t_6_061.cpp +t_6_062.cpp +t_6_063.cpp +t_6_064.cpp +t_6_065.cpp +t_6_066.cpp +t_6_067.cpp +t_6_068.cpp +t_6_069.cpp + +# +# t_7: C++0x testing +# +t_7_001.cpp +t_7_002.cpp +t_7_003.cpp +t_7_004.cpp +t_7_005.cpp +t_7_006.cpp + +# +# t_9: General preprocessing problems +# +t_9_001.cpp +t_9_002.cpp +t_9_003.cpp +t_9_004.cpp +t_9_005.cpp +t_9_006.cpp +t_9_007.cpp +t_9_008.cpp +t_9_009.cpp +t_9_010.cpp +t_9_011.cpp +t_9_012.cpp +t_9_013.cpp +t_9_014.cpp +t_9_015.cpp +t_9_016.cpp +t_9_017.cpp +t_9_018.cpp +t_9_019.cpp +t_9_020.cpp +t_9_021.cpp +t_9_022.cpp +t_9_023.cpp +t_9_024.cpp +t_9_025.cpp +t_9_026.cpp +# t_9_027.cpp currently disabled, expected fail only on windows +# t_9_028.cpp currently disabled, expected fail only on windows diff --git a/src/boost/libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/file.hpp b/src/boost/libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/file.hpp new file mode 100644 index 000000000..df704b2d0 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testfiles/utf8-test-ßµ™∃/file.hpp @@ -0,0 +1,10 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +__FILE__ diff --git a/src/boost/libs/wave/test/testwave/testwave.cpp b/src/boost/libs/wave/test/testwave/testwave.cpp new file mode 100644 index 000000000..e5e481d0d --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testwave.cpp @@ -0,0 +1,301 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +// system headers +#include <string> +#include <iostream> +#include <vector> + +// include boost +#include <boost/config.hpp> +#include <boost/wave.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> + +// test application related headers +#include "cmd_line_utils.hpp" +#include "testwave_app.hpp" + +namespace po = boost::program_options; +namespace fs = boost::filesystem; + +/////////////////////////////////////////////////////////////////////////////// +// +// The debuglevel command line parameter is used to control the amount of text +// printed by the testwave application. +// +// level 0: prints nothing except serious failures preventing the testwave +// executable from running, the return value of the executable is +// equal to the number of failed tests +// level 1: prints a short summary only +// level 2: prints the names of the failed tests only +// level 3: prints the expected and real result for failed tests +// level 4: prints the outcome of every test +// level 5: prints the real result even for succeeded tests +// level 6: prints the real hooks information recorded, even for succeeded +// tests +// +// level 9: prints information about almost everything +// +// The default debug level is 1. +// +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +int +main(int argc, char *argv[]) +{ + int error_count = 0; + int config_file_error_count = 0; + try { + // analyze the command line options and arguments + po::options_description desc_cmdline ("Options allowed on the command line"); + 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") + ("config-file", po::value<std::vector<std::string> >()->composing(), + "specify a config file (alternatively: @arg)") + ("hooks", po::value<bool>()->default_value(true), + "test preprocessing hooks") + ("debug,d", po::value<int>(), "set the debug level (0...9)") + ; + + // Hidden options, will be used in in config file analysis to allow to + // recognize positional arguments, will not be shown to the user. + po::options_description desc_hidden("Hidden options"); + desc_hidden.add_options() + ("input", po::value<std::vector<std::string> >()->composing(), + "inputfile") + ; + + // this is the test application object + po::variables_map vm; + testwave_app app(vm); + + // all command line and config file options + po::options_description cmdline_options; + cmdline_options.add(desc_cmdline).add(app.common_options()); + + // parse command line + // (the (int) cast is to make the True64 compiler happy) + using namespace boost::program_options::command_line_style; + po::parsed_options opts(po::parse_command_line(argc, argv, + cmdline_options, (int)unix_style, cmd_line_utils::at_option_parser)); + + po::store(opts, vm); + po::notify(vm); + + // ... act as required + if (vm.count("help")) { + po::options_description desc_help ( + "Usage: testwave [options] [@config-file(s)] file(s)"); + desc_help.add(desc_cmdline).add(app.common_options()); + std::cout << desc_help << std::endl; + return 0; + } + + // debug flag + if (vm.count("debug")) { + int debug_level = vm["debug"].as<int>(); + if (debug_level < 0 || debug_level > 9) { + std::cerr + << "testwave: please use an integer in the range [0..9] " + << "as the parameter to the debug option!" + << std::endl; + } + else { + app.set_debuglevel(debug_level); + } + } + + if (vm.count("version")) { + return app.print_version(); + } + + if (vm.count("copyright")) { + return app.print_copyright(); + } + + // If there is specified at least one config file, parse it and add the + // options to the main variables_map + // Each of the config files is parsed into a separate variables_map to + // allow correct paths handling. + int input_count = 0; + if (vm.count("config-file")) { + std::vector<std::string> const &cfg_files = + vm["config-file"].as<std::vector<std::string> >(); + + if (9 == app.get_debuglevel()) { + std::cerr << "found " << (unsigned)cfg_files.size() + << " config-file arguments" << std::endl; + } + + std::vector<std::string>::const_iterator end = cfg_files.end(); + for (std::vector<std::string>::const_iterator cit = cfg_files.begin(); + cit != end; ++cit) + { + if (9 == app.get_debuglevel()) { + std::cerr << "reading config_file: " << *cit << std::endl; + } + + // parse a single config file and store the results, config files + // may only contain --input and positional arguments + po::variables_map cvm; + if (!cmd_line_utils::read_config_file(app.get_debuglevel(), + *cit, desc_hidden, cvm)) + { + if (9 == app.get_debuglevel()) { + std::cerr << "failed to read config_file: " << *cit + << std::endl; + } + ++config_file_error_count; + } + + if (9 == app.get_debuglevel()) { + std::cerr << "succeeded to read config_file: " << *cit + << std::endl; + } + + // correct the paths parsed into this variables_map + if (cvm.count("input")) { + std::vector<std::string> const &infiles = + cvm["input"].as<std::vector<std::string> >(); + + if (9 == app.get_debuglevel()) { + std::cerr << "found " << (unsigned)infiles.size() + << " entries" << std::endl; + } + + std::vector<std::string>::const_iterator iend = infiles.end(); + for (std::vector<std::string>::const_iterator iit = infiles.begin(); + iit != iend; ++iit) + { + // correct the file name (pre-pend the config file path) + fs::path cfgpath = boost::wave::util::complete_path( + boost::wave::util::create_path(*cit), + boost::wave::util::current_path()); + 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))) + { + if (9 == app.get_debuglevel()) { + std::cerr << "failed to execute test: " + << boost::wave::util::native_file_string(filepath) + << std::endl; + } + ++error_count; + } + else if (9 == app.get_debuglevel()) { + std::cerr << "succeeded to execute test: " + << boost::wave::util::native_file_string(filepath) + << std::endl; + } + ++input_count; + + if (9 == app.get_debuglevel()) { + std::cerr << std::string(79, '-') << std::endl; + } + } + } + else if (9 == app.get_debuglevel()) { + std::cerr << "no entries found" << std::endl; + } + } + } + + // extract the arguments from the parsed command line + std::vector<po::option> arguments; + std::remove_copy_if(opts.options.begin(), opts.options.end(), + std::back_inserter(arguments), cmd_line_utils::is_argument()); + + if (9 == app.get_debuglevel()) { + std::cerr << "found " << (unsigned)arguments.size() + << " arguments" << std::endl; + } + + // iterate over remaining arguments + std::vector<po::option>::const_iterator arg_end = arguments.end(); + for (std::vector<po::option>::const_iterator arg = arguments.begin(); + arg != arg_end; ++arg) + { + fs::path filepath(boost::wave::util::create_path((*arg).value[0])); + + 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; + } + + if (!app.test_a_file(boost::wave::util::native_file_string(filepath))) + { + if (9 == app.get_debuglevel()) { + std::cerr << "failed to execute test: " + << boost::wave::util::native_file_string(filepath) + << std::endl; + } + ++error_count; + } + else if (9 == app.get_debuglevel()) { + std::cerr << "succeeded to execute test: " + << boost::wave::util::native_file_string(filepath) + << std::endl; + } + + if (9 == app.get_debuglevel()) { + std::cerr << std::string(79, '-') << std::endl; + } + ++input_count; + } + + // print a message if no input is given + if (0 == input_count) { + std::cerr + << "testwave: no input file specified, " + << "try --help to get a hint." + << std::endl; + return (std::numeric_limits<int>::max)() - 3; + } + else if (app.get_debuglevel() > 0) { + std::cout + << "testwave: " << input_count-error_count + << " of " << input_count << " test(s) succeeded"; + if (0 != error_count) { + std::cout + << " (" << error_count << " test(s) failed)"; + } + std::cout << "." << std::endl; + } + } + catch (std::exception const& e) { + std::cerr << "testwave: exception caught: " << e.what() << std::endl; + return (std::numeric_limits<int>::max)() - 1; + } + catch (...) { + std::cerr << "testwave: unexpected exception caught." << std::endl; + return (std::numeric_limits<int>::max)() - 2; + } + + return error_count + config_file_error_count; +} diff --git a/src/boost/libs/wave/test/testwave/testwave_app.cpp b/src/boost/libs/wave/test/testwave/testwave_app.cpp new file mode 100644 index 000000000..140408560 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testwave_app.cpp @@ -0,0 +1,1486 @@ +/*============================================================================= + 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) +=============================================================================*/ + +// disable stupid compiler warnings +#include <boost/config/warning_disable.hpp> + +// system headers +#include <string> +#include <iostream> +#include <vector> +#include <ctime> + +// include boost +#include <boost/config.hpp> +#include <boost/assert.hpp> +#include <boost/throw_exception.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/detail/workaround.hpp> + +// include Wave + +// always use new hooks +#define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 0 + +#include <boost/wave.hpp> + +// include the lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +/////////////////////////////////////////////////////////////////////////////// +// Include lexer specifics, import lexer names +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION == 0 +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Include the grammar definitions, if these shouldn't be compiled separately +// (ATTENTION: _very_ large compilation times!) +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION == 0 +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> +#include <boost/wave/grammars/cpp_grammar.hpp> +#include <boost/wave/grammars/cpp_expression_grammar.hpp> +#include <boost/wave/grammars/cpp_predef_macros_grammar.hpp> +#include <boost/wave/grammars/cpp_defined_grammar.hpp> +#endif + +// test application related headers +#include "cmd_line_utils.hpp" +#include "testwave_app.hpp" +#include "collect_hooks_information.hpp" + +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/detail/utf8_codecvt_facet.hpp> + +# ifdef BOOST_NO_STDC_NAMESPACE +namespace std +{ + using ::asctime; using ::gmtime; using ::localtime; + using ::difftime; using ::time; using ::tm; using ::mktime; using ::system; +} +# endif + +namespace po = boost::program_options; +namespace fs = boost::filesystem; + +/////////////////////////////////////////////////////////////////////////////// +// testwave version definitions +#define TESTWAVE_VERSION_MAJOR 0 +#define TESTWAVE_VERSION_MINOR 6 +#define TESTWAVE_VERSION_SUBMINOR 0 + +namespace { + struct fs_path_imbue_utf8 + { + explicit fs_path_imbue_utf8(bool enable) + : m_enabled(enable), m_prevLocale() + { + if (!m_enabled) return; + static std::locale global_loc = std::locale(); + static std::locale utf_8_loc(global_loc, new boost::filesystem::detail::utf8_codecvt_facet); + + m_prevLocale = boost::filesystem::path::imbue(utf_8_loc); + + } + ~fs_path_imbue_utf8() + { + if (!m_enabled) return; + boost::filesystem::path::imbue(m_prevLocale); + } + private: + fs_path_imbue_utf8(); + fs_path_imbue_utf8(fs_path_imbue_utf8 const&); + fs_path_imbue_utf8& operator=(fs_path_imbue_utf8 const&); + + bool m_enabled; + std::locale m_prevLocale; + }; + + /////////////////////////////////////////////////////////////////////////// + template <typename Iterator> + inline bool + handle_next_token(Iterator &it, Iterator const& end, + std::string &result) + { + typedef typename Iterator::value_type token_type; + + token_type tok = *it++; + result = result + tok.get_value().c_str(); + return (it == end) ? false : true; + } + + /////////////////////////////////////////////////////////////////////////// + template <typename String> + 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())); + + name = String("\"") + boost::wave::util::leaf(p).c_str() + String("\""); + return name; + } + + /////////////////////////////////////////////////////////////////////////// + template <typename Iterator> + bool handle_line_directive(Iterator &it, Iterator const& end, + std::string &result) + { + 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 + !handle_next_token(it, end, result)) // whitespace + { + return false; + } + + using boost::wave::util::impl::unescape_lit; + + token_type filename = *it; + string_type name = filename.get_value(); + + handle_quoted_filepath(name); + result = result + name.c_str(); + return true; + } + + template <typename T> + inline T const& + variables_map_as(po::variable_value const& v, T*) + { +#if (__GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3)) || \ + BOOST_WORKAROUND(__MWERKS__, < 0x3200) +// gcc 3.2.x and 3.3.x choke on vm[...].as<...>() +// CW 8.3 has problems with the v.as<T>() below + T const* r = boost::any_cast<T>(&v.value()); + if (!r) + boost::throw_exception(boost::bad_any_cast()); + return *r; +#else + return v.as<T>(); +#endif + } + +} + +/////////////////////////////////////////////////////////////////////////// +// +// This function compares the real result and the expected one but first +// replaces all occurrences in the expected result of +// $E: to the result of preprocessing the given expression +// $F: to the passed full filepath +// $P: to the full path +// $B: to the full path (same as $P, but using forward slash '/' on Windows) +// $V: to the current Boost version number +// +/////////////////////////////////////////////////////////////////////////// +bool +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]) { + case 'E': // preprocess the given token sequence + { + if ('(' == expected[pos1+2]) { + std::size_t p = expected.find_first_of(")", pos1+1); + if (std::string::npos == p) { + std::cerr + << "testwave: unmatched parenthesis in $E" + " directive" << std::endl; + return false; + } + std::string source = expected.substr(pos1+3, p-pos1-3); + std::string result, error, hooks; + bool pp_result = preprocess_file(filename, source, + result, error, hooks, "", true); + if (!pp_result) { + std::cerr + << "testwave: preprocessing error in $E directive: " + << error << std::endl; + return false; + } + full_result = full_result + + expected.substr(pos, pos1-pos) + result; + pos1 = expected.find_first_of ("$", + pos = pos1 + 4 + source.size()); + } + } + break; + + case 'F': // insert base file name + full_result = full_result + + expected.substr(pos, pos1-pos) + escape_lit(filename); + pos1 = expected.find_first_of ("$", pos = pos1 + 2); + break; + + case 'P': // insert full path + case 'B': // same as 'P', but forward slashes on Windows + { + fs::path fullpath ( + boost::wave::util::complete_path( + 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); + if (std::string::npos == p) { + std::cerr + << "testwave: unmatched parenthesis in $P" + " directive" << std::endl; + return false; + } + std::string base = expected.substr(pos1+3, p-pos1-3); + fullpath = boost::wave::util::branch_path(fullpath) / + boost::wave::util::create_path(base); + full_result += expected.substr(pos, pos1-pos); + if ('P' == expected[pos1+1]) { +#if defined(BOOST_WINDOWS) + std::string p = replace_slashes( + boost::wave::util::native_file_string( + boost::wave::util::normalize(fullpath)), + "/", '\\'); +#else + std::string p ( + boost::wave::util::native_file_string( + boost::wave::util::normalize(fullpath))); +#endif + full_result += escape_lit(p); + } + else { +#if defined(BOOST_WINDOWS) + std::string p = replace_slashes( + boost::wave::util::normalize(fullpath).string()); +#else + std::string p ( + boost::wave::util::normalize(fullpath).string()); +#endif + full_result += escape_lit(p); + } + pos1 = expected.find_first_of ("$", + pos = pos1 + 4 + base.size()); + } + else { + // the $P is used on its own + full_result += expected.substr(pos, pos1-pos); + if ('P' == expected[pos1+1]) { + full_result += escape_lit( + boost::wave::util::native_file_string(fullpath)); + } + else { +#if defined(BOOST_WINDOWS) + std::string p = replace_slashes(fullpath.string()); +#else + std::string p (fullpath.string()); +#endif + full_result += escape_lit(fullpath.string()); + } + pos1 = expected.find_first_of ("$", pos = pos1 + 2); + } + } + break; + + case 'R': // insert relative file name + case 'S': // same as 'R', but forward slashes on Windows + { + fs::path relpath; + boost::wave::util::as_relative_to( + boost::wave::util::create_path(filename), + boost::wave::util::current_path(), + relpath); + + if ('(' == expected[pos1+2]) { + // the $R(basename) syntax is used + std::size_t p = expected.find_first_of(")", pos1+1); + if (std::string::npos == p) { + std::cerr + << "testwave: unmatched parenthesis in $R" + " directive" << std::endl; + return false; + } + std::string base = expected.substr(pos1+3, p-pos1-3); + relpath = boost::wave::util::branch_path(relpath) / + boost::wave::util::create_path(base); + full_result += expected.substr(pos, pos1-pos); + if ('R' == expected[pos1+1]) { + full_result += escape_lit( + boost::wave::util::native_file_string( + boost::wave::util::normalize(relpath))); + } + else { +#if defined(BOOST_WINDOWS) + std::string p = replace_slashes( + boost::wave::util::normalize(relpath).string()); +#else + std::string p ( + boost::wave::util::normalize(relpath).string()); +#endif + full_result += escape_lit(p); + } + pos1 = expected.find_first_of ("$", + pos = pos1 + 4 + base.size()); + } + else { + // the $R is used on its own + full_result += expected.substr(pos, pos1-pos); + if ('R' == expected[pos1+1]) { + full_result += escape_lit( + boost::wave::util::native_file_string(relpath)); + } + else { +#if defined(BOOST_WINDOWS) + std::string p = replace_slashes(relpath.string()); +#else + std::string p (relpath.string()); +#endif + full_result += escape_lit(p); + } + pos1 = expected.find_first_of ("$", pos = pos1 + 2); + } + } + break; + + case 'V': // insert Boost version + full_result = full_result + + expected.substr(pos, pos1-pos) + BOOST_LIB_VERSION; + pos1 = expected.find_first_of ("$", pos = pos1 + 2); + break; + + default: + full_result = full_result + + expected.substr(pos, pos1-pos); + pos1 = expected.find_first_of ("$", (pos = pos1) + 1); + break; + } + + } while(pos1 != std::string::npos); + full_result += expected.substr(pos); + } + else { + full_result = expected; + } + + expected = full_result; + return full_result == result; +} + +/////////////////////////////////////////////////////////////////////////////// +testwave_app::testwave_app(po::variables_map const& vm) +: debuglevel(1), desc_options("Preprocessor configuration options"), + global_vm(vm) +{ + desc_options.add_options() + ("include,I", po::value<cmd_line_utils::include_paths>()->composing(), + "specify an additional include directory") + ("sysinclude,S", po::value<std::vector<std::string> >()->composing(), + "specify an additional system include directory") + ("forceinclude,F", po::value<std::vector<std::string> >()->composing(), + "force inclusion of the given file") + ("define,D", po::value<std::vector<std::string> >()->composing(), + "specify a macro to define (as macro[=[value]])") + ("predefine,P", po::value<std::vector<std::string> >()->composing(), + "specify a macro to predefine (as macro[=[value]])") + ("undefine,U", po::value<std::vector<std::string> >()->composing(), + "specify a macro to undefine") + ("nesting,n", po::value<int>(), + "specify a new maximal include nesting depth") + ("long_long", "enable long long support in C++ mode") + ("preserve", "preserve comments") +#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 + ("variadics", "enable certain C99 extensions in C++ mode") + ("c99", "enable C99 mode (implies --variadics)") +#endif +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + ("noguard,G", "disable include guard detection") +#endif + ("skipped_token_hooks", "record skipped_token hook calls") +#if BOOST_WAVE_SUPPORT_CPP0X != 0 + ("c++11", "enable C++11 mode (implies --variadics and --long_long)") +#endif + ("warning,W", po::value<std::vector<std::string> >()->composing(), + "Warning settings.") + ; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Test the given file (i.e. preprocess the file and compare the result +// against the embedded 'R' comments, if an error occurs compare the error +// message against the given 'E' comments, if no error occurred, compare the +// generated hooks result against the given 'H' comments). +// +/////////////////////////////////////////////////////////////////////////////// +bool +testwave_app::test_a_file(std::string filename) +{ +// read the input file into a string + std::string instr; + if (!read_file(filename, instr)) + return false; // error was reported already + + std::string use_utf8; + extract_special_information(filename, instr, 'U', use_utf8); + fs_path_imbue_utf8 to_utf8(use_utf8.substr(0,3) == "yes"); + + bool test_hooks = true; + if (global_vm.count("hooks")) + test_hooks = variables_map_as(global_vm["hooks"], (bool *)NULL); + + std::string expected_cfg_macro; + extract_special_information(filename, instr, 'D', expected_cfg_macro); + +// extract expected output, preprocess the data and compare results + std::string expected, expected_hooks; + if (extract_expected_output(filename, instr, expected, expected_hooks)) { + bool retval = true; // assume success + bool printed_result = false; + std::string result, error, hooks; + bool pp_result = preprocess_file(filename, instr, result, error, hooks, + expected_cfg_macro); + if (pp_result || !result.empty()) { + // did we expect an error? + std::string expected_error; + if (!extract_special_information(filename, instr, 'E', expected_error)) + return false; + + if (!expected_error.empty() && + !got_expected_result(filename, error, expected_error)) + { + // we expected an error but got none (or a different one) + if (debuglevel > 2) { + std::cerr + << filename << ": failed" << std::endl + << "result: " << std::endl << result << std::endl; + + if (!error.empty()) { + std::cerr << "expected result: " << std::endl + << expected << std::endl; + } + if (!expected_error.empty()) { + std::cerr << "expected error: " << std::endl + << expected_error << std::endl; + } + } + else if (debuglevel > 1) { + std::cerr << filename << ": failed" << std::endl; + } + retval = false; + } + else if (!got_expected_result(filename, result, expected)) { + // no preprocessing error encountered + if (debuglevel > 2) { + std::cerr + << filename << ": failed" << std::endl + << "result: " << std::endl << result << std::endl + << "expected: " << std::endl << expected << std::endl; + } + else if (debuglevel > 1) { + std::cerr << filename << ": failed" << std::endl; + } + retval = false; + } + else { + // preprocessing succeeded, check hook information, if appropriate + if (test_hooks && !expected_hooks.empty() && + !got_expected_result(filename, hooks, expected_hooks)) + { + if (debuglevel > 2) { + std::cerr << filename << ": failed" << std::endl + << "hooks result: " << std::endl << hooks + << std::endl; + std::cerr << "expected hooks result: " << std::endl + << expected_hooks << std::endl; + } + else if (debuglevel > 1) { + std::cerr << filename << ": failed" << std::endl; + } + retval = false; + } + } + + // print success message, if appropriate + if (retval) { + if (debuglevel > 5) { + std::cerr + << filename << ": succeeded" << std::endl + << "result: " << std::endl << result << std::endl + << "hooks result: " << std::endl << hooks << std::endl; + } + else if (debuglevel > 4) { + std::cerr + << filename << ": succeeded" << std::endl + << "result: " << std::endl << result << std::endl; + } + else if (debuglevel > 3) { + std::cerr << filename << ": succeeded" << std::endl; + } + printed_result = true; + } + } + + if (!pp_result) { + // there was a preprocessing error, was it expected? + std::string expected_error; + if (!extract_special_information(filename, instr, 'E', expected_error)) + return false; + + if (!got_expected_result(filename, error, expected_error)) { + // the error was unexpected + if (debuglevel > 2) { + std::cerr + << filename << ": failed" << std::endl; + + if (!expected_error.empty()) { + std::cerr + << "error result: " << std::endl << error << std::endl + << "expected error: " << std::endl + << expected_error << std::endl; + } + else { + std::cerr << "unexpected error: " << error << std::endl; + } + } + else if (debuglevel > 1) { + std::cerr << filename << ": failed" << std::endl; + } + retval = false; + } + + if (retval) { + if (debuglevel > 5) { + std::cerr + << filename << ": succeeded (caught expected error)" + << std::endl << "error result: " << std::endl << error + << std::endl; + + if (!printed_result) { + std::cerr + << "hooks result: " << std::endl << hooks + << std::endl; + } + } + else if (debuglevel > 4) { + std::cerr + << filename << ": succeeded (caught expected error)" + << std::endl << "error result: " << std::endl << error + << std::endl; + } + else if (debuglevel > 3) { + // caught the expected error message + std::cerr << filename << ": succeeded" << std::endl; + } + } + } + return retval; + } + else { + std::cerr + << filename << ": no information about expected results found" + << std::endl; + } + return false; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// print the current version of this program +// +/////////////////////////////////////////////////////////////////////////////// +int +testwave_app::print_version() +{ +// get time of last compilation of this file +boost::wave::util::time_conversion_helper compilation_time(__DATE__ " " __TIME__); + +// calculate the number of days since Feb 12 2005 +// (the day the testwave project was started) +std::tm first_day; + + using namespace std; // some platforms have memset in namespace std + memset (&first_day, 0, sizeof(std::tm)); + first_day.tm_mon = 1; // Feb + first_day.tm_mday = 12; // 12 + first_day.tm_year = 105; // 2005 + +long seconds = long(std::difftime(compilation_time.get_time(), + std::mktime(&first_day))); + + std::cout + << TESTWAVE_VERSION_MAJOR << '.' + << TESTWAVE_VERSION_MINOR << '.' + << TESTWAVE_VERSION_SUBMINOR << '.' + << seconds/(3600*24) // get number of days from seconds + << std::endl; + return 0; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// +// print the copyright statement +// +/////////////////////////////////////////////////////////////////////////////// +int +testwave_app::print_copyright() +{ + char const *copyright[] = { + "", + "Testwave: A test driver for the Boost.Wave C++ preprocessor library", + "http://www.boost.org/", + "", + "Copyright (c) 2001-2012 Hartmut Kaiser, Distributed under the Boost", + "Software License, Version 1.0. (See accompanying file", + "LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)", + 0 + }; + + for (int i = 0; 0 != copyright[i]; ++i) + std::cout << copyright[i] << std::endl; + + return 0; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Read the given file into a string +// +/////////////////////////////////////////////////////////////////////////////// +bool +testwave_app::read_file(std::string const& filename, std::string& instr) +{ +// open the given file and report error, if appropriate + std::ifstream instream(filename.c_str()); + if (!instream.is_open()) { + std::cerr << "testwave: could not open input file: " + << filename << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "read_file: succeeded to open input file: " + << filename << std::endl; + } + instream.unsetf(std::ios::skipws); + +// read the input file into a string + +#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) +// this is known to be very slow for large files on some systems + std::copy (std::istream_iterator<char>(instream), + std::istream_iterator<char>(), + std::inserter(instr, instr.end())); +#else + instr = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); +#endif + + if (9 == debuglevel) { + std::cerr << "read_file: succeeded to read input file: " + << filename << std::endl; + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +namespace { + + std::string const& trim_whitespace(std::string& value) + { + std::string::size_type first = value.find_first_not_of(" \t"); + if (std::string::npos == first) + value.clear(); + else { + std::string::size_type last = value.find_last_not_of(" \t"); + BOOST_ASSERT(std::string::npos != last); + value = value.substr(first, last-first+1); + } + return value; + } +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Extract special information from comments marked with the given letter +// +/////////////////////////////////////////////////////////////////////////////// +bool +testwave_app::extract_special_information(std::string const& filename, + std::string const& instr, char flag, std::string& content) +{ + if (9 == debuglevel) { + std::cerr << "extract_special_information: extracting special information ('" + << flag << "') from input file: " << filename << std::endl; + } + +// tokenize the input data into C++ tokens using the C++ lexer + typedef boost::wave::cpplexer::lex_token<> token_type; + typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; + typedef token_type::position_type position_type; + + boost::wave::language_support const lang_opts = + (boost::wave::language_support)( + boost::wave::support_option_variadics | + boost::wave::support_option_long_long | + boost::wave::support_option_no_character_validation | + boost::wave::support_option_convert_trigraphs | + boost::wave::support_option_insert_whitespace); + + position_type pos(filename.c_str()); + lexer_type it = lexer_type(instr.begin(), instr.end(), pos, lang_opts); + lexer_type end = lexer_type(); + + try { + // look for C or C++ comments starting with the special character + for (/**/; it != end; ++it) { + using namespace boost::wave; + token_id id = token_id(*it); + if (T_CCOMMENT == id) { + std::string value = (*it).get_value().c_str(); + if (flag == value[2]) { + if (value.size() > 3 && '(' == value[3]) { + std::size_t p = value.find_first_of(")"); + if (std::string::npos == p) { + std::cerr + << "testwave: missing closing parenthesis in '" + << flag << "()' directive" << std::endl; + return false; + } + std::string source = value.substr(4, p-4); + std::string result, error, hooks; + bool pp_result = preprocess_file(filename, source, + result, error, hooks, "", true); + if (!pp_result) { + std::cerr + << "testwave: preprocessing error in '" << flag + << "()' directive: " << error << std::endl; + return false; + } + + // include this text into the extracted information + // only if the result is not zero + using namespace std; // some system have atoi in namespace std + if (0 != atoi(result.c_str())) { + std::string thiscontent(value.substr(p+1)); + if (9 == debuglevel) { + std::cerr << "extract_special_information: extracted: " + << thiscontent << std::endl; + } + trim_whitespace(thiscontent); + content += thiscontent; + } + } + else { + std::string thiscontent(value.substr(3, value.size()-5)); + if (9 == debuglevel) { + std::cerr << "extract_special_information: extracted: " + << thiscontent << std::endl; + } + trim_whitespace(thiscontent); + content += thiscontent; + } + } + } + else if (T_CPPCOMMENT == id) { + std::string value = (*it).get_value().c_str(); + if (flag == value[2]) { + if (value.size() > 3 && '(' == value[3]) { + std::size_t p = value.find_first_of(")"); + if (std::string::npos == p) { + std::cerr + << "testwave: missing closing parenthesis in '" + << flag << "()' directive" << std::endl; + return false; + } + std::string source = value.substr(4, p-4); + std::string result, error, hooks; + bool pp_result = preprocess_file(filename, source, + result, error, hooks, "", true); + if (!pp_result) { + std::cerr + << "testwave: preprocessing error in '" << flag + << "()' directive: " << error << std::endl; + return false; + } + + // include this text into the extracted information + // only if the result is not zero + using namespace std; // some system have atoi in namespace std + if (0 != atoi(result.c_str())) { + std::string thiscontent(value.substr((' ' == value[p+1]) ? p+2 : p+1)); + if (9 == debuglevel) { + std::cerr << "extract_special_information: extracted: " + << thiscontent << std::endl; + } + trim_whitespace(thiscontent); + content += thiscontent; + } + } + else { + std::string thiscontent(value.substr((' ' == value[3]) ? 4 : 3)); + if (9 == debuglevel) { + std::cerr << "extract_special_information: extracted: " + << thiscontent; + } + trim_whitespace(content); + content += thiscontent; + } + } + } + } + } + catch (boost::wave::cpplexer::lexing_exception const &e) { + // some lexing error + std::cerr + << e.file_name() << "(" << e.line_no() << "): " + << e.description() << std::endl; + return false; + } + + if (9 == debuglevel) { + std::cerr << "extract_special_information: succeeded extracting special information ('" + << flag << "')" << std::endl; + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Extract the expected output from the given input data +// +// The expected output has to be provided inside of special comments which +// start with a capital 'R'. All such comments are concatenated and returned +// through the parameter 'expected'. +// +/////////////////////////////////////////////////////////////////////////////// +inline bool +testwave_app::extract_expected_output(std::string const& filename, + std::string const& instr, std::string& expected, std::string& expectedhooks) +{ + return extract_special_information(filename, instr, 'R', expected) && + extract_special_information(filename, instr, 'H', expectedhooks); +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Extracts the required preprocessing options from the given input data and +// initialises the given Wave context object accordingly. +// We allow the same (applicable) options to be used as are valid for the wave +// driver executable. +// +/////////////////////////////////////////////////////////////////////////////// +template <typename Context> +bool +testwave_app::extract_options(std::string const& filename, + std::string const& instr, Context& ctx, bool single_line, + po::variables_map& vm) +{ + if (9 == debuglevel) { + std::cerr << "extract_options: extracting options" << std::endl; + } + +// extract the required information from the comments flagged by a +// capital 'O' + std::string options; + if (!extract_special_information(filename, instr, 'O', options)) + return false; + + try { + // parse the configuration information into a program_options_description + // object + cmd_line_utils::read_config_options(debuglevel, options, desc_options, vm); + initialise_options(ctx, vm, single_line); + } + catch (std::exception const &e) { + std::cerr << filename << ": exception caught: " << e.what() + << std::endl; + return false; + } + + if (9 == debuglevel) { + std::cerr << "extract_options: succeeded extracting options" + << std::endl; + } + + return true; +} + +template <typename Context> +bool +testwave_app::initialise_options(Context& ctx, po::variables_map const& vm, + bool single_line) +{ + if (9 == debuglevel) { + std::cerr << "initialise_options: initializing options" << std::endl; + } + + if (vm.count("skipped_token_hooks")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: skipped_token_hooks" << std::endl; + } + ctx.get_hooks().set_skipped_token_hooks(true); + } + +// initialize the given context from the parsed options +#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 +// enable C99 mode, if appropriate (implies variadics) + if (vm.count("c99")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: c99" << std::endl; + } + ctx.set_language( + boost::wave::language_support( + boost::wave::support_c99 + | boost::wave::support_option_emit_line_directives +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + | boost::wave::support_option_include_guard_detection +#endif +#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0 + | boost::wave::support_option_emit_pragma_directives +#endif + | boost::wave::support_option_insert_whitespace + )); + } + else if (vm.count("variadics")) { + // enable variadics and placemarkers, if appropriate + if (9 == debuglevel) { + std::cerr << "initialise_options: option: variadics" << std::endl; + } + ctx.set_language(boost::wave::enable_variadics(ctx.get_language())); + } +#endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 + +#if BOOST_WAVE_SUPPORT_CPP0X + if (vm.count("c++11")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: c++11" << std::endl; + } + ctx.set_language( + boost::wave::language_support( + boost::wave::support_cpp0x + | boost::wave::support_option_convert_trigraphs + | boost::wave::support_option_long_long + | boost::wave::support_option_emit_line_directives +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + | boost::wave::support_option_include_guard_detection +#endif +#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0 + | boost::wave::support_option_emit_pragma_directives +#endif + | boost::wave::support_option_insert_whitespace + )); + } +#endif + +// enable long_long mode, if appropriate + if (vm.count("long_long")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: long_long" << std::endl; + } + ctx.set_language(boost::wave::enable_long_long(ctx.get_language())); + } + +// enable preserving comments mode, if appropriate + if (vm.count("preserve")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: preserve" << std::endl; + } + ctx.set_language( + boost::wave::enable_preserve_comments(ctx.get_language())); + } + +// disable automatic include guard detection + if (vm.count("noguard")) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: guard" << std::endl; + } + ctx.set_language( + boost::wave::enable_include_guard_detection(ctx.get_language(), false)); + } + +// enable trigraph conversion + if (9 == debuglevel) { + std::cerr << "initialise_options: option: convert_trigraphs" << std::endl; + } + ctx.set_language(boost::wave::enable_convert_trigraphs(ctx.get_language())); + +// enable single_line mode + if (single_line) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: single_line" << std::endl; + } + ctx.set_language(boost::wave::enable_single_line(ctx.get_language())); + ctx.set_language(boost::wave::enable_emit_line_directives(ctx.get_language(), false)); + } + +// add include directories to the system include search paths + if (vm.count("sysinclude")) { + std::vector<std::string> const& syspaths = + variables_map_as(vm["sysinclude"], (std::vector<std::string> *)NULL); + + std::vector<std::string>::const_iterator end = syspaths.end(); + for (std::vector<std::string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + std::string full(*cit); + got_expected_result(ctx.get_current_filename(),"",full); + + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -S" << *cit + << std::endl; + } + ctx.add_sysinclude_path(full.c_str()); + } + } + +// add include directories to the user include search paths + if (vm.count("include")) { + cmd_line_utils::include_paths const &ip = + variables_map_as(vm["include"], (cmd_line_utils::include_paths*)NULL); + std::vector<std::string>::const_iterator end = ip.paths.end(); + + for (std::vector<std::string>::const_iterator cit = ip.paths.begin(); + cit != end; ++cit) + { + std::string full(*cit); + got_expected_result(ctx.get_current_filename(),"",full); + + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -I" << *cit + << std::endl; + } + ctx.add_include_path(full.c_str()); + } + + // if on the command line was given -I- , this has to be propagated + if (ip.seen_separator) { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -I-" << std::endl; + } + ctx.set_sysinclude_delimiter(); + } + + // add system include directories to the include path + std::vector<std::string>::const_iterator sysend = ip.syspaths.end(); + for (std::vector<std::string>::const_iterator syscit = ip.syspaths.begin(); + syscit != sysend; ++syscit) + { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -S" << *syscit + << std::endl; + } + ctx.add_sysinclude_path((*syscit).c_str()); + } + } + +// add additional defined macros + if (vm.count("define")) { + std::vector<std::string> const ¯os = + variables_map_as(vm["define"], (std::vector<std::string>*)NULL); + std::vector<std::string>::const_iterator end = macros.end(); + for (std::vector<std::string>::const_iterator cit = macros.begin(); + cit != end; ++cit) + { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -D" << *cit + << std::endl; + } + ctx.add_macro_definition(*cit, true); + } + } + +// add additional predefined macros + if (vm.count("predefine")) { + std::vector<std::string> const &predefmacros = + variables_map_as(vm["predefine"], (std::vector<std::string>*)NULL); + std::vector<std::string>::const_iterator end = predefmacros.end(); + for (std::vector<std::string>::const_iterator cit = predefmacros.begin(); + cit != end; ++cit) + { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -P" << *cit + << std::endl; + } + ctx.add_macro_definition(*cit, true); + } + } + +// undefine specified macros + if (vm.count("undefine")) { + std::vector<std::string> const &undefmacros = + variables_map_as(vm["undefine"], (std::vector<std::string>*)NULL); + std::vector<std::string>::const_iterator end = undefmacros.end(); + for (std::vector<std::string>::const_iterator cit = undefmacros.begin(); + cit != end; ++cit) + { + if (9 == debuglevel) { + std::cerr << "initialise_options: option: -U" << *cit + << std::endl; + } + ctx.remove_macro_definition(*cit); + } + } + +// maximal include nesting depth + if (vm.count("nesting")) { + int max_depth = variables_map_as(vm["nesting"], (int*)NULL); + if (max_depth < 1 || max_depth > 100000) { + std::cerr << "testwave: bogus maximal include nesting depth: " + << max_depth << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "initialise_options: option: -n" << max_depth + << std::endl; + } + ctx.set_max_include_nesting_depth(max_depth); + } + + if (9 == debuglevel) { + std::cerr << "initialise_options: succeeded to initialize options" + << std::endl; + } + return true; +} + +/////////////////////////////////////////////////////////////////////////////// +// construct a SIZEOF macro definition string and predefine this macro +template <typename Context> +inline bool +testwave_app::add_sizeof_definition(Context& ctx, char const *name, int value) +{ + BOOST_WAVETEST_OSSTREAM strm; + strm << "__TESTWAVE_SIZEOF_" << name << "__=" << value; + + std::string macro(BOOST_WAVETEST_GETSTRING(strm)); + if (!ctx.add_macro_definition(macro, true)) { + std::cerr << "testwave: failed to predefine macro: " << macro + << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "add_sizeof_definition: predefined macro: " << macro + << std::endl; + } + return true; +} + +// construct a MIN macro definition string and predefine this macro +template <typename T, typename Context> +inline bool +testwave_app::add_min_definition(Context& ctx, char const *name) +{ + BOOST_WAVETEST_OSSTREAM strm; + if (!std::numeric_limits<T>::is_signed) { + strm << "__TESTWAVE_" << name << "_MIN__=" + << "0x" << std::hex + << (std::numeric_limits<T>::min)() << "U"; + } + else { + strm << "__TESTWAVE_" << name << "_MIN__=( " + << (std::numeric_limits<T>::min)()+1 << "-1)"; + } + + std::string macro(BOOST_WAVETEST_GETSTRING(strm)); + if (!ctx.add_macro_definition(macro, true)) { + std::cerr << "testwave: failed to predefine macro: " << macro + << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "add_min_definition: predefined macro: " << macro + << std::endl; + } + return true; +} + +// construct a MAX macro definition string and predefine this macro +template <typename T, typename Context> +inline bool +testwave_app::add_max_definition(Context& ctx, char const *name) +{ + BOOST_WAVETEST_OSSTREAM strm; + if (!std::numeric_limits<T>::is_signed) { + strm << "__TESTWAVE_" << name << "_MAX__=" + << "0x" << std::hex + << (std::numeric_limits<T>::max)() << "U"; + } + else { + strm << "__TESTWAVE_" << name << "_MAX__=" + << (std::numeric_limits<T>::max)(); + } + + std::string macro(BOOST_WAVETEST_GETSTRING(strm)); + if (!ctx.add_macro_definition(macro, true)) { + std::cerr << "testwave: failed to predefine macro: " << macro + << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "add_max_definition: predefined macro: " << macro + << std::endl; + } + return true; +} + +// Predefine __TESTWAVE_HAS_STRICT_LEXER__ +template <typename Context> +inline bool +testwave_app::add_strict_lexer_definition(Context& ctx) +{ + std::string macro("__TESTWAVE_HAS_STRICT_LEXER__=1"); + if (!ctx.add_macro_definition(macro, true)) { + std::cerr << "testwave: failed to predefine macro: " << macro + << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "add_strict_lexer_definition: predefined macro: " << macro + << std::endl; + } + return true; +} + +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS +// Predefine __TESTWAVE_SUPPORT_MS_EXTENSIONS__ +template <typename Context> +inline bool +testwave_app::add_support_ms_extensions_definition(Context& ctx) +{ + std::string macro("__TESTWAVE_SUPPORT_MS_EXTENSIONS__=1"); + if (!ctx.add_macro_definition(macro, true)) { + std::cerr << "testwave: failed to predefine macro: " << macro + << std::endl; + return false; + } + else if (9 == debuglevel) { + std::cerr << "add_support_ms_extensions_definition: predefined macro: " + << macro + << std::endl; + } + return true; +} +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Add special predefined macros to the context object. +// +// This adds a lot of macros to the test environment, which allows to adjust +// the test cases for different platforms. +// +/////////////////////////////////////////////////////////////////////////////// +template <typename Context> +bool +testwave_app::add_predefined_macros(Context& ctx) +{ + // add the __TESTWAVE_SIZEOF_<type>__ macros + if (!add_sizeof_definition(ctx, "CHAR", sizeof(char)) || + !add_sizeof_definition(ctx, "SHORT", sizeof(short)) || + !add_sizeof_definition(ctx, "INT", sizeof(int)) || +#if defined(BOOST_HAS_LONG_LONG) + !add_sizeof_definition(ctx, "LONGLONG", sizeof(boost::long_long_type)) || +#endif + !add_sizeof_definition(ctx, "LONG", sizeof(long))) + { + std::cerr << "testwave: failed to add a predefined macro (SIZEOF)." + << std::endl; + return false; + } + + // add the __TESTWAVE_<type>_MIN__ macros + if (/*!add_min_definition<char>(ctx, "CHAR") ||*/ + /*!add_min_definition<unsigned char>(ctx, "UCHAR") ||*/ + !add_min_definition<short>(ctx, "SHORT") || + !add_min_definition<unsigned short>(ctx, "USHORT") || + !add_min_definition<int>(ctx, "INT") || + !add_min_definition<unsigned int>(ctx, "UINT") || +#if defined(BOOST_HAS_LONG_LONG) + !add_min_definition<boost::long_long_type>(ctx, "LONGLONG") || + !add_min_definition<boost::ulong_long_type>(ctx, "ULONGLONG") || +#endif + !add_min_definition<long>(ctx, "LONG") || + !add_min_definition<unsigned long>(ctx, "ULONG")) + { + std::cerr << "testwave: failed to add a predefined macro (MIN)." + << std::endl; + } + + // add the __TESTWAVE_<type>_MAX__ macros + if (/*!add_max_definition<char>(ctx, "CHAR") ||*/ + /*!add_max_definition<unsigned char>(ctx, "UCHAR") ||*/ + !add_max_definition<short>(ctx, "SHORT") || + !add_max_definition<unsigned short>(ctx, "USHORT") || + !add_max_definition<int>(ctx, "INT") || + !add_max_definition<unsigned int>(ctx, "UINT") || +#if defined(BOOST_HAS_LONG_LONG) + !add_max_definition<boost::long_long_type>(ctx, "LONGLONG") || + !add_max_definition<boost::ulong_long_type>(ctx, "ULONGLONG") || +#endif + !add_max_definition<long>(ctx, "LONG") || + !add_max_definition<unsigned long>(ctx, "ULONG")) + { + std::cerr << "testwave: failed to add a predefined macro (MAX)." + << std::endl; + } + +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS +// Predefine __TESTWAVE_SUPPORT_MS_EXTENSIONS__ + if (!add_support_ms_extensions_definition(ctx)) + { + std::cerr << "testwave: failed to add a predefined macro " + "(__TESTWAVE_SUPPORT_MS_EXTENSIONS__)." + << std::endl; + } +#endif + +#if BOOST_WAVE_USE_STRICT_LEXER != 0 + return add_strict_lexer_definition(ctx); +#else + return true; +#endif +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Preprocess the given input data and return the generated output through +// the parameter 'result'. +// +/////////////////////////////////////////////////////////////////////////////// +bool +testwave_app::preprocess_file(std::string filename, std::string const& instr, + std::string& result, std::string& error, std::string& hooks, + std::string const& expected_cfg_macro, bool single_line) +{ +// create the wave::context object and initialize it from the file to +// preprocess (may contain options inside of special comments) + typedef boost::wave::cpplexer::lex_token<> token_type; + typedef boost::wave::cpplexer::lex_iterator<token_type> lexer_type; + typedef boost::wave::context< + std::string::const_iterator, lexer_type, + boost::wave::iteration_context_policies::load_file_to_string, + collect_hooks_information<token_type> > + context_type; + + if (9 == debuglevel) { + std::cerr << "preprocess_file: preprocessing input file: " << filename + << std::endl; + } + + try { + // create preprocessing context + context_type ctx(instr.begin(), instr.end(), filename.c_str(), + collect_hooks_information<token_type>(hooks)); + + // initialize the context from the options given on the command line + if (!initialise_options(ctx, global_vm, single_line)) + return false; + + // extract the options from the input data and initialize the context + boost::program_options::variables_map local_vm; + if (!extract_options(filename, instr, ctx, single_line, local_vm)) + return false; + + // add special predefined macros + if (!add_predefined_macros(ctx)) + return false; + + if (!expected_cfg_macro.empty() && + !ctx.is_defined_macro(expected_cfg_macro)) + { + // skip this test as it is for a disabled configuration + return false; + } + + // preprocess the input, loop over all generated tokens collecting the + // generated text + context_type::iterator_type it = ctx.begin(); + context_type::iterator_type end = ctx.end(); + + if (local_vm.count("forceinclude")) { + // add the filenames to force as include files in _reverse_ order + // the second parameter 'is_last' of the force_include function should + // be set to true for the last (first given) file. + std::vector<std::string> const &force = + local_vm["forceinclude"].as<std::vector<std::string> >(); + std::vector<std::string>::const_reverse_iterator rend = force.rend(); + for (std::vector<std::string>::const_reverse_iterator cit = force.rbegin(); + cit != rend; /**/) + { + std::string forceinclude(*cit); + if (9 == debuglevel) { + std::cerr << "preprocess_file: option: forceinclude (" + << forceinclude << ")" << std::endl; + } + it.force_include(forceinclude.c_str(), ++cit == rend); + } + } + + // perform actual preprocessing + for (/**/; it != end; ++it) + { + using namespace boost::wave; + + if (T_PP_LINE == token_id(*it)) { + // special handling of the whole #line directive is required to + // allow correct file name matching + if (!handle_line_directive(it, end, result)) + return false; // unexpected eof + } + else { + // add the value of the current token + result = result + (*it).get_value().c_str(); + } + } + error.clear(); + } + catch (boost::wave::cpplexer::lexing_exception const& e) { + // some lexer error + BOOST_WAVETEST_OSSTREAM strm; + std::string filename = e.file_name(); + strm + << handle_filepath(filename) << "(" << e.line_no() << "): " + << e.description() << std::endl; + + error = BOOST_WAVETEST_GETSTRING(strm); + return false; + } + catch (boost::wave::cpp_exception const& e) { + // some preprocessing error + BOOST_WAVETEST_OSSTREAM strm; + std::string filename = e.file_name(); + strm + << handle_filepath(filename) << "(" << e.line_no() << "): " + << e.description() << std::endl; + + error = BOOST_WAVETEST_GETSTRING(strm); + return false; + } + + if (9 == debuglevel) { + std::cerr << "preprocess_file: succeeded to preprocess input file: " + << filename << std::endl; + } + + return true; +} + diff --git a/src/boost/libs/wave/test/testwave/testwave_app.hpp b/src/boost/libs/wave/test/testwave/testwave_app.hpp new file mode 100644 index 000000000..755b6a103 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testwave_app.hpp @@ -0,0 +1,135 @@ +/*============================================================================= + 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) +=============================================================================*/ + +#if !defined(BOOST_WAVE_LIBS_WAVE_TEST_TESTWAVE_APP_HPP) +#define BOOST_WAVE_LIBS_WAVE_TEST_TESTWAVE_APP_HPP + +#include <string> +#include <vector> + +// include boost +#include <boost/config.hpp> + +#include "cmd_line_utils.hpp" + +/////////////////////////////////////////////////////////////////////////////// +class testwave_app +{ +public: + testwave_app(boost::program_options::variables_map const& vm); + + // Test the given file (i.e. preprocess the file and compare the result + // against the embedded 'R' comments, if an error occurs compare the error + // message against the given 'E' comments). + bool test_a_file(std::string filename); + + // print the current version of this program + int print_version(); + + // print the copyright statement + int print_copyright(); + + // access the common options used for the command line and the config + // options inside the test files + boost::program_options::options_description const& common_options() const + { + return desc_options; + } + + void set_debuglevel(int debuglevel_) + { + debuglevel = debuglevel_; + } + int get_debuglevel() const + { + return debuglevel; + } + +protected: + // Read the given file into a string + bool read_file(std::string const& filename, std::string& instr); + + // Extract special information from comments marked with the given letter + bool extract_special_information(std::string const& filename, + std::string const& instr, char flag, std::string& content); + + // Extract the expected output and expected hooks information from the + // given input data. + // The expected output has to be provided inside of special comments which + // start with a capital 'R' ('H' for the hooks information). All such + // comments are concatenated and returned through the parameter 'expected' + // ('expectedhooks' for hooks information). + bool extract_expected_output(std::string const& filename, + std::string const& instr, std::string& expected, + std::string& expectedhooks); + + // Extracts the required preprocessing options from the given input data + // and initializes the given Wave context object accordingly. + // We allow the same (applicable) options to be used as are valid for the + // wave driver executable. + template <typename Context> + bool extract_options(std::string const& filename, + std::string const& instr, Context& ctx, bool single_line, + boost::program_options::variables_map& vm); + + // transfers the options collected in the vm parameter into the given + // context + template <typename Context> + bool initialise_options(Context& ctx, + boost::program_options::variables_map const& vm, bool single_line); + + // Preprocess the given input data and return the generated output through + // the parameter 'result'. + bool preprocess_file(std::string filename, std::string const& instr, + std::string& result, std::string& error, std::string& hooks, + std::string const& expected_cfg_macro, bool single_line = false); + + // Add special predefined macros to the context object + template <typename Context> + bool add_predefined_macros(Context& ctx); + + // This function compares the real result and the expected one but first + // replaces all occurrences in the expected result of + // $E: to the result of preprocessing the given expression + // $F: to the passed full filepath + // $P: to the full path + // $R: to the relative path + // $V: to the current Boost version number + bool got_expected_result(std::string const& filename, + std::string const& result, std::string& expected); + + // construct a SIZEOF macro definition string and predefine this macro + template <typename Context> + bool add_sizeof_definition(Context& ctx, char const *name, int value); + + // construct a MIN macro definition string and predefine this macro + template <typename T, typename Context> + bool add_min_definition(Context& ctx, char const *name); + + // construct a MAX macro definition string and predefine this macro + template <typename T, typename Context> + bool add_max_definition(Context& ctx, char const *name); + + // Predefine __TESTWAVE_HAS_STRICT_LEXER__ + template <typename Context> + bool add_strict_lexer_definition(Context& ctx); + +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS + // Predefine __TESTWAVE_SUPPORT_MS_EXTENSIONS__ + template <typename Context> + bool add_support_ms_extensions_definition(Context& ctx); +#endif + +private: + int debuglevel; + boost::program_options::options_description desc_options; + boost::program_options::variables_map const& global_vm; +}; + +#endif // !defined(BOOST_WAVE_LIBS_WAVE_TEST_TESTWAVE_APP_HPP) diff --git a/src/boost/libs/wave/test/testwave/testwave_app_dll.cpp b/src/boost/libs/wave/test/testwave/testwave_app_dll.cpp new file mode 100644 index 000000000..ccc194831 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testwave_app_dll.cpp @@ -0,0 +1,13 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// This file is necessary only because Boost.Build V2 isn't able to handle +// several testcases using the same source files. + +#include "testwave_app.cpp" diff --git a/src/boost/libs/wave/test/testwave/testwave_dll.cpp b/src/boost/libs/wave/test/testwave/testwave_dll.cpp new file mode 100644 index 000000000..ac671b392 --- /dev/null +++ b/src/boost/libs/wave/test/testwave/testwave_dll.cpp @@ -0,0 +1,13 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +// This file is necessary only because Boost.Build V2 isn't able to handle +// several testcases using the same source files. + +#include "testwave.cpp" diff --git a/src/boost/libs/wave/tool/build/Jamfile.v2 b/src/boost/libs/wave/tool/build/Jamfile.v2 new file mode 100644 index 000000000..e7d911140 --- /dev/null +++ b/src/boost/libs/wave/tool/build/Jamfile.v2 @@ -0,0 +1,73 @@ +# Wave: A Standard compliant C++ preprocessor +# +# Boost Wave Library Build Jamfile +# +# http://www.boost.org/ +# +# Copyright (c) 2001-2010 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) + +# Make sure all of Wave is compiled with threading disabled. We still need +# to link with Boost.Thread, but no multi-threaded features are being used +# in the Wave tool anyway. + +import feature ; +import option ; + +feature.feature wavetool + : on + : optional composite propagated + ; + +feature.compose <wavetool>on + : <define>BOOST_WAVE_SUPPORT_THREADING=0 + ; + +############################################################################### +project + : requirements + <toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE + <toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE + ; + +exe wave + : + ../cpp.cpp + /boost//wave + /boost//program_options + /boost//filesystem + /boost//serialization + /boost//system + /boost//thread + /boost//date_time + : + <threading>multi +# <debug-symbols>on + <wavetool>on + : + release + ; + +local bindir = [ option.get bindir : ../../../dist/bin ] ; +local libdir = [ option.get libdir : ../../../dist/lib ] ; + +install dist-bin + : + wave + : + <install-type>EXE + <location>$(bindir) + : + release + ; + +install dist-lib + : + wave + : + <install-type>LIB + <location>$(libdir) + : + release + ; diff --git a/src/boost/libs/wave/tool/cpp.cpp b/src/boost/libs/wave/tool/cpp.cpp new file mode 100644 index 000000000..36988a6ba --- /dev/null +++ b/src/boost/libs/wave/tool/cpp.cpp @@ -0,0 +1,1508 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#define BOOST_WAVE_SERIALIZATION 0 // enable serialization +#define BOOST_WAVE_BINARY_SERIALIZATION 0 // use binary archives +#define BOOST_WAVE_XML_SERIALIZATION 1 // use XML archives + +#include "cpp.hpp" // global configuration + +/////////////////////////////////////////////////////////////////////////////// +// Include additional Boost libraries +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/convenience.hpp> +#include <boost/filesystem/fstream.hpp> +#include <boost/timer.hpp> +#include <boost/any.hpp> +#include <boost/algorithm/cxx11/any_of.hpp> +#include <boost/algorithm/string/join.hpp> +#include <boost/range/algorithm/find.hpp> +#include <boost/range/end.hpp> +#include <boost/foreach.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include Wave itself +#include <boost/wave.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// Include the lexer related stuff +#include <boost/wave/cpplexer/cpp_lex_token.hpp> // token type +#include <boost/wave/cpplexer/cpp_lex_iterator.hpp> // lexer type + +/////////////////////////////////////////////////////////////////////////////// +// Include serialization support, if requested +#if BOOST_WAVE_SERIALIZATION != 0 +#include <boost/serialization/serialization.hpp> +#if BOOST_WAVE_BINARY_SERIALIZATION != 0 +#include <boost/archive/binary_iarchive.hpp> +#include <boost/archive/binary_oarchive.hpp> +typedef boost::archive::binary_iarchive iarchive; +typedef boost::archive::binary_oarchive oarchive; +#elif BOOST_WAVE_XML_SERIALIZATION != 0 +#include <boost/archive/xml_iarchive.hpp> +#include <boost/archive/xml_oarchive.hpp> +typedef boost::archive::xml_iarchive iarchive; +typedef boost::archive::xml_oarchive oarchive; +#else +#include <boost/archive/text_iarchive.hpp> +#include <boost/archive/text_oarchive.hpp> +typedef boost::archive::text_iarchive iarchive; +typedef boost::archive::text_oarchive oarchive; +#endif +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Include the context policies to use +#include "trace_macro_expansion.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// Include lexer specifics, import lexer names +#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION == 0 +#include <boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp> +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Include the grammar definitions, if these shouldn't be compiled separately +// (ATTENTION: _very_ large compilation times!) +#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION == 0 +#include <boost/wave/grammars/cpp_intlit_grammar.hpp> +#include <boost/wave/grammars/cpp_chlit_grammar.hpp> +#include <boost/wave/grammars/cpp_grammar.hpp> +#include <boost/wave/grammars/cpp_expression_grammar.hpp> +#include <boost/wave/grammars/cpp_predef_macros_grammar.hpp> +#include <boost/wave/grammars/cpp_defined_grammar.hpp> +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Import required names +using namespace boost::spirit::classic; + +using std::pair; +using std::vector; +using std::getline; +using boost::filesystem::ofstream; +using boost::filesystem::ifstream; +using std::cout; +using std::cerr; +using std::endl; +using std::ostream; +using std::istreambuf_iterator; + +/////////////////////////////////////////////////////////////////////////////// +// +// This application uses the lex_iterator and lex_token types predefined +// with the Wave library, but it is possible to use your own types. +// +// You may want to have a look at the other samples to see how this is +// possible to achieve. + typedef boost::wave::cpplexer::lex_token<> token_type; + typedef boost::wave::cpplexer::lex_iterator<token_type> + lex_iterator_type; + +// The C++ preprocessor iterators shouldn't be constructed directly. They +// are to be generated through a boost::wave::context<> object. This +// boost::wave::context object is additionally to be used to initialize and +// define different parameters of the actual preprocessing. + typedef boost::wave::context< + std::string::iterator, lex_iterator_type, + boost::wave::iteration_context_policies::load_file_to_string, + trace_macro_expansion<token_type> > + context_type; + +/////////////////////////////////////////////////////////////////////////////// +// print the current version +std::string get_version() +{ + std::string version (context_type::get_version_string()); + version = version.substr(1, version.size()-2); // strip quotes + version += std::string(" (" CPP_VERSION_DATE_STR ")"); // add date + return version; +} + +/////////////////////////////////////////////////////////////////////////////// +// print the current version for interactive sessions +int print_interactive_version() +{ + cout << "Wave: A Standard conformant C++ preprocessor based on the Boost.Wave library" << endl; + cout << "Version: " << get_version() << endl; + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// print the copyright statement +int print_copyright() +{ + char const *copyright[] = { + "", + "Wave: A Standard conformant C++ preprocessor based on the Boost.Wave library", + "http://www.boost.org/", + "", + "Copyright (c) 2001-2012 Hartmut Kaiser, Distributed under the Boost", + "Software License, Version 1.0. (See accompanying file", + "LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)", + 0 + }; + + for (int i = 0; 0 != copyright[i]; ++i) + cout << copyright[i] << endl; + + return 0; // exit app +} + +/////////////////////////////////////////////////////////////////////////////// +// forward declarations only +namespace cmd_line_utils +{ + class include_paths; +} + +namespace boost { namespace program_options { + + void validate(boost::any &v, std::vector<std::string> const &s, + cmd_line_utils::include_paths *, long); + +}} // boost::program_options + +/////////////////////////////////////////////////////////////////////////////// +#include <boost/program_options.hpp> + +namespace po = boost::program_options; +namespace fs = boost::filesystem; + +/////////////////////////////////////////////////////////////////////////////// +namespace cmd_line_utils { + // Additional command line parser which interprets '@something' as an + // option "config-file" with the value "something". + inline pair<std::string, std::string> + at_option_parser(std::string const&s) + { + if ('@' == s[0]) + return std::make_pair(std::string("config-file"), s.substr(1)); + else + return pair<std::string, std::string>(); + } + + // class, which keeps include file information read from the command line + class include_paths { + public: + include_paths() : seen_separator(false) {} + + vector<std::string> paths; // stores user paths + vector<std::string> syspaths; // stores system paths + bool seen_separator; // command line contains a '-I-' option + + // Function which validates additional tokens from command line. + static void + validate(boost::any &v, vector<std::string> const &tokens) + { + if (v.empty()) + v = boost::any(include_paths()); + + include_paths *p = boost::any_cast<include_paths>(&v); + + BOOST_ASSERT(p); + // Assume only one path per '-I' occurrence. + std::string const& t = po::validators::get_single_string(tokens); + if (t == "-") { + // found -I- option, so switch behaviour + p->seen_separator = true; + } + else if (p->seen_separator) { + // store this path as a system path + p->syspaths.push_back(t); + } + else { + // store this path as an user path + p->paths.push_back(t); + } + } + }; + + // Read all options from a given config file, parse and add them to the + // given variables_map + bool read_config_file_options(std::string const &filename, + po::options_description const &desc, po::variables_map &vm, + bool may_fail = false) + { + ifstream ifs(filename.c_str()); + + if (!ifs.is_open()) { + if (!may_fail) { + cerr << filename + << ": command line warning: config file not found" + << endl; + } + return false; + } + + vector<std::string> options; + std::string line; + + while (std::getline(ifs, line)) { + // skip empty lines + std::string::size_type pos = line.find_first_not_of(" \t"); + if (pos == std::string::npos) + continue; + + // skip comment lines + if ('#' != line[pos]) { + // strip leading and trailing whitespace + std::string::size_type endpos = line.find_last_not_of(" \t"); + BOOST_ASSERT(endpos != std::string::npos); + options.push_back(line.substr(pos, endpos-pos+1)); + } + } + + if (options.size() > 0) { + using namespace boost::program_options::command_line_style; + po::store(po::command_line_parser(options) + .options(desc).style(unix_style).run(), vm); + po::notify(vm); + } + return true; + } + + // predicate to extract all positional arguments from the command line + struct is_argument { + bool operator()(po::option const &opt) + { + return (opt.position_key == -1) ? true : false; + } + }; + + // trim quotes from path names, if any + std::string trim_quotes(std::string const& file) + { + if (('"' == file[0] || '\'' == file[0]) && file[0] == file[file.size()-1]) + { + return file.substr(1, file.size()-2); + } + return file; + } + +/////////////////////////////////////////////////////////////////////////////// +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Special validator overload, which allows to handle the -I- syntax for +// switching the semantics of an -I option. +// +/////////////////////////////////////////////////////////////////////////////// +namespace boost { namespace program_options { + + void validate(boost::any &v, std::vector<std::string> const &s, + cmd_line_utils::include_paths *, long) + { + cmd_line_utils::include_paths::validate(v, s); + } + +}} // namespace boost::program_options + +/////////////////////////////////////////////////////////////////////////////// +namespace { + + class auto_stop_watch : public stop_watch + { + public: + auto_stop_watch(std::ostream &outstrm_) + : print_time(false), outstrm(outstrm_) + { + } + + ~auto_stop_watch() + { + if (print_time) { + outstrm << "Elapsed time: " + << this->format_elapsed_time() + << std::endl; + } + } + + void set_print_time(bool print_time_) + { + print_time = print_time_; + } + + private: + bool print_time; + std::ostream &outstrm; + }; + + /////////////////////////////////////////////////////////////////////////// + inline std::string + report_iostate_error(std::ios::iostate state) + { + BOOST_ASSERT(state & (std::ios::badbit | std::ios::failbit | std::ios::eofbit)); + std::string result; + if (state & std::ios::badbit) { + result += " the reported problem was: " + "loss of integrity of the stream buffer\n"; + } + if (state & std::ios::failbit) { + result += " the reported problem was: " + "an operation was not processed correctly\n"; + } + if (state & std::ios::eofbit) { + result += " the reported problem was: " + "end-of-file while writing to the stream\n"; + } + return result; + } + + /////////////////////////////////////////////////////////////////////////// + // Retrieve the position of a macro definition + template <typename Context> + inline bool + get_macro_position(Context &ctx, + typename Context::token_type::string_type const& name, + typename Context::position_type &pos) + { + bool has_parameters = false; + bool is_predefined = false; + std::vector<typename Context::token_type> parameters; + typename Context::token_sequence_type definition; + + return ctx.get_macro_definition(name, has_parameters, is_predefined, + pos, parameters, definition); + } + + /////////////////////////////////////////////////////////////////////////// + // Generate some meaningful error messages + template <typename Exception> + inline int + report_error_message(Exception const &e, bool treat_warnings_as_error) + { + // default error reporting + cerr + << e.file_name() << ":" << e.line_no() << ":" << e.column_no() + << ": " << e.description() << endl; + + // errors count as one + return (treat_warnings_as_error || + e.get_severity() == boost::wave::util::severity_error || + e.get_severity() == boost::wave::util::severity_fatal) ? 1 : 0; + } + + template <typename Context> + inline int + report_error_message(Context &ctx, boost::wave::cpp_exception const &e, + bool treat_warnings_as_error) + { + // default error reporting + int result = report_error_message(e, treat_warnings_as_error); + + using boost::wave::preprocess_exception; + switch(e.get_errorcode()) { + case preprocess_exception::macro_redefinition: + { + // report the point of the initial macro definition + typename Context::position_type pos; + if (get_macro_position(ctx, e.get_related_name(), pos)) { + cerr + << pos << ": " + << preprocess_exception::severity_text(e.get_severity()) + << ": this is the location of the previous definition." + << endl; + } + else { + cerr + << e.file_name() << ":" << e.line_no() << ":" + << e.column_no() << ": " + << preprocess_exception::severity_text(e.get_severity()) + << ": not able to retrieve the location of the previous " + << "definition." << endl; + } + } + break; + + default: + break; + } + + return result; + } + + /////////////////////////////////////////////////////////////////////////// + // Read one logical line of text + inline bool + read_a_line (std::istream &instream, std::string &instring) + { + bool eol = true; + do { + std::string line; + std::getline(instream, line); + if (instream.rdstate() & std::ios::failbit) + return false; // nothing to do + + eol = true; + if (line.find_last_of('\\') == line.size()-1) + eol = false; + + instring += line + '\n'; + } while (!eol); + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // Load and save the internal tables of the wave::context object + template <typename Context> + inline void + load_state(po::variables_map const &vm, Context &ctx) + { +#if BOOST_WAVE_SERIALIZATION != 0 + try { + if (vm.count("state") > 0) { + fs::path state_file ( + boost::wave::util::create_path(vm["state"].as<std::string>())); + if (state_file == "-") + state_file = boost::wave::util::create_path("wave.state"); + + std::ios::openmode mode = std::ios::in; + +#if BOOST_WAVE_BINARY_SERIALIZATION != 0 + mode = (std::ios::openmode)(mode | std::ios::binary); +#endif + ifstream ifs (state_file.string().c_str(), mode); + if (ifs.is_open()) { + 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 + else { + cerr << "wave: detected version mismatch while loading state, state was not loaded." << endl; + cerr << " loaded version: " << version << endl; + cerr << " expected version: " << CPP_VERSION_FULL_STR << endl; + } + } + } + } + catch (boost::archive::archive_exception const& e) { + cerr << "wave: error while loading state: " + << e.what() << endl; + } + catch (boost::wave::preprocess_exception const& e) { + cerr << "wave: error while loading state: " + << e.description() << endl; + } +#endif + } + + template <typename Context> + inline void + save_state(po::variables_map const &vm, Context const &ctx) + { +#if BOOST_WAVE_SERIALIZATION != 0 + try { + if (vm.count("state") > 0) { + fs::path state_file (boost::wave::util::create_path( + vm["state"].as<std::string>())); + if (state_file == "-") + state_file = boost::wave::util::create_path("wave.state"); + + std::ios::openmode mode = std::ios::out; + +#if BOOST_WAVE_BINARY_SERIALIZATION != 0 + mode = (std::ios::openmode)(mode | std::ios::binary); +#endif + ofstream ofs(state_file.string().c_str(), mode); + if (!ofs.is_open()) { + cerr << "wave: could not open state file for writing: " + << state_file.string() << endl; + // this is non-fatal + } + else { + using namespace boost::serialization; + oarchive oa(ofs); + std::string version(CPP_VERSION_FULL_STR); + oa << make_nvp("version", version); // write version + oa << make_nvp("state", ctx); // write the internal tables to disc + } + } + } + catch (boost::archive::archive_exception const& e) { + cerr << "wave: error while writing state: " + << e.what() << endl; + } +#endif + } + + /////////////////////////////////////////////////////////////////////////// + // list all defined macros + bool list_macro_names(context_type const& ctx, std::string filename) + { + // open file for macro names listing + ofstream macronames_out; + fs::path macronames_file (boost::wave::util::create_path(filename)); + + if (macronames_file != "-") { + macronames_file = boost::wave::util::complete_path(macronames_file); + boost::wave::util::create_directories( + boost::wave::util::branch_path(macronames_file)); + macronames_out.open(macronames_file.string().c_str()); + if (!macronames_out.is_open()) { + cerr << "wave: could not open file for macro name listing: " + << macronames_file.string() << endl; + return false; + } + } + else { + macronames_out.copyfmt(cout); + macronames_out.clear(cout.rdstate()); + static_cast<std::basic_ios<char> &>(macronames_out).rdbuf(cout.rdbuf()); + } + + // simply list all defined macros and its definitions + typedef context_type::const_name_iterator name_iterator; + name_iterator end = ctx.macro_names_end(); + for (name_iterator it = ctx.macro_names_begin(); it != end; ++it) + { + typedef std::vector<context_type::token_type> parameters_type; + + bool has_pars = false; + bool predef = false; + context_type::position_type pos; + parameters_type pars; + context_type::token_sequence_type def; + + if (ctx.get_macro_definition(*it, has_pars, predef, pos, pars, def)) + { + macronames_out << (predef ? "-P" : "-D") << *it; + if (has_pars) { + // list the parameter names for function style macros + macronames_out << "("; + parameters_type::const_iterator pend = pars.end(); + for (parameters_type::const_iterator pit = pars.begin(); + pit != pend; /**/) + { + macronames_out << (*pit).get_value(); + if (++pit != pend) + macronames_out << ", "; + } + macronames_out << ")"; + } + macronames_out << "="; + + // print the macro definition + context_type::token_sequence_type::const_iterator dend = def.end(); + for (context_type::token_sequence_type::const_iterator dit = def.begin(); + dit != dend; ++dit) + { + macronames_out << (*dit).get_value(); + } + + macronames_out << std::endl; + } + } + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // list macro invocation counts + bool list_macro_counts(context_type const& ctx, std::string filename) + { + // open file for macro invocation count listing + ofstream macrocounts_out; + fs::path macrocounts_file (boost::wave::util::create_path(filename)); + + if (macrocounts_file != "-") { + macrocounts_file = boost::wave::util::complete_path(macrocounts_file); + boost::wave::util::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<std::basic_ios<char> &>(macrocounts_out).rdbuf(cout.rdbuf()); + } + + // list all expanded macro names and their counts in alphabetical order + std::map<std::string, std::size_t> const& counts = + ctx.get_hooks().get_macro_counts(); + + typedef std::map<std::string, std::size_t>::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; + } + + /////////////////////////////////////////////////////////////////////////// + // read all of a file into a string + std::string read_entire_file(std::istream& instream) + { + std::string content; + + instream.unsetf(std::ios::skipws); + +#if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) + // this is known to be very slow for large files on some systems + copy (std::istream_iterator<char>(instream), + std::istream_iterator<char>(), + std::inserter(content, content.end())); +#else + content = std::string(std::istreambuf_iterator<char>(instream.rdbuf()), + std::istreambuf_iterator<char>()); +#endif + return content; + } +} // anonymous namespace + +/////////////////////////////////////////////////////////////////////////////// +// do the actual preprocessing +int +do_actual_work (std::string file_name, std::istream &instream, + po::variables_map const &vm, bool input_is_stdin) +{ +// current file position is saved for exception handling +boost::wave::util::file_position_type current_position; +auto_stop_watch elapsed_time(cerr); +int error_count = 0; +const bool treat_warnings_as_error = vm.count("warning") && + boost::algorithm::any_of_equal( + vm["warning"].as<std::vector<std::string> >(), "error"); + + try { + // process the given file + std::string instring; + + instream.unsetf(std::ios::skipws); + if (!input_is_stdin) + instring = read_entire_file(instream); + + // The preprocessing of the input stream is done on the fly behind the + // scenes during iteration over the context_type::iterator_type stream. + ofstream output; + ofstream traceout; + ofstream includelistout; + ofstream listguardsout; + + 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<std::string>())); + + if (trace_file != "-") { + boost::wave::util::create_directories( + boost::wave::util::branch_path(trace_file)); + traceout.open(trace_file.string().c_str()); + if (!traceout.is_open()) { + cerr << "wave: could not open trace file: " << trace_file + << endl; + return -1; + } + } + enable_trace = trace_macros; + } + if ((enable_trace & trace_macros) && !traceout.is_open()) { + // by default trace to std::cerr + traceout.copyfmt(cerr); + traceout.clear(cerr.rdstate()); + static_cast<std::basic_ios<char> &>(traceout).rdbuf(cerr.rdbuf()); + } + + // Open the stream where to output the list of included file names + if (vm.count("listincludes")) { + // try to open the file, where to put the include list + fs::path includes_file(boost::wave::util::create_path( + vm["listincludes"].as<std::string>())); + + if (includes_file != "-") { + boost::wave::util::create_directories( + boost::wave::util::branch_path(includes_file)); + includelistout.open(includes_file.string().c_str()); + if (!includelistout.is_open()) { + cerr << "wave: could not open include list file: " + << includes_file.string() << endl; + return -1; + } + } + enable_trace = trace_flags(enable_trace | trace_includes); + } + if ((enable_trace & trace_includes) && !includelistout.is_open()) { + // by default list included names to std::cout + includelistout.copyfmt(cout); + includelistout.clear(cout.rdstate()); + static_cast<std::basic_ios<char> &>(includelistout). + rdbuf(cout.rdbuf()); + } + + // Open the stream where to output the list of included file names + if (vm.count("listguards")) { + // try to open the file, where to put the include list + fs::path listguards_file(boost::wave::util::create_path( + vm["listguards"].as<std::string>())); + + if (listguards_file != "-") { + boost::wave::util::create_directories( + boost::wave::util::branch_path(listguards_file)); + listguardsout.open(listguards_file.string().c_str()); + if (!listguardsout.is_open()) { + cerr << "wave: could not open include guard list file: " + << listguards_file.string() << endl; + return -1; + } + } + enable_trace = trace_flags(enable_trace | trace_guards); + } + if ((enable_trace & trace_guards) && !listguardsout.is_open()) { + // by default list included names to std::cout + listguardsout.copyfmt(cout); + listguardsout.clear(cout.rdstate()); + static_cast<std::basic_ios<char> &>(listguardsout). + rdbuf(cout.rdbuf()); + } + + // enable preserving comments mode + bool preserve_comments = false; + bool preserve_whitespace = false; + bool preserve_bol_whitespace = false; + + if (vm.count("preserve")) { + int preserve = vm["preserve"].as<int>(); + + switch(preserve) { + case 0: break; // preserve no whitespace + case 3: // preserve all whitespace + preserve_whitespace = true; + preserve_comments = true; + preserve_bol_whitespace = true; + break; + + case 2: // preserve comments and BOL whitespace only + preserve_comments = true; + preserve_bol_whitespace = true; + break; + + case 1: // preserve BOL whitespace only + preserve_bol_whitespace = true; + break; + + default: + cerr << "wave: bogus preserve whitespace option value: " + << preserve << ", should be 0, 1, 2, or 3" << endl; + return -1; + } + } + + // 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 + std::string default_outfile; // will be used from inside the hooks object + trace_macro_expansion<token_type> hooks(preserve_whitespace, + preserve_bol_whitespace, output, traceout, includelistout, + listguardsout, enable_trace, enable_system_command, allow_output, + default_outfile); + + // enable macro invocation count, if appropriate + if (vm.count("macrocounts")) + hooks.enable_macro_counting(); + + // check, if we have a license file to prepend + std::string license; + + if (vm.count ("license")) { + // try to open the file, where to put the preprocessed output + std::string license_file(vm["license"].as<std::string>()); + ifstream license_stream(license_file.c_str()); + + if (!license_stream.is_open()) { + cerr << "wave: could not open specified license file: " + << license_file << endl; + return -1; + } + license = read_entire_file(license_stream); + hooks.set_license_info(license); + } + + context_type ctx (instring.begin(), instring.end(), file_name.c_str(), hooks); + +#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 + // enable C99 mode, if appropriate (implies variadics) + if (vm.count("c99")) { +#if BOOST_WAVE_SUPPORT_CPP0X != 0 + if (vm.count("c++11")) { + cerr << "wave: multiple language options specified: --c99 " + "and --c++11" << endl; + return -1; + } +#endif + ctx.set_language( + boost::wave::language_support( + boost::wave::support_c99 + | boost::wave::support_option_convert_trigraphs + | boost::wave::support_option_emit_line_directives +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + | boost::wave::support_option_include_guard_detection +#endif +#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0 + | boost::wave::support_option_emit_pragma_directives +#endif + | boost::wave::support_option_insert_whitespace + )); + } + else if (vm.count("variadics")) { + // enable variadics and placemarkers, if appropriate + ctx.set_language(boost::wave::enable_variadics(ctx.get_language())); + } +#endif // BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 +#if BOOST_WAVE_SUPPORT_CPP0X != 0 + if (vm.count("c++11")) { + if (vm.count("c99")) { + cerr << "wave: multiple language options specified: --c99 " + "and --c++11" << endl; + return -1; + } + ctx.set_language( + boost::wave::language_support( + boost::wave::support_cpp0x + | boost::wave::support_option_convert_trigraphs + | boost::wave::support_option_long_long + | boost::wave::support_option_emit_line_directives +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + | boost::wave::support_option_include_guard_detection +#endif +#if BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES != 0 + | boost::wave::support_option_emit_pragma_directives +#endif + | boost::wave::support_option_insert_whitespace + )); + } +#endif // BOOST_WAVE_SUPPORT_CPP0X != 0 + + // enable long long support, if appropriate + if (vm.count("long_long")) { + ctx.set_language( + boost::wave::enable_long_long(ctx.get_language())); + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 +// disable include guard detection + if (vm.count("noguard")) { + ctx.set_language( + boost::wave::enable_include_guard_detection( + ctx.get_language(), false)); + } +#endif + + // enable preserving comments mode + if (preserve_comments) { + ctx.set_language( + boost::wave::enable_preserve_comments(ctx.get_language())); + } + + // control the generation of #line directives + if (vm.count("line")) { + int lineopt = vm["line"].as<int>(); + if (0 != lineopt && 1 != lineopt && 2 != lineopt) { + cerr << "wave: bogus value for --line command line option: " + << lineopt << endl; + return -1; + } + ctx.set_language( + boost::wave::enable_emit_line_directives(ctx.get_language(), + lineopt != 0)); + + if (2 == lineopt) + ctx.get_hooks().enable_relative_names_in_line_directives(true); + } + + // control whether whitespace should be inserted to disambiguate output + if (vm.count("disambiguate")) { + int disambiguateopt = vm["disambiguate"].as<int>(); + if (0 != disambiguateopt && 1 != disambiguateopt) { + cerr << "wave: bogus value for --disambiguate command line option: " + << disambiguateopt << endl; + return -1; + } + ctx.set_language( + boost::wave::enable_insert_whitespace(ctx.get_language(), + disambiguateopt != 0)); + } + + // add include directories to the system include search paths + if (vm.count("sysinclude")) { + vector<std::string> syspaths = vm["sysinclude"].as<vector<std::string> >(); + + vector<std::string>::const_iterator end = syspaths.end(); + for (vector<std::string>::const_iterator cit = syspaths.begin(); + cit != end; ++cit) + { + ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*cit).c_str()); + } + } + + // add include directories to the include search paths + if (vm.count("include")) { + cmd_line_utils::include_paths const &ip = + vm["include"].as<cmd_line_utils::include_paths>(); + vector<std::string>::const_iterator end = ip.paths.end(); + + for (vector<std::string>::const_iterator cit = ip.paths.begin(); + cit != end; ++cit) + { + ctx.add_include_path(cmd_line_utils::trim_quotes(*cit).c_str()); + } + + // if -I- was given on the command line, this has to be propagated + if (ip.seen_separator) + ctx.set_sysinclude_delimiter(); + + // add system include directories to the include path + vector<std::string>::const_iterator sysend = ip.syspaths.end(); + for (vector<std::string>::const_iterator syscit = ip.syspaths.begin(); + syscit != sysend; ++syscit) + { + ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*syscit).c_str()); + } + } + + // add additional defined macros + if (vm.count("define")) { + vector<std::string> const ¯os = vm["define"].as<vector<std::string> >(); + vector<std::string>::const_iterator end = macros.end(); + for (vector<std::string>::const_iterator cit = macros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit); + } + } + + // add additional predefined macros + if (vm.count("predefine")) { + vector<std::string> const &predefmacros = + vm["predefine"].as<vector<std::string> >(); + vector<std::string>::const_iterator end = predefmacros.end(); + for (vector<std::string>::const_iterator cit = predefmacros.begin(); + cit != end; ++cit) + { + ctx.add_macro_definition(*cit, true); + } + } + + // undefine specified macros + if (vm.count("undefine")) { + vector<std::string> const &undefmacros = + vm["undefine"].as<vector<std::string> >(); + vector<std::string>::const_iterator end = undefmacros.end(); + for (vector<std::string>::const_iterator cit = undefmacros.begin(); + cit != end; ++cit) + { + ctx.remove_macro_definition(*cit, true); + } + } + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 + // suppress expansion of specified macros + if (vm.count("noexpand")) { + vector<std::string> const &noexpandmacros = + vm["noexpand"].as<vector<std::string> >(); + vector<std::string>::const_iterator end = noexpandmacros.end(); + for (vector<std::string>::const_iterator cit = noexpandmacros.begin(); + cit != end; ++cit) + { + ctx.get_hooks().add_noexpandmacro(*cit); + } + } +#endif + + // maximal include nesting depth + if (vm.count("nesting")) { + int max_depth = vm["nesting"].as<int>(); + if (max_depth < 1 || max_depth > 100000) { + cerr << "wave: bogus maximal include nesting depth: " + << max_depth << endl; + return -1; + } + ctx.set_max_include_nesting_depth(max_depth); + } + + // open the output file + if (vm.count("output")) { + // try to open the file, where to put the preprocessed output + fs::path out_file (boost::wave::util::create_path( + vm["output"].as<std::string>())); + + if (out_file == "-") { + allow_output = false; // inhibit output initially + default_outfile = "-"; + } + else { + out_file = boost::wave::util::complete_path(out_file); + boost::wave::util::create_directories( + boost::wave::util::branch_path(out_file)); + output.open(out_file.string().c_str()); + if (!output.is_open()) { + cerr << "wave: could not open output file: " + << out_file.string() << endl; + return -1; + } + if (!license.empty()) + output << license; + default_outfile = out_file.string(); + } + } + else if (!input_is_stdin && vm.count("autooutput")) { + // generate output in the file <input_base_name>.i + fs::path out_file (boost::wave::util::create_path(file_name)); + std::string basename (boost::wave::util::leaf(out_file)); + std::string::size_type pos = basename.find_last_of("."); + + if (std::string::npos != pos) + basename = basename.substr(0, pos); + out_file = boost::wave::util::branch_path(out_file) / (basename + ".i"); + + boost::wave::util::create_directories( + boost::wave::util::branch_path(out_file)); + output.open(out_file.string().c_str()); + if (!output.is_open()) { + cerr << "wave: could not open output file: " + << out_file.string() << endl; + return -1; + } + if (!license.empty()) + output << license; + default_outfile = out_file.string(); + } + + // we assume the session to be interactive if input is stdin and output is + // stdout and the output is not inhibited + bool is_interactive = input_is_stdin && !output.is_open() && allow_output; + + if (is_interactive) { + // if interactive we don't warn for missing endif's etc. + ctx.set_language( + boost::wave::enable_single_line(ctx.get_language()), false); + } + + // analyze the input file + context_type::iterator_type first = ctx.begin(); + context_type::iterator_type last = ctx.end(); + + // preprocess the required include files + if (vm.count("forceinclude")) { + // add the filenames to force as include files in _reverse_ order + // the second parameter 'is_last' of the force_include function should + // be set to true for the last (first given) file. + std::vector<std::string> const &force = + vm["forceinclude"].as<std::vector<std::string> >(); + std::vector<std::string>::const_reverse_iterator rend = force.rend(); + for (std::vector<std::string>::const_reverse_iterator cit = force.rbegin(); + cit != rend; /**/) + { + std::string filename(*cit); + first.force_include(filename.c_str(), ++cit == rend); + } + } + + elapsed_time.set_print_time(!input_is_stdin && vm.count("timer") > 0); + if (is_interactive) { + print_interactive_version(); // print welcome message + load_state(vm, ctx); // load the internal tables from disc + } + else if (vm.count("state")) { + // the option "state" is usable in interactive mode only + cerr << "wave: ignoring the command line option 'state', " + << "use it in interactive mode only." << endl; + } + + // >>>>>>>>>>>>> The actual preprocessing happens here. <<<<<<<<<<<<<<<<<<< + // loop over the input lines if reading from stdin, otherwise this loop + // will be executed once + do { + // loop over all generated tokens outputting the generated text + bool finished = false; + + if (input_is_stdin) { + if (is_interactive) + cout << ">>> "; // prompt if is interactive + + // read next line and continue + instring.clear(); + if (!read_a_line(instream, instring)) + break; // end of input reached + first = ctx.begin(instring.begin(), instring.end()); + } + + bool need_to_advanve = false; + + do { + try { + if (need_to_advanve) { + ++first; + need_to_advanve = false; + } + + while (first != last) { + // store the last known good token position + current_position = (*first).get_position(); + + // print out the current token value + if (allow_output) { + if (!output.good()) { + cerr << "wave: problem writing to the current " + << "output file" << endl; + cerr << report_iostate_error(output.rdstate()); + break; + } + if (output.is_open()) + output << (*first).get_value(); + else + cout << (*first).get_value(); + } + + // advance to the next token + ++first; + } + finished = true; + } + catch (boost::wave::cpp_exception const &e) { + // some preprocessing error + if (is_interactive || boost::wave::is_recoverable(e)) { + error_count += report_error_message(ctx, e, + treat_warnings_as_error); + need_to_advanve = true; // advance to the next token + } + else { + throw; // re-throw for non-recoverable errors + } + } + catch (boost::wave::cpplexer::lexing_exception const &e) { + // some preprocessing error + if (is_interactive || + boost::wave::cpplexer::is_recoverable(e)) + { + error_count += + report_error_message(e, treat_warnings_as_error); + need_to_advanve = true; // advance to the next token + } + else { + throw; // re-throw for non-recoverable errors + } + } + } while (!finished); + } while (input_is_stdin); + + if (is_interactive) + save_state(vm, ctx); // write the internal tables to disc + + // list all defined macros at the end of the preprocessing + if (vm.count("macronames")) { + if (!list_macro_names(ctx, vm["macronames"].as<std::string>())) + return -1; + } + if (vm.count("macrocounts")) { + if (!list_macro_counts(ctx, vm["macrocounts"].as<std::string>())) + return -1; + } + } + catch (boost::wave::cpp_exception const &e) { + // some preprocessing error + report_error_message(e, treat_warnings_as_error); + return 1; + } + catch (boost::wave::cpplexer::lexing_exception const &e) { + // some lexing error + report_error_message(e, treat_warnings_as_error); + return 2; + } + catch (std::exception const &e) { + // use last recognized token to retrieve the error position + cerr + << current_position << ": " + << "exception caught: " << e.what() + << endl; + return 3; + } + catch (...) { + // use last recognized token to retrieve the error position + cerr + << current_position << ": " + << "unexpected exception caught." << endl; + return 4; + } + return -error_count; // returns the number of errors as a negative integer +} + +/////////////////////////////////////////////////////////////////////////////// +// main entry point +int +main (int argc, char *argv[]) +{ + const std::string accepted_w_args[] = {"error"}; + + // test Wave compilation configuration + if (!BOOST_WAVE_TEST_CONFIGURATION()) { + cout << "wave: warning: the library this application was linked against was compiled " + << endl + << " using a different configuration (see wave_config.hpp)." + << endl; + } + + // analyze the command line options and arguments + try { + // declare the options allowed on the command line only + po::options_description desc_cmdline ("Options allowed on the command line only"); + + desc_cmdline.add_options() + ("help,h", "print out program usage (this message)") + ("version,v", "print the version number") + ("copyright", "print out the copyright statement") + ("config-file", po::value<vector<std::string> >()->composing(), + "specify a config file (alternatively: @filepath)") + ; + + const std::string w_arg_desc = "Warning settings. Currently supported: -W" + + boost::algorithm::join(accepted_w_args, ", -W"); + + // declare the options allowed on command line and in config files + po::options_description desc_generic ("Options allowed additionally in a config file"); + + desc_generic.add_options() + ("output,o", po::value<std::string>(), + "specify a file [arg] to use for output instead of stdout or " + "disable output [-]") + ("autooutput,E", + "output goes into a file named <input_basename>.i") + ("license", po::value<std::string>(), + "prepend the content of the specified file to each created file") + ("include,I", po::value<cmd_line_utils::include_paths>()->composing(), + "specify an additional include directory") + ("sysinclude,S", po::value<vector<std::string> >()->composing(), + "specify an additional system include directory") + ("forceinclude,F", po::value<std::vector<std::string> >()->composing(), + "force inclusion of the given file") + ("define,D", po::value<std::vector<std::string> >()->composing(), + "specify a macro to define (as macro[=[value]])") + ("predefine,P", po::value<std::vector<std::string> >()->composing(), + "specify a macro to predefine (as macro[=[value]])") + ("undefine,U", po::value<std::vector<std::string> >()->composing(), + "specify a macro to undefine") +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 + ("noexpand,N", po::value<std::vector<std::string> >()->composing(), + "specify a macro name, which should not be expanded") +#endif + ("nesting,n", po::value<int>(), + "specify a new maximal include nesting depth") + ("warning,W", po::value<std::vector<std::string> >()->composing(), + w_arg_desc.c_str()) + ; + + po::options_description desc_ext ("Extended options (allowed everywhere)"); + + desc_ext.add_options() + ("traceto,t", po::value<std::string>(), + "output macro expansion tracing information to a file [arg] " + "or to stderr [-]") + ("timer", "output overall elapsed computing time to stderr") + ("long_long", "enable long long support in C++ mode") +#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 + ("variadics", "enable certain C99 extensions in C++ mode") + ("c99", "enable C99 mode (implies --variadics)") +#endif +#if BOOST_WAVE_SUPPORT_CPP0X != 0 + ("c++11", "enable C++11 mode (implies --variadics and --long_long)") +#endif + ("listincludes,l", po::value<std::string>(), + "list names of included files to a file [arg] or to stdout [-]") + ("macronames,m", po::value<std::string>(), + "list all defined macros to a file [arg] or to stdout [-]") + ("macrocounts,c", po::value<std::string>(), + "list macro invocation counts to a file [arg] or to stdout [-]") + ("preserve,p", po::value<int>()->default_value(0), + "preserve whitespace\n" + "0: no whitespace is preserved (default),\n" + "1: begin of line whitespace is preserved,\n" + "2: comments and begin of line whitespace is preserved,\n" + "3: all whitespace is preserved") + ("line,L", po::value<int>()->default_value(1), + "control the generation of #line directives\n" + "0: no #line directives are generated,\n" + "1: #line directives will be emitted (default),\n" + "2: #line directives will be emitted using relative\n" + " filenames") + ("disambiguate", po::value<int>()->default_value(1), + "control whitespace insertion to disambiguate\n" + "consecutive tokens\n" + "0: no additional whitespace is generated,\n" + "1: whitespace is used to disambiguate output (default)") + ("extended,x", "enable the #pragma wave system() directive") +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + ("noguard,G", "disable include guard detection") + ("listguards,g", po::value<std::string>(), + "list names of files flagged as 'include once' to a file [arg] " + "or to stdout [-]") +#endif +#if BOOST_WAVE_SERIALIZATION != 0 + ("state,s", po::value<std::string>(), + "load and save state information from/to the given file [arg] " + "or 'wave.state' [-] (interactive mode only)") +#endif + ; + + // combine the options for the different usage schemes + po::options_description desc_overall_cmdline; + po::options_description desc_overall_cfgfile; + + desc_overall_cmdline.add(desc_cmdline).add(desc_generic).add(desc_ext); + desc_overall_cfgfile.add(desc_generic).add(desc_ext); + + // parse command line and store results + using namespace boost::program_options::command_line_style; + + po::parsed_options opts(po::parse_command_line(argc, argv, + desc_overall_cmdline, unix_style, cmd_line_utils::at_option_parser)); + po::variables_map vm; + + po::store(opts, vm); + po::notify(vm); + +// // Try to find a wave.cfg in the same directory as the executable was +// // started from. If this exists, treat it as a wave config file +// fs::path filename(argv[0]); +// +// filename = filename.branch_path() / "wave.cfg"; +// cmd_line_utils::read_config_file_options(filename.string(), +// desc_overall_cfgfile, vm, true); + + // extract the arguments from the parsed command line + vector<po::option> 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. + if (arguments.size() > 0 && arguments[0].value[0] != "-") { + // construct full path of input file + fs::path input_dir (boost::wave::util::complete_path( + boost::wave::util::create_path(arguments[0].value[0]))); + + // chop of file name + input_dir = boost::wave::util::branch_path( + boost::wave::util::normalize(input_dir)); + + // walk up the hierarchy, trying to find a file wave.cfg + while (!input_dir.empty()) { + fs::path filename = input_dir / "wave.cfg"; + if (cmd_line_utils::read_config_file_options(filename.string(), + desc_overall_cfgfile, vm, true)) + { + break; // break on the first cfg file found + } + 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")) { + vector<std::string> const &cfg_files = + vm["config-file"].as<vector<std::string> >(); + vector<std::string>::const_iterator end = cfg_files.end(); + for (vector<std::string>::const_iterator cit = cfg_files.begin(); + cit != end; ++cit) + { + // parse a single config file and store the results + cmd_line_utils::read_config_file_options(*cit, + desc_overall_cfgfile, vm); + } + } + + // validate warning settings + if (vm.count("warning")) + { + BOOST_FOREACH(const std::string& arg, + vm["warning"].as<std::vector<std::string> >()) + { + if (boost::range::find(accepted_w_args, arg) == + boost::end(accepted_w_args)) + { + cerr << "wave: Invalid warning setting: " << arg << endl; + return -1; + } + } + } + + // ... act as required + if (vm.count("help")) { + po::options_description desc_help ( + "Usage: wave [options] [@config-file(s)] [file]"); + + desc_help.add(desc_cmdline).add(desc_generic).add(desc_ext); + cout << desc_help << endl; + return 1; + } + + if (vm.count("version")) { + cout << get_version() << endl; + return 0; + } + + if (vm.count("copyright")) { + return print_copyright(); + } + + // if there is no input file given, then take input from stdin + if (0 == arguments.size() || 0 == arguments[0].value.size() || + arguments[0].value[0] == "-") + { + // preprocess the given input from stdin + return do_actual_work("<stdin>", std::cin, vm, true); + } + else { + if (arguments.size() > 1) { + // this driver understands to parse one input file only + cerr << "wave: more than one input file specified, " + << "ignoring all but the first!" << endl; + } + + std::string file_name(arguments[0].value[0]); + ifstream instream(file_name.c_str()); + + // preprocess the given input file + if (!instream.is_open()) { + cerr << "wave: could not open input file: " << file_name << endl; + return -1; + } + return do_actual_work(file_name, instream, vm, false); + } + } + catch (std::exception const &e) { + cout << "wave: exception caught: " << e.what() << endl; + return 6; + } + catch (...) { + cerr << "wave: unexpected exception caught." << endl; + return 7; + } +} + diff --git a/src/boost/libs/wave/tool/cpp.hpp b/src/boost/libs/wave/tool/cpp.hpp new file mode 100644 index 000000000..2c795d2bd --- /dev/null +++ b/src/boost/libs/wave/tool/cpp.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CPP_HPP_920D0370_741F_44AF_BF86_F6104BDACF75_INCLUDED) +#define CPP_HPP_920D0370_741F_44AF_BF86_F6104BDACF75_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// This file may be used as a precompiled header (if applicable) + +/////////////////////////////////////////////////////////////////////////////// +// include often used files from the stdlib +#include <iostream> +#include <string> +#include <vector> +#include <algorithm> +#include <iterator> + +/////////////////////////////////////////////////////////////////////////////// +// include boost config +#include <boost/config.hpp> // global configuration information + +/////////////////////////////////////////////////////////////////////////////// +// build version +#include "cpp_version.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// configure this app here (global configuration constants) +#include "cpp_config.hpp" + +/////////////////////////////////////////////////////////////////////////////// +// include required boost libraries +#include <boost/assert.hpp> +#include <boost/pool/pool_alloc.hpp> + +#endif // !defined(CPP_HPP_920D0370_741F_44AF_BF86_F6104BDACF75_INCLUDED) diff --git a/src/boost/libs/wave/tool/cpp_config.hpp b/src/boost/libs/wave/tool/cpp_config.hpp new file mode 100644 index 000000000..e6e4f63e2 --- /dev/null +++ b/src/boost/libs/wave/tool/cpp_config.hpp @@ -0,0 +1,63 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + Global application configuration of the Wave driver command + + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CPP_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED) +#define CPP_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED + +/////////////////////////////////////////////////////////////////////////////// +// Uncomment the following, if you need debug output, the +// BOOST_SPIRIT_DEBUG_FLAGS constants below helps to fine control the amount of +// the generated debug output +//#define BOOST_SPIRIT_DEBUG + +/////////////////////////////////////////////////////////////////////////////// +// debug rules, subrules and grammars only, for possible flags see +// spirit/include/classic_debug.hpp +#if defined(BOOST_SPIRIT_DEBUG) + +#define BOOST_SPIRIT_DEBUG_FLAGS ( \ + BOOST_SPIRIT_DEBUG_FLAGS_NODES | \ + BOOST_SPIRIT_DEBUG_FLAGS_CLOSURES \ + ) \ + /**/ + +/////////////////////////////////////////////////////////////////////////////// +// Debug flags for the Wave library, possible flags (defined in +// wave_config.hpp): +// +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_GRAMMAR 0x0001 +// #define BOOST_SPIRIT_DEBUG_FLAGS_TIME_CONVERSION 0x0002 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CPP_EXPR_GRAMMAR 0x0004 +// #define BOOST_SPIRIT_DEBUG_FLAGS_INTLIT_GRAMMAR 0x0008 +// #define BOOST_SPIRIT_DEBUG_FLAGS_CHLIT_GRAMMAR 0x0010 +// #define BOOST_SPIRIT_DEBUG_FLAGS_DEFINED_GRAMMAR 0x0020 +// #define BOOST_SPIRIT_DEBUG_FLAGS_PREDEF_MACROS_GRAMMAR 0x0040 + +#define BOOST_SPIRIT_DEBUG_FLAGS_CPP ( 0 \ + /* insert the required flags from above */ \ + ) \ + /**/ +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Include the configuration stuff for the Wave library itself +#include <boost/wave/wave_config.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// MSVC specific #pragma's +#if defined(BOOST_MSVC) +#pragma warning (disable: 4355) // 'this' used in base member initializer list +#pragma warning (disable: 4800) // forcing value to bool 'true' or 'false' +#pragma inline_depth(255) +#pragma inline_recursion(on) +#endif // defined(BOOST_MSVC) + +#endif // !defined(CPP_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED) diff --git a/src/boost/libs/wave/tool/cpp_version.hpp b/src/boost/libs/wave/tool/cpp_version.hpp new file mode 100644 index 000000000..43330c2c9 --- /dev/null +++ b/src/boost/libs/wave/tool/cpp_version.hpp @@ -0,0 +1,25 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED) +#define CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED + +#include <boost/wave/wave_version.hpp> + +#define CPP_VERSION_MAJOR BOOST_WAVE_VERSION_MAJOR +#define CPP_VERSION_MINOR BOOST_WAVE_VERSION_MINOR +#define CPP_VERSION_SUBMINOR BOOST_WAVE_VERSION_SUBMINOR +#define CPP_VERSION_FULL BOOST_WAVE_VERSION + +#define CPP_VERSION_FULL_STR BOOST_PP_STRINGIZE(CPP_VERSION_FULL) + +#define CPP_VERSION_DATE 20120523L +#define CPP_VERSION_DATE_STR "20120523" + +#endif // !defined(CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED) diff --git a/src/boost/libs/wave/tool/stop_watch.hpp b/src/boost/libs/wave/tool/stop_watch.hpp new file mode 100644 index 000000000..e3285466e --- /dev/null +++ b/src/boost/libs/wave/tool/stop_watch.hpp @@ -0,0 +1,84 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(STOP_WATCH_HPP_HK040911_INCLUDED) +#define STOP_WATCH_HPP_HK040911_INCLUDED + +#include <boost/config.hpp> +#include <boost/timer.hpp> + +/////////////////////////////////////////////////////////////////////////////// +// +class stop_watch : public boost::timer { + + typedef boost::timer base_t; + +public: + stop_watch() : is_suspended_since(0), suspended_overall(0) {} + + void suspend() + { + if (0 == is_suspended_since) { + // if not already suspended + is_suspended_since = this->base_t::elapsed(); + } + } + void resume() + { + if (0 != is_suspended_since) { + // if really suspended + suspended_overall += this->base_t::elapsed() - is_suspended_since; + is_suspended_since = 0; + } + } + double elapsed() const + { + if (0 == is_suspended_since) { + // currently running + return this->base_t::elapsed() - suspended_overall; + } + + // currently suspended + BOOST_ASSERT(is_suspended_since >= suspended_overall); + return is_suspended_since - suspended_overall; + } + + std::string format_elapsed_time() const + { + double current = elapsed(); + char time_buffer[sizeof("1234:56:78.90 abcd.")+1]; + + using namespace std; + if (current >= 3600) { + // show hours + sprintf (time_buffer, "%d:%02d:%02d.%03d hrs.", + (int)(current) / 3600, ((int)(current) % 3600) / 60, + ((int)(current) % 3600) % 60, + (int)(current * 1000) % 1000); + } + else if (current >= 60) { + // show minutes + sprintf (time_buffer, "%d:%02d.%03d min.", + (int)(current) / 60, (int)(current) % 60, + (int)(current * 1000) % 1000); + } + else { + // show seconds + sprintf(time_buffer, "%d.%03d sec.", (int)current, + (int)(current * 1000) % 1000); + } + return time_buffer; + } + +private: + double is_suspended_since; + double suspended_overall; +}; + +#endif // !defined(STOP_WATCH_HPP_HK040911_INCLUDED) diff --git a/src/boost/libs/wave/tool/trace_macro_expansion.hpp b/src/boost/libs/wave/tool/trace_macro_expansion.hpp new file mode 100644 index 000000000..99a3647e4 --- /dev/null +++ b/src/boost/libs/wave/tool/trace_macro_expansion.hpp @@ -0,0 +1,1494 @@ +/*============================================================================= + Boost.Wave: A Standard compliant C++ preprocessor library + http://www.boost.org/ + + Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost + Software License, Version 1.0. (See accompanying file + LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +=============================================================================*/ + +#if !defined(TRACE_MACRO_EXPANSION_HPP_D8469318_8407_4B9D_A19F_13CA60C1661F_INCLUDED) +#define TRACE_MACRO_EXPANSION_HPP_D8469318_8407_4B9D_A19F_13CA60C1661F_INCLUDED + +#include <cstdio> +#include <cstdlib> +#include <ctime> + +#include <ostream> +#include <string> +#include <stack> +#include <set> + +#include <boost/assert.hpp> +#include <boost/config.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> +#include <boost/filesystem/convenience.hpp> + +#include <boost/wave/token_ids.hpp> +#include <boost/wave/util/macro_helpers.hpp> +#include <boost/wave/util/filesystem_compatibility.hpp> +#include <boost/wave/preprocessing_hooks.hpp> +#include <boost/wave/whitespace_handling.hpp> +#include <boost/wave/language_support.hpp> +#include <boost/wave/cpp_exceptions.hpp> + +#include "stop_watch.hpp" + +#ifdef BOOST_NO_STRINGSTREAM +#include <strstream> +#define BOOST_WAVE_OSSTREAM std::ostrstream +std::string BOOST_WAVE_GETSTRING(std::ostrstream& ss) +{ + ss << std::ends; + std::string rval = ss.str(); + ss.freeze(false); + return rval; +} +#else +#include <sstream> +#define BOOST_WAVE_GETSTRING(ss) ss.str() +#define BOOST_WAVE_OSSTREAM std::ostringstream +#endif + +// trace_flags: enable single tracing functionality +enum trace_flags { + trace_nothing = 0, // disable tracing + trace_macros = 1, // enable macro tracing + trace_macro_counts = 2, // enable invocation counting + trace_includes = 4, // enable include file tracing + trace_guards = 8 // enable include guard tracing +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// Special error thrown whenever the #pragma wave system() directive is +// disabled +// +/////////////////////////////////////////////////////////////////////////////// +class bad_pragma_exception : + public boost::wave::preprocess_exception +{ +public: + enum error_code { + 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, std::size_t line_, + std::size_t column_, char const *filename_) throw() + : boost::wave::preprocess_exception(what_, + (boost::wave::preprocess_exception::error_code)code, line_, + column_, filename_) + { + } + ~bad_pragma_exception() throw() {} + + virtual char const *what() const throw() + { + return "boost::wave::bad_pragma_exception"; + } + virtual bool is_recoverable() const throw() + { + return true; + } + virtual int get_severity() const throw() + { + 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"; + } + return "Unknown exception"; + } + static boost::wave::util::severity severity_level(int code) + { + switch(code) { + case pragma_system_not_enabled: + return boost::wave::util::severity_remark; + + case pragma_mismatched_push_pop: + return boost::wave::util::severity_error; + } + return boost::wave::util::severity_fatal; + } + static char const *severity_text(int code) + { + return boost::wave::util::get_severity(boost::wave::util::severity_remark); + } +}; + +/////////////////////////////////////////////////////////////////////////////// +// +// The trace_macro_expansion 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)' directive. The macro +// tracing is disabled with the help of a '#pragma wave_option(trace: disable)' +// directive. +// +// This policy type is used as a template parameter to the boost::wave::context<> +// object. +// +/////////////////////////////////////////////////////////////////////////////// +template <typename TokenT> +class trace_macro_expansion +: public boost::wave::context_policies::eat_whitespace<TokenT> +{ + typedef boost::wave::context_policies::eat_whitespace<TokenT> base_type; + +public: + trace_macro_expansion( + bool preserve_whitespace_, bool preserve_bol_whitespace_, + std::ofstream &output_, std::ostream &tracestrm_, + std::ostream &includestrm_, std::ostream &guardstrm_, + trace_flags flags_, bool enable_system_command_, + bool& generate_output_, std::string const& default_outfile_) + : outputstrm(output_), tracestrm(tracestrm_), + includestrm(includestrm_), guardstrm(guardstrm_), + level(0), flags(flags_), logging_flags(trace_nothing), + enable_system_command(enable_system_command_), + preserve_whitespace(preserve_whitespace_), + preserve_bol_whitespace(preserve_bol_whitespace_), + generate_output(generate_output_), + default_outfile(default_outfile_), + emit_relative_filenames(false) + { + } + ~trace_macro_expansion() + { + } + + void enable_macro_counting() + { + logging_flags = trace_flags(logging_flags | trace_macro_counts); + } + std::map<std::string, std::size_t> const& get_macro_counts() const + { + return counts; + } + + void enable_relative_names_in_line_directives(bool flag) + { + emit_relative_filenames = flag; + } + bool enable_relative_names_in_line_directives() const + { + return emit_relative_filenames; + } + + // add a macro name, which should not be expanded at all (left untouched) + void add_noexpandmacro(std::string const& name) + { + noexpandmacros.insert(name); + } + + void set_license_info(std::string const& info) + { + license_info = info; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanding_function_like_macro' is called whenever a + // function-like macro is to be expanded. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'macrodef' marks the position, where the macro to expand + // is defined. + // + // The parameter 'formal_args' holds the formal arguments used during the + // definition of the macro. + // + // The parameter 'definition' holds the macro definition for the macro to + // trace. + // + // The parameter 'macro_call' marks the position, where this macro invoked. + // + // The parameter 'arguments' holds the macro arguments used during the + // invocation of the macro + // + // The parameters 'seqstart' and 'seqend' point into the input token + // stream allowing to access the whole token sequence comprising the macro + // invocation (starting with the opening parenthesis and ending after the + // closing one). + // + // The return value defines whether the corresponding macro will be + // expanded (return false) or will be copied to the output (return true). + // Note: the whole argument list is copied unchanged to the output as well + // without any further processing. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + // old signature + template <typename ContainerT> + void expanding_function_like_macro( + TokenT const ¯odef, std::vector<TokenT> const &formal_args, + ContainerT const &definition, + TokenT const ¯ocall, std::vector<ContainerT> const &arguments) + { + if (enabled_macro_counting()) + count_invocation(macrodef.get_value().c_str()); + + if (!enabled_macro_tracing()) + return; +#else + // new signature + template <typename ContextT, typename ContainerT, typename IteratorT> + bool + expanding_function_like_macro(ContextT const& ctx, + TokenT const ¯odef, std::vector<TokenT> const &formal_args, + ContainerT const &definition, + TokenT const ¯ocall, std::vector<ContainerT> const &arguments, + IteratorT const& seqstart, IteratorT const& seqend) + { + if (enabled_macro_counting() || !noexpandmacros.empty()) { + std::string name (macrodef.get_value().c_str()); + + if (noexpandmacros.find(name.c_str()) != noexpandmacros.end()) + return true; // do not expand this macro + + if (enabled_macro_counting()) + count_invocation(name.c_str()); + } + + if (!enabled_macro_tracing()) + return false; +#endif + if (0 == get_level()) { + // output header line + BOOST_WAVE_OSSTREAM stream; + + stream + << macrocall.get_position() << ": " + << macrocall.get_value() << "("; + + // argument list + for (typename ContainerT::size_type i = 0; i < arguments.size(); ++i) { + stream << boost::wave::util::impl::as_string(arguments[i]); + if (i < arguments.size()-1) + stream << ", "; + } + stream << ")" << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + increment_level(); + } + + // output definition reference + { + BOOST_WAVE_OSSTREAM stream; + + stream + << macrodef.get_position() << ": see macro definition: " + << macrodef.get_value() << "("; + + // formal argument list + for (typename std::vector<TokenT>::size_type i = 0; + i < formal_args.size(); ++i) + { + stream << formal_args[i].get_value(); + if (i < formal_args.size()-1) + stream << ", "; + } + stream << ")" << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + } + + if (formal_args.size() > 0) { + // map formal and real arguments + open_trace_body("invoked with\n"); + for (typename std::vector<TokenT>::size_type j = 0; + j < formal_args.size(); ++j) + { + using namespace boost::wave; + + BOOST_WAVE_OSSTREAM stream; + stream << formal_args[j].get_value() << " = "; +#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0 + if (T_ELLIPSIS == token_id(formal_args[j])) { + // ellipsis + for (typename ContainerT::size_type k = j; + k < arguments.size(); ++k) + { + stream << boost::wave::util::impl::as_string(arguments[k]); + if (k < arguments.size()-1) + stream << ", "; + } + } + else +#endif + { + stream << boost::wave::util::impl::as_string(arguments[j]); + } + stream << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + } + close_trace_body(); + } + open_trace_body(); + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 + return false; +#endif + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanding_object_like_macro' is called whenever a + // object-like macro is to be expanded . + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'macrodef' marks the position, where the macro to expand + // is defined. + // + // The definition 'definition' holds the macro definition for the macro to + // trace. + // + // The parameter 'macrocall' marks the position, where this macro invoked. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + // old signature + template <typename ContainerT> + 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 + // new signature + template <typename ContextT, typename ContainerT> + bool + expanding_object_like_macro(ContextT const& ctx, + TokenT const ¯odef, ContainerT const &definition, + TokenT const ¯ocall) + { + if (enabled_macro_counting() || !noexpandmacros.empty()) { + std::string name (macrodef.get_value().c_str()); + + if (noexpandmacros.find(name.c_str()) != noexpandmacros.end()) + return true; // do not expand this macro + + if (enabled_macro_counting()) + count_invocation(name.c_str()); + } + + if (!enabled_macro_tracing()) + return false; +#endif + if (0 == get_level()) { + // output header line + BOOST_WAVE_OSSTREAM stream; + + stream + << macrocall.get_position() << ": " + << macrocall.get_value() << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + increment_level(); + } + + // output definition reference + { + BOOST_WAVE_OSSTREAM stream; + + stream + << macrodef.get_position() << ": see macro definition: " + << macrodef.get_value() << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + } + open_trace_body(); + +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0 + return false; +#endif + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'expanded_macro' is called whenever the expansion of a + // macro is finished but before the rescanning process starts. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'result' contains the token sequence generated as the + // result of the macro expansion. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + // old signature + template <typename ContainerT> + void expanded_macro(ContainerT const &result) +#else + // new signature + template <typename ContextT, typename ContainerT> + void expanded_macro(ContextT const& ctx,ContainerT const &result) +#endif + { + if (!enabled_macro_tracing()) return; + + BOOST_WAVE_OSSTREAM stream; + stream << boost::wave::util::impl::as_string(result) << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + + open_trace_body("rescanning\n"); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'rescanned_macro' is called whenever the rescanning of a + // macro is finished. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'result' contains the token sequence generated as the + // result of the rescanning. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + // old signature + template <typename ContainerT> + void rescanned_macro(ContainerT const &result) +#else + // new signature + template <typename ContextT, typename ContainerT> + void rescanned_macro(ContextT const& ctx,ContainerT const &result) +#endif + { + if (!enabled_macro_tracing() || get_level() == 0) + return; + + BOOST_WAVE_OSSTREAM stream; + stream << boost::wave::util::impl::as_string(result) << std::endl; + output(BOOST_WAVE_GETSTRING(stream)); + close_trace_body(); + close_trace_body(); + + if (1 == get_level()) + decrement_level(); + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'interpret_pragma' is called whenever a #pragma command + // directive is found which isn't known to the core Wave library, where + // command is the value defined as the BOOST_WAVE_PRAGMA_KEYWORD constant + // which defaults to "wave". + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used as the replacement text for the whole + // #pragma directive. + // + // The parameter 'option' contains the name of the interpreted pragma. + // + // The parameter 'values' holds the values of the parameter provided to + // the pragma operator. + // + // The parameter 'act_token' contains the actual #pragma token, which may + // be used for error output. + // + // 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. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename ContainerT> + bool + interpret_pragma(ContextT &ctx, ContainerT &pending, + typename ContextT::token_type const &option, ContainerT const &valuetokens, + typename ContextT::token_type const &act_token) + { + typedef typename ContextT::token_type token_type; + + ContainerT values(valuetokens); + boost::wave::util::impl::trim_sequence(values); // trim whitespace + + if (option.get_value() == "timer") { + // #pragma wave timer(value) + if (0 == values.size()) { + // no value means '1' + using namespace boost::wave; + timer(token_type(T_INTLIT, "1", act_token.get_position())); + } + else { + timer(values.front()); + } + return true; + } + if (option.get_value() == "trace") { + // enable/disable tracing option + return interpret_pragma_trace(ctx, values, act_token); + } + if (option.get_value() == "system") { + if (!enable_system_command) { + // if the #pragma wave system() directive is not enabled, throw + // a corresponding error (actually its a remark), + typename ContextT::string_type msg( + boost::wave::util::impl::as_string(values)); + BOOST_WAVE_THROW_CTX(ctx, bad_pragma_exception, + pragma_system_not_enabled, + msg.c_str(), 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); + } + if (option.get_value() == "stop") { + // stop the execution and output the argument + typename ContextT::string_type msg( + boost::wave::util::impl::as_string(values)); + BOOST_WAVE_THROW_CTX(ctx, boost::wave::preprocess_exception, + error_directive, msg.c_str(), act_token.get_position()); + return false; + } + if (option.get_value() == "option") { + // handle different options + return interpret_pragma_option(ctx, values, act_token); + } + return false; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'emit_line_directive' is called whenever a #line directive + // has to be emitted into the generated output. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'pending' may be used to push tokens back into the input + // stream, which are to be used instead of the default output generated + // for the #line directive. + // + // The parameter 'act_token' contains the actual #pragma token, which may + // be used for error output. The line number stored in this token can be + // used as the line number emitted as part of the #line directive. + // + // If the return value is 'false', a default #line directive is emitted + // by the library. A return value of 'true' will inhibit any further + // actions, the tokens contained in 'pending' will be copied verbatim + // to the output. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT, typename ContainerT> + bool + emit_line_directive(ContextT const& ctx, ContainerT &pending, + typename ContextT::token_type const& act_token) + { + if (!need_emit_line_directives(ctx.get_language()) || + !enable_relative_names_in_line_directives()) + { + return false; + } + + // emit a #line directive showing the relative filename instead + typename ContextT::position_type pos = act_token.get_position(); + unsigned int column = 6; + + typedef typename ContextT::token_type result_type; + using namespace boost::wave; + + pos.set_column(1); + pending.push_back(result_type(T_PP_LINE, "#line", pos)); + + pos.set_column(column); // account for '#line' + pending.push_back(result_type(T_SPACE, " ", pos)); + + // 21 is the max required size for a 64 bit integer represented as a + // string + char buffer[22]; + + using namespace std; // for some systems sprintf is in namespace std + sprintf (buffer, "%zd", pos.get_line()); + + pos.set_column(++column); // account for ' ' + pending.push_back(result_type(T_INTLIT, buffer, pos)); + pos.set_column(column += (unsigned int)strlen(buffer)); // account for <number> + pending.push_back(result_type(T_SPACE, " ", pos)); + pos.set_column(++column); // account for ' ' + + std::string file("\""); + boost::filesystem::path filename( + boost::wave::util::create_path(ctx.get_current_relative_filename().c_str())); + + using boost::wave::util::impl::escape_lit; + file += escape_lit(boost::wave::util::native_file_string(filename)) + "\""; + + pending.push_back(result_type(T_STRINGLIT, file.c_str(), pos)); + pos.set_column(column += (unsigned int)file.size()); // account for filename + pending.push_back(result_type(T_GENERATEDNEWLINE, "\n", pos)); + + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'opened_include_file' is called whenever a file referred + // by an #include directive was successfully located and opened. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'filename' contains the file system path of the + // opened file (this is relative to the directory of the currently + // processed file or a absolute path depending on the paths given as the + // include search paths). + // + // The include_depth parameter contains the current include file depth. + // + // The is_system_include parameter denotes, whether the given file was + // found as a result of a #include <...> directive. + // + /////////////////////////////////////////////////////////////////////////// +#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0 + // old signature + void + opened_include_file(std::string const &relname, std::string const &absname, + std::size_t include_depth, bool is_system_include) + { +#else + // new signature + template <typename ContextT> + void + opened_include_file(ContextT const& ctx, std::string const &relname, + std::string const &absname, bool is_system_include) + { + 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 + includestrm << "\"" << relname << "\" (" << absname << ")"; + + includestrm << std::endl; + } + } + +#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0 + /////////////////////////////////////////////////////////////////////////// + // + // The function 'detected_include_guard' is called whenever either a + // include file is about to be added to the list of #pragma once headers. + // That means this header file will not be opened and parsed again even + // if it is specified in a later #include directive. + // This function is called as the result of a detected include guard + // scheme. + // + // The implemented heuristics for include guards 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 + // ... + // #endif + // + // 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. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'filename' contains the file system path of the + // opened file (this is relative to the directory of the currently + // processed file or a absolute path depending on the paths given as the + // include search paths). + // + // The parameter contains the name of the detected include guard. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT> + void + detected_include_guard(ContextT const& ctx, std::string const& filename, + std::string const& include_guard) + { + if (enabled_guard_tracing()) { + guardstrm << include_guard << ":" << std::endl + << " " << filename << std::endl; + } + } +#endif + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'may_skip_whitespace' will be called by the + // library whenever a token is about to be returned to the calling + // application. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The 'token' parameter holds a reference to the current token. The policy + // is free to change this token if needed. + // + // The 'skipped_newline' parameter holds a reference to a boolean value + // which should be set to true by the policy function whenever a newline + // is going to be skipped. + // + // If the return value is true, the given token is skipped and the + // preprocessing continues to the next token. If the return value is + // false, the given token is returned to the calling application. + // + // ATTENTION! + // Caution has to be used, because by returning true the policy function + // is able to force skipping even significant tokens, not only whitespace. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT> + bool may_skip_whitespace(ContextT const &ctx, TokenT &token, + bool &skipped_newline) + { + return this->base_type::may_skip_whitespace( + ctx, token, need_preserve_comments(ctx.get_language()), + preserve_bol_whitespace, skipped_newline) ? + !preserve_whitespace : false; + } + + /////////////////////////////////////////////////////////////////////////// + // + // The function 'throw_exception' will be called by the library whenever a + // preprocessing exception occurs. + // + // The parameter 'ctx' is a reference to the context object used for + // instantiating the preprocessing iterators by the user. + // + // The parameter 'e' is the exception object containing detailed error + // information. + // + // The default behavior is to call the function boost::throw_exception. + // + /////////////////////////////////////////////////////////////////////////// + template <typename ContextT> + void + throw_exception(ContextT const& ctx, boost::wave::preprocess_exception const& e) + { +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + if (!is_import_directive_error(e)) + boost::throw_exception(e); +#else + boost::throw_exception(e); +#endif + } + using base_type::throw_exception; + +protected: +#if BOOST_WAVE_SUPPORT_MS_EXTENSIONS != 0 + /////////////////////////////////////////////////////////////////////////// + // Avoid throwing an error from a #import directive + bool is_import_directive_error(boost::wave::preprocess_exception const& e) + { + using namespace boost::wave; + if (e.get_errorcode() != preprocess_exception::ill_formed_directive) + return false; + + // the error string is formatted as 'severity: error: directive' + std::string error(e.description()); + std::string::size_type p = error.find_last_of(":"); + return p != std::string::npos && error.substr(p+2) == "import"; + } +#endif + + /////////////////////////////////////////////////////////////////////////// + // Interpret the different Wave specific pragma directives/operators + template <typename ContextT, typename ContainerT> + bool + interpret_pragma_trace(ContextT& ctx, ContainerT const &values, + typename ContextT::token_type const &act_token) + { + typedef typename ContextT::token_type token_type; + typedef typename token_type::string_type string_type; + + bool valid_option = false; + + if (1 == values.size()) { + token_type const &value = values.front(); + + if (value.get_value() == "enable" || + value.get_value() == "on" || + value.get_value() == "1") + { + // #pragma wave trace(enable) + enable_tracing(static_cast<trace_flags>( + tracing_enabled() | trace_macros)); + valid_option = true; + } + else if (value.get_value() == "disable" || + value.get_value() == "off" || + value.get_value() == "0") + { + // #pragma wave trace(disable) + enable_tracing(static_cast<trace_flags>( + tracing_enabled() & ~trace_macros)); + valid_option = true; + } + } + if (!valid_option) { + // unknown option value + string_type option_str ("trace"); + + if (values.size() > 0) { + option_str += "("; + option_str += boost::wave::util::impl::as_string(values); + option_str += ")"; + } + BOOST_WAVE_THROW_CTX(ctx, boost::wave::preprocess_exception, + ill_formed_pragma_option, option_str.c_str(), + act_token.get_position()); + return false; + } + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // interpret the pragma wave option(preserve: [0|1|2|3|push|pop]) directive + template <typename ContextT> + static bool + interpret_pragma_option_preserve_set(int mode, bool &preserve_whitespace, + bool& preserve_bol_whitespace, ContextT &ctx) + { + switch(mode) { + // preserve no whitespace + case 0: + preserve_whitespace = false; + preserve_bol_whitespace = false; + ctx.set_language( + enable_preserve_comments(ctx.get_language(), false), + false); + break; + + // preserve BOL whitespace only + case 1: + preserve_whitespace = false; + preserve_bol_whitespace = true; + ctx.set_language( + enable_preserve_comments(ctx.get_language(), false), + false); + break; + + // preserve comments and BOL whitespace only + case 2: + preserve_whitespace = false; + preserve_bol_whitespace = true; + ctx.set_language( + enable_preserve_comments(ctx.get_language()), + false); + break; + + // preserve all whitespace + case 3: + preserve_whitespace = true; + preserve_bol_whitespace = true; + ctx.set_language( + enable_preserve_comments(ctx.get_language()), + false); + break; + + default: + return false; + } + return true; + } + + template <typename ContextT, typename IteratorT> + bool + interpret_pragma_option_preserve(ContextT &ctx, IteratorT &it, + IteratorT end, typename ContextT::token_type const &act_token) + { + using namespace boost::wave; + + 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") { + // push current preserve option onto the internal option stack + if (need_preserve_comments(ctx.get_language())) { + if (preserve_whitespace) + preserve_options.push(3); + else + preserve_options.push(2); + } + else if (preserve_bol_whitespace) { + preserve_options.push(1); + } + else { + preserve_options.push(0); + } + return true; + } + else if ((*it).get_value() == "pop") { + // test for mismatched push/pop #pragmas + if (preserve_options.empty()) { + BOOST_WAVE_THROW_CTX(ctx, bad_pragma_exception, + pragma_mismatched_push_pop, "preserve", + act_token.get_position()); + } + + // pop output preserve from the internal option stack + bool result = interpret_pragma_option_preserve_set( + preserve_options.top(), preserve_whitespace, + preserve_bol_whitespace, ctx); + preserve_options.pop(); + return result; + } + return false; + } + + 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, + preserve_bol_whitespace, ctx); + } + + // interpret the pragma wave option(line: [0|1|2|push|pop]) directive + template <typename ContextT, typename IteratorT> + bool + interpret_pragma_option_line(ContextT &ctx, IteratorT &it, + IteratorT end, typename ContextT::token_type const &act_token) + { + using namespace boost::wave; + + 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") { + // push current line option onto the internal option stack + int mode = 0; + if (need_emit_line_directives(ctx.get_language())) { + mode = 1; + if (enable_relative_names_in_line_directives()) + mode = 2; + } + line_options.push(mode); + return true; + } + else if ((*it).get_value() == "pop") { + // test for mismatched push/pop #pragmas + if (line_options.empty()) { + BOOST_WAVE_THROW_CTX(ctx, bad_pragma_exception, + 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(), 0 != line_options.top()), + false); + enable_relative_names_in_line_directives(2 == line_options.top()); + line_options.pop(); + return true; + } + return false; + } + + 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 || 2 == emit_lines) { + // set the new emit #line directive mode + ctx.set_language( + enable_emit_line_directives(ctx.get_language(), emit_lines), + false); + return true; + } + return false; + } + + // interpret the pragma wave option(output: ["filename"|null|default|push|pop]) + // directive + template <typename ContextT> + bool + interpret_pragma_option_output_open(boost::filesystem::path &fpath, + ContextT& ctx, typename ContextT::token_type const &act_token) + { + namespace fs = boost::filesystem; + + // ensure all directories for this file do exist + boost::wave::util::create_directories( + boost::wave::util::branch_path(fpath)); + + // figure out, whether the file has been written to by us, if yes, we + // append any output to this file, otherwise we overwrite it + std::ios::openmode mode = std::ios::out; + if (fs::exists(fpath) && written_by_us.find(fpath) != written_by_us.end()) + mode = (std::ios::openmode)(std::ios::out | std::ios::app); + + written_by_us.insert(fpath); + + // close the current file + if (outputstrm.is_open()) + outputstrm.close(); + + // open the new file + outputstrm.open(fpath.string().c_str(), mode); + if (!outputstrm.is_open()) { + BOOST_WAVE_THROW_CTX(ctx, boost::wave::preprocess_exception, + could_not_open_output_file, + fpath.string().c_str(), act_token.get_position()); + return false; + } + + // write license text, if file was created and if requested + if (mode == std::ios::out && !license_info.empty()) + outputstrm << license_info; + + generate_output = true; + current_outfile = fpath; + return true; + } + + bool interpret_pragma_option_output_close(bool generate) + { + if (outputstrm.is_open()) + outputstrm.close(); + current_outfile = boost::filesystem::path(); + generate_output = generate; + return true; + } + + template <typename ContextT, typename IteratorT> + bool + interpret_pragma_option_output(ContextT &ctx, IteratorT &it, + IteratorT end, typename ContextT::token_type const &act_token) + { + 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; + + string_type fname ((*it).get_value()); + fs::path fpath (boost::wave::util::create_path( + util::impl::unescape_lit(fname.substr(1, fname.size()-2)).c_str())); + fpath = boost::wave::util::complete_path(fpath, ctx.get_current_directory()); + result = interpret_pragma_option_output_open(fpath, ctx, act_token); + } + else if (T_IDENTIFIER == id) { + if ((*it).get_value() == "null") { + // suppress all output from this point on + result = interpret_pragma_option_output_close(false); + } + else if ((*it).get_value() == "push") { + // initialize the current_outfile, if appropriate + if (output_options.empty() && current_outfile.empty() && + !default_outfile.empty() && default_outfile != "-") + { + current_outfile = boost::wave::util::complete_path( + default_outfile, ctx.get_current_directory()); + } + + // push current output option onto the internal option stack + output_options.push( + output_option_type(generate_output, current_outfile)); + result = true; + } + else if ((*it).get_value() == "pop") { + // test for mismatched push/pop #pragmas + if (output_options.empty()) { + BOOST_WAVE_THROW_CTX(ctx, bad_pragma_exception, + pragma_mismatched_push_pop, "output", + 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; + current_outfile = opts.second; + if (!current_outfile.empty()) { + // re-open the last file + result = interpret_pragma_option_output_open(current_outfile, + ctx, act_token); + } + else { + // either no output or generate to std::cout + result = interpret_pragma_option_output_close(generate_output); + } + output_options.pop(); + } + } + else if (T_DEFAULT == id) { + // re-open the default output given on command line + if (!default_outfile.empty()) { + if (default_outfile == "-") { + // the output was suppressed on the command line + result = interpret_pragma_option_output_close(false); + } + else { + // there was a file name on the command line + fs::path fpath(boost::wave::util::create_path(default_outfile)); + result = interpret_pragma_option_output_open(fpath, ctx, + act_token); + } + } + else { + // generate the output to std::cout + result = interpret_pragma_option_output_close(true); + } + } + return result; + } + + /////////////////////////////////////////////////////////////////////////// + // join all adjacent string tokens into the first one + template <typename StringT> + StringT unlit(StringT const& str) + { + return str.substr(1, str.size()-2); + } + + template <typename StringT> + StringT merge_string_lits(StringT const& lhs, StringT const& rhs) + { + StringT result ("\""); + + result += unlit(lhs); + result += unlit(rhs); + result += "\""; + return result; + } + + template <typename ContextT, typename ContainerT> + void join_adjacent_string_tokens(ContextT &ctx, ContainerT const& values, + ContainerT& joined_values) + { + 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; + typedef typename ContainerT::iterator iterator; + + token_type* current = 0; + + const_iterator end = values.end(); + for (const_iterator it = values.begin(); it != end; ++it) { + token_id id(*it); + + if (id == T_STRINGLIT) { + if (!current) { + joined_values.push_back(*it); + current = &joined_values.back(); + } + else { + current->set_value(merge_string_lits( + current->get_value(), (*it).get_value())); + } + } + else if (current) { + typedef util::impl::next_token<const_iterator> next_token_type; + token_id next_id (next_token_type::peek(it, end, true)); + + if (next_id != T_STRINGLIT) { + current = 0; + joined_values.push_back(*it); + } + } + else { + joined_values.push_back(*it); + } + } + } + + /////////////////////////////////////////////////////////////////////////// + // interpret the pragma wave option() directives + template <typename ContextT, typename ContainerT> + bool + interpret_pragma_option(ContextT &ctx, ContainerT const &cvalues, + 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; + + ContainerT values; + join_adjacent_string_tokens(ctx, cvalues, values); + + 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|3|push|pop]) + valid_option = interpret_pragma_option_preserve(ctx, it, end, + act_token); + } + else if (value.get_value() == "line") { + // #pragma wave option(line: [0|1|2|push|pop]) + valid_option = interpret_pragma_option_line(ctx, it, end, + act_token); + } + else if (value.get_value() == "output") { + // #pragma wave option(output: ["filename"|null|default|push|pop]) + valid_option = interpret_pragma_option_output(ctx, it, end, + act_token); + } + + if (!valid_option) { + // unknown option value + string_type option_str ("option"); + + if (values.size() > 0) { + option_str += "("; + option_str += util::impl::as_string(values); + option_str += ")"; + } + BOOST_WAVE_THROW_CTX(ctx, boost::wave::preprocess_exception, + ill_formed_pragma_option, + option_str.c_str(), act_token.get_position()); + return false; + } + + token_id id = util::impl::skip_whitespace(it, end); + if (id == T_COMMA) + util::impl::skip_whitespace(it, end); + } + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // interpret the #pragma wave system() directive + template <typename ContextT, typename ContainerT> + bool + interpret_pragma_system(ContextT& ctx, ContainerT &pending, + ContainerT const &values, + typename ContextT::token_type const &act_token) + { + typedef typename ContextT::token_type token_type; + 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)); + string_type native_cmd(system_str); + + system_str += " >" + stdout_file + " 2>" + stderr_file; + 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, boost::wave::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; + typedef typename ContextT::input_policy_type input_policy_type; + typedef boost::wave::iteration_context< + ContextT, lexer_type, input_policy_type> + iteration_context_type; + + iteration_context_type iter_ctx(ctx, stdout_file.c_str(), + act_token.get_position(), ctx.get_language()); + ContainerT pragma; + + for (/**/; iter_ctx.first != iter_ctx.last; ++iter_ctx.first) + pragma.push_back(*iter_ctx.first); + + // prepend the newly generated token sequence to the 'pending' container + pending.splice(pending.begin(), pragma); + + // erase the created tempfiles + std::remove(stdout_file.c_str()); + std::remove(stderr_file.c_str()); + return true; + } + + /////////////////////////////////////////////////////////////////////////// + // The function enable_tracing is called, whenever the status of the + // tracing was changed. + // The parameter 'enable' is to be used as the new tracing status. + void enable_tracing(trace_flags flags) + { logging_flags = flags; } + + // The function tracing_enabled should return the current tracing status. + trace_flags tracing_enabled() + { return logging_flags; } + + // Helper functions for generating the trace output + void open_trace_body(char const *label = 0) + { + if (label) + output(label); + output("[\n"); + increment_level(); + } + void close_trace_body() + { + if (get_level() > 0) { + decrement_level(); + output("]\n"); + tracestrm << std::flush; // flush the stream buffer + } + } + + template <typename StringT> + void output(StringT const &outstr) const + { + indent(get_level()); + tracestrm << outstr; // output the given string + } + + void indent(int level) const + { + for (int i = 0; i < level; ++i) + tracestrm << " "; // indent + } + + 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); + } + bool enabled_include_tracing() const + { + return (flags & trace_includes); + } + bool enabled_guard_tracing() const + { + return (flags & trace_guards); + } + bool enabled_macro_counting() const + { + return logging_flags & trace_macro_counts; + } + + void count_invocation(std::string const& name) + { + typedef std::map<std::string, std::size_t>::iterator iterator; + typedef std::map<std::string, std::size_t>::value_type value_type; + + iterator it = counts.find(name); + if (it == counts.end()) + { + std::pair<iterator, bool> 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") { + // restart the timer + elapsed_time.restart(); + } + else if (value.get_value() == "1") { + // print out the current elapsed time + std::cerr + << value.get_position() << ": " + << elapsed_time.format_elapsed_time() + << std::endl; + } + else if (value.get_value() == "suspend") { + // suspend the timer + elapsed_time.suspend(); + } + else if (value.get_value() == "resume") { + // resume the timer + elapsed_time.resume(); + } + } + +private: + std::ofstream &outputstrm; // main output stream + std::ostream &tracestrm; // trace output stream + std::ostream &includestrm; // included list output stream + std::ostream &guardstrm; // include guard output stream + int level; // indentation level + trace_flags flags; // enabled globally + trace_flags logging_flags; // enabled by a #pragma + bool enable_system_command; // enable #pragma wave system() command + bool preserve_whitespace; // enable whitespace preservation + bool preserve_bol_whitespace; // enable begin of line whitespace preservation + 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::set<boost::filesystem::path> written_by_us; // all files we have written to + + typedef std::pair<bool, boost::filesystem::path> output_option_type; + std::stack<output_option_type> output_options; // output option stack + std::stack<int> line_options; // line option stack + std::stack<int> preserve_options; // preserve option stack + + std::map<std::string, std::size_t> counts; // macro invocation counts + bool emit_relative_filenames; // emit relative names in #line directives + + std::set<std::string> noexpandmacros; // list of macros not to expand + + std::string license_info; // text to pre-pend to all generated output files +}; + +#undef BOOST_WAVE_GETSTRING +#undef BOOST_WAVE_OSSTREAM + +#endif // !defined(TRACE_MACRO_EXPANSION_HPP_D8469318_8407_4B9D_A19F_13CA60C1661F_INCLUDED) |