diff --git a/ChangeLog b/ChangeLog deleted file mode 100644 index 573f513..0000000 --- a/ChangeLog +++ /dev/null @@ -1,1314 +0,0 @@ -Boost.Wave: A Standard compliant C++ preprocessor library -http://www.boost.org/ - -Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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. -- Fix the re2c lexer for iterators others then string::iterator (or more - generally for iterators, which aren't random access iterators) -- 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'. - -- Do a sourceforge release. - -------------------------------------------------------------------------------- - -CHANGELOG - -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. - -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 - includeed 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;" staements 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 - . -- 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 'vc-7_1: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 'vc-7_1:off' to 'vc-7.1: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 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 - occured. -- 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 occurences 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 occured, 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 occured 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 ' 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 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/build/Jamfile b/build/Jamfile deleted file mode 100644 index 74d0d2d..0000000 --- a/build/Jamfile +++ /dev/null @@ -1,64 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Build Jamfile -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/build ; - -SOURCES = instantiate_cpp_exprgrammar - instantiate_cpp_grammar - instantiate_cpp_literalgrs - instantiate_defined_grammar - instantiate_predef_macros - instantiate_re2c_lexer - instantiate_re2c_lexer_str - cpplexer/re2clex/aq - cpplexer/re2clex/cpp_re - ; - -lib boost_wave - : ../src/$(SOURCES).cpp - : # build requirements - [ common-names ] # magic for install and auto-link features - $(BOOST_ROOT) - $(BOOST_ROOT) - <*>off # workaround for compiler bug - cpp_re.cpp - : debug release # build variants - ; - -#dll boost_wave -# : ../src/$(SOURCES).cpp -# : # build requirements -# [ common-names ] # magic for install and auto-link features -# BOOST_WAVE_DYN_LINK=1 # tell source we're building dll's -# dynamic # build only for dynamic runtimes -# $(BOOST_ROOT) -# $(BOOST_ROOT) -# : debug release # build variants -# ; - -install wave lib - : boost_wave -# boost_wave - ; - -stage stage/lib : boost_wave # boost_wave - : - # copy to a path rooted at BOOST_ROOT: - $(BOOST_ROOT) - # make sure the names of the libraries are correctly named: - [ common-names ] - # add this target to the "stage" and "all" pseudo-targets: - stage - all - : - debug release - ; - -# end diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 deleted file mode 100644 index b42f9d5..0000000 --- a/build/Jamfile.v2 +++ /dev/null @@ -1,46 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Build Jamfile -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - : - 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 - cpplexer/re2clex/aq - cpplexer/re2clex/cpp_re - ; - -lib boost_wave - : - $(SOURCES).cpp - /boost/filesystem//boost_filesystem - : - msvc-7.1:off # workaround for compiler bug - # Not supported by V2 - # cpp_re.cpp - ; - -install dist-lib - : - boost_wave - : - LIB - ../../../dist/lib - ; - -explicit dist-lib ; diff --git a/doc/acknowledgements.html b/doc/acknowledgements.html deleted file mode 100644 index 466d6ac..0000000 --- a/doc/acknowledgements.html +++ /dev/null @@ -1,91 +0,0 @@ - - - -Acknowledgements - - - - - - - - - - -

Acknowledgements
-
- - - - - - - -
-

Special thanks to:

-
-

Paul Mensonides for his invaluable help while developing the macro - expansion engine and his insightful tips. He developed the recursive macro - expansion algorithm implemented herein and also contributed most of the small - testcases used for testing the correctness of the macro expansion.

-

Dan Nuffer, who wrote the initial Re2C based C++ lexer and the Slex - (Spirit Lex) scanner generator sample.

-

Martin Wille for helping with the port to Linux, testing on Linux and for contributing - the automated test scripts.

-

Vladimir Prus for helping with the command line and config file options - analysis for the Wave driver executable.

-

Juan Carlos Arevalo-Baeza, who wrote the Spirit cpp_lexer sample, - from which are taken some ideas.

-

Andrei Alexandrescu for allowing to use his flex_string class, -a policy based std::basic_string<> compatible string implementation.

-

Reece Dunn, Vesa Karvonen, Faisal Vali, Porter Schermerhorn and Daniel Fontijne for - reporting several problems and bugs.

-

Tarmo Pikaro for reporting several bug while compiling specific - headers from the Microsoft Windows SDK.

-

Rob Stewart helped a lot with proof reading the documentation.

-

Stefan Seefeld for integrating Wave into his Synopsis library and finding a couple of bugs along the way.

-
-

and last but not least

-
-

Joel de Guzman for nudging me into this adventure and for his work - on the Spirit parser framework, without which the Wave library - wouldn't have been possible.

-
-

Special thanks also to people who gave feedback and valuable comments, particularly members of Boost and Spirit mailing lists. This includes all those who participated in the Boost review: -

-

Tom Brinkman (who volunteered to be the review managaer), 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

-
-

The Wave library uses the following Boost [8] - libraries:

-
-

 Boost - Spirit (LL parser framework that represents parsers directly as EBNF grammars - in inlined C++)
- Boost - Iterator Adaptor Library (Adapt a base type into a standard conforming iterator)
- Boost - Filesystem Library (Portable paths, iteration over directories, and other - useful filesystem operations)
-  Boost Program - options and arguments library

-
-

and other small parts of different Boost libraries.

- - - - - - - -
-
- -Last updated: - Sunday, May 15, 2005 12:23 - - - diff --git a/doc/class_reference_context.html b/doc/class_reference_context.html deleted file mode 100644 index e2df7d5..0000000 --- a/doc/class_reference_context.html +++ /dev/null @@ -1,450 +0,0 @@ - - - - The Context Object - - - - - - - - - - -

The - Context Object
-
- - - - - - - -
-
-

Introduction
- Header 'wave/context.hpp' synopsis
- Public Typedefs
- Template parameters
- Member functions

-
-

Introduction

-

The boost::wave::context<> object is the main user visible object of - the Wave library. It exists to generate the pair of iterators, which - while dereferenced return the preprocessed tokens. Additionally it is used - to control other aspects of the preprocessing, such as

-
-

 include - search paths, which define, where to search for files to be included with - #include <...> and #include "..." directives
-  which - macros to predefine and which of the predefined macros to undefine
-  several - other options as for instance to control, whether to enable several extensions - to the C++ Standard (as for instance variadics and placemarkers) or not.

-
-

Header wave/cpp_context.hpp - synopsis

-
namespace boost {
-namespace wave { 
-    
-    template <
-        typename Iterator, typename LexIterator, 
-        typename InputPolicy, typename TracePolicy 
-    > 
-    class context : public InputPolicy 
-    {
-    public: 
-
-        typedef pp_iterator<context> iterator_type; 
-        typedef Token token_type;
-        typedef typename token_type::position_type position_type;
-
-    // constructor
-        context(Iterator const &first_, 
-            Iterator const &last_, 
-            char const *fname = "<Unknown>",
-            TracePolicy &trace = TracePolicy())
-
-    // iterator interface
-        iterator_type begin() const;
-        iterator_type end() const;
-
-    // maintain include paths
-        bool add_include_path(char const *path_);
-        bool add_sysinclude_path(char const *path_);
-        void set_sysinclude_delimiter();
-  
-        size_t get_iteration_depth() const;
-
-    // maintain defined macros
-        bool add_macro_definition(std::string macrostring, 
-            bool is_predefined = false);
-        bool is_defined_macro(std::string const &name) const;
-        bool remove_macro_definition(std::string const &name, 
-            bool even_predefined = false);
-        void reset_macro_definitions();
-
-    // other options
-        void set_language(language_support enable);
-        language_support get_language() const;
- void set_max_include_nesting_depth(std::size_t new_depth);
size_t get_max_include_nesting_depth() const;
- // get the Wave version information - static std::string get_version(); - static std::string get_version_string(); - }; - -} // namespace wave -} // namespace boost
-

Template parameters

-

The boost::wave::context object has three template parameters to specify - the concrete behaviour of its operation. The following table describes these - with more detail.

- - - - - - - - - - - - - - - - - - - - -
Template parameters required for the - boost::wave::context class
Iterator

The type of the underlying iterator, - through which the input stream is accessed.
- This should be at least an forward_iterator type iterator.

LexIterator

The type of the lexer type to be used by the Wave - library to identify tokens in the input stream.

InputPolicy

The type of the input policy class, which allows - to customize the behaviour of the Wave library and the type of the iterators - to use, when it comes to including and opening an included file.

TracePolicy

The type of the trace policy class, which allows - to customize the trace output generated while expanding macros.

-

For further information about the lexer type to use, please refer to the The - Lexer Interface .

-

If the template parameter InputPolicy is omitted, the template wave::iteration_context_policies::load_file_to_string - is used. For further information about the input policy, please refer to the - topic The Input Policy.

-

If the template parameter TracePolicyT is omitted, the wave::macro_trace_policies::no_tracing - policy type is used, i.e. by default there is no tracing performed. For further - information about the tracing policy, please refer to the topic The - Tracing Policy.

-

Public Typedefs

-

The boost::wave::context template defines the following public typedefs, which may be useful while using this class:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Public typedef's defined by the boost::wave::context class
iterator_type

The Iterator template parameter provided, while the context class was instantiated.

lex_type

The LexIterator template parameter provided, while the context class was instantiated.

token_type

The token type, which is returned by the context generated iterators. This type is taken from the LexIterator template parameter provided, whicle the context class was instantiated.

input_policy_type

The InputPolicy template parameter provided, while the context class was instantiated.

trace_policy_type

The TracePolicy template parameter provided, while the context class was instantiated.

position_type

The type of the position information contained in every returned token, which describes the point, at which the given token was recognised.

-

Member functions

-

Constructor

-
    context(Iterator const &first, 
-        Iterator const &last, char const *filename, 
-        TracePolicy &trace);
-

Constructs a context object on top of the input stream given by the pair - of auxilliary iterators [first, last). The iterators should - be at least forward_iterator type iterators. The filename parameter - is to be supplied for informational purposes only. This string is used for - indicating the token positions inside the input stream, it is not validated - against the file system. If the filename parameter is not given it defaults - to "<Unknown>". If the trace - parameter isn't supplied it defaults to a default constructed TracePolicy - object.

-

Additionally the macro symbol table is filled with the predefined macros - and the current reference directory is set to the path of the given filename. - If this filename does not reference valid file system item, the current reference - directory is set to the current system directory. (The current reference directory - is the file system path, which is used as the target directory during the - processing of #include "..." directives).

-

Iterator interface

-

The pair of iterators returned by the context::begin and context::end - functions is the main interface for accessing the preprocessed tokens from the - preprocessor engine. While iterating over the given iterator range [begin, end) - there are returned the preprocessed C++ tokens, which are generated on the fly - from the underlying input stream. The returned iterators are conceptually of - forward_iterator type.

-

begin

-
    iterator_type begin();
-
-

Initializes and returns the starting iterator for the preprocessed token - stream.

- -
-

end

-
    iterator_type end() const;
-
-

Initializes and returns the end of stream iterator to compare with for detecting - the end of the preprocessed token stream.

-
-

Maintain include paths

-

The Wave library maintains two separate search paths for include - files. A search path for user include files and a search path for system include - files. Any directories specified with the add_include_path() - function before the function set_sysinclude_delimiter() - is called are searched only for the case of #include "..." - directives, they are not searched for #include <file> directives. - I.e. these directories are added to the user include search path.

-

If additional directories are specified with the add_include_path() - function after a call to the function set_sysinclude_delimiter(), - these directories are searched for all #include directives. I.e. these - directories are added to the system include search path.

-

In addition, a call to the function set_sysinclude_delimiter() - inhibits the use of the current reference directory as the first search directory - for #include "..." directives. Therefore, the current - reference directory is searched only, if it is requested explicitly with a call - to the function add_include_path("."). -

-

Callig both functions, the set_sysinclude_delimiter() - and add_include_path(".") allows you - to control precisely, which directories are searched before the current one - and which are searched after.

-

These functions are modelled after the command line behaviour implemented by - the popular gcc compiler.
-

-

add_include_path

-
    bool add_include_path(char const *path);
-
-
-

Adds the given file system path to the user include search paths. After a - call to the set_sysinclude_delimiter() - this function adds the given file system path to the system include search - paths. Note though, that the given path is validated against the file system. -

-

If the given path string does not form a name of a valid file system directory - item, the function returns false. If the given path was successfully - added to the include search paths in question, the function returns true.

-
-

add_sysinclude_path

-
    bool add_sysinclude_path(char const *path);
-
-

Adds the given file system path to the system include search paths. This - function operates on the system include search path regardless of the mode - of operation of the add_include_path(). Note - though, that the given path is validated against the file system.

-

If the given path string does not form a name of a valid file system directory - item, the function returns false. If the given path was successfully - added to the system include search paths, the function returns true.

-
-

set_sysinclude_delimiter

-
    void set_sysinclude_delimiter();
-
-

Switches the mode, how the add_include_path() - function operates. By default the given file system path is added to the user - include search paths. After calling this function a subsequent call to the - add_include_path() adds the given file system - path to the system include search paths. Additionally it inhibits the the - use of the current reference directory as the first search directory for #include "..." - directives.

-
-

get_iteration_depth

-
    size_t get_iteration_depth() const;
-
-

Returns the actual include iteration depth, i.e. the current number of include - levels to be poped from the include iteration context, before the main (topmost) - iteration context is reached.

-
-

Maintain defined macros

-

add_macro_definition

-
    bool add_macro_definition(
-        std::string macrostring, 
-        bool is_predefined); 
-
-
-

Adds a new macro definition to the macro symbol table. The parameter macrostring - should contain the macro to define in the command line format, i.e. something - like MACRO(x)=definition. The following table describes this format - in more detail. The parameter is_predefined should be true while - defining predefined macros, i.e. macros, which are not undefinable with an - #undef directive from inside the preprocessed input stream. If this - parameter is not given, it defaults to false.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Summary of possible formats for defining - macros
MACROdefine MACRO as 1
MACRO=define MACRO as nothing (empty)
MACRO=definitiondefine MACRO as definition
MACRO(x)define MACRO(x) as 1
MACRO(x)=define MACRO(x) as nothing (empty)
MACRO(x)=definitiondefine MACRO(x) as definition
-

The function returns false, if the macro to define already was defined - and the new definition is equivalent to the existing one, it returns true, - if the new macro was successfully added to the macro symbol table.

-

If the given macro definition resembles a redefinition and the new macro - is not identical to the already defined macro (in the sense defined by the - C++ Standard), the function throws a corresponding preprocess_exception.

-
-

is_defined_macro

-
    bool is_defined_macro(std::string const &name) const; 
-
-

Returns, if a macro with the given name is defined, i.e. if it is - contained in the macro symbol table.

-
-

remove_macro_definition

-
    bool remove_macro_definition(
-        std::string const &name, 
-        bool even_predefined); 
-
-

Removes the definition of the macro with the given name from the - macro symbol table. This operation is equivalent to an #undef directive - with this name executed from within the input stream. If the parameter - even_predefined is true, then the macro is removed from - the macro symbol table even, if it is defined as a predefined macro.

-

Note though, that the following macros are not undefinable in any - case: __FILE__, __LINE__, __DATE__, __TIME__, - __cplusplus, __STDC__. If the parameter even_predefined - is not given, it defaults to false.

-

The function returns false, if the macro to undefine was not defined - and returns true otherwise.

-

If the macro to remove may not be undefined (it is a predefined macro and - the parameter even_predefined is set to false or it is one - of the mentioned not undefinable macros above) the function throws a preprocess_exception.

-
-

reset_macro_definitions

-
    void reset_macro_definitions(); 
-
-

Resets the macro symbol table to it's initial state, i.e. undefines all user defined macros and inserts the internal predefined macros as described here.

-
-

Get Version information

-

get_version

-
    static std::string get_version(); 
-
-

Returns a string containing the current Wave version formatted as 0xvvrsbbbb - (this is a string representation of the equivalent hexadecimal number), where - 'vv' is the version number, 'r' - the release number, 's' the subrelease number - and 'bbbb' the build number. A possible return - value looks like 0x00910454. The returned value - is the same as is inserted in the preprocessed token stream, when the predefined - macro __WAVE_VERSION__ is expanded.

-
-

get_version_str

-
    static std::string get_version_str(); 
-
-

Returns a string containing the current Wave version formatted as "v.rr.ss.bbbb", - where 'v' is the version number, 'rr' - the release number, 'ss' the subrelease number - and 'bbbb' the build number. A possible return - value looks like "0.9.1.454". The returned - value is the same as is inserted in the preprocessed token stream, when the - predefined macro __WAVE_VERSION_STR__ is expanded.

-
-

Control extended options

-

set_language
- get_language

-
    void set_language(language_support language);
-    language_support get_language() const;
-
-

This functions allows to specify the language mode, in which the Wave - library should work. The possible language modes are defined by the enumerated - type language_support:

-
    enum language_support {
-    // support flags for C++98
-        support_normal = 0x01,
-        support_cpp = support_normal,
-    
-    // support flags for C99
-        support_long_long = 0x02,
-        support_variadics = 0x04,
-        support_c99 = support_variadics | 
-                      support_long_long | 0x08,
-
-    // the mask for the main language settings
-        support_option_mask = 0xFF00,
- // additional fine tuning of the general behaviour - support_option_preserve_comments = 0x0100,
support_option_no_character_validation = 0x0200,
support_option_convert_trigraphs = 0x0400
};
-

When used with support_variadics the support for variadics, placemarkers - and the operator _Pragma() is enabled in normal C++ mode. When used with the support_long_long the support for long long suffixes is enabled in C++ mode.

-

The support_c99 switches to the C99 language support, which enables variadics, placemarkers, the operator _Pragma and long long suffixes by default. Additionally it disables the C++ specific tokens such as '->*', '.*', '::' etc.

-

The support_option_... values are to be used in conjunction with the main language settings (support_normal and support_c99) .

-
    -
  • If the support_option_preserve_comments flag is set, the Wave library preserves almost all comments in the source code. The only comments not preserved are those contained inside macro definitions. By default all comments are replaced by a single space.
  • -
  • If the support_option_no_character_validation flag is set , the Wave library doesn't validate universal character literals (given in the form of 'u1234' or 'U12345678') to be in the allowed value range. This flag is merely used for internal purposes by the testing framework and will be rarely used by a user of the library.
  • -
  • If the support_option_convert_trigraphs flag is set, the Wave library replaces all occurences of trigraph characters with their non-trigraph character sequence (i.e. '??=' is replaced by '#' etc.) . By default no replacement is performed.
  • -
-
-

Note: The set_language function internally resets the list of defined macros, so please be careful not to call it after you have defined your own macros already.

-

set_max_include_nesting_depth
- g et_max_include_nesting_depth

-
    void set_max_include_nesting_depth(size_t new_depth); 
-    size_t get_max_include_nesting_depth() const;
-
-

This functions allow to set or to get the maximal possible include file nesting - depth supported by the Wave library. The initial value for this is - determined by the preprocessing constant WAVE_MAX_INCLUDE_LEVEL_DEPTH - (see here).

-
- - - - - - - -
-
- - - -

 

- - diff --git a/doc/class_reference_ctxpolicy.html b/doc/class_reference_ctxpolicy.html deleted file mode 100644 index 55e6ae8..0000000 --- a/doc/class_reference_ctxpolicy.html +++ /dev/null @@ -1,285 +0,0 @@ - - - -The Context Policy - - - - - - - - - - - -

The - Context Policy
-
- - - - - - - -
-
-

Introduction
- Header 'wave/preprocessing_hooks.hpp' - synopsis
- Member functions

-
-

Introduction

-

The context policy is used to provide callback hooks, which are called from inside the library into the user code, whenever

-
    -
  • a macro get's defined or undefind,
  • -
  • a macro is expanded or rescanned,
  • -
  • an include file is opened or left,
  • -
  • a pragma of the form 'wave option[(value)]' is recognised.
  • -
-

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

-

Header wave/preprocessing_hooks.hpp - synopsis

-
-namespace boost {
-namespace wave {
-namespace context_policies {
- 
-    struct default_preprocessing_hooks {
-
-        // general control function
-        template <typename TokenT, typename ContainerT>
-        void expanding_function_like_macro(TokenT const &macrodef, 
-            std::vector<TokenT> const &formal_args, 
-            ContainerT const &definition, TokenT const &macrocall, 
-            std::vector<ContainerT> const &arguments);
- 
-        template <typename TokenT, typename ContainerT>
-        void expanding_object_like_macro(TokenT const &macro, 
-            ContainerT const &definition, TokenT const &macrocall);
- 
-        template <typename ContainerT>
-        void expanded_macro(ContainerT const &result);
- 
-        template <typename ContainerT>
-        void rescanned_macro(ContainerT const &result);
-
-        // include file tracing functions
-        void found_include_directive(std::string const &filename,
-            bool include_next);
-
-        void opened_include_file(std::string const &relname, 
-            std::string const& absname,
-            std::size_t include_depth, bool is_system_include); 
-
-        void returning_from_include_file();
-
-        // interpretation of #pragma's of the form 
-        // 'wave option[(value)]'
-        template <typename ContextT, typename ContainerT>
-		bool interpret_pragma(ContextT const &ctx, ContainerT &pending, 
-            typename ContextT::token_type const &option, 
-            ContainerT const &values, 
-            typename ContextT::token_type const &pragma_token);
-
-        // macro definition hooks
-        template <
-            typename TokenT, typename ParametersT, typename DefinitionT
-        >
-        void defined_macro(TokenT const &name, bool is_functionlike,
-            ParametersT const &parameters, DefinitionT const &definition,
-            bool is_predefined);
-
-        template <typename TokenT>
-        void undefined_macro(TokenTconst &name);
-    };
-
-}}}   // namespace boost::wave::context_policies
-

Member functions

-

Macro expansion tracking functions

-

expanding_function_like_macro

-
    template <typename TokenT, typename ContainerT>
-    void expanding_function_like_macro(TokenT const &macrodef, 
-        std::vector<TokenT> const &formal_args, 
-        ContainerT const &definition, TokenT const &macrocall, 
-        std::vector<ContainerT> const &arguments);
-
-

The function expanding_function_like_macro is called, whenever a - function-like macro is to be expanded, i.e. before the actual expansion - starts.

-

The macroname parameter marks the position where the macro to expand - is defined. It contains the token which identifies the macro name used inside - the corresponding macro definition.

-

The formal_args parameter holds the formal arguments used during - the definition of the macro.

-

The definition parameter holds the macro definition for the macro - to trace. This is a standard STL container which holds the token sequence - identified during the macro definition as the macro replacement list.

-

The macrocall parameter marks the position where this macro is invoked. - It contains the token, which identifies the macro call inside the preprocessed - input stream.

-

The arguments parameter holds the macro arguments used during the - invocation of the macro. This is a vector of standard STL containers which - contain the token sequences identified at the position of the macro call as - the arguments to be used during the macro expansion.

-
-

expanding_object_like_macro

-
    template <typename TokenT, typename ContainerT>
-    void expanding_object_like_macro(TokenT const &macro, 
-        ContainerT const &definition, TokenT const &macrocall);
-
-
-

The function expanding_object_like_macro is called, whenever a object-like - macro is to be expanded, i.e. before the actual expansion starts.

-

The macroname parameter marks the position where the macro to expand - is defined. It contains the token which identifies the macro name used inside - the corresponding macro definition.

-

The definition parameter holds the macro definition for the macro - to trace. This is a standard STL container which holds the token sequence - identified during the macro definition as the macro replacement list.

-

The macrocall parameter marks the position where this macro is invoked. - It contains the token which identifies the macro call inside the preprocessed - input stream.

-
-

expanded_macro

-
    template <typename ContainerT>
-    void expanded_macro(ContainerT const &result);
-
-
-

The function expanded_macro is called whenever the expansion of - a macro is finished, the replacement list is completely scanned and the identified - macros herein are replaced by its corresponding expansion results, but before - the rescanning process starts.

-

The parameter result contains the the result of the macro expansion - so far. This is a standard STL container containing the generated token sequence.

-
-

rescanned_macro

-
    template <typename ContainerT>
-    void rescanned_macro(ContainerT const &result);
-
-
-

The function rescanned_macro is called whenever the rescanning - of a macro is finished, i.e. the macro expansion is complete.

-

The parameter result contains the the result of the whole macro - expansion. This is a standard STL container containing the generated token - sequence.

-
-

Include file tracing functions

-

found_include_directive

-
    void found_include_directive(std::string const &filename,
-        bool include_next);
-
-
-

The function found_include_directive is called whenever whenever a #include directive was located..

-

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.
-

-
-

opened_include_file

-
    void opened_include_file(std::string const &rel_filename, 
-        std::string const &abs_filename, 
-        std::size_t include_depth, bool is_system_include);
-
-
-

The function opened_include_file is called whenever a file referred - by an #include directive was successfully located and opened.

-

The parameter rel_filename contains the (normalised) probably relative file system path of the opened file. The concrete format of this file name depends on the format of the include search path given to the library beforehand.

-

The parameter abs_filename contains the (normalised) full file system path of the - opened file.

-

The include_depth parameter contains the current include file depth. -

-

The is_system_include parameter denotes, if the given file was found - as a result of a #include <...> directive.

-
-

returning_from_include_file

-
    void returning_from_include_file();
-
-
-

The function returning_from_include_file is called whenever an - included file is about to be closed after it's processing is complete.

-
-

Interpretation of #pragma's

-

interpret_pragma

-
    template <typename Context, typename ContainerT>
-    bool interpret_pragma(ContextT const &ctx, ContainerT &pending, 
-        typename ContextT::token_type const &option, 
-        ContainerT const &values, 
-        typename ContextT::token_type const &pragma_token);
-
-
-

The function interpret_pragma is called whenever an unrecognized - #pragma wave ... or operator _Pragma("wave ...") - is found in the input stream.

-

The ctx parameter provides a reference to the context_type used during instantiation of the preprocessing iterators by the user.

-

The pending parameter may be used to push tokens back into the input - stream which are to be used as the replacement text for the whole #pragma wave() - directive. If this sequence is left empty, no replacement takes place, i.e. - the interpreted directive is removed from the generated token stream.

-

The option parameter contains the name of the interpreted pragma.

-

The values parameter holds the value of the parameter provided to - the pragma operator.

-

The pragma_token parameter contains the actual #pragma token which - may be used for extraction of the location information for some error output.

-

If the return value is 'false', the whole #pragma directive is interpreted - as unknown and a corresponding error message is issued. A return value of - 'true' signs a successful interpretation of the given #pragma.
-

-
-

Macro definition

-

defined_macro

-
    template <
-        typename TokenT, typename ParametersT, typename DefinitionT
-    >
-    void defined_macro(TokenT const &name, bool is_functionlike,
-        ParametersT const &parameters, DefinitionT const &definition,
-        bool is_predefined);
-
-

The function defined_macro is called whenever a macro was defined successfully.

-

The parameter name is a reference to the token holding the macro name.

-

The parameter is_functionlike is set to true whenever the newly - defined macro is defined as a function like macro.

-

The parameter parameters holds the parameter tokens for the macro - definition. If the macro has no parameters or if it is a object like - macro, then this container is empty.

-

The parameter definition contains the token sequence given as the - replacement sequence (definition part) of the newly defined macro.

-

The parameter is_predefined is set to true for all macros predefined - during the initialisation pahase of the library.
-

-
-

undefined_macro

-
    template <typename TokenT>
-    void undefined_macro(TokenTconst &name);
-
-
-

The function undefined_macro is called whenever a macro definition - was removed successfully.

-

The parameter name holds the token of the macro which definition was removed.
-

-
- - - - - - - -
-
- - - - - diff --git a/doc/class_reference_filepos.html b/doc/class_reference_filepos.html deleted file mode 100644 index d002005..0000000 --- a/doc/class_reference_filepos.html +++ /dev/null @@ -1,119 +0,0 @@ - - - -The File Position - - - - - - - - - - - -

The - File Position
-
- - - - - - - -
-
-

Introduction
- Header 'wave/util/file_position.hpp' - synopsis
- Template parameters
- Member functions

-
-

Introduction

-

The file position template is used to represent a concrete token position inside - the underlying input stream. This token position contains the corresponding - filename, the line number and the column number, where the token was recognized.

-

Header wave/util/file_position.hpp - synopsis

-
namespace boost {
-namespace wave {
-namespace util {
-
-    template <typename String = std::string>
-    class file_position {
- 
-    public:
-        file_position();
-        explicit file_position(String const &file, 
-            int line_ = 1, int column_ = 1);
-
-    // accessors
-        String const &get_file() const;
-        int get_line() const;
-        int get_column() const;
-    
-        void set_file(String const &file);
-        void set_line(int line);
-        void set_column(int column);
-    };
-
-}   // namespace util
-}   // namespace wave
-}   // namespace boost
-

Template parameters

-

The file_position template used by the default token type has to be instantiated with one template parameter, - which gives the string type to use for storing the file name member of the file - position. If this parameter isn't given, it defaults to a std::string. - Please note, that the type given as the template parameter must be compatible - with a std::string.

-

You may use your own position types if appropriate, but in any case these should implement the same interface as the file_position template described here.

-

Member functions

-

Constructors

-
        file_position();
-        explicit file_position(String const &file, 
-            int line_ = 1, int column_ = 1);
-
-
-

The constructors initialize a new instance of a file_position in - correspondence to the supplied parameters. The parameters default to an empty - filename and the line number and column number set to one.

-
-

get_file, get_line, get_column

-
        String const &get_file() const;
-        int get_line() const;
-        int get_column() const;
-
-
-

The get_... functions are used to access the current values of the - file position members: the filename (get_file), the line number (get_line) - and the column number (get_column).

-
-

set_file, set_line, set_column

-
        void set_file(String const &file);
-        void set_line(int line);
-        void set_column(int column);
-
-
-

The set_... functions are used to set new values to the file position - members: the filename (set_file), the line number (set_line) - and the column number (set_column).

-
- - - - - - - -
-
- -Sunday, May 15, 2005 12:23e format:fcAm1m -->Thursday, May 12, 2005 9:14 -

- - -Sunday, May 15, 2005 12:23 \ No newline at end of file diff --git a/doc/class_reference_inptpolcy.html b/doc/class_reference_inptpolcy.html deleted file mode 100644 index f0c62ae..0000000 --- a/doc/class_reference_inptpolcy.html +++ /dev/null @@ -1,132 +0,0 @@ - - - -The Input Policy - - - - - - - - - - - -

The - Input Policy
-
- - - - - - - -
- -
-

Introduction
- Header 'wave/cpp_iteration_context.hpp' - synopsis
- Template parameters
- Member functions

-
-

Introduction

-

The input policy type may be specified as a template parameter to the wave::context - object and is used for customizing the way, how an included file is to be represented - by a pair of iterators pointing to the beginning and the end of the resulting - input sequence. If this template parameter is not given while instantiating - the context object, it defaults to the iteration_context_policies::load_file_to_string - type.

-

Header wave/iteration_context.hpp - synopsis

-

The following code listing does not show the required interface only, but for - brevity reasons the whole implementation of an input policy, which loads the - given file into a string variable and exposes the begin() and end() iterators - of this string to the Wave library.

-
namespace boost {
-namespace wave {
-namespace iteration_context_policies {
-
-    struct load_file_to_string {
-    
-        template <typename IterContext>
-        class inner {
-        
-        public:
-            // expose the begin and end iterators for the
-            // included file
-            template <typename Position>
-            static 
-            void init_iterators(IterContext&iter_ctx, 
-                Position const &act_pos)
-            {
-                typedef typename IterContext::iterator_type iterator_type;
-                
-                std::ifstream instream(iter_ctx.filename.c_str());
-                if (!instream.is_open()) {
-                    CPP_THROW(preprocess_exception, bad_include_file, 
-                        iter_ctx.filename, act_pos);
-                }
-                
-                iter_ctx.instring = std::string(
-                    std::istreambuf_iterator(instream.rdbuf()),
-                    std::istreambuf_iterator());
-
-                iter_ctx.first = iterator_type(iter_ctx.instring.begin(), 
-                    iter_ctx.instring.end(), 
-                    PositionT(iter_ctx.filename));
-                iter_ctx.last = iterator_type();
-            }
-
-        private:
-            std::string instring;
-        };
-    };
-
-}   // namespace iteration_context_policies
-}   // namespace wave 
-}   // namespace boost   
-

As you can see, an input_policy for the wave::context object - should implement one function only, the init_iterators function. The policy - shown is implemented with the help of an embedded class to avoid the need for - template template parameters, which aren't implemented by all systems today. - This embedded class should have the name inner.

-

Template Parameters

-

The inner class is instantiated with one template parameter, the iteration - context type, from which the policy is a part of. The iterator type iterator_type - which is used to access the underlying input stream has to be derived through - a typedef as shown. The iterator pair to initialize (which is accessible as - iter_ctx.first and iter_ctx.last) has to initialized from - an abritrary iterator type, representing the actual input stream.

-

Member Functions

-

init_iterators

-
    template <typename Position>
-    static void init_iterators(
-        IterContext iter_ctx, 
-        Position const &act_pos);
- -

directive was found in the input token stream. The main rationale for this - function is to initialize the pair of iterators iter_ctx.first and - iter_ctx.last, which are to be used to access the input stream corresponding - to the include file to be inserted from inside the preprocessing engine.

- - - - - - - - -
-
- - - - - diff --git a/doc/class_reference_lexer.html b/doc/class_reference_lexer.html deleted file mode 100644 index 2929985..0000000 --- a/doc/class_reference_lexer.html +++ /dev/null @@ -1,102 +0,0 @@ - - - -The Lexer Interface - - - - - - - - - - - -

The - Lexer Iterator Interface
-
- - - - - - - -
-
-

Introduction
- Wave Lexer - synopsis
- Public Typedefs
- Member functions

-
-

Introduction

-

Every lexer, which should be used in conjunction with the Wave library, has to return tokens formed from the input stream. These tokens should conform to the synopsis described in the topic The Token Type. The lexer type should expose an interface which conforms at least to a forward_iterator (in the sense defined by the the C++ Standard) returning the token type. The code sample below does not show the definition of this forward iterator interface because this is highly implementation defined.

-

Wave lexer - synopsis (header: wave/cpplexer/cpp_lexer_interface.hpp)

-
    struct lex_iterator
-    {
-        typedef boost::wave::lex_token<> token_type;
-
-    // Every lex_iterator should implement at least a complete 
-    // forward_iterator interface (not shown here)
-        typedef std::forward_iterator_tag iterator_category;
-
-    // additional requirements
-        lex_iterator();
-
-        template <typename Iterator>
-        lex_iterator(Iterator const &first, Iterator const &last
-            typename token_type::position_type const &pos, 
-            boost::wave::language_support language)
-    };
-
-
-

Please note, that the lex_iterator defined in the library header wave/cpplexer/cpp_lexer_interface.hpp actually is a template class taking the token type to use as its template parameter. This is omitted in the synopsis above because it is an implementation detail of the Re2C lexer provided as part of the Wave library.

-

If you want to use Wave in conjunction with your own lexing component this will have to conform to the interface described above only.

-

Public Typedefs

-

Besides the typedefs mandated for a forward_iterator by the C++ standard every lexer to be used with the Wave library should define the following typedefs:

- - - - - - - - -
Public typedef's defined by the boost::wave::context class
token_type

The token type returned by the lexer. This is type is used as the return value of the main iterators provided by the boost::wave::context object too.

-

Member functions

-

Besides the functions, which should be provided for forward_iterators as mandated by the C++ Standard, every lexer must implement the following functions to be used with the Wave library:

-

constructor

-
    lex_iterator();
-
-

The default constructor should construct a lexer iterator, which may be used as the end iterator of the provided iterator range.

-
-
-    template <typename Iterator>
-    lex_iterator(Iterator const &first, Iterator const &last,
-        typename token_type::position_type const &pos, 
-        boost::wave::language_support language);
-
-

The second constructor should construct a lexer iterator, which may be used as a iterator traversing over the token sequence, generated by the lexer class.

-

The pair of iterators first and last should represent the input stream to be tokenized by the given lexer class.

-

The parameter pos contains the initial position information to be used for token generation.

-

The parameter language controls the reuqired mode with which the lexer should be initialised.

-
- - - - - - - -
-
- - -
-

Introduction
- Header 'wave/context.hpp' - synopsis
- Template parameters
- Public Typedefs
- Member functions

-
-

Introduction

-

The token type in Wave is the main carrier of information. It is returned - by dereferencing the iterators exposed by the lexing component and the iterator exposed by the preprocessor component. The tokens are originally generated by the - lexer ("An entity that lexically transforms the subject of parsing to a - sequence of objects (called tokens) more suitable for subsequent parsing."). - The Wave library contains two different, interchangable C++ lexers, which may - be used as a starting point during developing your own application. The lexer - generated tokens are transformed by the preprocessing engine (macro expansion, - include file processing etc.) and after this returned to the user of the Wave - library.

-

You can use arbitrary token types in conjunction with your own lexer as long - as these implement some required interface. The required token type interface - is described below and is implemented by the wave::cpplexer::lex_token - template, the required lexer interface is described here. -

-

In the following is described the token type predefined inside the Wave - library, which is used in conjunction with the two predefined C++ lexers contained - in the Wave library too. If you need to use your own token type, it - is required to implement the interafce described below.

-

Header wave/cpplexer/cpp_lex_token.hpp - synopsis

-
namespace boost {
-namespace wave {
-namespace cpplexer {
-
-    template <typename Position>
-    class lex_token 
-    {
-    public:
-        typedef std::basic_string<char> string_type;
-        typedef Position                position_type;
-    
-        lex_token();
-        lex_token(token_id id, string_type const &value, 
-            PositionT const &pos);
-
-    // accessors
-        operator token_id() const;
-        string_type const &get_value() const;
-        position_type const &get_position() const;
-        void set_token_id (token_id id);
-        void set_value (string_type const &newval);
-        void set_position (position_type const &pos);
-    };
-
-}   // namespace cpplexer
-}   // namespace wave
-}   // namespace boost
-
-

Template parameters

-

The predefined token type uses a template parameter Position, which - allows to specify the type to be used to carry the file position information - contained inside the generated tokens. Your own token type do not need to take this Position template parameter, but please note, that the token type in any case needs to have an embedded type definition position_type (see below) .

-

Public Typedefs

-

The token type needs to define two embedded types: string_type and position_type. The string_type needs to be a type compatible to the std::basic_string<> class.

-

This type should contain at least the filename, the line number and the column number of the position, where the token was recognized. For the predefined token type it defaults to a simple file_position template class described here. Note, that your own position_type should follow the interface described for the file_position template as well.

-

Member functions

-

Constructors

-
    lex_token();
-
-    lex_token(token_id id, 
-        string_t const &value, 
-        PositionT const &pos);
-
-

The first (default) constructor is for generating an end of stream token, - which is used for indicating the end of the underlying input stream.

-

The second constructor initializes the newly created token object with its - token id (for a list of valid token id's please look here), - the string representation of its value and the file position, describing the - position inside the input stream , where this token was recognized.

-
-

Accessor functions

-

operator token_id

-
    operator token_id() const;
-
-

Allows the access to the token id of the token. This access Sunday, May 15, 2005 12:23operation of Spirit - parsers directly on top - - - top of a token stream. The possible token id's are described - - here.

-

This function does not throw in any case.

-
-

get_value

-
    string_type const &get_value() const;
-
-

Returns the value of the token, as it was recognized in the input stream. - Even for constant tokens (as keywords or operators etc.) the returned value - reflects the character sequence as found in the input stream.

-

This function does not throw in any case.

-
-

get_position

-
    Position const &get_position() const;
-
-

Returns the position of the token in the input stream, where it was recognized. - The position contains information about the filename, the line number and - the column number of the token. By default the Wave library uses - a file_position template for this purpose, which is described in more detail - here.

-

This function does not throw in any case.

-
-

set_token_id

-
    void set_token_id(token_id id);
-
-

Changes the token id of the token to the new value. The possible token id's - are described here. Probably this function is - of little value for the library user, but it is required under certain circumstances - for correct operation of the preprocessing engine.

-

This function does not throw in any case.

-
-

set_value

-
    void set_value(string_type const &newval);
-
-

Changes the value stored inside the token to the new value. Propably this - function is of little value for the library user, but it is required under - certain circumstances for correct operation of the preprocessing engine.

-
-

set_position

-
    void set_position(Position const &newpos);
-
-

Changes the position stored inside the token to the new value. This is used - for instance for implementing the functionality required for to implement - the #line directive.

-
- - - - - - - -
-
- - - - - diff --git a/doc/compiletime_config.html b/doc/compiletime_config.html deleted file mode 100644 index 415a5f3..0000000 --- a/doc/compiletime_config.html +++ /dev/null @@ -1,203 +0,0 @@ - - - -Compile Time Configuration - - - - - - - - - - - -

Compile - Time Configuration
-
- - - - - - - -
-

Library compile time configuration

-

The C++ preprocessor iterator library may be configured at compile - time by specifying different preprocessor constants to include different additional - features. The possible preprocessor constants are described in the following - table.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Summary of possible preprocessor constants - for
- library configuration
BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE

Support the #warning directive

BOOST_WAVE_SUPPORT_MS_EXTENSIONS

Support several MS specific language - extensions (i.e. __int8 et.al.)

BOOST_WAVE_PREPROCESS_ERROR_MESSAGE_BODY

Enable the preprocessing of the message bodies - of #error and #warning - directives.

BOOST_WAVE_RETURN_PRAGMA_DIRECTIVES

If defined, then the #pragma - directives are returned as a token sequence to the caller, if not defined, - the whole #pragma directive is skipped.

BOOST_WAVE_PREPROCESS_PRAGMA_BODY

Enable the preprocessing of the bodies of - #pragma directives.
- Note though, that the body of an operator _Pragma() is preprocessed - always, as required by the C99 Standard [2]. -

BOOST_WAVE_ENABLE_COMMANDLINE_MACROS

Enable the functionality required to define macros - with the command line syntax (-DMACRO(x)=definition)

BOOST_WAVE_STRINGTYPE

The tokens generated by the Wave library - contain the token data and the file position, where this token was found - in the input stream.
- This constant may be used to redefine the data type, which is used to - hold the token data and the corresponding file name. If this isn't defined - it defaults to std::string. (The here defined data type should be compatible - to the std::string type)

BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS

If defined, then the preprocessor library supports - variadics and placemarkers. Note, to support C99 mode, this constant must - be defined too.

BOOST_WAVE_MAX_INCLUDE_LEVEL_DEPTH

If defined, it will determine the initial maximal - possible include file nesting depth supported. It defaults to 1024.

BOOST_WAVE_SUPPORT_PRAGMA_ONCE

If defined, then the #pragma once directive is supported by Wave. This specifies that the file, in which the pragma resides, will be included - (opened) only once by the compiler in a build.

BOOST_WAVE_SUPPORT_INCLUDE_NEXT

If defined, then the #include_next directive is supported by Wave. This is syntactically equivalent to the #include directives, but may be used to inherit a header file (i.e. to include a file, which is named as the current file containing the #include_next).

-

Using a different token type or lexer type in conjunction with Wave

-

It is possible to use the Wave library while using your own token and/or lexer types. This may be achieved by providing your lexer type as the second template parameter while instantiating the boost::wave::context<> object. The token type used by the library is derived from the token_type typedef to be provided by the lexer type. If you want to provide your own token type only, you may use the boost::wave::lex_iterator<> type contained with the library. This type needs to be parametrized with the token type to use.

-

To show, how this may be done, the Wave library contains several samples illustrating this possibility. The cpp_tokens sample shows the usage of a custom lexer and a custom token types. The lexer type used is functionally fully compatible to the re2c [3] based lexer used by default. It is implemented based on the SLex [5] lexer example written by Dan Nuffer. The token type used therein is functionally equivalent to the default token type except for an additional operator<< used for dumping the information carried by the token.

-

Separation and inclusion compilation - models

-

The Wave C++ preprocessor iterator library is build almost - completely as a header only library (except for the re2c based lexer). If you're - trying to include all required files at once you will mention, that the resulting - compilation times are very large (up to an hour - depending on your system configuration). - This straightforward method we'll call the inclusion compilation model. If you - do not pay attention to compilation times, that's the way to go, no special - handling is needed.

-

If you're interested in decreasing compilation times, the following - method is to be used. This we will call it the separation compilation model. - The trick is to separate the different objects such, that they are compilable - separately. The function, which instantiates the templated object in question - is factored out such, that its definition is visible to only one translation - unit. To simplify this further this creation function is packaged into a small - generator template structure.

-

There are two levels of separation implemented: the separation of - the compilation of the C++ lexer and the separation of the compilation of the - different Spirit grammars used. To use these separations you will have to define - two preprocessor constants while compiling the whole application and you will - have to explicitely instantiate some helper templates. The following tables - shows these constants in detail.

- - - - - - - - - - - - - - - - -
Summary of possible compilation constants - required
- to enable the separation compilation model
Separate

Preprocessor - constant

C++ lexer

BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION

Spirit grammars

BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION

-

The following table shows the explicit template instantiations required, - if you want to use the separation compilation model. The TokenT placeholder - type has to be replaced with your token type to use and the LexIteratorT placeholder type has to be replaced with your lex iterator type you've used while instantiation of the boost::wave::context<> object. You will achieve the best - results, if you place these into separate compilation units each. The IteratorT - placeholder should be replaced by the iterator type, which was used to instantiate - the boost::wave::context<> object.

- - - - - - - - - - - - - - - - -
Summary of required explicit template - instantiations
- required when using the separation compilation model
Separate

Templates - to explicitly instantiate

C++ lexer template - cpplexer::re2clex::new_lexer_gen<IteratorT>;
Spirit grammars

template wave::grammars::expression_grammar_gen<TokenT>;
- template wave::grammars::intlit_grammar_gen<TokenT>;
- template wave::grammars::chlit_grammar_gen<TokenT>;
- template wave::grammars::cpp_grammar_gen<LexIteratorT>;
-
template
wave::grammars::predefined_macros_grammar_gen<LexIteratorT>;
- template wave::grammars::defined_grammar_gen<LexIteratorT>;

-

To see an example of this you can look at the Wave driver program - included as an acompanion sample to the C++ preprocessor iterator library. The - corresponding files are named obviously "instantiate_...something.cpp", - where the '...somthing' is a hint, which grammars - are explicitely instantiated inside. By using the separation model the compilation - times required to build the Wave example are dropped by up to 90%.

- - - - - - - -
-
- - - - - diff --git a/doc/introduction.html b/doc/introduction.html deleted file mode 100644 index a1c7480..0000000 --- a/doc/introduction.html +++ /dev/null @@ -1,93 +0,0 @@ - - - -Introduction - - - - - - - - - - - -

Introduction
-
- - - - - - - -
-

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).

-

The Wave C++ preprocessor is not a monolitic application, - it's rather a modular library, which exposes mainly a context object and an - iterator interface. The context object helps to configure the actual preprocessing - process (as search path's, predefined macros, etc.). The exposed iterators are - generated by this context object too. Iterating over the sequence defined by - the two iterators will return the preprocessed tokens, which are to be built - on the fly from the given input stream.

-

The C++ preprocessor iterator itself is fed by a C++ lexer iterator, - which implements an abstract interface. The C++ lexers packaged with the - Wave library may be used standalone, too, and are not tied to the C++ - preprocessor iterator at all.

-

To make the C++ preprocessing library modular, the C++ lexer is held - completely separate and independent from the preprocessor. To prove this concept, - two different, but functionally identical C++ lexers were -implemented. Additionally there is implemented a IDL lexer, which allows to use the preprocessor library as the lexing component of a IDL oriented tool. All these lexers implement the mentioned abstract interface, - so that the C++ preprocessor iterator may be used with all of them. The abstraction - of the lexer from the preprocessor iterator library was done to allow - plugging in different lexers without the need to reimplement the preprocessor. - This will allow for benchmarking and specific fine tuning of the process of preprocessing - itself.

-

The first of these C++ lexers is implemented with the help of the - well known Re2C [3] tool, which generates - C code from given regular expressions. The lexers generated with Re2C - are known to be very fast, because they are not table driven but directly code the token building logic -(very similar to hand coded lexers). -

-

The second of these C++ lexers is built around a table driven lexer, - where the DFA tables (discrete finite automaton tables) are generated from regular expressions with the help of - a Spirit-based lexer generating framework named Slex [5]. - The Slex is fed during runtime with the token definitions (regular - expressions) and generates the resulting DFA table. This table is used to combine - the input characters into corresponding lexemes (tokens). The generated DFA table - can be saved to disk to avoid the generation process at program startup.

-

Wave may be used for preprocessing IDL files too, since the token set needed for the IDL language is very similar to the C++ token set. That's the reason, why the Wave preprocessor library contains also an IDL lexer. The IDL lexer is also based on the Re2C tool, but recognizes a different set of tokens. So this lexer does not recognize any keywords (except true and false, which are needed by the preprocessor itself). This is needed because there exist different IDL language flavours, where identifiers of one flavour may be keywords of others - Ok, this requires postponement of keyword identification until after the -preprocessing, but allows to use Wave for all of the IDL derivatives.

-

It is possible to build other C++ lexers if needed. Currently there - are plans to adapt the Spirit C++ lexer example cpplexer [6], - which is completely based on static Spirit[4] - grammars.

-

Both of the included lexers and the library itself are able - to act in a C99 compliant mode. In this mode the lexers reject C++-only tokens - ('::', '->*', '.*' and the alternate keywords - such as 'and', etc.). The preprocessor additionally handles placemarkers - (empty macro arguments) and variadics (macros with variable parameter counts). - As an extension to the C++ Standard, the library can be enabled to handle placemarkers - and variadics in C++ mode too.

- - - - - - - -
-
- - - - - diff --git a/doc/macro_expansion_process.html b/doc/macro_expansion_process.html deleted file mode 100644 index 26347f9..0000000 --- a/doc/macro_expansion_process.html +++ /dev/null @@ -1,101 +0,0 @@ - - - -The Macro Expansion Process - - - - - - - - - - - -

The - Macro Expansion Process
-
- - - - - - - -
-

The macro expansion process described here was initially developed by Paul - Mensonides and is implemented in Wave. It is much more understandable - as the description of the desired macro expansion algorithm provided in the - C++ Standard [1].

-

Macro replacement proceeds left-to-right.

-

If, during scanning (or rescanning) an identifier is found, it is looked up - in the symbol table. If the identifier is not found in the symbol table, it - is not a macro and scanning continues.

-

If the identifier is found, the value of a flag associated with the identifier - is used to determine if the identifier is available for expansion. If it is - not, the specific token (i.e. the specific instance of the identifier) is marked - as disabled and is not expanded. If the identifier is available for expansion, - the value of a different flag associated with the identifier in the symbol table - is used to determine if the identifier is an object-like or function-like macro. - If it is an object-like macro, it is expanded. If it is a function-like macro, - it is only expanded if the next token is an left parenthesis.
- An identifier is available for expansion if it is not marked as disabled and - if the the value of the flag associated with the identifier is not set, which - is used to determine if the identifier is available for expansion.

-

(If a macro is an object-like macro, skip past the next two paragraphs.)

-

If a macro to be expanded is a function-like macro, it must have the exact - number of actual arguments as the number of formal parameters required by the - definition of the macro. Each argument is recursively scanned and expanded. - Each parameter name found in the replacement list is replaced by the expanded - actual argument after leading and trailing whitespace and all placeholder tokens - are removed unless the parameter name immediately follows the stringizing operator - ('#') or is adjacent to the token-pasting operator ('##').

-

If the parameter name immediately follows the stringizing operator ('#'), - a stringized version of the unexpanded actual argument is inserted. If the parameter - name is adjacent to the token-pasting operator ('##'), the unexpanded - actual argument is inserted after all placeholder tokens are removed.

-

All concatenation takes place in the replacement list. (If a single concatenation - yields multiple tokens, the behavior is undefined. Moreover, Wave in - normal C++98 and C99 modes issues an error, if more then one token is produced - as the result of the concatenation. In C++0x mode Wave treats token-pasting - of unrelated tokens as well defined and inserts the reparsed string representation - of the concatenated tokens into the replacement list.).

-

The flag in the symbol table entry associated with the name of the macro being - expanded is set to indicate the that the macro is not available for expansion.

-

The replacement list is rescanned for further macro expansion. All leading - and trailing whitespace tokens in the replacement list are removed (the placeholder - tokens are left intact).

-

After rescanning completes, the flag in the symbol table entry associated with - the name of macro being expanded is cleared to indicate that the macro is again - available for expansion, and the sequence of tokens that constitutes the rescanned - replacement list is returned to the point of invocation of the macro.

-

If this sequence of tokens is empty, it is replaced by a placeholder token. - If a placeholder is found during scanning (or rescanning) it is ignored. (Also, - if the only thing separating a parameter from the stringizing operator or token-pasting - operator is placeholder, it is also ignored in that context.)

-

This sequence of tokens is inserted at the original point that the macro was - invoked, and scanning continues starting with the last token of the newly inserted - sequence of tokens. I.e. scanning looks back a single token (possibly a placeholder - token) and continues.
-

- - - - - - - -
-
- - - -

 

- - diff --git a/doc/predefined_macros.html b/doc/predefined_macros.html deleted file mode 100644 index fe2a8c9..0000000 --- a/doc/predefined_macros.html +++ /dev/null @@ -1,158 +0,0 @@ - - - -Predefined Macros - - - - - - - - - - - -

Predefined - Macros
-
- - - - - - - -
-

The following table lists the macros, which are predefined by the - Wave library. Some of these (all except the __LINE__, - __FILE__, __BASE_FILE__, __DATE__, - __TIME__, __STDC__, __INCLUDE_LEVEL__ - and __cplusplus macros) may be undefined from the command line of the driver executable - (see the -U option) or through the function remove_macro_definition().

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Summary of predefined macros
Name

Value

Undefinable
__STDC__

1 (a decimal constant)

yes

__cplusplus

199711L (a decimal constant), this - is defined in C++ mode only (C99 mode is off)
- In the C++0x mode this decimal constant is guaranteed to be larger than - 199711L (the concrete value is to be defined by the C++ committee).

no

__LINE__

The line number of the current source line (a decimal - constant)

no

__FILE__

The presumed name of the source file (a character string literal)

no

__BASE_FILE__

This macro expands to the name of the main input file (a character string literal). This is the source file that was specified during construction of the wave::context template.

no

__DATE__

The date of translation of the source file (a character - string literal of the form
- "Mmm dd yyyy", where the names of the months are the same as - those generated by the asctime function, and the first character of dd - is a space character if the value is less than 10).

no

__TIME__

The time of translation of the source file (a character - string literal of the form "hh:mm:ss"
- as in the time generated by the asctime function).

no

__INCLUDE_LEVEL__

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.

no

__WAVE__
__SPIRIT_PP__

The version of the driver program (a hexadecinal - constant of the form 0xMmrr, where 'M' is - the major version number, 'm' the minor version - number and 'rr' the release number).

yes

__WAVE_VERSION__
__SPIRIT_PP_VERSION__

The full version number of the driver program (a - hexadecimal constant of the form 0xMmrrbbbb, where 'M' - is the major version number, 'm' the minor - version number, 'rr' the release number and - 'bbbb' the build number).

yes

__WAVE_VERSION_STR__
__SPIRIT_PP_VERSION_STR__

The full version number of the driver program (a - character string literal of the form "M.m.rr.bbbb", - where 'M' is the major version number, 'm' - the minor version number, 'rr' the release - number and 'bbbb' the build number).

yes

__STDC_VERSION__

199901L (a decimal constant), this is defined in C99 mode only

yes

__STDC_HOSTED__

0L (a decimal constant), this is defined in C99 mode only

yes

__WAVE_HAS_VARIADICS__

1 (a decimal constant), this is defined in C++ - mode only if variadics and placemarkers are enabled, and it is defined - in the C99 mode

no

-
- - - - - - - -
-
- - - - - diff --git a/doc/preface.html b/doc/preface.html deleted file mode 100644 index aaef36c..0000000 --- a/doc/preface.html +++ /dev/null @@ -1,110 +0,0 @@ - - - -Preface - - - - - - - - - - - -

Preface
-
- - - - - - - -
-

During the last time many new features were developed as additions to the Spirit - [4] parser construction framework and we - felt more and more, that it would be very helpful, to have a 'real world' example, - which could be used as a sandbox for testing the usability of certain features. - Additionally a recent discussion on the Boost mailing list showed the widespread - interest of developers to have a modern, open source C++ preprocessor library - to play with.  So we had the idea to implement a C++ preprocessor to fit - this needs - Wave was born.

-

The Wave C++ preprocessor library uses the - Spirit[4] parser construction - library to implement a C++ lexer with ISO/ANSI Standards conformant preprocessing - capabilities. It exposes an iterator interface, which returns the current preprocessed - token from the input stream. This preprocessed token is generated on the fly - while iterating over the preprocessor iterator sequence (in the terminology - of the STL these iterators are forward iterators).

-

The C++ preprocessor is a macro processor that under normal - circumstances is used automatically by your C++ compiler to transform your program - before actual compilation. It is called a macro processor because it allows - you to define macros, which are brief abbreviations for longer constructs. The - C++ preprocessor provides four separate facilities that you can use as you see - fit:

-
-

 Inclusion - of header files
-  Macro - expansion
-  Conditional - compilation
-  Line - control

-
-

These features are greatly underestimated today, even more, the preprocessor - has been frowned on for so long that its usage just hasn't been effectively - pushed until the Boost preprocessor library [7] - came into being a few years ago. Only today we begin to understand, that preprocessor - generative metaprogramming combined with template metaprogramming in C++ is - by far one of the most powerful compile-time reflection/metaprogramming facilities - that any language has ever supported.

-

The C++ Standard [2] was adopted back in 1998, but there is still no (known to me) C++ compiler, which has a bugfree implementation of the rather simple preprocessor requirements mandated therein. This may be a result of the mentioned underestimation or even banning of the preprocessor from good programming style during the last few years or may stem from the somewhat awkward standardese dialect of English used to describe it.

-

So the main goals for the Wave project are:

-
-

 full - conformance with the C++ standard (ISO/IEC 14882:1998) [1] - and with the C99 standard (INCITS/ISO/IEC 9899:1999) [2]
-  usage of Spirit[4] - for the parsing parts of the game (certainly :-)
-  maximal usage - of STL and/or Boost libraries (for compactness and maintainability)
-  straightforward - extendability for the implementation of additional features
-  building a - flexible library for different C++ lexing and preprocessing needs

-
-

At the first steps it is not planned to make a very high performance or very - small C++ preprocessor. If you are looking for these objectives you probably - have to look at other places. Although our C++ preprocessor iterator works as expected and is usable as a reference implementation, for instance - for testing of other preprocessor oriented libraries as the Boost Preprocessor - library [7] et.al. Nevertheless recent work has lead to surprising performance enhancements (if compared - with earlier versions). Wave is still somewhat slower as for instance EDG - based preprocessors (Intel, Comeau) on simple input files, however, as - complexity increases, time dilates expontentially on EDG. Preprocessing time - dilates linearly under Wave, which causes it to easily outperform EDG based -preprocessors when complexity increases.

-

As tests showed, the Wave library is very conformant to the C++ Standard, - such that it compiles several strict conformant macro definitions, which are - not even compilable with EDG based preprocessors (i.e. Comeau or Intel). The only preprocessor known to have similar Standards conformance -today is the preprocessor of the gcc C/C++ compiler.

- - - - - - - -
-
- - - - - diff --git a/doc/quickstart.html b/doc/quickstart.html deleted file mode 100644 index 01841cf..0000000 --- a/doc/quickstart.html +++ /dev/null @@ -1,121 +0,0 @@ - - - -Quick Start - - - - - - - - - - - -

Quick - Start
-
- - - - - - - -
-

Preprocessing with Wave is highly configurable. You must -define a few options to control it. Here are a few of the -options you can define:

-
-

 include - search paths, which define, where to search for files to be included with - #include <...> and #include "..." directives
-  which - macros to predefine and which of the predefined macros to undefine
-  whether to enable any of several extensions to the C++ -Standard (such as for variadics and placemarkers)
-

-
-

You can access all these processing parameters through the boost::wave::context - object. So you must instantiate one object of this type to use the Wave - library. (For more information about the context template class, please refer - to the class reference here.) To instantiate - the boost::wave::context object you have to supply at least two template parameters: - the iterator type of the underlying input stream to use and the type of the lexer iterator to be used as the token source for the preprocessing engine.

-

Do not instantiate the main preprocessing iterators yourself. -Get them from the wave::context object instead.
-The following code snippet is taken from the quick_start sample, which shows a minimal usage scenario for Wave.

-
    // The following preprocesses a given input file.
-    // Open the file and read it into a string variable
-    std::ifstream instream("input.cpp");
-    std::string input(
-        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.
-    // This token type is one of the central types throughout 
-    // the library, because it is a template parameter to some 
-    // of the public classes and templates and it is returned 
-    // from the iterators.
-    // The template boost::wave::cpplexer::lex_iterator<> is
-    // the lexer iterator to use as the token source for the
-    // preprocessing engine. In this case this is parametrized
-    // with the token type.
-    typedef boost::wave::cpplexer::lex_iterator<
-            boost::wave::cpplexer::lex_token<> >
-        lex_iterator_type;
-    typedef boost::wave::context<
-            std::string::iterator, lex_iterator_type>
-        context_type;
-
-    context_type ctx(input.begin(), input.end(), "input.cpp");
-
-    // At this point you may want to set the parameters of the
-    // preprocessing as include paths and/or predefined macros.
-        ctx.add_include_path("...");
-        ctx.add_macro_definition(...);
-
-    // 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 during iteration
// over [first, last)
while (first != last) { - std::cout << (*first).get_value(); - ++first; - } - -
-

The constructor of the boost::wave::context object can - take a pair of arbitrary iterator types (at least input_iterator type - iterators) to the input stream, which must supply the data to be processed. - The third parameter supplies a filename, filename, which is reported in the preprocessor output to -indicate the current context. -Note though, that this filename is used - only as long as no #include or #line directives are encountered, - which in turn will alter the current filename reported.

-

The iteration over the preprocessed tokens is relativley straightforward. Just get the starting and the ending iterators from the context object - (maybe after initializing some include search paths) and you are done! Dereferencing - the iterator will return the preprocessed tokens, which are generated on - the fly from the input stream. (To get further information about the token type, - you may want to look here.)

- - - - - - - -
-
- - - - - diff --git a/doc/references.html b/doc/references.html deleted file mode 100644 index a389132..0000000 --- a/doc/references.html +++ /dev/null @@ -1,101 +0,0 @@ - - - -References - - - - - - - - - - - -

References
-
- - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1. ISO/IEC "Programming - languages - C++"
- ISO/IEC 14882:1998
2. INCITS/ISO/IEC "Programming - languages - C"
- INCITS/ISO/IEC 9899:1999
3. Peter Bumbulis and
- Donald D. Cowan
Re2c - V0.9.8
- A tool for generating C-based recognizers from regular expressions
4.Joel de Guzman et.al.Spirit v1.8.2 - documentation
5.Daniel C. NufferThe - Spirit Slex example
6.Juan Carlos Arevalo-BaezaThe - Spirit cpplexer example
7.Vesa Karvonen and
- Paul Mensonides
The - Boost Library Preprocessor Subset for C/C++
8.boost.orgThe Boost Libraries - Documentation.
-
- - - - - - - -
-
- - - - - -Sunday, May 15, 2005 12:23 \ No newline at end of file diff --git a/doc/samples.html b/doc/samples.html deleted file mode 100644 index 91a7920..0000000 --- a/doc/samples.html +++ /dev/null @@ -1,96 +0,0 @@ - - - -Samples - - - - - - - - - - - -
-

Samples
-
- - - - - - - -
-

The Wave library contains several samples illustrating how to use the different features. This section describes these samples and its main characteristics.

-

The quick_start sample

-

The quick_start sample shows a minimal way to use the Wave preprocessor library. It simply opens the file given as the first command line argument, preprocesses it assuming that there aren't any additional include paths or macros defined and outputs the textual representation of the tokens generated from the given input file. This sample may be used to introduce yourself to Wave, because it does not contain all the potential additional complexity exposed by more complex samples.

-

The lexed_tokens sample

-

The lexed_tokens sample shows a minimal way to use the C++ lexing component of Wave without using the preprocessor. It opens the file specified as the first command line argument and prints out the contents of the tokens returned from the lexer.

-

The cpp_tokens sample

-

The cpp_tokens sample dumps out the information contained within the tokens returned from the iterator supplied by the Wave library. It shows, how to use the Wave library in conjunction with custom lexer and custom token types. The lexer used within this sample is SLex [5] based, i.e. it is feeded during runtime (at startup) with the token definitions (regular expressions) and generates a resulting DFA table. This table is used for token identification and is saved to disc afterwards to avoid the table generation process at the next program startup. The name of the file to which the DFA table is saved is wave_slex_lexer.dfa.

-

The main advantage of this SLex based lexer if compared to the default Re2C [3] generated lexer is, that it provides not only the line information, where a particular token was recognized, but also the related column position. Otherwise the SLex based lexer is functionally fully compatible to the Re2C based one, i.e. you always may switch your application to use it, if you additionally need to get the column information back from the preprocessing.

-

Since no additional command line parameters are supported by this sample, it won't work well with include files, which aren't located in the same directory as the inspected input file. The command line syntax is straight forward:

-
    cpp_tokens input_file
-

The list_includes sample

-

The list_includes sample shows how the Wave library may be used to generate a include file dependency list for a particular input file. It completely depends on the default library configuration. The command line syntax for this sample is given below:

-
    Usage: list_includes [options] file ...:
-        -h [ --help ]        : print out program usage (this message)
-        -v [ --version ]     : print the version number
-        -I [ --path ] dir    : specify additional include directory
-        -S [ --syspath ] dir : specify additional system include directory
-
-

Please note though, that this sample will output only those include file names, which are visible to the preprocessor, i.e. given the following code snippet, only one of the two include file directives is triggered during preprocessing and for this reason only the corresponding file name is reported by the list_includes sample: -

    #if defined(INCLUDE_FILE_A)
-    #  include "file_a.h" 
-    #else
-    #  include "file_b.h"
-    #endif
-

The wave sample

-

Because of its general usefulness the wave sample is not located in the sample directory of the library, but inside the tools directory of Boost. The wave sample is usable as a full fledged preprocessor executable - on top of any other C++ compiler. It outputs the textual representation of the -preprocessed tokens generated from a given input file. It is described in more details here.

-

The waveidl sample

-

The main point of the waveidl sample is to show, how a completely independent lexer type may be used in conjunction with the default token type of the Wave library. The lexer used in this sample is supposed to be used for an IDL language based preprocessor. It is based on the Re2C tool too, but recognizes a different set of tokens as the default C++ lexer contained within the Wave library. So this lexer does not recognize any keywords (except true and false, which are needed by the preprocessor itself). This is needed because there exist different IDL languages, where identifiers of one language may be keywords of others. Certainly this implies to postpone keyword identification after the preprocessing, but allows to use Wave for all of the IDL derivatives.

-

It is only possible to use the Wave library to write an IDL preprocessor, because the token sets for both languages are very similar. The tokens to be recognized by the waveidl IDL language preprocessor is nearly a complete subset of the full C++ token set.

-

The command line syntax usable for this sample is shown below:

-
  Usage: waveidl [options] [@config-file(s)] file:
-
-
-    Options allowed on the command line only:
-      -h [ --help ]           : print out program usage (this message)
-      -v [ --version ]        : print the version number
-      -c [ --copyright ]      : print out the copyright statement
-      --config-file filepath  : specify a config file (alternatively: @filepath)
-
-        
-    Options allowed additionally in a config file:
-      -o [ --output ] path    : specify a file to use for output instead of stdout
-      -I [ --include ] path   : specify an additional include directory
-      -S [ --sysinclude ] syspath : specify an additional system include directory
-      -D [ --define ] macro[=[value]] : specify a macro to define
-      -P [ --predefine ] macro[=[value]] : specify a macro to predefine
-      -U [ --undefine ] macro : specify a macro to undefine
-
- - - - - - - -
-
- - - -

 

- - diff --git a/doc/supported_pragmas.html b/doc/supported_pragmas.html deleted file mode 100644 index f0bf166..0000000 --- a/doc/supported_pragmas.html +++ /dev/null @@ -1,128 +0,0 @@ - - - -Supported Pragma Directives - - - - - - - - - - - -

Supported - Pragma Directives
-
- - - - - - - -
-

The Wave preprocessor library supports a couple of specific #pragma - directives, which may be used to control some of the library features. All directives - described here are usable as conventional #pragma directives and as - operator _Pragma (if variadics are enabled). So for instance the - following directives are functionally identical:

-
    #pragma wave trace(enable)  
-

and

-
    _Pragma("wave trace(enable)")
-

All Wave specific pragma's must have the general form 'wave option[(value)]', - where 'wave' is the specific keyword, 'option' is the concrete - pragma functionality to trigger and 'value' is an optional value to - be supplied to the 'option' functionality. The following table lists - all possible pragma functions supported by the Wave library. For all recognised pragmas of this general form the interpret_pragma hook function from inside the context_policies are call, so that the user of the library is responsible for

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Supported pragma's

pragma option

pragma value

description

supported by

trace

enable/on/1
- disable/off/0

Enable or disable the tracing of the - macro expansion process. This is needed, even if there is given the --trace - command line option, because the trace output is generated only, if there - is at least one trace(enable) pragma found.

Wave driver

stop

message

Stop the execution of Wave and print out - the given message. This is very helpful for direct debugging purposes.

Wave driver

system

command

Try to spawn the 'command' as a new operating system - command and intercept the generated stdout and stderr. The stdout output - of this command (if any) is retokenized and used as the replacement text - for the whole pragma, the stderr output is ignored. The command is considered - to be successful, if/when the return value is zero, otherwise an error - is reported.
-

Wave driver

timer

restart/0
- <no value>
- suspend
- resume

The value restart set the current elapsed - time to 0 and restarts the timer.
- If no value is provided, the current elpsed time is printed to the std::cerr - stream.
- The values suspend and resume allow to temporarily stop - the timing.

Wave driver

-

All pragma's not listed here but flagged as 'wave' are reported as - errors. The handling of all remaining pragma's depends on the compilation constant - WAVE_RETURN_PRAGMA_DIRECTIVES, which allows to specify, - if those pragmas are left unchanged in the output stream or not. Please note, - that the operator _Pragma variant is always subject to full preprocessing, before - the pragma itself is evaluated. The #pragma variant is subject to preprocessing - only, if the WAVE_PREPROCESS_PRAGMA_BODY compilation constant - was specified during compilation. For more information about the possible compilation - constants look here.

-

Additionally the Wave preprocessor supports the #pragma once directive, - which specifies that the file, in which the pragma resides, will be included - (opened) only once by the compiler in a build. This may be used to optimize - the preprocessing of larger compilation units, which include a lot of files. Note though, that the #pragma once directive is supported only, if the compile time constant WAVE_SUPPORT_PRAGMA_ONCE was given during compilation of the library.

-

It is fairly easy to implement your own #pragma wave ... directives. All you have to do is to implement your own interpret_pragma function (see here) which should the handle additional directives. For an example of how to do it, you may have a look at the Wave driver application, which implements the #pragma wave timer() directive with the help of a supplied interpret_pragma function.

- - - - - - - -
-
- - - -

 

- - diff --git a/doc/theme/bkd.gif b/doc/theme/bkd.gif deleted file mode 100644 index dcabcb8..0000000 Binary files a/doc/theme/bkd.gif and /dev/null differ diff --git a/doc/theme/bkd2.gif b/doc/theme/bkd2.gif deleted file mode 100644 index b03d9ba..0000000 Binary files a/doc/theme/bkd2.gif and /dev/null differ diff --git a/doc/theme/bullet.gif b/doc/theme/bullet.gif deleted file mode 100644 index da787e2..0000000 Binary files a/doc/theme/bullet.gif and /dev/null differ diff --git a/doc/theme/l_arr.gif b/doc/theme/l_arr.gif deleted file mode 100644 index 5b3cb1c..0000000 Binary files a/doc/theme/l_arr.gif and /dev/null differ diff --git a/doc/theme/l_arr_disabled.gif b/doc/theme/l_arr_disabled.gif deleted file mode 100644 index ed58a60..0000000 Binary files a/doc/theme/l_arr_disabled.gif and /dev/null differ diff --git a/doc/theme/r_arr.gif b/doc/theme/r_arr.gif deleted file mode 100644 index 2dcdad1..0000000 Binary files a/doc/theme/r_arr.gif and /dev/null differ diff --git a/doc/theme/r_arr_disabled.gif b/doc/theme/r_arr_disabled.gif deleted file mode 100644 index 2100f78..0000000 Binary files a/doc/theme/r_arr_disabled.gif and /dev/null differ diff --git a/doc/theme/style.css b/doc/theme/style.css deleted file mode 100644 index 4ffecb9..0000000 --- a/doc/theme/style.css +++ /dev/null @@ -1,179 +0,0 @@ -/* Use, modification and distribution is subject to the Boost Software License, - Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at - http://www.boost.org/LICENSE_1_0.txt) - */ -body -{ - background-image: url(bkd.gif); - background-color: #FFFFFF; - margin: 1em 2em 1em 2em; -} - -h1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; text-align: left; } -h2 { font: 140% sans-serif; font-weight: bold; text-align: left; } -h3 { font: 120% sans-serif; font-weight: bold; text-align: left; } -h4 { font: bold 100% sans-serif; font-weight: bold; text-align: left; } -h5 { font: italic 100% sans-serif; font-weight: bold; text-align: left; } -h6 { font: small-caps 100% sans-serif; font-weight: bold; text-align: left; } - -pre -{ - border-top: gray 1pt solid; - border-right: gray 1pt solid; - border-left: gray 1pt solid; - border-bottom: gray 1pt solid; - - padding-top: 2pt; - padding-right: 2pt; - padding-left: 2pt; - padding-bottom: 2pt; - - display: block; - font-family: "courier new", courier, mono; - background-color: #eeeeee; font-size: small -} - -code -{ - font-family: "Courier New", Courier, mono; - font-size: small -} - -tt -{ - display: inline; - font-family: "Courier New", Courier, mono; - color: #000099; - font-size: small -} - -p -{ - text-align: justify; - font-family: Georgia, "Times New Roman", Times, serif -} - -ul -{ - list-style-image: url(bullet.gif); - font-family: Georgia, "Times New Roman", Times, serif -} - -ol -{ - font-family: Georgia, "Times New Roman", Times, serif -} - -a -{ - font-weight: bold; - color: #003366; - text-decoration: none; -} - -a:hover { color: #8080FF; } - -.literal { color: #666666; font-style: italic} -.keyword { color: #000099} -.identifier {} -.comment { font-style: italic; color: #990000} -.special { color: #800040} -.preprocessor { color: #990099} -.string { font-style: italic; color: #666666} -.copyright { color: #666666; font-size: small} -.white_bkd { background-color: #FFFFFF} -.dk_grey_bkd { background-color: #999999} -.quotes { color: #666666; font-style: italic; font-weight: bold} - -.note_box -{ - display: block; - - border-top: gray 1pt solid; - border-right: gray 1pt solid; - border-left: gray 1pt solid; - border-bottom: gray 1pt solid; - - padding-right: 12pt; - padding-left: 12pt; - padding-bottom: 12pt; - padding-top: 12pt; - - font-family: Arial, Helvetica, sans-serif; - background-color: #E2E9EF; - font-size: small; text-align: justify -} - -.table_title -{ - background-color: #648CCA; - - font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; - font-weight: bold -; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px -} - -.table_cells -{ - background-color: #E2E9EF; - - font-family: Geneva, Arial, Helvetica, san-serif; - font-size: small -; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px -} - -.toc -{ - DISPLAY: block; - background-color: #E2E9EF - font-family: Arial, Helvetica, sans-serif; - - border-top: gray 1pt solid; - border-left: gray 1pt solid; - border-bottom: gray 1pt solid; - border-right: gray 1pt solid; - - padding-top: 24pt; - padding-right: 24pt; - padding-left: 24pt; - padding-bottom: 24pt; -} - -.toc_title -{ - background-color: #648CCA; - padding-top: 4px; - padding-right: 4px; - padding-bottom: 4px; - padding-left: 4px; - font-family: Geneva, Arial, Helvetica, san-serif; - color: #FFFFFF; - font-weight: bold -} - -.toc_cells -{ - background-color: #E2E9EF; - padding-top: 4px; - padding-right: 4px; - padding-bottom: 4px; - padding-left: 4px; - font-family: Geneva, Arial, Helvetica, san-serif; - font-size: small -} - -div.logo -{ - float: right; -} - -.toc_cells_L0 { background-color: #E2E9EF; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; font-family: Geneva, Arial, Helvetica, san-serif; font-size: small } -.toc_cells_L1 { background-color: #E2E9EF; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 44px; font-family: Geneva, Arial, Helvetica, san-serif; font-size: small } -.toc_cells_L2 { background-color: #E2E9EF; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 88px; font-family: Geneva, Arial, Helvetica, san-serif; font-size: small } -.toc_cells_L3 { background-color: #E2E9EF; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 122px; font-family: Geneva, Arial, Helvetica, san-serif; font-size: small } -.toc_cells_L4 { background-color: #E2E9EF; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 166px; font-family: Geneva, Arial, Helvetica, san-serif; font-size: small } -.updated { - font-size: x-small; - color: #666666; - font-style: italic; -} diff --git a/doc/theme/u_arr.gif b/doc/theme/u_arr.gif deleted file mode 100644 index ada3d6e..0000000 Binary files a/doc/theme/u_arr.gif and /dev/null differ diff --git a/doc/theme/uc.gif b/doc/theme/uc.gif deleted file mode 100644 index 7575b39..0000000 Binary files a/doc/theme/uc.gif and /dev/null differ diff --git a/doc/theme/wave.gif b/doc/theme/wave.gif deleted file mode 100644 index 7dfe5fd..0000000 Binary files a/doc/theme/wave.gif and /dev/null differ diff --git a/doc/token_ids.html b/doc/token_ids.html deleted file mode 100644 index 6f59007..0000000 --- a/doc/token_ids.html +++ /dev/null @@ -1,981 +0,0 @@ - - - -The Token Identifiers - - - - - - - - - - -

The - Token Identifiers
-
- - - - - - - -
-
-

Table of literal token identifiers
- Table of white token identifiers
- Table of keyword token identifiers
- Table of operator token identifiers
- Table of preprocessor token identifiers

-
-

The following tables contain all those tokens, which should be recognized by - a C++ lexer, which is to be used in conjunction with the Wave preprocessing - engine. The tokens are grouped into categories to simplify some internal logic - and eventually the driver programs. The token identifiers are defined as an - enum, and it is recommended to reuse this definition for your own lexer - implementations.

-

Note though, that the preprocessor engine does some token transformation, so - that not all of the listet here token identifiers may occur inside tokens, returned - from the preprocessing iterator.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

List of literal token id's

Token identifier

Token category

Token value

T_CHARLIT 

CharacterLiteralTokenType

'a', '\t', '\u0057'

T_FLOATLIT

FloatingLiteralTokenType

-1.23456e78

T_IDENTIFIER

IdentifierTokenType

C++ identifier

T_OCTALINT

IntegerLiteralTokenType

007

T_DECIMALINT

IntegerLiteralTokenType

10
-

T_HEXAINT

-

IntegerLiteralTokenType

0x1234

T_INTLIT

IntegerLiteralTokenType

T_OCTALINT, T_DECIMALINT or T_HEXAINT
-

T_LONGINTLIT

-

IntegerLiteralTokenType

0x1234LL

T_STRINGLIT

StringLiteralTokenType

"abc"

T_FALSE

BoolLiteralTokenType

false

T_TRUE

BoolLiteralTokenType

true
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

List of whitespace token id's

Token identifier

Token category

Token value

T_ANY

UnknownTokenType

any value not matched otherwise

T_CCOMMENT

WhiteSpaceTokenType

/* ... */

T_CPPCOMMENT

WhiteSpaceTokenType

// ... \n

T_SPACE

WhiteSpaceTokenType

blank or '\t'

T_SPACE2

WhiteSpaceTokenType

'\v' or '\f'

T_EOF

EOFTokenType

end of input

T_CONTLINE

EOLTokenType

'\\' followed by '\n'

T_NEWLINE

EOLTokenType

'\n'
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

List of keyword token id's

Token identifier

Token category

Token value

T_ASM

KeywordTokenType

asm

T_AUTO

KeywordTokenType

auto

T_BOOL

KeywordTokenType

bool

T_BREAK

KeywordTokenType

break

T_CASE

KeywordTokenType

case

T_CATCH

KeywordTokenType

catch

T_CHAR

KeywordTokenType

char

T_CLASS

KeywordTokenType

class

T_CONST

KeywordTokenType

const

T_CONSTCAST

KeywordTokenType

const_cast

T_CONTINUE

KeywordTokenType

continue

T_DEFAULT

KeywordTokenType

default

T_DEFINED

KeywordTokenType

defined

T_DELETE

KeywordTokenType

delete

T_DO

KeywordTokenType

do

T_DOUBLE

KeywordTokenType

double

T_DYNAMICCAST

KeywordTokenType

dynamic_cast

T_ELSE

KeywordTokenType

else

T_ENUM

KeywordTokenType

enum

T_EXPLICIT

KeywordTokenType

explicit

T_EXPORT

KeywordTokenType

export

T_EXTERN

KeywordTokenType

extern

T_FLOAT

KeywordTokenType

float

T_FOR

KeywordTokenType

for

T_FRIEND

KeywordTokenType

friend

T_GOTO

KeywordTokenType

goto

T_IF

KeywordTokenType

if

T_INLINE

KeywordTokenType

inline

T_INT

KeywordTokenType

int

T_LONG

KeywordTokenType

long

T_MUTABLE

KeywordTokenType

mutable

T_NAMESPACE

KeywordTokenType

namespace

T_NEW

KeywordTokenType

new

T_OPERATOR

KeywordTokenType

operator

T_PRIVATE

KeywordTokenType

private

T_PROTECTED

KeywordTokenType

protected

T_PUBLIC

KeywordTokenType

public

T_REGISTER

KeywordTokenType

register

T_REINTERPRETCAST

KeywordTokenType

reinterpret_cast

T_RETURN

KeywordTokenType

return

T_SHORT

KeywordTokenType

short

T_SIGNED

KeywordTokenType

signed

T_SIZEOF

KeywordTokenType

sizeof

T_STATIC

KeywordTokenType

static

T_STATICCAST

KeywordTokenType

static_cast

T_STRUCT

KeywordTokenType

struct

T_SWITCH

KeywordTokenType

switch

T_TEMPLATE

KeywordTokenType

template

T_THIS

KeywordTokenType

this

T_THROW

KeywordTokenType

throw

T_TRY

KeywordTokenType

try

T_TYPEDEF

KeywordTokenType

typedef

T_TYPEID

KeywordTokenType

typeid

T_TYPENAME

KeywordTokenType

typename

T_UNION

KeywordTokenType

union

T_UNSIGNED

KeywordTokenType

unsigned

T_USING

KeywordTokenType

using

T_VIRTUAL

KeywordTokenType

virtual

T_VOID

KeywordTokenType

void

T_VOLATILE

KeywordTokenType

volatile

T_WCHART

KeywordTokenType

wchar_t

T_WHILE

KeywordTokenType

while
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

List of operator token id's

Token identifier

Token category

Token value

T_AND

OperatorTokenType

&

T_ANDAND

OperatorTokenType

&&

T_ASSIGN

OperatorTokenType

=

T_ANDASSIGN

OperatorTokenType

&=

T_OR

OperatorTokenType

|

T_ORASSIGN

OperatorTokenType

|=

T_XOR

OperatorTokenType

^

T_XORASSIGN

OperatorTokenType

^=

T_COMMA

OperatorTokenType

,

T_COLON

OperatorTokenType

:

T_DIVIDE

OperatorTokenType

/

T_DIVIDEASSIGN

OperatorTokenType

/=

T_DOT

OperatorTokenType

.

T_DOTSTAR

OperatorTokenType

.*

T_ELLIPSIS

OperatorTokenType

...

T_EQUAL

OperatorTokenType

==

T_GREATER

OperatorTokenType

>

T_GREATEREQUAL

OperatorTokenType

>=

T_LEFTBRACE

OperatorTokenType

{

T_LESS

OperatorTokenType

<

T_LESSEQUAL

OperatorTokenType

<=

T_LEFTPAREN

OperatorTokenType

(

T_LEFTBRACKET

OperatorTokenType

[

T_MINUS

OperatorTokenType

-

T_MINUSASSIGN

OperatorTokenType

-=

T_MINUSMINUS

OperatorTokenType

--

T_PERCENT

OperatorTokenType

%

T_PERCENTASSIGN

OperatorTokenType

%=

T_NOT

OperatorTokenType

!

T_NOTEQUAL

OperatorTokenType

!=

T_OROR

OperatorTokenType

||

T_PLUS

OperatorTokenType

+

T_PLUSASSIGN

OperatorTokenType

+=

T_PLUSPLUS

OperatorTokenType

++

T_ARROW

OperatorTokenType

->

T_ARROWSTAR

OperatorTokenType

->*

T_QUESTION_MARK

OperatorTokenType

?

T_RIGHTBRACE

OperatorTokenType

}

T_RIGHTPAREN

OperatorTokenType

)

T_RIGHTBRACKET

OperatorTokenType

]

T_COLON_COLON

OperatorTokenType

::

T_SEMICOLON

OperatorTokenType

;

T_SHIFTLEFT

OperatorTokenType

<<

T_SHIFTLEFTASSIGN

OperatorTokenType

<<=

T_SHIFTRIGHT

OperatorTokenType

>>

T_SHIFTRIGHTASSIGN

OperatorTokenType

>>=

T_STAR

OperatorTokenType

*

T_COMPL

OperatorTokenType

~

T_STARASSIGN

OperatorTokenType

*=

T_POUND_POUND

OperatorTokenType

##

T_POUND

OperatorTokenType

#

T_AND_ALT

OperatorTokenType | AltTokenType

bitand

T_ANDASSIGN_ALT

OperatorTokenType | AltTokenType

and_eq

T_OR_ALT

OperatorTokenType | AltTokenType

or

T_ORASSIGN_ALT

OperatorTokenType | AltTokenType

or_eq

T_XOR_ALT

OperatorTokenType | AltTokenType

xor

T_XORASSIGN_ALT

OperatorTokenType | AltTokenType

xor_eq

T_LEFTBRACE_ALT

OperatorTokenType | AltTokenType

<%

T_LEFTBRACKET_ALT

OperatorTokenType | AltTokenType

<:

T_NOT_ALT

OperatorTokenType | AltTokenType

not

T_NOTEQUAL_ALT

OperatorTokenType | AltTokenType

not_eq

T_RIGHTBRACE_ALT

OperatorTokenType | AltTokenType

%>

T_RIGHTBRACKET_ALT

OperatorTokenType | AltTokenType

:>

T_COMPL_ALT

OperatorTokenType | AltTokenType

compl

T_POUND_POUND_ALT

OperatorTokenType | AltTokenType

%:%:

T_POUND_ALT

OperatorTokenType | AltTokenType

%:

T_OR_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??!

T_XOR_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??'

T_LEFTBRACE_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??<

T_LEFTBRACKET_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??(

T_RIGHTBRACE_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??>

T_RIGHTBRACKET_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??)

T_COMPL_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??-

T_POUND_POUND_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??=??=

T_POUND_TRIGRAPH

OperatorTokenType | TriGraphTokenType

??=
-


- The preprocessor tokens listet in the following - table are returned by the C++ lexer only. The preprocessor naturally acts on - these tokens and they are not returned by dereferencing the preprocessing iterators.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

List of preprocessor token id's

Token identifier

Token category

Token value

T_PP_DEFINE

PPTokenType

#define

T_PP_IF

PPTokenType

#if

T_PP_IFDEF

PPTokenType

#ifdef

T_PP_IFNDEF

PPTokenType

#ifndef

T_PP_ELSE

PPTokenType

#else

T_PP_ELIF

PPTokenType

#elif

T_PP_ENDIF

PPTokenType

#endif

T_PP_ERROR

PPTokenType

#error

T_PP_LINE

PPTokenType

#line

T_PP_PRAGMA

PPTokenType

#pragma

T_PP_UNDEF

PPTokenType

#undef

T_PP_WARNING

PPTokenType

#warning

T_PP_INCLUDE

PPTokenType

#include "..."

T_PP_QHEADER

PPTokenType

#include <...>

T_PP_HHEADER

PPTokenType

#include ...
-
- - - - - - - -
-
- - - - - diff --git a/doc/tracing_facility.html b/doc/tracing_facility.html deleted file mode 100644 index 6e68820..0000000 --- a/doc/tracing_facility.html +++ /dev/null @@ -1,163 +0,0 @@ - - - -The Tracing Facility - - - - - - - - - - - -

The - Tracing Facility
-
- - - - - - - -
-

If you ever had the need to debug a macro expansion you had to discover, that - your tools provide only little or no support for this task. For this reason - the Wave library got a tracing facility, which allows to get selectively - some information about the expansion of a certain macro or several macros.

-

The tracing of macro expansions generates a possibly huge amount of information, - so it is recommended, that you explicitely enable/disable the tracing for the - macro in question only. This may be done with the help of a special, Wave - specific #pragma:

-
    #pragma wave trace(enable)    // enable the tracing
-    // the macro expansions here will be traced
-    // ...
-    #pragma wave trace(disable)   // disable the tracing
-

In C99 mode or when specifying the --variadics command line option - you may additionally use the operator _Pragma() variant to enable/disable - the tracing output:

-
    #define CONCAT(x, y) \
-        _Pragma("wave trace(enable)") \
-        x \
-        _Pragma("wave trace(disable)") \
-        ## y
-

This way you have the possibility to enable the tracing during the expansion - of a part of a macro only. In the sample shown there is traced the expansion - of the macro argument 'x' only. Note, that the operator _Pragma() - directives expand to nothing inside the macro expansion result.

-

To see, what the Wave driver generates while expanding a simple macro, - let's have a look at the tracing output for the following example:

-
    // test.cpp
-    #define X(x)          x
#define Y() 2
#define CONCAT_(x, y) x ## y - #define CONCAT(x, y) CONCAT_(x, y) - #pragma wave trace(enable) - // this macro expansion is to be traced - CONCAT(X(1), Y()) // should expand to 12 - #pragma wave trace(disable)
-

When preprocessed with 'wave -t test.trace test.cpp' the Wave - driver generates a file test.trace, which contains (without the line - numbers in front of the lines):

-
  1: test.cpp(8): CONCAT(X(1), Y())
-  2:   test.cpp(5): see macro definition: CONCAT(x, y)
-  3:   invoked with
-  4:   [
-  5:     x = X(1)
-  6:     y = Y()
-  7:   ]
-  8:   [
-  9:     test.cpp(2): see macro definition: X(x)
- 10:     invoked with
- 11:     [
- 12:       x = 1
- 13:     ]
- 14:     [
- 15:       1
- 16:       rescanning
- 17:       [
- 18:         1
- 19:       ]
- 20:     ]
- 21:     test.cpp(3): see macro definition: Y()
- 22:     [
- 23:       2
- 24:       rescanning
- 25:       [
- 26:         2
- 27:       ]
- 28:     ]
- 29:     CONCAT_(1, 2)
- 30:     rescanning
- 31:     [
- 32:       test.cpp(4): see macro definition: CONCAT_(x, y)
- 33:       invoked with
- 34:       [
- 35:         x = 1
- 36:         y = 2
- 37:       ]
- 38:       [
- 39:         12
- 40:         rescanning
- 41:         [
- 42:           12
- 43:         ]
- 44:       ]
- 45:       12
- 46:     ]
- 47:   ]
-
-

The generated trace output is very verbose, but allows to follow every step - of the actual macro expansion process. The first line in this tracing example - contains the reference to the position, from where the macro expansion was initiated. - Additionally the following information is contained for every single macro expansion:

-
    -
  • The reference to the position, where the macro to expand was defined first - (see lines 2, 9, 21 and 32).
  • -
  • The real parameters supplied for this macro expansion (see lines 3, 10 and - 33), this information is traced inside the invoked with block, where - the corresponding formal and actual parameters are listed.
  • -
  • The expansion of the given arguments (if any and if these are defined as - macros). This repeats the full tracing information for the argument macro - expansion, only indended by one level. Note though, that the macro expansion - of the actual arguments is traced, regardless of the fact, whether this argument - is really to be inserted into the replacement list after its expansion - or as it was initially supplied (see C++ Standard [16.3.1.1]: "A parameter - in the replacement list, unless preceded by a # or ## preprocessing - token or followed by a ## preprocessing token, is replaced by the - corresponding argument after all macros contained therein have been expanded" - [1]).
  • -
  • The result of the argument substitution (see lines 15, 23, 29 and 39), i.e. - the substituted replacement list.
  • -
  • The rescanning process, which again includes the full subsequent macro expansion - process of all found macros (see C++ Standard [16.3.4.1]: "After all - parameters in the replacement list have been substituted, the resulting preprocessing - token sequence is rescanned with all subsequent preprocessing tokens of the - source file for more macro names to replace." [1]).
  • -
  • The result of the actual macro expansion (this is the last line inside the - corresponding rescanning block - see lines 18, 26, 42 and 45).
  • -
-

Every found macro to expand will add an additional indentation level inside - the trace output.

- - - - - - - -
-
- - - - - - -Sunday, May 8, 2005 19:55Sunday, May 15, 2005 12:23 \ No newline at end of file diff --git a/doc/wave_driver.html b/doc/wave_driver.html deleted file mode 100644 index d094328..0000000 --- a/doc/wave_driver.html +++ /dev/null @@ -1,237 +0,0 @@ - - - -The Wave Driver - - - - - - - - - - - -

The - Wave Driver
-
- - - - - - - -
-

There is implemented a driver program for the Wave library, which - utilizes nearly all capabilities of the library. It is usable as a preprocessor executable - on top of any other C++ compiler. It outputs the textual representation of the - preprocessed tokens generated from a given input file. This driver program has - the following command line syntax:

-
Usage: wave [options] [@config-file(s)] file:
- 
-  Options allowed on the command line only:
-    -h [--help]:            print out program usage (this message)
-    -v [--version]:         print the version number
-    -c [--copyright]:       print out the copyright statement
-    --config-file filepath: specify a config file (alternatively: @filepath)
- 
-  Options allowed additionally in a config file:
-    -o [--output] path:          specify a file to use for output instead of stdout
-    -I [--include] path:         specify an additional include directory
-    -S [--sysinclude] syspath:   specify an additional system include directory
-    -F [--forceinclude] file:    force inclusion of the given file
-    -D [--define] macro[=[value]]:    specify a macro to define
-    -P [--predefine] macro[=[value]]: specify a macro to predefine
-    -U [--undefine] macro:       specify a macro to undefine
-    -u [--undefineall]:          undefine all macrodefinitions
-    -n [--nesting] depth:        specify a new maximal include nesting depth
-	
-  Extended options (allowed everywhere)
-    -t [--traceto] arg:          output trace info to a file [arg] or to stderr [-]
-    --timer                      output overall elapsed computing time
-    --long_long:                 enable long long support if C++ mode
-    --variadics:                 enable variadics and placemarkers in C++ mode
-    --c99:                       enable C99 mode (implies variadics and placemarkers)
-    -l [ --listincludes ] arg:   list included file to a file [arg] or to stdout [-]
-    -p [ --preserve ]:           preserve comments
-
-
-

The possible options are straightforward and self explanatory. The - following describes some of these options in more detail. Please note, that - the extended options (--c99 and --variadics) are available only, if the driver - was compiled with the constant WAVE_SUPPORT_VARIADICS_PLACEMARKERS - defined.

-

-o [--output] path

-
-

Specify a filename to be used for the generated preprocessed output - stream. If this option is not given, then the standard output is used (stdout).

-
-

-I [--include] option

-
-

Add the directory dir to the head of the list of directories to be searched for header files. This can be used to override a system - header file, substituting your own version, since these directories are - searched before the system header file directories. However, you should - not use this option to add directories that contain vendor-supplied - system header files (use '-S' for that). If you use more than - one '-I' option, the directories are scanned in left-to-right order, - the standard system directories come after.

-

If a standard system include directory, or a directory specified with - '-S', is also specified with '-I', the '-I' option will be - ignored. The directory will still be searched but as a system - directory at its normal position in the system include chain.

-
-

-I- [--include-] option

-
-

The Wave library maintains two separate search paths - for include files. A search path for user include files and a search path - for system include files, where the user include paths are searched before the system include paths.

-

Any directories specified with '-I' options before - an eventually given '-I-' option are searched only for the case of '#include "file"' - (user include files), they are not searched for '#include <file>' - directives (system include files). If additional directories are specified - with '-I' options after a '-I-' option was given, these directories are searched - for all '#include' directives (ordinarily all '-I' directories are used this way.).

-

In addition, the '-I-' option inhibits the - use of the current directory (where the current input file came from) as the first search directory for '#include "file"' - directives . With '-I.' you can specify searching the directory which was current when the compiler was invoked. That is not exactly the same as what the - preprocessor does by default, but it is often satisfactory.

-
-

-S [--sysinclude] option

-
-

Add the given directory to the head of the list of directories - to be searched for system header files. If you use more than one '-S' option, - the directories are scanned in left-to-right order. This option is most useful - in the wave.cfg configuration file to specify, where the system include files - are to be searched.

-
-

-F [--forceinclude] option

-
-

Process the given file as normal input and include all the resulting - output before the processing the regular input file starts. If more than one - such option is given, the files are pre-included in the sequence of its occurance - on the command line.

-
-

-D [--define] macro[=definition]
-P [--predefine] macro[=definition]

-
-

This option allows to define ('-D') or predefine ('-P') a macro - from the command line. The string given in conjunction with the '-D' or '-P' - option should conform to the usual syntax MACRO(x)=definition as is described - in more detail here.

-

The only difference between the '-D' and the '-P' options is, - that the latter predefines a macro such, that it is not undefinable - through an #undef directive from inside the preprocessed program.

-
-

-U [--undefine] macro

-
-

This allows to undefine some of the automatically predefined macros - of the Wave library (see Predefined macros). The only exception are - the __LINE__, __FILE__, - __DATE__, __TIME__, - __STDC__ and __cplusplus - predefined macros, which are not undefinable. If -U and -D are both specified - for one name, the name is not predefined.

-
-

-n [--nesting] depth

-
-

Specify a new maximal include nesting depth. If the preprocessing - reaches this include file nesting depth, it aborts the preprocessing after - emitting an error message. The default include file nesting depth is 1024.

-
-

-t [--traceto] path

-
-

Enable the tracing facility build into the Wave library. - The path specifies the filename to use for the output of the generated trace - log. If the filename given equals to '-' (without the quotes), the - trace log is put into the standard error stream (stderr).

-
-

--timer

-
-

Enable to track the overall elapsed computing time required for - the given input file. The elapsed time is printed to stdout after the compilation - is completed.

-
-

--variadics

-
-

Enables support for variadics (macros with variable parameter lists), - placemarkers (empty macro arguments) and operator _Pragma in - normal C++ mode. This option predefines a special predefined macro __WAVE_HAS_VARIADICS__.

-
-

--c99

-
-

Enable the C99 mode. This mode enables certain C99 specific features - as variadics (macros with variable parameter lists), placemarkers (empty macro - arguments) and operator _Pragma support and disables some C++ - specific token types as for instance '::', '->*' and '->.'. - Several predefined macros are different for this mode, for more information - about predefined macros you may look here. -

-
-

-l [--listincludes] path

-
-

Enable the output of the names of all opened include files. The path specifies the filename to use for the output of the generated include log. If the filename given equals to '-' (without the quotes), the include log is put into the standard output stream (stdout).

-
-

-p [--preserve]

-
-

Preserve the comments from the input stream not located inside of macro definitions. The comments located inside macro definitions are skipped even if this option is specified. If this option is not specified on the command line all comments are skipped.

-
-

@ [--config-file] option

-
-

Some of the possible command line options may be specified inside - of special configuration files. This is very useful, as a shorthand for different - global configurations. A config file may contain additional options (-I, -S, - -F, -U, -D and -P options), one option per line. Empty lines and lines beginning - with a '#' character are ignored (are treated as a comment lines). Note that - the '#' character is treated as the beginning of a comment only, if it is - the first non-whitespace character on a line. Here is a small sample illustrating the supported configuration file syntax:

-
    # 
-    # enable variadics et.al. in C++ mode
-    #
-    --variadics
-    #
-    # enable timer support
-    #
-    --timer
-    #
-    # emulate gcc V3.3.2
-    #
-    -D__GNUC__=3
-    -D__GNUC_MINOR__=3
-    -D__GNUC_PATCHLEVEL__=2
-    -D__GNUG__
-    # 
-    # add Boost to the system include search paths
-    #
-    -S/usr/local/boost
-

There is a shorthand for specifying a configuration file on the - command line: simply use the '@' character immediatly before the corresponding - file name.

-

The options found in a configuration file are interpreted, as - if they were place instead of the configuration file option on the command - line.

-
-

The Wave driver program looks at startup for a configuration - file named 'wave.cfg' in the same directory, where it was started from (where - is located the driver executable). If this file exists, it is treated as a normal - configuration file and the specified herein options are interpreted as if they - were given as the first options on the command line. This feature is very useful - for defining a global environment for the Wave preprocessor driver.

- - - - - - - -
-
- - - - - diff --git a/index.html b/index.html deleted file mode 100644 index f6a0349..0000000 --- a/index.html +++ /dev/null @@ -1,106 +0,0 @@ - - - -Wave V1.2 - - - - - - - - - - -

Wave - V1.2.0
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table of Contents
Preface
Introduction
Quick Start
Class - References
The Context - Object
The Input - Policy
The Context - Policy
The Lexer Iterator Interface -
The Token - Type
The Token Identifiers
The File - Position
Predefined Macros
Supported Pragma - Directives
The Macro - Expansion Process
Compile Time Configuration
Samples
The Wave Driver Executable
The Wave Driver Command - Line
The Tracing Facility
Acknowledgments
References
-
-
- - - - - diff --git a/samples/Jamfile.v2 b/samples/Jamfile.v2 deleted file mode 100644 index 314358f..0000000 --- a/samples/Jamfile.v2 +++ /dev/null @@ -1,13 +0,0 @@ -# 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 true - ; - -build-project cpp_tokens/build ; -build-project list_includes/build ; -build-project quick_start/build ; -build-project waveidl/build ; diff --git a/samples/cpp_tokens/build/Jamfile b/samples/cpp_tokens/build/Jamfile deleted file mode 100644 index d47f096..0000000 --- a/samples/cpp_tokens/build/Jamfile +++ /dev/null @@ -1,30 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (cpp_tokens) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/samples/cpp_tokens/build ; - -exe cpp_tokens - : ../cpp_tokens.cpp - ../instantiate_cpp_exprgrammar.cpp - ../instantiate_cpp_grammar.cpp - ../instantiate_cpp_literalgrs.cpp - ../instantiate_defined_grammar.cpp - ../instantiate_slex_lexer.cpp - ../../../build/boost_wave - ../../../../../libs/program_options/build/boost_program_options - ../../../../../libs/filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - <*>off # workaround for compiler bug - : - static - single - ; - diff --git a/samples/cpp_tokens/build/Jamfile.v2 b/samples/cpp_tokens/build/Jamfile.v2 deleted file mode 100644 index 4972cda..0000000 --- a/samples/cpp_tokens/build/Jamfile.v2 +++ /dev/null @@ -1,23 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (cpp_tokens) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 cpp_tokens - : ../cpp_tokens.cpp - ../instantiate_cpp_exprgrammar.cpp - ../instantiate_cpp_grammar.cpp - ../instantiate_cpp_literalgrs.cpp - ../instantiate_defined_grammar.cpp - ../instantiate_slex_lexer.cpp - ../../../build//boost_wave - $(BOOST_ROOT)/boost/program_options//boost_program_options - : - msvc-7.1:off # workaround for compiler bug - ; - diff --git a/samples/cpp_tokens/cpp_tokens.cpp b/samples/cpp_tokens/cpp_tokens.cpp deleted file mode 100644 index 893900e..0000000 --- a/samples/cpp_tokens/cpp_tokens.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -/////////////////////////////////////////////////////////////////////////////// -// 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; - -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); - string line; - for (getline(infile, line); infile.good(); getline(infile, line)) { - teststr += line; - teststr += '\n'; - } - } - 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 lexer_type; - typedef boost::wave::context - 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::enable_long_long(ctx.get_language())); - ctx.set_language(boost::wave::enable_preserve_comments(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 &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_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/samples/cpp_tokens/cpp_tokens.hpp b/samples/cpp_tokens/cpp_tokens.hpp deleted file mode 100644 index 4d1bae4..0000000 --- a/samples/cpp_tokens/cpp_tokens.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// include boost config -#include // global configuration information - -/////////////////////////////////////////////////////////////////////////////// -// configure this app here (global configuration constants) -#include "cpp_tokens_config.hpp" - -/////////////////////////////////////////////////////////////////////////////// -// include required boost libraries -#include -#include - -#endif // !defined(CPP_TOKENS_HPP_D6A31137_CE14_4869_9779_6357E2C43187_INCLUDED) diff --git a/samples/cpp_tokens/cpp_tokens_config.hpp b/samples/cpp_tokens/cpp_tokens_config.hpp deleted file mode 100644 index f155b68..0000000 --- a/samples/cpp_tokens/cpp_tokens_config.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -/////////////////////////////////////////////////////////////////////////////// -// 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/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp b/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp deleted file mode 100644 index 83d463a..0000000 --- a/samples/cpp_tokens/instantiate_cpp_exprgrammar.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include - -#include "slex_token.hpp" -#include "slex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/cpp_tokens/instantiate_cpp_grammar.cpp b/samples/cpp_tokens/instantiate_cpp_grammar.cpp deleted file mode 100644 index 90f1278..0000000 --- a/samples/cpp_tokens/instantiate_cpp_grammar.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include - -#include "slex_token.hpp" -#include "slex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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::slex_iterator< - boost::wave::cpplexer::slex_token<> > - lexer_type; -template struct boost::wave::grammars::cpp_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp b/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp deleted file mode 100644 index a63b3e8..0000000 --- a/samples/cpp_tokens/instantiate_cpp_literalgrs.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include - -#include "slex_token.hpp" -#include "slex_iterator.hpp" - -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; -template struct boost::wave::grammars::chlit_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/cpp_tokens/instantiate_defined_grammar.cpp b/samples/cpp_tokens/instantiate_defined_grammar.cpp deleted file mode 100644 index 50b18dc..0000000 --- a/samples/cpp_tokens/instantiate_defined_grammar.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#include - -#include "slex_token.hpp" -#include "slex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/cpp_tokens/instantiate_slex_lexer.cpp b/samples/cpp_tokens/instantiate_slex_lexer.cpp deleted file mode 100644 index a88af6d..0000000 --- a/samples/cpp_tokens/instantiate_slex_lexer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include - -#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/samples/cpp_tokens/slex/cpp_slex_lexer.hpp b/samples/cpp_tokens/slex/cpp_slex_lexer.hpp deleted file mode 100644 index 6279ba2..0000000 --- a/samples/cpp_tokens/slex/cpp_slex_lexer.hpp +++ /dev/null @@ -1,713 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - SLex (Spirit Lex) based C++ lexer - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#if defined(BOOST_SPIRIT_DEBUG) -#include -#endif // defined(BOOST_SPIRIT_DEBUG) - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#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 arraysizes 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 -#define INIT_DATA_CPP_SIZE 15 -#else -#define INIT_DATA_SIZE 159 -#define INIT_DATA_CPP_SIZE 15 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// encapsulation of the boost::spirit::slex based cpp lexer -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// The following lexer_base class was necessary to workaround a CodeWarrior -// bug (at least up to CW V9.5). -template -class lexer_base -: public boost::spirit::lexer< - boost::wave::util::position_iterator > -{ -protected: - typedef boost::wave::util::position_iterator - iterator_type; - typedef typename std::iterator_traits::value_type char_type; - typedef boost::spirit::lexer 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 -class lexer -: public lexer_base -{ -public: - typedef boost::wave::cpplexer::slex_token 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 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 -}; - -/////////////////////////////////////////////////////////////////////////////// -// 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("*") "+" ")*" 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]?" ")" -#define LONGINTEGER_SUFFIX "(" "[uU]" "(" "ll" OR "LL" ")" OR \ - "(" "ll" OR "LL" ")" "[uU]" "?" ")" -#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" OR "\\r\\n" ")" - -#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 -#define INCLUDEDEF "(include|include_next)" -#else -#define INCLUDEDEF "include" -#endif - -/////////////////////////////////////////////////////////////////////////////// -// sexer 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 lexer_base::lexer_data const -lexer::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(DEFINED, "defined"), - 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(IDENTIFIER, "([a-zA-Z_]" OR UNIVERSALCHAR ")([a-zA-Z0-9_]" OR UNIVERSALCHAR ")*"), -// 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(INTLIT, INTEGER INTEGER_SUFFIX "?"), - TOKEN_DATA(LONGINTLIT, INTEGER LONGINTEGER_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 "[^\\n\\r']" OR UNIVERSALCHAR ")+" "'"), - TOKEN_DATA(STRINGLIT, CHAR_SPEC Q("\"") - "(" ESCAPESEQ OR "[^\\n\\r\"]" OR UNIVERSALCHAR ")*" Q("\"")), - TOKEN_DATA(SPACE, BLANK "+"), - 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, "."), - TOKEN_DATA(ANY_TRIGRAPH, TRI(Q("/"))), - { token_id(0) } // this should be the last entry -}; - -/////////////////////////////////////////////////////////////////////////////// -// C++ only token definitions -template -typename lexer_base::lexer_data const -lexer::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"), - TOKEN_DATA(ARROWSTAR, Q("->") Q("*")), - TOKEN_DATA(DOTSTAR, Q(".") Q("*")), - TOKEN_DATA(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 with token data -template -inline -lexer_base::lexer_base() -: base_type(NUM_LEXER_STATES) -{ -} - -template -inline void -lexer::init_dfa(boost::wave::language_support lang) -{ - if (this->has_compiled_dfa()) - return; - -// 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); - } - } - - 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 -boost::wave::util::time_conversion_helper - lexer::compilation_time(__DATE__ " " __TIME__); - -/////////////////////////////////////////////////////////////////////////////// -} // namespace lexer - -/////////////////////////////////////////////////////////////////////////////// -// -template -inline void -init_lexer (lexer::lexer &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 -class slex_functor -: public slex_input_interface< - typename lexer::lexer::token_type - > -{ -public: - - typedef boost::wave::util::position_iterator - iterator_type; - typedef typename std::iterator_traits::value_type char_type; - typedef BOOST_WAVE_STRINGTYPE string_type; - typedef typename lexer::lexer::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 token; - - 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 (T_CONTLINE != id) { - // The cast should avoid spurious warnings about missing case labels - // for the other token ids's. - switch ((unsigned int)id) { - case T_IDENTIFIER: - // test identifier characters for validity (throws if - // invalid chars found) - if (!(language & support_option_no_character_validation)) { - 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_STRINGLIT: - case T_CHARLIT: - // test literal characters for validity (throws if invalid - // chars found) - if (language & support_option_convert_trigraphs) { - using boost::wave::cpplexer::impl::convert_trigraphs; - token_val = convert_trigraphs(token_val, - pos.get_line(), pos.get_column(), pos.get_file()); - } - if (!(language & support_option_no_character_validation)) { - 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; - -#if BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 - case T_PP_HHEADER: - case T_PP_QHEADER: - case T_PP_INCLUDE: - // convert to the corresponding ..._next token, if appropriate - { - // 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); - break; - } -#endif // BOOST_WAVE_SUPPORT_INCLUDE_NEXT != 0 - - 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 (language & support_option_convert_trigraphs) - { - using boost::wave::cpplexer::impl::convert_trigraph; - token_val = convert_trigraph( - token_val, pos.get_line(), pos.get_column(), - pos.get_file()); - } - break; - } - return token_type(id, token_val, pos); - } - - // skip the T_CONTLINE token - } while (true); - } - return token; // 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()); - } - -private: - iterator_type first; - iterator_type last; - boost::wave::language_support language; - static lexer::lexer lexer; // needed only once - - bool at_eof; -}; - -template -lexer::lexer slex_functor::lexer; - -/////////////////////////////////////////////////////////////////////////////// -// -// 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 is 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 -BOOST_WAVE_SLEX_NEW_LEXER_INLINE -slex_input_interface > * -new_lexer_gen::new_lexer(IteratorT const &first, - IteratorT const &last, PositionT const &pos, - boost::wave::language_support language) -{ - return new slex_functor(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/samples/cpp_tokens/slex/lexer.hpp b/samples/cpp_tokens/slex/lexer.hpp deleted file mode 100644 index 45dab74..0000000 --- a/samples/cpp_tokens/slex/lexer.hpp +++ /dev/null @@ -1,2897 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Spirit based lexer - - http://www.boost.org/ - - Copyright (c) 2001, Daniel C. Nuffer. - Copyright (c) 2001-2005 Hartmut Kaiser. - Distributed under the 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 -#include -#include -#include - -#include -#include -#include -#include -#include // for pair -#include -#include -#include -#include - -#if SPIRIT_VERSION < 0x1700 && defined(BOOST_MSVC) && (BOOST_MSVC <= 1300) -#include -#endif - -#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 { - -typedef unsigned char uchar; -typedef unsigned int node_id_t; -const node_id_t invalid_node = node_id_t(-1); -typedef std::set node_set; -typedef std::vector uchar_vector; -typedef std::map followpos_t; -typedef std::vector state_match_t; - -template -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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(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: - - std::auto_ptr m_left; - std::auto_ptr m_right; -}; - -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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(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: - - std::auto_ptr m_left; - std::auto_ptr m_right; -}; - -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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(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: - - std::auto_ptr m_left; -}; - -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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(out, ",")); -} -#endif - -class ccl_node : public node -{ - -public: - - ccl_node(const std::vector& 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 m_match; - node_id_t m_node_num; -}; - -inline -ccl_node::ccl_node(const std::vector& 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(out, ",")); - - out << " lastpos() = "; - node_set lp = lastpos(); - std::copy(lp.begin(), lp.end(), - std::ostream_iterator(out, ",")); -} -#endif - -template -class make_concat -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - - make_concat(std::stack& 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& m_stack; -}; - -template -struct get_byte_aux; - -template<> -struct get_byte_aux<1> -{ - template - unsigned char operator()(CharT c, unsigned int byte) - { - BOOST_ASSERT(byte == 0); - return c; - } -}; - -template<> -struct get_byte_aux<2> -{ - template - 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 - 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 -inline unsigned char -get_byte(CharT c, unsigned int byte) -{ - return get_byte_aux()(c, byte); -} - -template -class make_star -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - make_star(std::stack& 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& m_stack; -}; - -template -class make_or -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - - make_or(std::stack& 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& m_stack; -}; - -template -class make_plus -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - make_plus(std::stack& 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& m_stack; -}; - -template -class make_optional -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - make_optional(std::stack& 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& m_stack; -}; - -/////////////////////////////////////////////////////////////////////////////// -// utility function -template -inline utility::impl::range const& -full_range() -{ - static utility::impl::range full((std::numeric_limits::min)(), - (std::numeric_limits::max)()); - return full; -} - -namespace ccl_utils -{ - template - inline utility::impl::range_run - negate_range_run( - const utility::impl::range_run& rr) - { - utility::impl::range_run newrr; - newrr.set(full_range()); - for (typename utility::impl::range_run::const_iterator iter = rr.begin(); - iter != rr.end(); ++iter) - newrr.clear(*iter); - return newrr; - } - - template - 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 - inline void - handle_mb_char(char_t c, bool first_time, - std::stack& 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 - inline void - handle_mb_range(char_t c1, char_t c2, bool first_time, - std::stack& stack); - - template - inline void - create_nodes(const utility::impl::range_run& rr, - std::stack& stack) - { - - if (sizeof(char_t) == 1) - { - std::vector ccl; - ccl.resize(256); - for (typename utility::impl::range_run::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::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 - 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 - 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 - 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 - struct correct_char_aux { - }; - - template <> - struct correct_char_aux { - - template - static char_t correct(char_t c) { if (c < 0) c = 0; return c; } - }; - - template <> - struct correct_char_aux { - - template - static char_t correct(char_t c) { return c; } - }; - - template - struct correct_char - { - static char_t correct(char_t c) - { - return correct_char_aux::is_signed >:: - correct(c); - } - }; - - template - inline void - handle_mb_range(char_t c1, char_t c2, bool first_time, - std::stack& 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::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 -class make_char -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - make_char(std::stack& the_stack) - : m_stack(the_stack) - {} - - void operator()(iterator_type const& first, iterator_type const& last) const - { - const escape_char_parser lex_escape_ch = - escape_char_parser(); - 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& m_stack; -}; - - -template -class make_ccl -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - make_ccl(std::stack& 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 - static void fill_ccl(utility::impl::range_run& rr, const ParserT& parser) - { - for (int i = 0; i < 256; ++i) - { - if (parser.test(static_cast(uchar(i)))) - rr.set(utility::impl::range(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 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_escape_ch = - escape_char_parser(); - - 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(c1, c2)); - } - else // insert 1 char - { - rr.set(utility::impl::range(c1, c1)); - } - } - } - - if (negated_ccl) - { - rr = ccl_utils::negate_range_run(rr); - } - - ccl_utils::create_nodes(rr, m_stack); - } - - std::stack& m_stack; -}; - -template -class make_any_char -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - std::stack& m_stack; - - make_any_char(std::stack& 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 rr; - rr.set(full_range()); - char_t newline = '\n'; - rr.clear(utility::impl::range(newline, newline)); - - ccl_utils::create_nodes(rr, m_stack); - } -}; - -template -class make_string -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - std::stack& m_stack; - - make_string(std::stack& 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 == '"') - { - throw bad_regex(); - } - - const escape_char_parser lex_escape_ch = - escape_char_parser(); - - 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 -class make_rep1 -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - std::stack& m_stack; - - make_rep1(std::stack& 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) - throw bad_regex(); - - node* top_node = m_stack.top(); - m_stack.pop(); - top_node = repeat_node(top_node, count); - m_stack.push(top_node); - } -}; - -template -class make_rep2 -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - std::stack& m_stack; - - make_rep2(std::stack& 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) - throw 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 -class make_rep3 -{ - typedef typename ScannerT::iterator_t iterator_type; - -public: - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - std::stack& m_stack; - - make_rep3(std::stack& 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) - throw bad_regex(); - - ++scan.first; // skip over ',' - - uint_p[assign(count2)].parse(scan); - if (count2 <= count1) - throw 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::grammar -{ -public: - lexer_grammar(std::stack &node_stack_) - : node_stack(node_stack_) {} - - template - struct definition - { - typedef rule rule_t; - typedef typename ScannerT::iterator_t iterator_type; - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::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(self.node_stack)] ) - ; - - series = - singleton - >>*( singleton[make_concat(self.node_stack)] ) - ; - - singleton = - ch_p('.')[make_any_char(self.node_stack)] - >> singleton2 - | fullccl - >> singleton2 - | ('"' >> string >> '"') - [ - make_string(self.node_stack) - ] - >> singleton2 - | '(' >> re >> ')' - >> singleton2 - | ((anychar_p - chset<>("/|*+?.(){}\\")) | escseq) - [ - make_char(self.node_stack) - ] - >> singleton2 - ; - - singleton2 = - ch_p('*')[make_star(self.node_stack)] - >> singleton2 - | ch_p('+')[make_plus(self.node_stack)] - >> singleton2 - | ch_p('?')[make_optional(self.node_stack)] - >> singleton2 - | ('{' >> uint_p >> '}') - [ - make_rep1(self.node_stack) - ] - >> singleton2 - | ('{' >> uint_p >> ',' >> '}') - [ - make_rep2(self.node_stack) - ] - >> singleton2 - | ('{' >> uint_p >> ',' >> uint_p >> '}') - [ - make_rep3(self.node_stack) - ] - >> singleton2 - | epsilon_p - ; - - fullccl = - ('[' >> !ch_p('^') >> ccl >> ']') - [ - make_ccl(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::digits / 3 + 1 - > oct_parser_t; - typedef - uint_parser::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 const& - start() const { return regex; } - }; - - std::stack &node_stack; - -}; // class lexer_grammar - -template -inline node * -parse(lexer_grammar& g, StringT const& str) -{ - typedef - scanner > - scanner_t; - typedef typename rule::template result::type - result_t; - - typename StringT::const_iterator first = str.begin(); - typename StringT::const_iterator last = str.end(); - - scanner_t scan(first, last); -// typename rule::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 -struct regex_match_helper; - -template<> -struct regex_match_helper // single byte char -{ - template - 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::value_type - > *token) - { - typedef std::basic_string< - typename BOOST_SPIRIT_IT_NS::iterator_traits::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 // wide char -{ - template - 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::value_type - > *token) - { - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - typedef std::basic_string 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 -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::value_type - > *token) - { - return regex_match_helper::do_match( - dfa, first, last, regex_index, token); - } -}; - -} // namespace lexerimpl - -/////////////////////////////////////////////////////////////////////////////// -// -template &)> -class lexer -{ -public: - typedef CallbackT callback_t; - typedef - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - char_t; - - struct regex_info - { - std::basic_string str; - TokenT token; - CallbackT callback; - - regex_info(const std::basic_string& _str, - const TokenT& _token, - const CallbackT& _callback) - : str(_str) - , token(_token) - , callback(_callback) - {} - - }; - - struct dfa_table - { - std::vector > transition_table; - std::vector acceptance_index; - }; - typedef std::vector node_table_t; - typedef std::vector transition_table_t; - typedef std::vector dfa_t; - - - lexer(unsigned int states = 1); - - void register_regex(const std::basic_string& regex, - const TokenT& id, const CallbackT& cb = CallbackT(), - unsigned int state = 0); - - TokenT next_token(IteratorT &first, IteratorT const &last, - std::basic_string *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 > 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 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 m_state_stack; - unsigned int m_num_states; -}; - - -template -inline -lexer::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 -inline void -lexer::register_regex( - const std::basic_string& 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 -inline TokenT -lexer::next_token( - IteratorT &first, IteratorT const& last, - std::basic_string< - typename BOOST_SPIRIT_IT_NS::iterator_traits::value_type - > *token) -{ - if (!m_compiled_dfa) - { - create_dfa(); - } - - IteratorT saved = first; - int regex_index; - if (!lexerimpl::regex_match 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 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 -inline std::auto_ptr -parse_regexes(const RegexListT& regex_list, GrammarT& g) -{ - // parse the expressions into a tree - if (regex_list.begin() == regex_list.end()) - throw bad_regex(); - - typename RegexListT::const_iterator ri = regex_list.begin(); - std::auto_ptr tree(lexerimpl::parse(g, (*ri).str)); - if (tree.get() == 0) - throw bad_regex(); - - ++ri; - for (/**/; ri != regex_list.end(); ++ri) - { - std::auto_ptr next_tree(lexerimpl::parse(g, (*ri).str)); - if (next_tree.get() == 0) - throw bad_regex(); - std::auto_ptr newnode(new or_node(tree.release(), next_tree.release())); - tree = newnode; - } - return tree; -} - -} //namespace lexerimpl - -template -inline void -lexer::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 -inline void -lexer::create_dfa_for_state(int state) -{ - using lexerimpl::node; - std::auto_ptr tree = lexerimpl::parse_regexes(m_regex_list[state], g); - 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 dstates1; - std::map dstates2; - - // the dfa transitions - m_dfa[state].transition_table.push_back( - std::vector(256, invalid_node)); - m_dfa[state].acceptance_index.push_back(invalid_node); - - // whether the dfa state has been processed yet - std::vector 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 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::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::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(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 -inline void -lexer::set_case_insensitive(bool insensitive) -{ - m_case_insensitive = insensitive; -} - - -#if defined(BOOST_SPIRIT_DEBUG) && (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_SLEX) -template -inline void -lexer::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 -inline bool -lexer::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 -inline bool -lexer::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 -class lexer_control -{ -public: - - lexer_control(TokenT& token, unsigned int& current_state, - std::stack& 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& m_state_stack; -}; - -template -inline -lexer_control::lexer_control(TokenT& token, unsigned int& current_state, - std::stack& state_stack) - : m_token(token) - , m_ignore_current_token(false) - , m_current_state(current_state) - , m_state_stack(state_stack) -{ -} - -template -inline void -lexer_control::set_state(unsigned int state) -{ - m_current_state = state; -} - -template -inline unsigned int -lexer_control::get_state() -{ - return m_current_state; -} - -template -inline void -lexer_control::push_state(unsigned int new_state) -{ - m_state_stack.push(m_current_state); - m_current_state = new_state; -} - -template -inline void -lexer_control::pop_state() -{ - m_current_state = m_state_stack.top(); - m_state_stack.pop(); -} - -template -inline unsigned int -lexer_control::top_state() -{ - return m_state_stack.top(); -} - -template -inline void -lexer_control::set_token(const TokenT& token) -{ - m_token = token; -} - -template -inline void -lexer_control::terminate() -{ - m_token = -1; // TOOD: fix this, need to be determined by traits -} - -template -inline void -lexer_control::ignore_current_token() -{ - m_ignore_current_token = true; -} - -template -inline bool -lexer_control::ignore_current_token_set() -{ - return m_ignore_current_token; -} - -} // namespace spirit -} // namespace boost - -#undef BOOST_SPIRIT_IT_NS - -#endif - diff --git a/samples/cpp_tokens/slex_interface.hpp b/samples/cpp_tokens/slex_interface.hpp deleted file mode 100644 index 9efd66d..0000000 --- a/samples/cpp_tokens/slex_interface.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Definition of the abstract lexer interface - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace cpplexer { -namespace slex { - -/////////////////////////////////////////////////////////////////////////////// -// -// new_lexer_gen: generates a new instance of the required C++ lexer -// -/////////////////////////////////////////////////////////////////////////////// -template struct slex_input_interface; - -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 slex_input_interface > * - 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 -struct slex_input_interface -{ - typedef typename TokenT::position_type position_type; - - virtual TokenT get() = 0; - virtual void set_position(position_type const &pos) = 0; - - virtual ~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 - static slex_input_interface * - new_lexer(IteratorT const &first, IteratorT const &last, - position_type const &pos, boost::wave::language_support language) - { - return new_lexer_gen::new_lexer (first, last, - pos, language); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace slex -} // namespace cpplexer -} // namespace wave -} // namespace boost - -#endif // !defined(SLEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED) diff --git a/samples/cpp_tokens/slex_iterator.hpp b/samples/cpp_tokens/slex_iterator.hpp deleted file mode 100644 index a551d37..0000000 --- a/samples/cpp_tokens/slex_iterator.hpp +++ /dev/null @@ -1,172 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Definition of the lexer iterator - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include - -#include -#include -#include - -#include -#include -#include - -#include "slex_interface.hpp" - -#if 0 != __COMO_VERSION__ -#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 -class slex_iterator_functor_shim -{ -public: - template - slex_iterator_functor_shim(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : functor_ptr(slex_input_interface - ::new_lexer(first, last, pos, language)) -#if 0 != __DECCXX_VER - , eof() -#endif // 0 != __DECCXX_VER - {} - -// interface to the boost::spirit::multi_pass_policies::functor_input policy - typedef TokenT result_type; - - BOOST_WAVE_EOF_PREFIX result_type const eof; - - result_type operator()() - { - BOOST_ASSERT(0 != functor_ptr.get()); - return functor_ptr->get(); - } - void set_position(typename TokenT::position_type const &pos) - { - BOOST_ASSERT(0 != functor_ptr.get()); - functor_ptr->set_position(pos); - } - -private: - boost::shared_ptr > functor_ptr; -}; - -#if 0 != __COMO_VERSION__ -/////////////////////////////////////////////////////////////////////////////// -// eof token -template -typename slex_iterator_functor_shim::result_type const - slex_iterator_functor_shim::eof = - typename slex_iterator_functor_shim::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.) -// -/////////////////////////////////////////////////////////////////////////////// - -template -class slex_iterator -: public boost::spirit::multi_pass< - impl::slex_iterator_functor_shim, - boost::wave::util::functor_input - > -{ - typedef impl::slex_iterator_functor_shim input_policy_type; - typedef - boost::spirit::multi_pass - base_type; - -public: - typedef TokenT token_type; - - slex_iterator() - {} - - template - slex_iterator(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : base_type(input_policy_type(first, last, pos, language)) - {} - - void set_position(typename TokenT::position_type const &pos) - { - typedef typename token_type::position_type position_type; - - // set the new position in the current token - token_type const& currtoken = base_type::get_input(); - position_type currpos = currtoken.get_position(); - - currpos.set_file(pos.get_file()); - currpos.set_line(pos.get_line()); - base_type::get_input().set_position(currpos); - - // set the new position for future tokens as well - if (token_type::string_type::npos != - currtoken.get_value().find_first_of('\n')) - { - currpos.set_line(pos.get_line() + 1); - } - base_type::get_functor().set_position(currpos); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // 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/samples/cpp_tokens/slex_token.hpp b/samples/cpp_tokens/slex_token.hpp deleted file mode 100644 index 66355c4..0000000 --- a/samples/cpp_tokens/slex_token.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - A generic C++ lexer token definition - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace cpplexer { - -/////////////////////////////////////////////////////////////////////////////// -// forward declaration of the token type -template -class slex_token; - -/////////////////////////////////////////////////////////////////////////////// -// -// lex_token -// -/////////////////////////////////////////////////////////////////////////////// - -template -class slex_token -{ -public: - typedef BOOST_WAVE_STRINGTYPE string_type; - typedef PositionT position_type; - - slex_token() - : id(T_EOI) - {} - - 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; } - 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(lex_token const &t) - { return ID_FROM_TOKEN(token_id(t)); } - static string_type get_token_value(lex_token const &t) - { return t.get_value(); } -#endif - -// print support - void print (std::ostream &stream) const - { - using namespace std; - using namespace boost::wave; - stream << setw(16) << left << boost::wave::get_token_name(id) << " (" - << "#" << token_id(ID_FROM_TOKEN(*this)) - << ") at " << get_position().get_file() << " (" - << setw(3) << right << get_position().get_line() << "/" - << setw(2) << 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 -inline std::ostream & -operator<< (std::ostream &stream, slex_token const &object) -{ - object.print(stream); - return stream; -} - -/////////////////////////////////////////////////////////////////////////////// -} // namespace cpplexer -} // namespace wave -} // namespace boost - -#endif // !defined(SLEX_TOKEN_HPP_53A13BD2_FBAA_444B_9B8B_FCB225C2BBA8_INCLUDED) diff --git a/samples/lexed_tokens/build/Jamfile b/samples/lexed_tokens/build/Jamfile deleted file mode 100644 index f9d4da7..0000000 --- a/samples/lexed_tokens/build/Jamfile +++ /dev/null @@ -1,24 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (lexed_tokens) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/samples/lexed_tokens/build ; - -exe lexed_tokens - : ../lexed_tokens.cpp - ../../../build/boost_wave - ../../../../../libs/filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - <*>off # workaround for compiler bug - : - static - single - ; - diff --git a/samples/lexed_tokens/build/Jamfile.v2 b/samples/lexed_tokens/build/Jamfile.v2 deleted file mode 100644 index 3c87775..0000000 --- a/samples/lexed_tokens/build/Jamfile.v2 +++ /dev/null @@ -1,17 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (lexed_tokens) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - ../../../build//boost_wave - : - msvc-7.1:off # workaround for compiler bug - ; - diff --git a/samples/lexed_tokens/lexed_tokens.cpp b/samples/lexed_tokens/lexed_tokens.cpp deleted file mode 100644 index 480eaa7..0000000 --- a/samples/lexed_tokens/lexed_tokens.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include Wave itself -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include the lexer stuff -#include // token class -#include // lexer class - -/////////////////////////////////////////////////////////////////////////////// -// -// Special output operator for a lex_token. -// -// Note: this doesn't compile if BOOST_SPIRIT_DEBUG is defined. -// -/////////////////////////////////////////////////////////////////////////////// -template -inline std::ostream & -operator<< (std::ostream &stream, - boost::wave::cpplexer::lex_token const &t) -{ - using namespace std; - using namespace boost::wave; - - token_id id = token_id(t); - stream << setw(16) - << left << boost::wave::get_token_name(id) << " (" - << "#" << 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::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(instream.rdbuf()), - std::istreambuf_iterator()); - - // 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 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_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 &e) { - // some lexing error - std::cerr - << e.file_name() << "(" << e.line_no() << "): " - << e.description() << std::endl; - return 2; - } - catch (std::exception &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/samples/list_includes/build/Jamfile b/samples/list_includes/build/Jamfile deleted file mode 100644 index 8ef7938..0000000 --- a/samples/list_includes/build/Jamfile +++ /dev/null @@ -1,25 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (list_includes) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/samples/list_includes/build ; - -exe list_includes - : ../list_includes.cpp - ../../../build/boost_wave - ../../../../../libs/program_options/build/boost_program_options - ../../../../../libs/filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - <*>off # workaround for compiler bug - : - static - single - ; - diff --git a/samples/list_includes/build/Jamfile.v2 b/samples/list_includes/build/Jamfile.v2 deleted file mode 100644 index a79b009..0000000 --- a/samples/list_includes/build/Jamfile.v2 +++ /dev/null @@ -1,19 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (list_includes) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 list_includes - : ../list_includes.cpp - ../../../build//boost_wave - $(BOOST_ROOT)/boost/program_options//boost_program_options - $(BOOST_ROOT)/boost/filesystem//boost_filesystem - : - msvc-7.1:off # workaround for compiler bug - ; - diff --git a/samples/list_includes/list_includes.cpp b/samples/list_includes/list_includes.cpp deleted file mode 100644 index a097c70..0000000 --- a/samples/list_includes/list_includes.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include Wave itself -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include the lexer stuff -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include the default context trace policies -#include - -/////////////////////////////////////////////////////////////////////////////// -// include lexer specifics, import lexer names -#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION == 0 -#include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// import required names -using namespace boost::spirit; - -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 &files_) : files(files_) {} - - void - opened_include_file(string const &relname, string const &filename, - std::size_t include_depth, bool is_system_include) - { - set::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); - } - } - - set &files; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -int -do_actual_work(vector 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::const_iterator lastfile = arguments.end(); - for (vector::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(instream.rdbuf()), - istreambuf_iterator()); - - // The template boost::wave::cpplexer::lex_token<> is the token type to be - // used by the Wave library. - typedef boost::wave::cpplexer::lex_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 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 const &paths = - vm["include"].as >(); - vector::const_iterator end = paths.end(); - for (vector::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 const &syspaths = - vm["sysinclude"].as >(); - vector::const_iterator end = syspaths.end(); - for (vector::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 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 >(), - "specify additional include directory") - ("sysinclude,S", po::value >(), - "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 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/samples/list_includes/list_includes.hpp b/samples/list_includes/list_includes.hpp deleted file mode 100644 index 1271119..0000000 --- a/samples/list_includes/list_includes.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// include boost config -#include // 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 -#include - -#endif // !defined(LIST_INCLUDES_HPP_843DB412_3AA8_4BCF_8081_AA4A5FDE0BE7_INCLUDED) diff --git a/samples/list_includes/list_includes_config.hpp b/samples/list_includes/list_includes_config.hpp deleted file mode 100644 index f3115dd..0000000 --- a/samples/list_includes/list_includes_config.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Global application configuration of the list_includes sample - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 cofiguration stuff for the Wave library itself -#include - -/////////////////////////////////////////////////////////////////////////////// -// 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/samples/list_includes/list_includes_version.hpp b/samples/list_includes/list_includes_version.hpp deleted file mode 100644 index 2300713..0000000 --- a/samples/list_includes/list_includes_version.hpp +++ /dev/null @@ -1,20 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 3 -#define LIST_INCLUDES_VERSION_SUBMINOR 0 - -#endif // !defined(LIST_INCLUDES_VERSION_HPP_FF662D6C_C3E6_4BEC_A062_5D9BD7415EBF_INCLUDED) diff --git a/samples/quick_start/build/Jamfile b/samples/quick_start/build/Jamfile deleted file mode 100644 index 3eb4a63..0000000 --- a/samples/quick_start/build/Jamfile +++ /dev/null @@ -1,24 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (quick_start) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/samples/quick_start/build ; - -exe quick_start - : ../quick_start.cpp - ../../../build/boost_wave - ../../../../../libs/filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - <*>off # workaround for compiler bug - : - static - single - ; - diff --git a/samples/quick_start/build/Jamfile.v2 b/samples/quick_start/build/Jamfile.v2 deleted file mode 100644 index dadacee..0000000 --- a/samples/quick_start/build/Jamfile.v2 +++ /dev/null @@ -1,17 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (quick_start) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - ../../../build//boost_wave - : - msvc-7.1:off # workaround for compiler bug - ; - diff --git a/samples/quick_start/quick_start.cpp b/samples/quick_start/quick_start.cpp deleted file mode 100644 index 764659b..0000000 --- a/samples/quick_start/quick_start.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include Wave itself -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include the lexer stuff -#include // token class -#include // 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 { - // 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(instream.rdbuf()), - std::istreambuf_iterator()); - - // The template boost::wave::cpplexer::lex_token<> is the token type to be - // used by the Wave library. - typedef boost::wave::cpplexer::lex_token<> token_type; - - // The template boost::wave::cpplexer::lex_iterator<> is the lexer type to - // be used by the Wave library. - typedef boost::wave::cpplexer::lex_iterator lex_iterator_type; - - // This is the resulting context type to use. The first template parameter - // should match the iterator type to be used during construction of the - // corresponding context object (see below). - typedef boost::wave::context - 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 &e) { - // some preprocessing error - std::cerr - << e.file_name() << "(" << e.line_no() << "): " - << e.description() << std::endl; - return 2; - } - catch (std::exception &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/samples/waveidl/build/Jamfile b/samples/waveidl/build/Jamfile deleted file mode 100644 index 9d89fc2..0000000 --- a/samples/waveidl/build/Jamfile +++ /dev/null @@ -1,31 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (waveidl) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/samples/waveidl/build ; - -exe waveidl - : ../idl.cpp - ../instantiate_cpp_grammar.cpp - ../instantiate_defined_grammar.cpp - ../instantiate_predef_macros.cpp - ../instantiate_re2c_lexer.cpp - ../instantiate_re2c_lexer_string.cpp - ../idllexer/idl_re.cpp - ../../../build/boost_wave - ../../../../../libs/program_options/build/boost_program_options - ../../../../../libs/filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - <*>off # workaround for compiler bug - : - static - single - ; - diff --git a/samples/waveidl/build/Jamfile.v2 b/samples/waveidl/build/Jamfile.v2 deleted file mode 100644 index e235ec4..0000000 --- a/samples/waveidl/build/Jamfile.v2 +++ /dev/null @@ -1,24 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Sample Build Jamfile (waveidl) -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 waveidl - : ../idl.cpp - ../instantiate_cpp_grammar.cpp - ../instantiate_defined_grammar.cpp - ../instantiate_predef_macros.cpp - ../instantiate_re2c_lexer.cpp - ../instantiate_re2c_lexer_string.cpp - ../idllexer/idl_re.cpp - ../../../build//boost_wave - $(BOOST_ROOT)/boost/program_options//boost_program_options - : - msvc-7.1:off # workaround for compiler bug - ; - diff --git a/samples/waveidl/idl.cpp b/samples/waveidl/idl.cpp deleted file mode 100644 index 56b3a52..0000000 --- a/samples/waveidl/idl.cpp +++ /dev/null @@ -1,537 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: IDL oriented preprocessor - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include Wave itself -#include - -/////////////////////////////////////////////////////////////////////////////// -// Include the lexer related stuff -#include // 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 -#include -#include -#include -#include -#include -#endif - -/////////////////////////////////////////////////////////////////////////////// -// import required names -using namespace boost::spirit; - -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 - 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-2005 Hartmut Kaiser, Distributed under the 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 at_option_parser(string const&s) - { - if ('@' == s[0]) - return std::make_pair(string("config-file"), s.substr(1)); - else - return pair(); - } - - // class, which keeps include file information read from the command line - class include_paths { - public: - include_paths() : seen_separator(false) {} - - vector paths; // stores user paths - vector 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 const &tokens) - { - if (v.empty()) - v = boost::any(include_paths()); - - include_paths *p = boost::any_cast(&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 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 boost { namespace program_options { - - void validate(boost::any &v, std::vector const &s, - cmd_line_util::include_paths *, int) - { - cmd_line_util::include_paths::validate(v, s); - } - -}} // namespace boost::program_options - -/////////////////////////////////////////////////////////////////////////////// -// 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(instream), - istream_iterator(), - inserter(instring, instring.end())); -#else - instring = string(istreambuf_iterator(instream.rdbuf()), - istreambuf_iterator()); -#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 - 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 const &syspaths = - vm["sysinclude"].as >(); - vector::const_iterator end = syspaths.end(); - for (vector::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(); - vector::const_iterator end = ip.paths.end(); - - for (vector::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::const_iterator sysend = ip.syspaths.end(); - for (vector::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 const ¯os = vm["define"].as >(); - vector::const_iterator end = macros.end(); - for (vector::const_iterator cit = macros.begin(); - cit != end; ++cit) - { - ctx.add_macro_definition(*cit); - } - } - - // add additional predefined macros - if (vm.count("predefine")) { - vector const &predefmacros = - vm["predefine"].as >(); - vector::const_iterator end = predefmacros.end(); - for (vector::const_iterator cit = predefmacros.begin(); - cit != end; ++cit) - { - ctx.add_macro_definition(*cit, true); - } - } - - // undefine specified macros - if (vm.count("undefine")) { - vector const &undefmacros = - vm["undefine"].as >(); - vector::const_iterator end = undefmacros.end(); - for (vector::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()); - - 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 &>(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 &e) { - // some preprocessing error - cerr - << e.file_name() << "(" << e.line_no() << "): " - << e.description() << endl; - return 1; - } - catch (boost::wave::cpplexer::lexing_exception &e) { - // some lexing 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; -} - -/////////////////////////////////////////////////////////////////////////////// -// 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 >(), - "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", "specify a file to use for output instead of stdout") - ("include,I", po::value()->composing(), - "specify an additional include directory") - ("sysinclude,S", po::value >()->composing(), - "specify an additional system include directory") - ("define,D", po::value >()->composing(), - "specify a macro to define (as macro[=[value]])") - ("predefine,P", po::value >()->composing(), - "specify a macro to predefine (as macro[=[value]])") - ("undefine,U", po::value >()->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(argv[0], fs::native); - - 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 const &cfg_files = - vm["config-file"].as >(); - vector::const_iterator end = cfg_files.end(); - for (vector::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 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 &e) { - cout << "waveidl: exception caught: " << e.what() << endl; - return 6; - } - catch (...) { - cerr << "waveidl: unexpected exception caught." << endl; - return 7; - } -} - diff --git a/samples/waveidl/idl.hpp b/samples/waveidl/idl.hpp deleted file mode 100644 index 5b7575c..0000000 --- a/samples/waveidl/idl.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: IDL oriented preprocessor - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// include boost config -#include // 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 -#include - -#endif // !defined(IDL_HPP_FC7EE131_5CE9_43F2_A713_8D9BBC3C8477_INCLUDED) diff --git a/samples/waveidl/idl_config.hpp b/samples/waveidl/idl_config.hpp deleted file mode 100644 index a16d96a..0000000 --- a/samples/waveidl/idl_config.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -/////////////////////////////////////////////////////////////////////////////// -// 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/samples/waveidl/idl_version.hpp b/samples/waveidl/idl_version.hpp deleted file mode 100644 index 1164c19..0000000 --- a/samples/waveidl/idl_version.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: IDL oriented preprocessor - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#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/samples/waveidl/idllexer/idl.re b/samples/waveidl/idllexer/idl.re deleted file mode 100644 index bb30288..0000000 --- a/samples/waveidl/idllexer/idl.re +++ /dev/null @@ -1,583 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: IDL lexer - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include -#include -#include -#include - -#include - -#if defined(BOOST_HAS_UNISTD_H) -#include -#else -#include -#endif - -#include -#include - -// reuse the token ids and re2c helper functions from the default C++ lexer -#include -#include -#include - -#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 BSIZE 196608 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) {cursor = fill(s, cursor);} - -//#define RET(i) {s->cur = cursor; return (i);} -#define RET(i) \ - { \ - s->line += count_backslash_newlines(s, cursor); \ - s->cur = cursor; \ - return (i); \ - } \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace idllexer { -namespace re2clex { - -#define RE2C_ASSERT BOOST_ASSERT - -int -get_one_char(boost::wave::cpplexer::re2clex::Scanner *s) -{ - using namespace boost::wave::cpplexer::re2clex; - if (s->fd != -1) { - uchar val; - - if (read(s->fd, &val, sizeof(val))) - return val; - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - if (s->act < s->last) - return *(s->act)++; - } - return -1; -} - -std::ptrdiff_t -rewind_stream (boost::wave::cpplexer::re2clex::Scanner *s, int cnt) -{ - if (s->fd != -1) { - return lseek(s->fd, cnt, SEEK_CUR); - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - s->act += cnt; - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - return s->act - s->first; - } - return 0; -} - -std::size_t -get_first_eol_offset(boost::wave::cpplexer::re2clex::Scanner* s) -{ - if (!AQ_EMPTY(s->eol_offsets)) - { - return s->eol_offsets->queue[s->eol_offsets->head]; - } - else - { - return (unsigned int)-1; - } -} - -void -adjust_eol_offsets(boost::wave::cpplexer::re2clex::Scanner* 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; -} - -int -count_backslash_newlines(boost::wave::cpplexer::re2clex::Scanner *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) -{ - if (*p == '\\') { - len = 1; - return true; - } - else if (*p == '?' && *(p+1) == '?' && (p+2 < end && *(p+2) == '/')) { - len = 3; - return true; - } - return false; -} - -boost::wave::cpplexer::re2clex::uchar * -fill(boost::wave::cpplexer::re2clex::Scanner *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) < BSIZE) - { - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - if (buf == 0) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "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[BSIZE]; - free(s->bot); - s->bot = buf; - } - - if (s->fd != -1) { - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE) - { - s->eof = &s->lim[cnt]; *(s->eof)++ = '\0'; - } - } - else if (s->act != 0) { - cnt = s->last - s->act; - if (cnt > BSIZE) - cnt = BSIZE; - memcpy(s->lim, s->act, cnt); - s->act += cnt; - if (cnt != 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 */ - lseek(s->fd, -1, SEEK_CUR); - } - } - /* 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; -} - -boost::wave::token_id -scan(boost::wave::cpplexer::re2clex::Scanner *s) -{ - using namespace boost::wave::cpplexer::re2clex; - - uchar *cursor = s->tok = s->cur; - -/*!re2c -any = [\t\v\f\r\n\040-\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" { RET(T_TRUE); } - "FALSE" { RET(T_FALSE); } - - "{" { RET(T_LEFTBRACE); } - "}" { RET(T_RIGHTBRACE); } - "[" { RET(T_LEFTBRACKET); } - "]" { RET(T_RIGHTBRACKET); } - "#" { RET(T_POUND); } - "##" { RET(T_POUND_POUND); } - "(" { RET(T_LEFTPAREN); } - ")" { RET(T_RIGHTPAREN); } - ";" { RET(T_SEMICOLON); } - ":" { RET(T_COLON); } - "?" { RET(T_QUESTION_MARK); } - "." { RET(T_DOT); } - "+" { RET(T_PLUS); } - "-" { RET(T_MINUS); } - "*" { RET(T_STAR); } - "/" { RET(T_DIVIDE); } - "%" { RET(T_PERCENT); } - "^" { RET(T_XOR); } - "&" { RET(T_AND); } - "|" { RET(T_OR); } - "~" { RET(T_COMPL); } - "!" { RET(T_NOT); } - "=" { RET(T_ASSIGN); } - "<" { RET(T_LESS); } - ">" { RET(T_GREATER); } - "<<" { RET(T_SHIFTLEFT); } - ">>" { RET(T_SHIFTRIGHT); } - "==" { RET(T_EQUAL); } - "!=" { RET(T_NOTEQUAL); } - "<=" { RET(T_LESSEQUAL); } - ">=" { RET(T_GREATEREQUAL); } - "&&" { RET(T_ANDAND); } - "||" { RET(T_OROR); } - "++" { RET(T_PLUSPLUS); } - "--" { RET(T_MINUSMINUS); } - "," { RET(T_COMMA); } - - ([a-zA-Z_] | UniversalChar) ([a-zA-Z_0-9] | UniversalChar)* - { RET(T_IDENTIFIER); } - - (("0" [xX] HexDigit+) | ("0" OctalDigit*) | ([1-9] Digit*)) IntegerSuffix? - { RET(T_INTLIT); } - - ((FractionalConstant ExponentPart?) | (Digit+ ExponentPart)) FloatingSuffix? - { RET(T_FLOATLIT); } - - (FractionalConstant | Digit+) FixedPointSuffix - { RET(T_FIXEDPOINTLIT); } - - "L"? (['] (EscapeSequence|any\[\n\r\\']|UniversalChar)+ [']) - { RET(T_CHARLIT); } - - "L"? (["] (EscapeSequence|any\[\n\r\\"]|UniversalChar)* ["]) - { RET(T_STRINGLIT); } - - - Pound PPSpace "include" PPSpace "<" (any\[\n\r>])+ ">" - { RET(T_PP_HHEADER); } - - Pound PPSpace "include" PPSpace "\"" (any\[\n\r"])+ "\"" - { RET(T_PP_QHEADER); } - - Pound PPSpace "include" PPSpace - { RET(T_PP_INCLUDE); } - - Pound PPSpace "if" { RET(T_PP_IF); } - Pound PPSpace "ifdef" { RET(T_PP_IFDEF); } - Pound PPSpace "ifndef" { RET(T_PP_IFNDEF); } - Pound PPSpace "else" { RET(T_PP_ELSE); } - Pound PPSpace "elif" { RET(T_PP_ELIF); } - Pound PPSpace "endif" { RET(T_PP_ENDIF); } - Pound PPSpace "define" { RET(T_PP_DEFINE); } - Pound PPSpace "undef" { RET(T_PP_UNDEF); } - Pound PPSpace "line" { RET(T_PP_LINE); } - Pound PPSpace "error" { RET(T_PP_ERROR); } - Pound PPSpace "pragma" { RET(T_PP_PRAGMA); } - - Pound PPSpace "warning" { RET(T_PP_WARNING); } - - [ \t\v\f]+ - { RET(T_SPACE); } - - Newline - { - s->line++; - 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, "'\\000' in input stream"); - else - printf("Error: 0 in file\n"); - } - RET(T_EOF); - } - - any - { - /* if (0 != s->error_proc) - (*s->error_proc)(s, "Unexpected character: '%c'", *s->tok); - else - printf("unexpected character: '%c'\n", *s->tok); - */ - RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); - } -*/ - -ccomment: -/*!re2c - "*/" { RET(T_CCOMMENT); } - Newline - { - /*if(cursor == s->eof) 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, "Unterminated comment"); - else - printf("Error: Unterminated comment\n"); - } - else - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CCOMMENT); - } - -*/ - -cppcomment: -/*!re2c - Newline - { - /*if(cursor == s->eof) RET(T_EOF); */ - /*s->tok = cursor; */ - s->line++; - 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, "'\\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 */ - RET(T_CPPCOMMENT); - } -*/ - -} /* end of scan */ - -#undef RE2C_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -} // namespace re2clex -} // namespace idllexer -} // namespace wave -} // namespace boost diff --git a/samples/waveidl/idllexer/idl_lex_interface.hpp b/samples/waveidl/idllexer/idl_lex_interface.hpp deleted file mode 100644 index fe540e8..0000000 --- a/samples/waveidl/idllexer/idl_lex_interface.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Definition of the abstract lexer interface - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED) -#define CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED - -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace idllexer { - -/////////////////////////////////////////////////////////////////////////////// -// -// new_lexer_gen: generates a new instance of the required C++ lexer -// -/////////////////////////////////////////////////////////////////////////////// -template struct lex_input_interface; - -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 lex_input_interface< - boost::wave::cpplexer::lex_token - > * - 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 -struct lex_input_interface -{ - typedef typename TokenT::position_type position_type; - - virtual TokenT get() = 0; - virtual void set_position(position_type const &pos) = 0; - - virtual ~lex_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 - static lex_input_interface * - new_lexer(IteratorT const &first, IteratorT const &last, - position_type const &pos, boost::wave::language_support language) - { - return new_lexer_gen::new_lexer (first, last, - pos, language); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace cpplexer -} // namespace wave -} // namespace boost - -#endif // !defined(CPP_LEX_INTERFACE_HPP_E83F52A4_90AC_4FBE_A9A7_B65F7F94C497_INCLUDED) diff --git a/samples/waveidl/idllexer/idl_lex_iterator.hpp b/samples/waveidl/idllexer/idl_lex_iterator.hpp deleted file mode 100644 index 532f358..0000000 --- a/samples/waveidl/idllexer/idl_lex_iterator.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 -#include - -#include -#include -#include - -#include -#include -#include - -#include "idl_lex_interface.hpp" - -#if 0 != __COMO_VERSION__ -#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 -class lex_iterator_functor_shim -{ - typedef lex_input_interface lex_input_interface_t; - -public: - template - lex_iterator_functor_shim(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : functor_ptr(lex_input_interface_t::new_lexer(first, last, pos, language)) - {} - -// interface to the boost::spirit::multi_pass_policies::functor_input policy - typedef TokenT result_type; - - BOOST_WAVE_EOF_PREFIX result_type const eof; - - result_type operator()() - { - BOOST_ASSERT(0 != functor_ptr.get()); - return functor_ptr->get(); - } - void set_position(typename TokenT::position_type const &pos) - { - BOOST_ASSERT(0 != functor_ptr.get()); - functor_ptr->set_position(pos); - } - -private: - boost::shared_ptr functor_ptr; -}; - -#if 0 != __COMO_VERSION__ -/////////////////////////////////////////////////////////////////////////////// -// eof token -template -typename lex_iterator_functor_shim::result_type const - lex_iterator_functor_shim::eof; -#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 -// -/////////////////////////////////////////////////////////////////////////////// - -template -class lex_iterator -: public boost::spirit::multi_pass< - impl::lex_iterator_functor_shim, - boost::wave::util::functor_input - > -{ - typedef impl::lex_iterator_functor_shim input_policy_type; - typedef - boost::spirit::multi_pass - base_type; - typedef lex_iterator self_type; - -public: - typedef TokenT token_type; - - lex_iterator() - {} - - template - lex_iterator(IteratorT const &first, IteratorT const &last, - typename TokenT::position_type const &pos, - boost::wave::language_support language) - : base_type(input_policy_type(first, last, pos, language)) - {} - - void set_position(typename TokenT::position_type const &pos) - { - typedef typename TokenT::position_type position_type; - - // set the new position in the current token - position_type currpos = base_type::get_input().get_position(); - currpos.set_file(pos.get_file()); - currpos.set_line(pos.get_line()); - base_type::get_input().set_position(currpos); - - // set the new position for future tokens as well - base_type::get_functor().set_position(pos); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace idllexer -} // namespace wave -} // namespace boost - -#endif // !defined(IDL_LEX_ITERATOR_HPP_7926F865_E02F_4950_9EB5_5F453C9FF953_INCLUDED) diff --git a/samples/waveidl/idllexer/idl_re.cpp b/samples/waveidl/idllexer/idl_re.cpp deleted file mode 100644 index 8913d3e..0000000 --- a/samples/waveidl/idllexer/idl_re.cpp +++ /dev/null @@ -1,4153 +0,0 @@ -/* Generated by re2c 0.9.9 on Sat Aug 27 21:57:59 2005 */ -#line 1 "idl.re" -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: IDL lexer - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#include -#include -#include -#include - -#include - -#if defined(BOOST_HAS_UNISTD_H) -#include -#else -#include -#endif - -#include -#include - -// reuse the token ids and re2c helper functions from the default C++ lexer -#include -#include -#include - -#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 BSIZE 196608 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT s->lim -#define YYMARKER s->ptr -#define YYFILL(n) {cursor = fill(s, cursor);} - -//#define RET(i) {s->cur = cursor; return (i);} -#define RET(i) \ - { \ - s->line += count_backslash_newlines(s, cursor); \ - s->cur = cursor; \ - return (i); \ - } \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace idllexer { -namespace re2clex { - -#define RE2C_ASSERT BOOST_ASSERT - -int -get_one_char(boost::wave::cpplexer::re2clex::Scanner *s) -{ - using namespace boost::wave::cpplexer::re2clex; - if (s->fd != -1) { - uchar val; - - if (read(s->fd, &val, sizeof(val))) - return val; - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - if (s->act < s->last) - return *(s->act)++; - } - return -1; -} - -std::ptrdiff_t -rewind_stream (boost::wave::cpplexer::re2clex::Scanner *s, int cnt) -{ - if (s->fd != -1) { - return lseek(s->fd, cnt, SEEK_CUR); - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - s->act += cnt; - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - return s->act - s->first; - } - return 0; -} - -std::size_t -get_first_eol_offset(boost::wave::cpplexer::re2clex::Scanner* s) -{ - if (!AQ_EMPTY(s->eol_offsets)) - { - return s->eol_offsets->queue[s->eol_offsets->head]; - } - else - { - return (unsigned int)-1; - } -} - -void -adjust_eol_offsets(boost::wave::cpplexer::re2clex::Scanner* 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; -} - -int -count_backslash_newlines(boost::wave::cpplexer::re2clex::Scanner *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) -{ - if (*p == '\\') { - len = 1; - return true; - } - else if (*p == '?' && *(p+1) == '?' && (p+2 < end && *(p+2) == '/')) { - len = 3; - return true; - } - return false; -} - -boost::wave::cpplexer::re2clex::uchar * -fill(boost::wave::cpplexer::re2clex::Scanner *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) < BSIZE) - { - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - if (buf == 0) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "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[BSIZE]; - free(s->bot); - s->bot = buf; - } - - if (s->fd != -1) { - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE) - { - s->eof = &s->lim[cnt]; *(s->eof)++ = '\0'; - } - } - else if (s->act != 0) { - cnt = s->last - s->act; - if (cnt > BSIZE) - cnt = BSIZE; - memcpy(s->lim, s->act, cnt); - s->act += cnt; - if (cnt != 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 */ - lseek(s->fd, -1, SEEK_CUR); - } - } - /* 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; -} - -boost::wave::token_id -scan(boost::wave::cpplexer::re2clex::Scanner *s) -{ - using namespace boost::wave::cpplexer::re2clex; - - uchar *cursor = s->tok = s->cur; - -#line 387 "idl.re" - - - -#line 377 "idl_re.cpp" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy0; - ++YYCURSOR; -yy0: - if((YYLIMIT - YYCURSOR) < 12) YYFILL(12); - yych = *YYCURSOR; - switch(yych){ - case 0x00: goto yy70; - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - case 0x08: case 0x0E: - case 0x0F: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - case 0x1C: - case 0x1D: - case 0x1E: - case 0x1F: goto yy2; - case 0x09: case 0x0B: - case 0x0C: case ' ': goto yy65; - case 0x0A: goto yy67; - case 0x0D: goto yy69; - case '!': goto yy46; - case '"': goto yy64; - case '#': goto yy16; - case '%': goto yy36; - case '&': goto yy40; - case '\'': goto yy63; - case '(': goto yy18; - case ')': goto yy20; - case '*': goto yy34; - case '+': goto yy30; - case ',': goto yy54; - case '-': goto yy32; - case '.': goto yy28; - case '/': goto yy3; - case '0': goto yy60; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy62; - case ':': goto yy24; - case ';': goto yy22; - case '<': goto yy50; - case '=': goto yy48; - case '>': goto yy52; - case '?': goto yy26; - 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 yy56; - case 'F': goto yy7; - case 'L': goto yy57; - case 'T': goto yy5; - case '[': goto yy12; - case '\\': goto yy58; - case ']': goto yy14; - case '^': goto yy38; - case '{': goto yy8; - case '|': goto yy42; - case '}': goto yy10; - case '~': goto yy44; - default: goto yy72; - } -yy2: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 12: goto yy353; - case 11: goto yy349; - case 1: goto yy17; - case 2: goto yy27; - case 3: goto yy37; - case 0: goto yy6; - case 5: goto yy61; - case 8: goto yy170; - case 7: goto yy131; - case 6: goto yy81; - case 10: goto yy302; - case 9: goto yy294; - case 4: goto yy59; - } -yy3: ++YYCURSOR; - if((yych = *YYCURSOR) == '*') goto yy356; - if(yych == '/') goto yy354; - goto yy4; -yy4: -#line 411 "idl.re" -{ RET(T_DIVIDE); } -#line 528 "idl_re.cpp" -yy5: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'R') goto yy350; - goto yy202; -yy6: -#line 434 "idl.re" -{ RET(T_IDENTIFIER); } -#line 536 "idl_re.cpp" -yy7: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'A') goto yy345; - goto yy202; -yy8: ++YYCURSOR; - goto yy9; -yy9: -#line 396 "idl.re" -{ RET(T_LEFTBRACE); } -#line 546 "idl_re.cpp" -yy10: ++YYCURSOR; - goto yy11; -yy11: -#line 397 "idl.re" -{ RET(T_RIGHTBRACE); } -#line 552 "idl_re.cpp" -yy12: ++YYCURSOR; - goto yy13; -yy13: -#line 398 "idl.re" -{ RET(T_LEFTBRACKET); } -#line 558 "idl_re.cpp" -yy14: ++YYCURSOR; - goto yy15; -yy15: -#line 399 "idl.re" -{ RET(T_RIGHTBRACKET); } -#line 564 "idl_re.cpp" -yy16: yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'e'){ - if(yych <= '"'){ - if(yych <= 0x09){ - if(yych >= 0x09) goto yy239; - goto yy17; - } else { - if(yych == ' ') goto yy239; - goto yy17; - } - } else { - if(yych <= '.'){ - if(yych <= '#') goto yy343; - goto yy17; - } else { - if(yych <= '/') goto yy239; - if(yych >= 'd') goto yy239; - goto yy17; - } - } - } else { - if(yych <= 'o'){ - if(yych <= 'i'){ - if(yych >= 'i') goto yy239; - goto yy17; - } else { - if(yych == 'l') goto yy239; - goto yy17; - } - } else { - if(yych <= 'u'){ - if(yych <= 'p') goto yy239; - if(yych >= 'u') goto yy239; - goto yy17; - } else { - if(yych == 'w') goto yy239; - goto yy17; - } - } - } -yy17: -#line 400 "idl.re" -{ RET(T_POUND); } -#line 609 "idl_re.cpp" -yy18: ++YYCURSOR; - goto yy19; -yy19: -#line 402 "idl.re" -{ RET(T_LEFTPAREN); } -#line 615 "idl_re.cpp" -yy20: ++YYCURSOR; - goto yy21; -yy21: -#line 403 "idl.re" -{ RET(T_RIGHTPAREN); } -#line 621 "idl_re.cpp" -yy22: ++YYCURSOR; - goto yy23; -yy23: -#line 404 "idl.re" -{ RET(T_SEMICOLON); } -#line 627 "idl_re.cpp" -yy24: ++YYCURSOR; - goto yy25; -yy25: -#line 405 "idl.re" -{ RET(T_COLON); } -#line 633 "idl_re.cpp" -yy26: yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '?') goto yy341; - goto yy27; -yy27: -#line 406 "idl.re" -{ RET(T_QUESTION_MARK); } -#line 641 "idl_re.cpp" -yy28: ++YYCURSOR; - if((yych = *YYCURSOR) <= '/') goto yy29; - if(yych <= '9') goto yy168; - goto yy29; -yy29: -#line 407 "idl.re" -{ RET(T_DOT); } -#line 649 "idl_re.cpp" -yy30: ++YYCURSOR; - if((yych = *YYCURSOR) == '+') goto yy339; - goto yy31; -yy31: -#line 408 "idl.re" -{ RET(T_PLUS); } -#line 656 "idl_re.cpp" -yy32: ++YYCURSOR; - if((yych = *YYCURSOR) == '-') goto yy337; - goto yy33; -yy33: -#line 409 "idl.re" -{ RET(T_MINUS); } -#line 663 "idl_re.cpp" -yy34: ++YYCURSOR; - goto yy35; -yy35: -#line 410 "idl.re" -{ RET(T_STAR); } -#line 669 "idl_re.cpp" -yy36: yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == ':') goto yy238; - goto yy37; -yy37: -#line 412 "idl.re" -{ RET(T_PERCENT); } -#line 677 "idl_re.cpp" -yy38: ++YYCURSOR; - goto yy39; -yy39: -#line 413 "idl.re" -{ RET(T_XOR); } -#line 683 "idl_re.cpp" -yy40: ++YYCURSOR; - if((yych = *YYCURSOR) == '&') goto yy236; - goto yy41; -yy41: -#line 414 "idl.re" -{ RET(T_AND); } -#line 690 "idl_re.cpp" -yy42: ++YYCURSOR; - if((yych = *YYCURSOR) == '|') goto yy234; - goto yy43; -yy43: -#line 415 "idl.re" -{ RET(T_OR); } -#line 697 "idl_re.cpp" -yy44: ++YYCURSOR; - goto yy45; -yy45: -#line 416 "idl.re" -{ RET(T_COMPL); } -#line 703 "idl_re.cpp" -yy46: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy232; - goto yy47; -yy47: -#line 417 "idl.re" -{ RET(T_NOT); } -#line 710 "idl_re.cpp" -yy48: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy230; - goto yy49; -yy49: -#line 418 "idl.re" -{ RET(T_ASSIGN); } -#line 717 "idl_re.cpp" -yy50: ++YYCURSOR; - if((yych = *YYCURSOR) <= ';') goto yy51; - if(yych <= '<') goto yy228; - if(yych <= '=') goto yy226; - goto yy51; -yy51: -#line 419 "idl.re" -{ RET(T_LESS); } -#line 726 "idl_re.cpp" -yy52: ++YYCURSOR; - if((yych = *YYCURSOR) <= '<') goto yy53; - if(yych <= '=') goto yy222; - if(yych <= '>') goto yy224; - goto yy53; -yy53: -#line 420 "idl.re" -{ RET(T_GREATER); } -#line 735 "idl_re.cpp" -yy54: ++YYCURSOR; - goto yy55; -yy55: -#line 431 "idl.re" -{ RET(T_COMMA); } -#line 741 "idl_re.cpp" -yy56: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy202; -yy57: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '?'){ - if(yych <= '\''){ - if(yych == '"') goto yy76; - if(yych <= '&') goto yy6; - goto yy221; - } else { - if(yych <= '/') goto yy6; - if(yych <= '9') goto yy201; - if(yych <= '>') goto yy6; - goto yy204; - } - } else { - if(yych <= '\\'){ - if(yych <= '@') goto yy6; - if(yych <= 'Z') goto yy201; - if(yych <= '[') goto yy6; - goto yy203; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy6; - goto yy201; - } else { - if(yych <= '`') goto yy6; - if(yych <= 'z') goto yy201; - goto yy6; - } - } - } -yy58: yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy193; - if(yych == 'u') goto yy192; - goto yy59; -yy59: -#line 498 "idl.re" -{ - /* if (0 != s->error_proc) - (*s->error_proc)(s, "Unexpected character: '%c'", *s->tok); - else - printf("unexpected character: '%c'\n", *s->tok); - */ - RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); - } -#line 790 "idl_re.cpp" -yy60: yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'U'){ - if(yych <= 'C'){ - if(yych <= '/'){ - if(yych == '.') goto yy168; - goto yy61; - } else { - if(yych <= '7') goto yy185; - if(yych <= '9') goto yy187; - goto yy61; - } - } else { - if(yych <= 'K'){ - if(yych <= 'D') goto yy164; - if(yych <= 'E') goto yy171; - goto yy61; - } else { - if(yych <= 'L') goto yy173; - if(yych >= 'U') goto yy172; - goto yy61; - } - } - } else { - if(yych <= 'k'){ - if(yych <= 'c'){ - if(yych == 'X') goto yy189; - goto yy61; - } else { - if(yych <= 'd') goto yy164; - if(yych <= 'e') goto yy171; - goto yy61; - } - } else { - if(yych <= 'u'){ - if(yych <= 'l') goto yy173; - if(yych >= 'u') goto yy172; - goto yy61; - } else { - if(yych == 'x') goto yy189; - goto yy61; - } - } - } -yy61: -#line 437 "idl.re" -{ RET(T_INTLIT); } -#line 838 "idl_re.cpp" -yy62: yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'L'){ - if(yych <= '9'){ - if(yych == '.') goto yy168; - if(yych <= '/') goto yy61; - goto yy166; - } else { - if(yych <= 'D'){ - if(yych <= 'C') goto yy61; - goto yy164; - } else { - if(yych <= 'E') goto yy171; - if(yych <= 'K') goto yy61; - goto yy173; - } - } - } else { - if(yych <= 'e'){ - if(yych <= 'U'){ - if(yych <= 'T') goto yy61; - goto yy172; - } else { - if(yych <= 'c') goto yy61; - if(yych <= 'd') goto yy164; - goto yy171; - } - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy61; - goto yy173; - } else { - if(yych == 'u') goto yy172; - goto yy61; - } - } - } -yy63: yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x0C){ - if(yych == 0x09) goto yy121; - if(yych <= 0x0A) goto yy59; - goto yy121; - } else { - if(yych <= 0x1F) goto yy59; - if(yych == '\'') goto yy59; - goto yy121; - } -yy64: yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x0A){ - if(yych == 0x09) goto yy77; - goto yy59; - } else { - if(yych <= 0x0C) goto yy77; - if(yych <= 0x1F) goto yy59; - goto yy77; - } -yy65: ++YYCURSOR; - yych = *YYCURSOR; - goto yy75; -yy66: -#line 476 "idl.re" -{ RET(T_SPACE); } -#line 903 "idl_re.cpp" -yy67: ++YYCURSOR; - goto yy68; -yy68: -#line 479 "idl.re" -{ - s->line++; - RET(T_NEWLINE); - } -#line 912 "idl_re.cpp" -yy69: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy73; - goto yy68; -yy70: ++YYCURSOR; - goto yy71; -yy71: -#line 485 "idl.re" -{ - if(cursor != s->eof) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "'\\000' in input stream"); - else - printf("Error: 0 in file\n"); - } - RET(T_EOF); - } -#line 931 "idl_re.cpp" -yy72: yych = *++YYCURSOR; - goto yy59; -yy73: yych = *++YYCURSOR; - goto yy68; -yy74: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy75; -yy75: if(yych <= 0x0A){ - if(yych == 0x09) goto yy74; - goto yy66; - } else { - if(yych <= 0x0C) goto yy74; - if(yych == ' ') goto yy74; - goto yy66; - } -yy76: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy77; -yy77: if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy78; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy78: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy91; - } else { - if(yych != '\\') goto yy76; - goto yy79; - } - } -yy79: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '`'){ - if(yych <= '7'){ - if(yych <= '&'){ - if(yych == '"') goto yy76; - goto yy2; - } else { - if(yych <= '\'') goto yy76; - if(yych <= '/') goto yy2; - goto yy86; - } - } else { - if(yych <= 'T'){ - if(yych == '?') goto yy84; - goto yy2; - } else { - if(yych <= 'U') goto yy83; - if(yych == '\\') goto yy76; - goto yy2; - } - } - } else { - if(yych <= 'r'){ - if(yych <= 'f'){ - if(yych <= 'b') goto yy76; - if(yych <= 'e') goto yy2; - goto yy76; - } else { - if(yych == 'n') goto yy76; - if(yych <= 'q') goto yy2; - goto yy76; - } - } else { - if(yych <= 'u'){ - if(yych <= 's') goto yy2; - if(yych <= 't') goto yy76; - goto yy82; - } else { - if(yych <= 'v') goto yy76; - if(yych == 'x') goto yy85; - goto yy2; - } - } - } -yy80: ++YYCURSOR; - goto yy81; -yy81: -#line 449 "idl.re" -{ RET(T_STRINGLIT); } -#line 1044 "idl_re.cpp" -yy82: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy117; - goto yy2; - } else { - if(yych <= 'F') goto yy117; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy117; - goto yy2; - } -yy83: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy110; - goto yy2; - } else { - if(yych <= 'F') goto yy110; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy110; - goto yy2; - } -yy84: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy90; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy85: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy88; - goto yy2; - } else { - if(yych <= 'F') goto yy88; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy88; - goto yy2; - } -yy86: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy76; - goto yy80; - } - } else { - if(yych <= '>'){ - if(yych <= '/') goto yy76; - if(yych >= '8') goto yy76; - goto yy87; - } else { - if(yych <= '?') goto yy78; - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy87: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy78; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy88: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy89; -yy89: if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy88; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy88; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych <= 'f') goto yy88; - goto yy76; - } - } - } -yy90: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy91; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy91: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy92; -yy92: if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy76; - goto yy80; - } - } else { - if(yych <= '>'){ - if(yych != '/') goto yy76; - goto yy93; - } else { - if(yych <= '?') goto yy91; - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy93: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy94; -yy94: if(yych <= '>'){ - if(yych <= 0x1F){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy76; - } else { - if(yych <= 0x0A) goto yy2; - if(yych <= 0x0C) goto yy76; - goto yy2; - } - } else { - if(yych <= '"'){ - if(yych <= '!') goto yy76; - goto yy97; - } else { - if(yych <= '/') goto yy76; - if(yych <= '7') goto yy86; - goto yy76; - } - } - } else { - if(yych <= '\\'){ - if(yych <= 'T'){ - if(yych <= '?') goto yy98; - goto yy76; - } else { - if(yych <= 'U') goto yy96; - if(yych <= '[') goto yy76; - goto yy93; - } - } else { - if(yych <= 'u'){ - if(yych <= 't') goto yy76; - goto yy95; - } else { - if(yych == 'x') goto yy88; - goto yy76; - } - } - } -yy95: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy107; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy107; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych <= 'f') goto yy107; - goto yy76; - } - } - } -yy96: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy100; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy100; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych <= 'f') goto yy100; - goto yy76; - } - } - } -yy97: yyaccept = 6; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy81; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy81; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy78; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy98: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy99; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy99: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy76; - goto yy80; - } - } else { - if(yych <= '>'){ - if(yych == '/') goto yy93; - goto yy76; - } else { - if(yych <= '?') goto yy91; - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy100: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy101; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy101; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy101; - } - } - } -yy101: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy102; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy102; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy102; - } - } - } -yy102: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy103; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy103; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy103; - } - } - } -yy103: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy104; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy104; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy104; - } - } - } -yy104: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy105; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy105; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy105; - } - } - } -yy105: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy106; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy106; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy106; - } - } - } -yy106: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy78; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy107: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy108; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy108; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy108; - } - } - } -yy108: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy76; - if(yych <= 0x0A) goto yy2; - goto yy76; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy76; - } else { - if(yych <= '"') goto yy80; - if(yych <= '/') goto yy76; - goto yy109; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy78; - if(yych <= '@') goto yy76; - goto yy109; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy76; - goto yy79; - } else { - if(yych <= '`') goto yy76; - if(yych >= 'g') goto yy76; - goto yy109; - } - } - } -yy109: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy76; - goto yy2; - } else { - if(yych <= 0x0C) goto yy76; - if(yych <= 0x1F) goto yy2; - goto yy76; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy80; - if(yych <= '>') goto yy76; - goto yy78; - } else { - if(yych == '\\') goto yy79; - goto yy76; - } - } -yy110: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy111; - } else { - if(yych <= 'F') goto yy111; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy111; - } -yy111: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy112; - } else { - if(yych <= 'F') goto yy112; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy112; - } -yy112: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy113; - } else { - if(yych <= 'F') goto yy113; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy113; - } -yy113: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy114; - } else { - if(yych <= 'F') goto yy114; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy114; - } -yy114: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy115; - } else { - if(yych <= 'F') goto yy115; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy115; - } -yy115: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy116; - } else { - if(yych <= 'F') goto yy116; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy116; - } -yy116: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy76; - goto yy2; - } else { - if(yych <= 'F') goto yy76; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy76; - goto yy2; - } -yy117: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy118; - } else { - if(yych <= 'F') goto yy118; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy118; - } -yy118: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy119; - } else { - if(yych <= 'F') goto yy119; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy119; - } -yy119: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy76; - goto yy2; - } else { - if(yych <= 'F') goto yy76; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy76; - goto yy2; - } -yy120: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy121; -yy121: if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy122; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy122: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy135; - } else { - if(yych != '\\') goto yy120; - goto yy123; - } - } -yy123: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '`'){ - if(yych <= '7'){ - if(yych <= '&'){ - if(yych == '"') goto yy120; - goto yy2; - } else { - if(yych <= '\'') goto yy120; - if(yych <= '/') goto yy2; - goto yy128; - } - } else { - if(yych <= 'T'){ - if(yych == '?') goto yy126; - goto yy2; - } else { - if(yych <= 'U') goto yy125; - if(yych == '\\') goto yy120; - goto yy2; - } - } - } else { - if(yych <= 'r'){ - if(yych <= 'f'){ - if(yych <= 'b') goto yy120; - if(yych <= 'e') goto yy2; - goto yy120; - } else { - if(yych == 'n') goto yy120; - if(yych <= 'q') goto yy2; - goto yy120; - } - } else { - if(yych <= 'u'){ - if(yych <= 's') goto yy2; - if(yych <= 't') goto yy120; - goto yy124; - } else { - if(yych <= 'v') goto yy120; - if(yych == 'x') goto yy127; - goto yy2; - } - } - } -yy124: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy161; - goto yy2; - } else { - if(yych <= 'F') goto yy161; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy161; - goto yy2; - } -yy125: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy154; - goto yy2; - } else { - if(yych <= 'F') goto yy154; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy154; - goto yy2; - } -yy126: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy134; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy127: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy132; - goto yy2; - } else { - if(yych <= 'F') goto yy132; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy132; - goto yy2; - } -yy128: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - if(yych <= '&') goto yy120; - goto yy130; - } - } else { - if(yych <= '>'){ - if(yych <= '/') goto yy120; - if(yych >= '8') goto yy120; - goto yy129; - } else { - if(yych <= '?') goto yy122; - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy129: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy122; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy130: ++YYCURSOR; - goto yy131; -yy131: -#line 446 "idl.re" -{ RET(T_CHARLIT); } -#line 2062 "idl_re.cpp" -yy132: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy133; -yy133: if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - 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(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy135; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy135: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy136; -yy136: if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - if(yych <= '&') goto yy120; - goto yy130; - } - } else { - if(yych <= '>'){ - if(yych != '/') goto yy120; - goto yy137; - } else { - if(yych <= '?') goto yy135; - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy137: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy138; -yy138: if(yych <= '>'){ - if(yych <= 0x1F){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy120; - } else { - if(yych <= 0x0A) goto yy2; - if(yych <= 0x0C) goto yy120; - goto yy2; - } - } 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; - goto yy139; - } else { - if(yych == 'x') goto yy132; - goto yy120; - } - } - } -yy139: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - 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 <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - 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(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy131; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy131; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy122; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy142: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy143; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy143: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - 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 <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy145; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy145; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy145; - } - } - } -yy145: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy146; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy146; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy146; - } - } - } -yy146: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy147; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy147; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy147; - } - } - } -yy147: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy148; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy148; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy148; - } - } - } -yy148: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy149; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy149; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy149; - } - } - } -yy149: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy150; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy150; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy150; - } - } - } -yy150: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy122; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy151: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy152; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy152; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy152; - } - } - } -yy152: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy120; - if(yych <= 0x0A) goto yy2; - goto yy120; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy120; - } else { - if(yych <= '\'') goto yy130; - if(yych <= '/') goto yy120; - goto yy153; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy122; - if(yych <= '@') goto yy120; - goto yy153; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy120; - goto yy123; - } else { - if(yych <= '`') goto yy120; - if(yych >= 'g') goto yy120; - goto yy153; - } - } - } -yy153: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy120; - goto yy2; - } else { - if(yych <= 0x0C) goto yy120; - if(yych <= 0x1F) goto yy2; - goto yy120; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy130; - if(yych <= '>') goto yy120; - goto yy122; - } else { - if(yych == '\\') goto yy123; - goto yy120; - } - } -yy154: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy155; - } else { - if(yych <= 'F') goto yy155; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy155; - } -yy155: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy156; - } else { - if(yych <= 'F') goto yy156; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy156; - } -yy156: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy157; - } else { - if(yych <= 'F') goto yy157; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy157; - } -yy157: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy158; - } else { - if(yych <= 'F') goto yy158; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy158; - } -yy158: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy159; - } else { - if(yych <= 'F') goto yy159; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy159; - } -yy159: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy160; - } else { - if(yych <= 'F') goto yy160; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy160; - } -yy160: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy120; - goto yy2; - } else { - if(yych <= 'F') goto yy120; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy120; - goto yy2; - } -yy161: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy162; - } else { - if(yych <= 'F') goto yy162; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy162; - } -yy162: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy163; - } else { - if(yych <= 'F') goto yy163; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy163; - } -yy163: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy120; - goto yy2; - } else { - if(yych <= 'F') goto yy120; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy120; - goto yy2; - } -yy164: ++YYCURSOR; - goto yy165; -yy165: -#line 443 "idl.re" -{ RET(T_FIXEDPOINTLIT); } -#line 2775 "idl_re.cpp" -yy166: yyaccept = 5; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy167; -yy167: if(yych <= 'L'){ - if(yych <= '9'){ - if(yych == '.') goto yy168; - if(yych <= '/') goto yy61; - goto yy166; - } else { - if(yych <= 'D'){ - if(yych <= 'C') goto yy61; - goto yy164; - } else { - if(yych <= 'E') goto yy171; - if(yych <= 'K') goto yy61; - goto yy173; - } - } - } else { - if(yych <= 'e'){ - if(yych <= 'U'){ - if(yych <= 'T') goto yy61; - goto yy172; - } else { - if(yych <= 'c') goto yy61; - if(yych <= 'd') goto yy164; - goto yy171; - } - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy61; - goto yy173; - } else { - if(yych == 'u') goto yy172; - goto yy61; - } - } - } -yy168: yyaccept = 8; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy169; -yy169: if(yych <= 'K'){ - if(yych <= 'C'){ - if(yych <= '/') goto yy170; - if(yych <= '9') goto yy168; - goto yy170; - } else { - if(yych <= 'D') goto yy164; - if(yych <= 'E') goto yy181; - if(yych <= 'F') goto yy178; - goto yy170; - } - } 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; - goto yy170; - } - } -yy170: -#line 440 "idl.re" -{ RET(T_FLOATLIT); } -#line 2847 "idl_re.cpp" -yy171: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych == '+') goto yy175; - goto yy2; - } else { - if(yych <= '-') goto yy175; - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy176; - goto yy2; - } -yy172: yych = *++YYCURSOR; - if(yych == 'L') goto yy174; - if(yych == 'l') goto yy174; - goto yy61; -yy173: yych = *++YYCURSOR; - if(yych == 'U') goto yy174; - if(yych != 'u') goto yy61; - goto yy174; -yy174: yych = *++YYCURSOR; - goto yy61; -yy175: yych = *++YYCURSOR; - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy176; -yy176: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy177; -yy177: if(yych <= 'K'){ - if(yych <= '9'){ - if(yych <= '/') goto yy170; - goto yy176; - } else { - if(yych != 'F') goto yy170; - goto yy178; - } - } else { - if(yych <= 'f'){ - if(yych <= 'L') goto yy179; - if(yych <= 'e') goto yy170; - goto yy178; - } 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; - goto yy180; -yy180: yych = *++YYCURSOR; - goto yy170; -yy181: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych != '+') goto yy2; - goto yy182; - } else { - if(yych <= '-') goto yy182; - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy183; - goto yy2; - } -yy182: yych = *++YYCURSOR; - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy183; -yy183: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy184; -yy184: 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; - goto yy186; -yy186: if(yych <= 'L'){ - if(yych <= '9'){ - if(yych <= '.'){ - if(yych <= '-') goto yy61; - goto yy168; - } else { - if(yych <= '/') goto yy61; - if(yych <= '7') goto yy185; - goto yy187; - } - } else { - if(yych <= 'D'){ - if(yych <= 'C') goto yy61; - goto yy164; - } else { - if(yych <= 'E') goto yy171; - if(yych <= 'K') goto yy61; - goto yy173; - } - } - } else { - if(yych <= 'e'){ - if(yych <= 'U'){ - if(yych <= 'T') goto yy61; - goto yy172; - } else { - if(yych <= 'c') goto yy61; - if(yych <= 'd') goto yy164; - goto yy171; - } - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy61; - goto yy173; - } else { - if(yych == 'u') goto yy172; - goto yy61; - } - } - } -yy187: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy188; -yy188: if(yych <= 'C'){ - if(yych <= '.'){ - if(yych <= '-') goto yy2; - goto yy168; - } else { - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy187; - goto yy2; - } - } else { - if(yych <= 'c'){ - if(yych <= 'D') goto yy164; - if(yych <= 'E') goto yy171; - goto yy2; - } else { - if(yych <= 'd') goto yy164; - if(yych <= 'e') goto yy171; - goto yy2; - } - } -yy189: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy190; - } else { - if(yych <= 'F') goto yy190; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy190; - } -yy190: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy191; -yy191: if(yych <= 'T'){ - if(yych <= '@'){ - if(yych <= '/') goto yy61; - if(yych <= '9') goto yy190; - goto yy61; - } else { - if(yych <= 'F') goto yy190; - if(yych == 'L') goto yy173; - goto yy61; - } - } else { - if(yych <= 'k'){ - if(yych <= 'U') goto yy172; - if(yych <= '`') goto yy61; - if(yych <= 'f') goto yy190; - goto yy61; - } else { - if(yych <= 'l') goto yy173; - if(yych == 'u') goto yy172; - goto yy61; - } - } -yy192: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy218; - goto yy2; - } else { - if(yych <= 'F') goto yy218; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy218; - goto yy2; - } -yy193: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy194; - } else { - if(yych <= 'F') goto yy194; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy194; - } -yy194: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy195; - } else { - if(yych <= 'F') goto yy195; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy195; - } -yy195: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy196; - } else { - if(yych <= 'F') goto yy196; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy196; - } -yy196: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy197; - } else { - if(yych <= 'F') goto yy197; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy197; - } -yy197: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy198; - } else { - if(yych <= 'F') goto yy198; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy198; - } -yy198: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy199; - } else { - if(yych <= 'F') goto yy199; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy199; - } -yy199: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy200; - } else { - if(yych <= 'F') goto yy200; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy200; - } -yy200: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy201; - } else { - if(yych <= 'F') goto yy201; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy201; - } -yy201: yyaccept = 0; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy202; -yy202: if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy6; - if(yych <= '9') goto yy201; - goto yy6; - } else { - if(yych <= '?') goto yy204; - if(yych <= '@') goto yy6; - goto yy201; - } - } else { - if(yych <= '^'){ - if(yych != '\\') goto yy6; - goto yy203; - } else { - if(yych == '`') goto yy6; - if(yych <= 'z') goto yy201; - goto yy6; - } - } -yy203: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy207; - if(yych == 'u') goto yy206; - goto yy2; -yy204: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych != '?') goto yy2; - goto yy205; -yy205: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '/') goto yy203; - goto yy2; -yy206: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy215; - goto yy2; - } else { - if(yych <= 'F') goto yy215; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy215; - goto yy2; - } -yy207: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy208; - } else { - if(yych <= 'F') goto yy208; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy208; - } -yy208: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy209; - } else { - if(yych <= 'F') goto yy209; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy209; - } -yy209: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy210; - } else { - if(yych <= 'F') goto yy210; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy210; - } -yy210: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy211; - } else { - if(yych <= 'F') goto yy211; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy211; - } -yy211: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy212; - } else { - if(yych <= 'F') goto yy212; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy212; - } -yy212: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy213; - } else { - if(yych <= 'F') goto yy213; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy213; - } -yy213: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy214; - } else { - if(yych <= 'F') goto yy214; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy214; - } -yy214: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy201; - goto yy2; - } else { - if(yych <= 'F') goto yy201; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy201; - goto yy2; - } -yy215: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy216; - } else { - if(yych <= 'F') goto yy216; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy216; - } -yy216: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy217; - } else { - if(yych <= 'F') goto yy217; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy217; - } -yy217: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy201; - goto yy2; - } else { - if(yych <= 'F') goto yy201; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy201; - goto yy2; - } -yy218: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy219; - } else { - if(yych <= 'F') goto yy219; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy219; - } -yy219: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy220; - } else { - if(yych <= 'F') goto yy220; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy220; - } -yy220: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy201; - goto yy2; - } else { - if(yych <= 'F') goto yy201; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy201; - goto yy2; - } -yy221: yych = *++YYCURSOR; - if(yych == '\'') goto yy2; - goto yy121; -yy222: ++YYCURSOR; - goto yy223; -yy223: -#line 426 "idl.re" -{ RET(T_GREATEREQUAL); } -#line 3383 "idl_re.cpp" -yy224: ++YYCURSOR; - goto yy225; -yy225: -#line 422 "idl.re" -{ RET(T_SHIFTRIGHT); } -#line 3389 "idl_re.cpp" -yy226: ++YYCURSOR; - goto yy227; -yy227: -#line 425 "idl.re" -{ RET(T_LESSEQUAL); } -#line 3395 "idl_re.cpp" -yy228: ++YYCURSOR; - goto yy229; -yy229: -#line 421 "idl.re" -{ RET(T_SHIFTLEFT); } -#line 3401 "idl_re.cpp" -yy230: ++YYCURSOR; - goto yy231; -yy231: -#line 423 "idl.re" -{ RET(T_EQUAL); } -#line 3407 "idl_re.cpp" -yy232: ++YYCURSOR; - goto yy233; -yy233: -#line 424 "idl.re" -{ RET(T_NOTEQUAL); } -#line 3413 "idl_re.cpp" -yy234: ++YYCURSOR; - goto yy235; -yy235: -#line 428 "idl.re" -{ RET(T_OROR); } -#line 3419 "idl_re.cpp" -yy236: ++YYCURSOR; - goto yy237; -yy237: -#line 427 "idl.re" -{ RET(T_ANDAND); } -#line 3425 "idl_re.cpp" -yy238: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 7) YYFILL(7); - yych = *YYCURSOR; - goto yy239; -yy239: if(yych <= 'h'){ - if(yych <= '.'){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy238; - } else { - if(yych == ' ') goto yy238; - goto yy2; - } - } else { - if(yych <= 'c'){ - if(yych >= '0') goto yy2; - goto yy240; - } else { - if(yych <= 'd') goto yy243; - if(yych <= 'e') goto yy242; - goto yy2; - } - } - } else { - if(yych <= 'p'){ - if(yych <= 'k'){ - if(yych <= 'i') goto yy241; - goto yy2; - } else { - if(yych <= 'l') goto yy245; - if(yych <= 'o') goto yy2; - goto yy246; - } - } else { - if(yych <= 'u'){ - if(yych <= 't') goto yy2; - goto yy244; - } else { - if(yych == 'w') goto yy247; - goto yy2; - } - } - } -yy240: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '*') goto yy330; - goto yy2; -yy241: yych = *++YYCURSOR; - if(yych == 'f') goto yy293; - if(yych == 'n') goto yy295; - goto yy2; -yy242: yych = *++YYCURSOR; - if(yych <= 'm'){ - if(yych == 'l') goto yy278; - goto yy2; - } else { - if(yych <= 'n') goto yy277; - if(yych == 'r') goto yy276; - goto yy2; - } -yy243: yych = *++YYCURSOR; - if(yych == 'e') goto yy270; - goto yy2; -yy244: yych = *++YYCURSOR; - if(yych == 'n') goto yy265; - goto yy2; -yy245: yych = *++YYCURSOR; - if(yych == 'i') goto yy261; - goto yy2; -yy246: yych = *++YYCURSOR; - if(yych == 'r') goto yy255; - goto yy2; -yy247: yych = *++YYCURSOR; - if(yych != 'a') goto yy2; - goto yy248; -yy248: yych = *++YYCURSOR; - if(yych != 'r') goto yy2; - goto yy249; -yy249: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy250; -yy250: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy251; -yy251: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy252; -yy252: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy253; -yy253: ++YYCURSOR; - goto yy254; -yy254: -#line 473 "idl.re" -{ RET(T_PP_WARNING); } -#line 3522 "idl_re.cpp" -yy255: yych = *++YYCURSOR; - if(yych != 'a') goto yy2; - goto yy256; -yy256: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy257; -yy257: yych = *++YYCURSOR; - if(yych != 'm') goto yy2; - goto yy258; -yy258: yych = *++YYCURSOR; - if(yych != 'a') goto yy2; - goto yy259; -yy259: ++YYCURSOR; - goto yy260; -yy260: -#line 471 "idl.re" -{ RET(T_PP_PRAGMA); } -#line 3540 "idl_re.cpp" -yy261: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy262; -yy262: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy263; -yy263: ++YYCURSOR; - goto yy264; -yy264: -#line 469 "idl.re" -{ RET(T_PP_LINE); } -#line 3552 "idl_re.cpp" -yy265: yych = *++YYCURSOR; - if(yych != 'd') goto yy2; - goto yy266; -yy266: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy267; -yy267: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy268; -yy268: ++YYCURSOR; - goto yy269; -yy269: -#line 468 "idl.re" -{ RET(T_PP_UNDEF); } -#line 3567 "idl_re.cpp" -yy270: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy271; -yy271: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy272; -yy272: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy273; -yy273: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy274; -yy274: ++YYCURSOR; - goto yy275; -yy275: -#line 467 "idl.re" -{ RET(T_PP_DEFINE); } -#line 3585 "idl_re.cpp" -yy276: yych = *++YYCURSOR; - if(yych == 'r') goto yy289; - goto yy2; -yy277: yych = *++YYCURSOR; - if(yych == 'd') goto yy285; - goto yy2; -yy278: yych = *++YYCURSOR; - if(yych == 'i') goto yy280; - if(yych != 's') goto yy2; - goto yy279; -yy279: yych = *++YYCURSOR; - if(yych == 'e') goto yy283; - goto yy2; -yy280: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy281; -yy281: ++YYCURSOR; - goto yy282; -yy282: -#line 465 "idl.re" -{ RET(T_PP_ELIF); } -#line 3607 "idl_re.cpp" -yy283: ++YYCURSOR; - goto yy284; -yy284: -#line 464 "idl.re" -{ RET(T_PP_ELSE); } -#line 3613 "idl_re.cpp" -yy285: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy286; -yy286: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy287; -yy287: ++YYCURSOR; - goto yy288; -yy288: -#line 466 "idl.re" -{ RET(T_PP_ENDIF); } -#line 3625 "idl_re.cpp" -yy289: yych = *++YYCURSOR; - if(yych != 'o') goto yy2; - goto yy290; -yy290: yych = *++YYCURSOR; - if(yych != 'r') goto yy2; - goto yy291; -yy291: ++YYCURSOR; - goto yy292; -yy292: -#line 470 "idl.re" -{ RET(T_PP_ERROR); } -#line 3637 "idl_re.cpp" -yy293: yyaccept = 9; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy321; - if(yych == 'n') goto yy322; - goto yy294; -yy294: -#line 461 "idl.re" -{ RET(T_PP_IF); } -#line 3646 "idl_re.cpp" -yy295: yych = *++YYCURSOR; - if(yych != 'c') goto yy2; - goto yy296; -yy296: yych = *++YYCURSOR; - if(yych != 'l') goto yy2; - goto yy297; -yy297: yych = *++YYCURSOR; - if(yych != 'u') goto yy2; - goto yy298; -yy298: yych = *++YYCURSOR; - if(yych != 'd') goto yy2; - goto yy299; -yy299: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy300; -yy300: yyaccept = 10; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy301; -yy301: if(yych <= '!'){ - if(yych <= 0x09){ - if(yych >= 0x09) goto yy300; - goto yy302; - } else { - if(yych == ' ') goto yy300; - goto yy302; - } - } else { - if(yych <= '/'){ - if(yych <= '"') goto yy304; - if(yych >= '/') goto yy303; - goto yy302; - } else { - if(yych == '<') goto yy305; - goto yy302; - } - } -yy302: -#line 459 "idl.re" -{ RET(T_PP_INCLUDE); } -#line 3688 "idl_re.cpp" -yy303: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '*') goto yy314; - goto yy2; -yy304: yych = *++YYCURSOR; - if(yych == '"') goto yy2; - goto yy311; -yy305: yych = *++YYCURSOR; - if(yych == '>') goto yy2; - goto yy307; -yy306: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy307; -yy307: if(yych <= 0x0C){ - if(yych == 0x09) goto yy306; - if(yych <= 0x0A) goto yy2; - goto yy306; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '>') goto yy306; - goto yy308; - } -yy308: ++YYCURSOR; - goto yy309; -yy309: -#line 453 "idl.re" -{ RET(T_PP_HHEADER); } -#line 3718 "idl_re.cpp" -yy310: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy311; -yy311: if(yych <= 0x0C){ - if(yych == 0x09) goto yy310; - if(yych <= 0x0A) goto yy2; - goto yy310; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '"') goto yy310; - goto yy312; - } -yy312: ++YYCURSOR; - goto yy313; -yy313: -#line 456 "idl.re" -{ RET(T_PP_QHEADER); } -#line 3737 "idl_re.cpp" -yy314: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy315; -yy315: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy314; - goto yy316; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy318; - goto yy314; - } -yy316: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy317; -yy317: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy314; - goto yy316; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '*') goto yy314; - goto yy318; - } -yy318: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy319; -yy319: if(yych <= 0x1F){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy314; - if(yych >= 0x0E) goto yy2; - goto yy320; - } else { - if(yych <= '*'){ - if(yych <= ')') goto yy314; - goto yy318; - } else { - if(yych == '/') goto yy300; - goto yy314; - } - } -yy320: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy314; - goto yy316; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy318; - goto yy314; - } -yy321: yych = *++YYCURSOR; - if(yych == 'e') goto yy327; - goto yy2; -yy322: yych = *++YYCURSOR; - if(yych != 'd') goto yy2; - goto yy323; -yy323: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy324; -yy324: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy325; -yy325: ++YYCURSOR; - goto yy326; -yy326: -#line 463 "idl.re" -{ RET(T_PP_IFNDEF); } -#line 3811 "idl_re.cpp" -yy327: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy328; -yy328: ++YYCURSOR; - goto yy329; -yy329: -#line 462 "idl.re" -{ RET(T_PP_IFDEF); } -#line 3820 "idl_re.cpp" -yy330: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy331; -yy331: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy330; - goto yy332; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy334; - goto yy330; - } -yy332: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy333; -yy333: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy330; - goto yy332; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '*') goto yy330; - goto yy334; - } -yy334: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy335; -yy335: if(yych <= 0x1F){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy330; - if(yych >= 0x0E) goto yy2; - goto yy336; - } else { - if(yych <= '*'){ - if(yych <= ')') goto yy330; - goto yy334; - } else { - if(yych == '/') goto yy238; - goto yy330; - } - } -yy336: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy330; - goto yy332; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy334; - goto yy330; - } -yy337: ++YYCURSOR; - goto yy338; -yy338: -#line 430 "idl.re" -{ RET(T_MINUSMINUS); } -#line 3882 "idl_re.cpp" -yy339: ++YYCURSOR; - goto yy340; -yy340: -#line 429 "idl.re" -{ RET(T_PLUSPLUS); } -#line 3888 "idl_re.cpp" -yy341: yych = *++YYCURSOR; - if(yych == '/') goto yy342; - if(yych == '=') goto yy238; - goto yy2; -yy342: yych = *++YYCURSOR; - if(yych == 'U') goto yy193; - if(yych == 'u') goto yy192; - goto yy2; -yy343: ++YYCURSOR; - goto yy344; -yy344: -#line 401 "idl.re" -{ RET(T_POUND_POUND); } -#line 3902 "idl_re.cpp" -yy345: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'L') goto yy202; - goto yy346; -yy346: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'S') goto yy202; - goto yy347; -yy347: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'E') goto yy202; - goto yy348; -yy348: yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy349; - if(yych <= '9') goto yy201; - goto yy349; - } else { - if(yych <= '?') goto yy204; - if(yych >= 'A') goto yy201; - goto yy349; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy203; - goto yy349; - } else { - if(yych == '`') goto yy349; - if(yych <= 'z') goto yy201; - goto yy349; - } - } -yy349: -#line 394 "idl.re" -{ RET(T_FALSE); } -#line 3940 "idl_re.cpp" -yy350: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'U') goto yy202; - goto yy351; -yy351: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'E') goto yy202; - goto yy352; -yy352: yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy353; - if(yych <= '9') goto yy201; - goto yy353; - } else { - if(yych <= '?') goto yy204; - if(yych >= 'A') goto yy201; - goto yy353; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy203; - goto yy353; - } else { - if(yych == '`') goto yy353; - if(yych <= 'z') goto yy201; - goto yy353; - } - } -yy353: -#line 393 "idl.re" -{ RET(T_TRUE); } -#line 3974 "idl_re.cpp" -yy354: ++YYCURSOR; - goto yy355; -yy355: -#line 391 "idl.re" -{ goto cppcomment; } -#line 3980 "idl_re.cpp" -yy356: ++YYCURSOR; - goto yy357; -yy357: -#line 390 "idl.re" -{ goto ccomment; } -#line 3986 "idl_re.cpp" -} -#line 506 "idl.re" - - -ccomment: - -#line 3993 "idl_re.cpp" -{ - YYCTYPE yych; - goto yy358; - ++YYCURSOR; -yy358: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= 0x0C){ - if(yych <= 0x08){ - if(yych <= 0x00) goto yy367; - goto yy360; - } else { - if(yych == 0x0A) goto yy363; - goto yy366; - } - } else { - if(yych <= 0x1F){ - if(yych <= 0x0D) goto yy365; - goto yy360; - } else { - if(yych == '*') goto yy361; - goto yy366; - } - } -yy360:yy361: ++YYCURSOR; - if((yych = *YYCURSOR) == '/') goto yy370; - goto yy362; -yy362: -#line 519 "idl.re" -{ goto ccomment; } -#line 4024 "idl_re.cpp" -yy363: ++YYCURSOR; - goto yy364; -yy364: -#line 512 "idl.re" -{ - /*if(cursor == s->eof) RET(T_EOF);*/ - /*s->tok = cursor; */ - s->line += count_backslash_newlines(s, cursor) +1; - goto ccomment; - } -#line 4035 "idl_re.cpp" -yy365: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy369; - goto yy364; -yy366: yych = *++YYCURSOR; - goto yy362; -yy367: ++YYCURSOR; - goto yy368; -yy368: -#line 522 "idl.re" -{ - using namespace std; // some systems have printf in std - if(cursor == s->eof) - { - if (s->error_proc) - (*s->error_proc)(s, "Unterminated comment"); - else - printf("Error: Unterminated comment\n"); - } - else - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CCOMMENT); - } -#line 4066 "idl_re.cpp" -yy369: yych = *++YYCURSOR; - goto yy364; -yy370: ++YYCURSOR; - goto yy371; -yy371: -#line 510 "idl.re" -{ RET(T_CCOMMENT); } -#line 4074 "idl_re.cpp" -} -#line 544 "idl.re" - - -cppcomment: - -#line 4081 "idl_re.cpp" -{ - YYCTYPE yych; - goto yy372; - ++YYCURSOR; -yy372: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= 0x0A){ - if(yych <= 0x00) goto yy380; - if(yych <= 0x08) goto yy374; - if(yych <= 0x09) goto yy378; - goto yy375; - } else { - if(yych <= 0x0C) goto yy378; - if(yych <= 0x0D) goto yy377; - if(yych >= ' ') goto yy378; - goto yy374; - } -yy374:yy375: ++YYCURSOR; - goto yy376; -yy376: -#line 549 "idl.re" -{ - /*if(cursor == s->eof) RET(T_EOF); */ - /*s->tok = cursor; */ - s->line++; - RET(T_CPPCOMMENT); - } -#line 4110 "idl_re.cpp" -yy377: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy382; - goto yy376; -yy378: ++YYCURSOR; - goto yy379; -yy379: -#line 556 "idl.re" -{ goto cppcomment; } -#line 4119 "idl_re.cpp" -yy380: ++YYCURSOR; - goto yy381; -yy381: -#line 559 "idl.re" -{ - using namespace std; // some systems have printf in std - if(cursor != s->eof) - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CPPCOMMENT); - } -#line 4138 "idl_re.cpp" -yy382: ++YYCURSOR; - yych = *YYCURSOR; - goto yy376; -} -#line 573 "idl.re" - - -} /* end of scan */ - -#undef RE2C_ASSERT - -/////////////////////////////////////////////////////////////////////////////// -} // namespace re2clex -} // namespace idllexer -} // namespace wave -} // namespace boost diff --git a/samples/waveidl/idllexer/idl_re.hpp b/samples/waveidl/idllexer/idl_re.hpp deleted file mode 100644 index b81dfe4..0000000 --- a/samples/waveidl/idllexer/idl_re.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Sample: Re2C based IDL lexer - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace idllexer { -namespace re2clex { - -/////////////////////////////////////////////////////////////////////////////// -// The scanner function to call whenever a new token is requested -boost::wave::token_id scan( - boost::wave::cpplexer::re2clex::Scanner *s); - -/////////////////////////////////////////////////////////////////////////////// -} // namespace re2clex -} // namespace idllexer -} // namespace wave -} // namespace boost - -#endif // !defined(IDL_RE_HPP_BD62775D_1659_4684_872C_03C02543C9A5_INCLUDED) diff --git a/samples/waveidl/idllexer/idl_re2c_lexer.hpp b/samples/waveidl/idllexer/idl_re2c_lexer.hpp deleted file mode 100644 index 5a6d29a..0000000 --- a/samples/waveidl/idllexer/idl_re2c_lexer.hpp +++ /dev/null @@ -1,271 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Re2C based IDL lexer - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 -#include -#include -#if defined(BOOST_SPIRIT_DEBUG) -#include -#endif // defined(BOOST_SPIRIT_DEBUG) - -#include -#include -#include - -#include -#include -#include -#include -#include - -// reuse the default token type and re2c lexer helpers -#include -#include -#include - -#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 scanner_t; - -public: - - typedef char char_t; - typedef boost::wave::cpplexer::re2clex::Scanner base_t; - typedef boost::wave::cpplexer::lex_token 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(); - - boost::wave::cpplexer::lex_token get(); - 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 *s, char *, ...); - -private: - static char const *tok_names[]; - - scanner_t scanner; - string_type filename; - bool at_eof; - boost::wave::language_support language; -}; - -/////////////////////////////////////////////////////////////////////////////// -// initialize cpp lexer -template -inline -lexer::lexer(IteratorT const &first, - IteratorT const &last, PositionT const &pos, - boost::wave::language_support language) -: filename(pos.get_file()), at_eof(false), language(language) -{ - using namespace std; // some systems have memset in std - using namespace boost::wave::cpplexer::re2clex; - - memset(&scanner, '\0', sizeof(scanner_t)); - scanner.fd = -1; - scanner.eol_offsets = aq_create(); - scanner.first = scanner.act = (uchar *)&(*first); - scanner.last = scanner.first + std::distance(first, last); - 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; - scanner.act_in_cpp0x_mode = 0; - - boost::ignore_unused_variable_warning(language); -} - -template -inline -lexer::~lexer() -{ - boost::wave::cpplexer::re2clex::aq_terminate(scanner.eol_offsets); - free(scanner.bot); -} - -/////////////////////////////////////////////////////////////////////////////// -// get the next token from the input stream -template -inline boost::wave::cpplexer::lex_token -lexer::get() -{ - using namespace boost::wave; // to import token ids to this scope - - if (at_eof) - return boost::wave::cpplexer::lex_token(); // return T_EOI - - token_id id = token_id(scan(&scanner)); - string_type value((char const *)scanner.tok, scanner.cur-scanner.tok); - - if (T_IDENTIFIER == id) { - // test identifier characters for validity (throws if invalid chars found) - if (!(language & support_option_no_character_validation)) { - 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 (!(language & support_option_no_character_validation)) { - 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 boost::wave::cpplexer::lex_token(id, value, - PositionT(filename, scanner.line, -1)); -} - -template -inline int -lexer::report_error(scanner_t *s, char *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(boost::wave::cpplexer::lexing_exception, - generic_lexing_error, buffer, s->line, -1, s->file_name); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// lex_functor -// -/////////////////////////////////////////////////////////////////////////////// - -template < - typename IteratorT, - typename PositionT = boost::wave::util::file_position_type -> -class lex_functor -: public lex_input_interface::token_type> -{ -public: - - typedef typename lexer::token_type token_type; - - lex_functor(IteratorT const &first, IteratorT const &last, - PositionT const &pos, boost::wave::language_support language) - : lexer(first, last, pos, language) - {} - virtual ~lex_functor() {} - -// get the next token from the input stream - token_type get() { return lexer.get(); } - void set_position(PositionT const &pos) - { lexer.set_position(pos); } - -private: - lexer 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 is 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 -BOOST_WAVE_RE2C_NEW_LEXER_INLINE -lex_input_interface > * -new_lexer_gen::new_lexer(IteratorT const &first, - IteratorT const &last, PositionT const &pos, - wave::language_support language) -{ - return new re2clex::lex_functor(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/samples/waveidl/instantiate_cpp_grammar.cpp b/samples/waveidl/instantiate_cpp_grammar.cpp deleted file mode 100644 index 5fa9a49..0000000 --- a/samples/waveidl/instantiate_cpp_grammar.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include - -#include "idllexer/idl_lex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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::idllexer::lex_iterator< - boost::wave::cpplexer::lex_token<> > - lexer_type; -template struct boost::wave::grammars::cpp_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/waveidl/instantiate_defined_grammar.cpp b/samples/waveidl/instantiate_defined_grammar.cpp deleted file mode 100644 index 01e12e2..0000000 --- a/samples/waveidl/instantiate_defined_grammar.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include - -#include "idllexer/idl_lex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/waveidl/instantiate_predef_macros.cpp b/samples/waveidl/instantiate_predef_macros.cpp deleted file mode 100644 index a0526bf..0000000 --- a/samples/waveidl/instantiate_predef_macros.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include - -#include "idllexer/idl_lex_iterator.hpp" - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/samples/waveidl/instantiate_re2c_lexer.cpp b/samples/waveidl/instantiate_re2c_lexer.cpp deleted file mode 100644 index f7cecd4..0000000 --- a/samples/waveidl/instantiate_re2c_lexer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include - -#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/samples/waveidl/instantiate_re2c_lexer_str.cpp b/samples/waveidl/instantiate_re2c_lexer_str.cpp deleted file mode 100644 index 829b627..0000000 --- a/samples/waveidl/instantiate_re2c_lexer_str.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - 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-2005 Hartmut Kaiser. Distributed under the 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 - -#include -#include - -#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; - -#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/cpplexer/re2clex/aq.cpp b/src/cpplexer/re2clex/aq.cpp deleted file mode 100644 index d60ef7b..0000000 --- a/src/cpplexer/re2clex/aq.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001 Daniel C. Nuffer. - Copyright (c) 2001-2005 Hartmut Kaiser. - Distributed under the 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 -#include - -#include - -#include // configuration data -#include - -/////////////////////////////////////////////////////////////////////////////// -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 diff --git a/src/cpplexer/re2clex/cpp.re b/src/cpplexer/re2clex/cpp.re deleted file mode 100644 index 925f7de..0000000 --- a/src/cpplexer/re2clex/cpp.re +++ /dev/null @@ -1,779 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Copyright (c) 2001 Daniel C. Nuffer - Copyright (c) 2001-2005 Hartmut Kaiser. - Distributed under the 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) -=============================================================================*/ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(BOOST_HAS_UNISTD_H) -#include -#else -#include -#endif - -#include -#include - -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -#if defined(BOOST_MSVC) -#pragma warning (disable: 4101) // 'foo' : unreferenced local variable -#pragma warning (disable: 4102) // 'foo' : unreferenced label -#endif - -/////////////////////////////////////////////////////////////////////////////// -#define BSIZE 196608 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker -#define YYFILL(n) {cursor = uchar_wrapper(fill(s, cursor), cursor.column);} - -//#define RET(i) {s->cur = cursor; return (i);} -#define RET(i) \ - { \ - s->line += count_backslash_newlines(s, cursor); \ - s->curr_column = cursor.column; \ - s->cur = cursor; \ - s->lim = limit; \ - s->ptr = marker; \ - return (i); \ - } \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace cpplexer { -namespace re2clex { - -#define RE2C_ASSERT BOOST_ASSERT - -int get_one_char(Scanner *s) -{ - if (s->fd != -1) { - uchar val; - - if (read(s->fd, &val, sizeof(val))) - return val; - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - if (s->act < s->last) - return *(s->act)++; - } - return -1; -} - -std::ptrdiff_t rewind_stream (Scanner *s, int cnt) -{ - if (s->fd != -1) { - return lseek(s->fd, cnt, SEEK_CUR); - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - s->act += cnt; - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - return s->act - s->first; - } - return 0; -} - -std::size_t get_first_eol_offset(Scanner* s) -{ - if (!AQ_EMPTY(s->eol_offsets)) - { - return s->eol_offsets->queue[s->eol_offsets->head]; - } - else - { - return (unsigned int)-1; - } -} - -void adjust_eol_offsets(Scanner* s, std::size_t adjustment) -{ - aq_queue q; - std::size_t i; - - if (!s->eol_offsets) - s->eol_offsets = 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; -} - -int count_backslash_newlines(Scanner *s, uchar *cursor) -{ - std::size_t diff, offset; - int skipped = 0; - - /* figure out how many backslash-newlines skipped over unknowingly. */ - diff = cursor - s->bot; - offset = get_first_eol_offset(s); - while (offset <= diff && offset != (unsigned int)-1) - { - skipped++; - aq_pop(s->eol_offsets); - offset = get_first_eol_offset(s); - } - return skipped; -} - -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; -} - -uchar *fill(Scanner *s, uchar *cursor) -{ - using namespace std; // some systems have memcpy etc. in namespace std - if(!s->eof) - { - uchar* p; - std::ptrdiff_t cnt = s->tok - s->bot; - if(cnt) - { - if (NULL == s->lim) - s->lim = s->top; - 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) < BSIZE) - { - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - if (buf == 0) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "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[BSIZE]; - free(s->bot); - s->bot = buf; - } - - if (s->fd != -1) { - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE) - { - s->eof = &s->lim[cnt]; *(s->eof)++ = '\0'; - } - } - else if (s->act != 0) { - cnt = s->last - s->act; - if (cnt > BSIZE) - cnt = BSIZE; - memcpy(s->lim, s->act, cnt); - s->act += cnt; - if (cnt != 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. */ - 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; - } - 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; - } - aq_enqueue(s->eol_offsets, cnt + (s->lim - s->bot)); - } - /* check \ \n EOB */ - else if (last == '\n' && last2 == '\\') - { - cnt -= 2; - 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; -} - -/////////////////////////////////////////////////////////////////////////////// -// Special wrapper class holding the current cursor position -struct uchar_wrapper -{ - uchar_wrapper (uchar *base_cursor, unsigned int column = 1) - : base_cursor(base_cursor), column(column) - {} - - uchar_wrapper& operator++() - { - ++base_cursor; - ++column; - return *this; - } - - uchar_wrapper& operator--() - { - --base_cursor; - --column; - return *this; - } - - uchar operator* () const - { - return *base_cursor; - } - - operator uchar *() const - { - return base_cursor; - } - - friend int operator- (uchar_wrapper const& lhs, uchar_wrapper const& rhs) - { - return lhs.base_cursor - rhs.base_cursor; - } - - uchar *base_cursor; - unsigned int column; -}; - -/////////////////////////////////////////////////////////////////////////////// -boost::wave::token_id scan(Scanner *s) -{ - uchar_wrapper cursor (s->tok = s->cur, s->column = s->curr_column); - uchar_wrapper marker (s->ptr); - uchar_wrapper limit (s->lim); - -/*!re2c -any = [\t\v\f\r\n\040-\377]; -OctalDigit = [0-7]; -Digit = [0-9]; -HexDigit = [a-fA-F0-9]; -Integer = (("0" [xX] HexDigit+) | ("0" OctalDigit*) | ([1-9] Digit*)); -ExponentPart = [Ee] [+-]? Digit+; -FractionalConstant = (Digit* "." Digit+) | (Digit+ "."); -FloatingSuffix = [fF] [lL]? | [lL] [fF]?; -IntegerSuffix = [uU] [lL]? | [lL] [uU]?; -LongIntegerSuffix = [uU] ("ll" | "LL") | ("ll" | "LL") [uU]?; -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; } - - "asm" { RET(T_ASM); } - "auto" { RET(T_AUTO); } - "bool" { RET(T_BOOL); } - "break" { RET(T_BREAK); } - "case" { RET(T_CASE); } - "catch" { RET(T_CATCH); } - "char" { RET(T_CHAR); } - "class" { RET(T_CLASS); } - "const" { RET(T_CONST); } - "const_cast" { RET(T_CONSTCAST); } - "continue" { RET(T_CONTINUE); } - "default" { RET(T_DEFAULT); } - "delete" { RET(T_DELETE); } - "do" { RET(T_DO); } - "double" { RET(T_DOUBLE); } - "dynamic_cast" { RET(T_DYNAMICCAST); } - "else" { RET(T_ELSE); } - "enum" { RET(T_ENUM); } - "explicit" { RET(T_EXPLICIT); } - "export" { RET(T_EXPORT); } - "extern" { RET(T_EXTERN); } - "false" { RET(T_FALSE); } - "float" { RET(T_FLOAT); } - "for" { RET(T_FOR); } - "friend" { RET(T_FRIEND); } - "goto" { RET(T_GOTO); } - "if" { RET(T_IF); } - "inline" { RET(T_INLINE); } - "int" { RET(T_INT); } - "long" { RET(T_LONG); } - "mutable" { RET(T_MUTABLE); } - "namespace" { RET(T_NAMESPACE); } - "new" { RET(T_NEW); } - "operator" { RET(T_OPERATOR); } - "private" { RET(T_PRIVATE); } - "protected" { RET(T_PROTECTED); } - "public" { RET(T_PUBLIC); } - "register" { RET(T_REGISTER); } - "reinterpret_cast" { RET(T_REINTERPRETCAST); } - "return" { RET(T_RETURN); } - "short" { RET(T_SHORT); } - "signed" { RET(T_SIGNED); } - "sizeof" { RET(T_SIZEOF); } - "static" { RET(T_STATIC); } - "static_cast" { RET(T_STATICCAST); } - "struct" { RET(T_STRUCT); } - "switch" { RET(T_SWITCH); } - "template" { RET(T_TEMPLATE); } - "this" { RET(T_THIS); } - "throw" { RET(T_THROW); } - "true" { RET(T_TRUE); } - "try" { RET(T_TRY); } - "typedef" { RET(T_TYPEDEF); } - "typeid" { RET(T_TYPEID); } - "typename" { RET(T_TYPENAME); } - "union" { RET(T_UNION); } - "unsigned" { RET(T_UNSIGNED); } - "using" { RET(T_USING); } - "virtual" { RET(T_VIRTUAL); } - "void" { RET(T_VOID); } - "volatile" { RET(T_VOLATILE); } - "wchar_t" { RET(T_WCHART); } - "while" { RET(T_WHILE); } - - "__int8" { RET(s->enable_ms_extensions ? T_MSEXT_INT8 : T_IDENTIFIER); } - "__int16" { RET(s->enable_ms_extensions ? T_MSEXT_INT16 : T_IDENTIFIER); } - "__int32" { RET(s->enable_ms_extensions ? T_MSEXT_INT32 : T_IDENTIFIER); } - "__int64" { RET(s->enable_ms_extensions ? T_MSEXT_INT64 : T_IDENTIFIER); } - "_"? "_based" { RET(s->enable_ms_extensions ? T_MSEXT_BASED : T_IDENTIFIER); } - "_"? "_declspec" { RET(s->enable_ms_extensions ? T_MSEXT_DECLSPEC : T_IDENTIFIER); } - "_"? "_cdecl" { RET(s->enable_ms_extensions ? T_MSEXT_CDECL : T_IDENTIFIER); } - "_"? "_fastcall" { RET(s->enable_ms_extensions ? T_MSEXT_FASTCALL : T_IDENTIFIER); } - "_"? "_stdcall" { RET(s->enable_ms_extensions ? T_MSEXT_STDCALL : T_IDENTIFIER); } - "__try" { RET(s->enable_ms_extensions ? T_MSEXT_TRY : T_IDENTIFIER); } - "__except" { RET(s->enable_ms_extensions ? T_MSEXT_EXCEPT : T_IDENTIFIER); } - "__finally" { RET(s->enable_ms_extensions ? T_MSEXT_FINALLY : T_IDENTIFIER); } - "__leave" { RET(s->enable_ms_extensions ? T_MSEXT_LEAVE : T_IDENTIFIER); } - "_"? "_inline" { RET(s->enable_ms_extensions ? T_MSEXT_INLINE : T_IDENTIFIER); } - "_"? "_asm" { RET(s->enable_ms_extensions ? T_MSEXT_ASM : T_IDENTIFIER); } - - "{" { RET(T_LEFTBRACE); } - "??<" { RET(T_LEFTBRACE_TRIGRAPH); } - "<%" { RET(T_LEFTBRACE_ALT); } - "}" { RET(T_RIGHTBRACE); } - "??>" { RET(T_RIGHTBRACE_TRIGRAPH); } - "%>" { RET(T_RIGHTBRACE_ALT); } - "[" { RET(T_LEFTBRACKET); } - "??(" { RET(T_LEFTBRACKET_TRIGRAPH); } - "<:" { RET(T_LEFTBRACKET_ALT); } - "]" { RET(T_RIGHTBRACKET); } - "??)" { RET(T_RIGHTBRACKET_TRIGRAPH); } - ":>" { RET(T_RIGHTBRACKET_ALT); } - "#" { RET(T_POUND); } - "%:" { RET(T_POUND_ALT); } - "??=" { RET(T_POUND_TRIGRAPH); } - "##" { RET(T_POUND_POUND); } - "#??=" { RET(T_POUND_POUND_TRIGRAPH); } - "??=#" { RET(T_POUND_POUND_TRIGRAPH); } - "??=??=" { RET(T_POUND_POUND_TRIGRAPH); } - "%:%:" { RET(T_POUND_POUND_ALT); } - "(" { RET(T_LEFTPAREN); } - ")" { RET(T_RIGHTPAREN); } - ";" { RET(T_SEMICOLON); } - ":" { RET(T_COLON); } - "..." { RET(T_ELLIPSIS); } - "?" { RET(T_QUESTION_MARK); } - "::" - { - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_COLON); - } - else { - RET(T_COLON_COLON); - } - } - "." { RET(T_DOT); } - ".*" - { - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_DOT); - } - else { - RET(T_DOTSTAR); - } - } - "+" { RET(T_PLUS); } - "-" { RET(T_MINUS); } - "*" { RET(T_STAR); } - "/" { RET(T_DIVIDE); } - "%" { RET(T_PERCENT); } - "^" { RET(T_XOR); } - "??'" { RET(T_XOR_TRIGRAPH); } - "xor" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_XOR_ALT); } - "&" { RET(T_AND); } - "bitand" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_AND_ALT); } - "|" { RET(T_OR); } - "bitor" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_OR_ALT); } - "??!" { RET(T_OR_TRIGRAPH); } - "~" { RET(T_COMPL); } - "??-" { RET(T_COMPL_TRIGRAPH); } - "compl" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_COMPL_ALT); } - "!" { RET(T_NOT); } - "not" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_NOT_ALT); } - "=" { RET(T_ASSIGN); } - "<" { RET(T_LESS); } - ">" { RET(T_GREATER); } - "+=" { RET(T_PLUSASSIGN); } - "-=" { RET(T_MINUSASSIGN); } - "*=" { RET(T_STARASSIGN); } - "/=" { RET(T_DIVIDEASSIGN); } - "%=" { RET(T_PERCENTASSIGN); } - "^=" { RET(T_XORASSIGN); } - "xor_eq" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_XORASSIGN_ALT); } - "??'=" { RET(T_XORASSIGN_TRIGRAPH); } - "&=" { RET(T_ANDASSIGN); } - "and_eq" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ANDASSIGN_ALT); } - "|=" { RET(T_ORASSIGN); } - "or_eq" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ORASSIGN_ALT); } - "??!=" { RET(T_ORASSIGN_TRIGRAPH); } - "<<" { RET(T_SHIFTLEFT); } - ">>" { RET(T_SHIFTRIGHT); } - ">>=" { RET(T_SHIFTRIGHTASSIGN); } - "<<=" { RET(T_SHIFTLEFTASSIGN); } - "==" { RET(T_EQUAL); } - "!=" { RET(T_NOTEQUAL); } - "not_eq" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_NOTEQUAL_ALT); } - "<=" { RET(T_LESSEQUAL); } - ">=" { RET(T_GREATEREQUAL); } - "&&" { RET(T_ANDAND); } - "and" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ANDAND_ALT); } - "||" { RET(T_OROR); } - "??!|" { RET(T_OROR_TRIGRAPH); } - "|??!" { RET(T_OROR_TRIGRAPH); } - "or" { RET(s->act_in_c99_mode ? T_IDENTIFIER : T_OROR_ALT); } - "??!??!" { RET(T_OROR_TRIGRAPH); } - "++" { RET(T_PLUSPLUS); } - "--" { RET(T_MINUSMINUS); } - "," { RET(T_COMMA); } - "->*" - { - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_ARROW); - } - else { - RET(T_ARROWSTAR); - } - } - "->" { RET(T_ARROW); } - "??/" { RET(T_ANY_TRIGRAPH); } - - ([a-zA-Z_] | UniversalChar) ([a-zA-Z_0-9] | UniversalChar)* - { RET(T_IDENTIFIER); } - - Integer LongIntegerSuffix - { RET(T_LONGINTLIT); } - - Integer IntegerSuffix? - { RET(T_INTLIT); } - - ((FractionalConstant ExponentPart?) | (Digit+ ExponentPart)) FloatingSuffix? - { RET(T_FLOATLIT); } - - "L"? (['] (EscapeSequence|any\[\n\r\\']|UniversalChar)+ [']) - { RET(T_CHARLIT); } - - "L"? (["] (EscapeSequence|any\[\n\r\\"]|UniversalChar)* ["]) - { RET(T_STRINGLIT); } - - - Pound PPSpace ( "include" | "include_next") PPSpace "<" (any\[\n\r>])+ ">" - { RET(T_PP_HHEADER); } - - Pound PPSpace ( "include" | "include_next") PPSpace "\"" (any\[\n\r"])+ "\"" - { RET(T_PP_QHEADER); } - - Pound PPSpace ( "include" | "include_next") PPSpace - { RET(T_PP_INCLUDE); } - - Pound PPSpace "if" { RET(T_PP_IF); } - Pound PPSpace "ifdef" { RET(T_PP_IFDEF); } - Pound PPSpace "ifndef" { RET(T_PP_IFNDEF); } - Pound PPSpace "else" { RET(T_PP_ELSE); } - Pound PPSpace "elif" { RET(T_PP_ELIF); } - Pound PPSpace "endif" { RET(T_PP_ENDIF); } - Pound PPSpace "define" { RET(T_PP_DEFINE); } - Pound PPSpace "undef" { RET(T_PP_UNDEF); } - Pound PPSpace "line" { RET(T_PP_LINE); } - Pound PPSpace "error" { RET(T_PP_ERROR); } - Pound PPSpace "pragma" { RET(T_PP_PRAGMA); } - - Pound PPSpace "warning" { RET(T_PP_WARNING); } - - Pound PPSpace "region" { RET(T_MSEXT_PP_REGION); } - Pound PPSpace "endregion" { RET(T_MSEXT_PP_ENDREGION); } - - [ \t\v\f]+ - { RET(T_SPACE); } - - Newline - { - s->line++; - cursor.column = 1; - 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, "'\\000' in input stream"); - else - printf("Error: 0 in file\n"); - } - RET(T_EOF); - } - - any - { - /* if (0 != s->error_proc) - (*s->error_proc)(s, "Unexpected character: '%c'", *s->tok); - else - printf("unexpected character: '%c'\n", *s->tok); - */ - RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); - } -*/ - -ccomment: -/*!re2c - "*/" { RET(T_CCOMMENT); } - - Newline - { - /*if(cursor == s->eof) RET(T_EOF);*/ - /*s->tok = cursor; */ - s->line += count_backslash_newlines(s, cursor) +1; - cursor.column = 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, "Unterminated comment"); - else - printf("Error: Unterminated comment\n"); - } - else - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CCOMMENT); - } - -*/ - -cppcomment: -/*!re2c - Newline - { - /*if(cursor == s->eof) RET(T_EOF); */ - /*s->tok = cursor; */ - s->line++; - cursor.column = 1; - 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, "'\\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 */ - RET(T_CPPCOMMENT); - } -*/ - -} /* end of scan */ - -/////////////////////////////////////////////////////////////////////////////// -} // namespace re2clex -} // namespace cpplexer -} // namespace wave -} // namespace boost - -#undef RET -#undef BSIZE -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER -#undef YYFILL - diff --git a/src/cpplexer/re2clex/cpp_re.cpp b/src/cpplexer/re2clex/cpp_re.cpp deleted file mode 100644 index c6c5353..0000000 --- a/src/cpplexer/re2clex/cpp_re.cpp +++ /dev/null @@ -1,8374 +0,0 @@ -/* Generated by re2c 0.9.9 on Sat Aug 27 21:53:07 2005 */ -#line 1 "cpp.re" -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - - Copyright (c) 2001 Daniel C. Nuffer - Copyright (c) 2001-2005 Hartmut Kaiser. - Distributed under the 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) -=============================================================================*/ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#if defined(BOOST_HAS_UNISTD_H) -#include -#else -#include -#endif - -#include -#include - -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -#if defined(BOOST_MSVC) -#pragma warning (disable: 4101) // 'foo' : unreferenced local variable -#pragma warning (disable: 4102) // 'foo' : unreferenced label -#endif - -/////////////////////////////////////////////////////////////////////////////// -#define BSIZE 196608 - -#define YYCTYPE uchar -#define YYCURSOR cursor -#define YYLIMIT limit -#define YYMARKER marker -#define YYFILL(n) {cursor = uchar_wrapper(fill(s, cursor), cursor.column);} - -//#define RET(i) {s->cur = cursor; return (i);} -#define RET(i) \ - { \ - s->line += count_backslash_newlines(s, cursor); \ - s->curr_column = cursor.column; \ - s->cur = cursor; \ - s->lim = limit; \ - s->ptr = marker; \ - return (i); \ - } \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { -namespace wave { -namespace cpplexer { -namespace re2clex { - -#define RE2C_ASSERT BOOST_ASSERT - -int get_one_char(Scanner *s) -{ - if (s->fd != -1) { - uchar val; - - if (read(s->fd, &val, sizeof(val))) - return val; - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - if (s->act < s->last) - return *(s->act)++; - } - return -1; -} - -std::ptrdiff_t rewind_stream (Scanner *s, int cnt) -{ - if (s->fd != -1) { - return lseek(s->fd, cnt, SEEK_CUR); - } - else if (0 != s->act) { - RE2C_ASSERT(s->first != 0 && s->last != 0); - s->act += cnt; - RE2C_ASSERT(s->first <= s->act && s->act <= s->last); - return s->act - s->first; - } - return 0; -} - -std::size_t get_first_eol_offset(Scanner* s) -{ - if (!AQ_EMPTY(s->eol_offsets)) - { - return s->eol_offsets->queue[s->eol_offsets->head]; - } - else - { - return (unsigned int)-1; - } -} - -void adjust_eol_offsets(Scanner* s, std::size_t adjustment) -{ - aq_queue q; - std::size_t i; - - if (!s->eol_offsets) - s->eol_offsets = 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; -} - -int count_backslash_newlines(Scanner *s, uchar *cursor) -{ - std::size_t diff, offset; - int skipped = 0; - - /* figure out how many backslash-newlines skipped over unknowingly. */ - diff = cursor - s->bot; - offset = get_first_eol_offset(s); - while (offset <= diff && offset != (unsigned int)-1) - { - skipped++; - aq_pop(s->eol_offsets); - offset = get_first_eol_offset(s); - } - return skipped; -} - -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; -} - -uchar *fill(Scanner *s, uchar *cursor) -{ - using namespace std; // some systems have memcpy etc. in namespace std - if(!s->eof) - { - uchar* p; - std::ptrdiff_t cnt = s->tok - s->bot; - if(cnt) - { - if (NULL == s->lim) - s->lim = s->top; - 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) < BSIZE) - { - uchar *buf = (uchar*) malloc(((s->lim - s->bot) + BSIZE)*sizeof(uchar)); - if (buf == 0) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "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[BSIZE]; - free(s->bot); - s->bot = buf; - } - - if (s->fd != -1) { - if((cnt = read(s->fd, (char*) s->lim, BSIZE)) != BSIZE) - { - s->eof = &s->lim[cnt]; *(s->eof)++ = '\0'; - } - } - else if (s->act != 0) { - cnt = s->last - s->act; - if (cnt > BSIZE) - cnt = BSIZE; - memcpy(s->lim, s->act, cnt); - s->act += cnt; - if (cnt != 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. */ - 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; - } - 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; - } - aq_enqueue(s->eol_offsets, cnt + (s->lim - s->bot)); - } - /* check \ \n EOB */ - else if (last == '\n' && last2 == '\\') - { - cnt -= 2; - 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; -} - -/////////////////////////////////////////////////////////////////////////////// -// Special wrapper class holding the current cursor position -struct uchar_wrapper -{ - uchar_wrapper (uchar *base_cursor, unsigned int column = 1) - : base_cursor(base_cursor), column(column) - {} - - uchar_wrapper& operator++() - { - ++base_cursor; - ++column; - return *this; - } - - uchar_wrapper& operator--() - { - --base_cursor; - --column; - return *this; - } - - uchar operator* () const - { - return *base_cursor; - } - - operator uchar *() const - { - return base_cursor; - } - - friend int operator- (uchar_wrapper const& lhs, uchar_wrapper const& rhs) - { - return lhs.base_cursor - rhs.base_cursor; - } - - uchar *base_cursor; - unsigned int column; -}; - -/////////////////////////////////////////////////////////////////////////////// -boost::wave::token_id scan(Scanner *s) -{ - uchar_wrapper cursor (s->tok = s->cur, s->column = s->curr_column); - uchar_wrapper marker (s->ptr); - uchar_wrapper limit (s->lim); - -#line 416 "cpp.re" - - - -#line 405 "cpp_re.cpp" -{ - YYCTYPE yych; - unsigned int yyaccept; - goto yy0; - ++YYCURSOR; -yy0: - if((YYLIMIT - YYCURSOR) < 17) YYFILL(17); - yych = *YYCURSOR; - switch(yych){ - case 0x00: goto yy89; - case 0x01: - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - case 0x08: case 0x0E: - case 0x0F: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - case 0x1C: - case 0x1D: - case 0x1E: - case 0x1F: goto yy2; - case 0x09: case 0x0B: - case 0x0C: case ' ': goto yy84; - case 0x0A: goto yy86; - case 0x0D: goto yy88; - case '!': goto yy67; - case '"': goto yy83; - case '#': goto yy42; - case '%': goto yy34; - case '&': goto yy61; - case '\'': goto yy82; - case '(': goto yy44; - case ')': goto yy46; - case '*': goto yy56; - case '+': goto yy52; - case ',': goto yy73; - case '-': goto yy54; - case '.': goto yy50; - case '/': goto yy3; - case '0': goto yy79; - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': goto yy81; - case ':': goto yy40; - case ';': goto yy48; - case '<': goto yy30; - case '=': goto yy69; - case '>': goto yy71; - case '?': goto yy28; - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - 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 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': case 'h': case 'j': - case 'k': case 'q': case 'y': - case 'z': goto yy75; - case 'L': goto yy76; - case '[': goto yy36; - case '\\': goto yy77; - case ']': goto yy38; - case '^': goto yy58; - case '_': goto yy25; - case 'a': goto yy5; - case 'b': goto yy7; - case 'c': goto yy8; - case 'd': goto yy9; - case 'e': goto yy10; - case 'f': goto yy11; - case 'g': goto yy12; - case 'i': goto yy13; - case 'l': goto yy14; - case 'm': goto yy15; - case 'n': goto yy16; - case 'o': goto yy17; - case 'p': goto yy18; - case 'r': goto yy19; - case 's': goto yy20; - case 't': goto yy21; - case 'u': goto yy22; - case 'v': goto yy23; - case 'w': goto yy24; - case 'x': goto yy60; - case '{': goto yy26; - case '|': goto yy63; - case '}': goto yy32; - case '~': goto yy65; - default: goto yy91; - } -yy2: YYCURSOR = YYMARKER; - switch(yyaccept){ - case 102: goto yy934; - case 101: goto yy932; - case 98: goto yy918; - case 97: goto yy915; - case 96: goto yy908; - case 95: goto yy906; - case 94: goto yy901; - case 93: goto yy898; - case 91: goto yy888; - case 92: goto yy894; - case 90: goto yy886; - case 88: goto yy870; - case 87: goto yy865; - case 84: goto yy842; - case 86: goto yy859; - case 85: goto yy854; - case 83: goto yy839; - case 82: goto yy836; - case 81: goto yy833; - case 80: goto yy828; - case 79: goto yy823; - case 78: goto yy814; - case 77: goto yy810; - case 76: goto yy806; - case 75: goto yy804; - case 74: goto yy795; - case 71: goto yy783; - case 73: goto yy791; - case 72: goto yy787; - case 70: goto yy781; - case 69: goto yy777; - case 68: goto yy770; - case 67: goto yy762; - case 64: goto yy751; - case 61: goto yy737; - case 60: goto yy732; - case 59: goto yy723; - case 58: goto yy716; - case 57: goto yy710; - case 56: goto yy696; - case 55: goto yy688; - case 54: goto yy684; - case 53: goto yy680; - case 51: goto yy668; - case 52: goto yy674; - case 50: goto yy664; - case 49: goto yy658; - case 48: goto yy649; - case 47: goto yy642; - case 46: goto yy640; - case 45: goto yy635; - case 44: goto yy633; - case 43: goto yy630; - case 42: goto yy627; - case 41: goto yy625; - case 40: goto yy612; - case 39: goto yy609; - case 38: goto yy601; - case 37: goto yy595; - case 36: goto yy589; - case 35: goto yy587; - case 34: goto yy577; - case 33: goto yy571; - case 29: goto yy559; - case 32: goto yy565; - case 31: goto yy563; - case 30: goto yy561; - case 23: goto yy523; - case 21: goto yy513; - case 22: goto yy518; - case 20: goto yy505; - case 18: goto yy491; - case 27: goto yy545; - case 26: goto yy542; - case 28: goto yy552; - case 25: goto yy536; - case 19: goto yy497; - case 24: goto yy526; - case 2: goto yy43; - case 14: goto yy424; - case 15: goto yy452; - case 1: goto yy29; - case 3: goto yy51; - case 10: goto yy269; - case 100: goto yy926; - case 4: goto yy64; - case 99: goto yy923; - case 16: goto yy456; - case 89: goto yy879; - case 65: goto yy756; - case 11: goto yy273; - case 104: goto yy940; - case 63: goto yy744; - case 66: goto yy760; - case 103: goto yy936; - case 62: goto yy740; - case 17: goto yy460; - case 0: goto yy6; - case 6: goto yy80; - case 9: goto yy188; - case 8: goto yy150; - case 7: goto yy100; - case 13: goto yy329; - case 12: goto yy314; - case 5: goto yy78; - } -yy3: ++YYCURSOR; - if((yych = *YYCURSOR) <= '.'){ - if(yych == '*') goto yy945; - goto yy4; - } else { - if(yych <= '/') goto yy943; - if(yych == '=') goto yy941; - goto yy4; - } -yy4: -#line 552 "cpp.re" -{ RET(T_DIVIDE); } -#line 653 "cpp_re.cpp" -yy5: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'r'){ - if(yych == 'n') goto yy927; - goto yy225; - } else { - if(yych <= 's') goto yy928; - if(yych == 'u') goto yy929; - goto yy225; - } -yy6: -#line 616 "cpp.re" -{ RET(T_IDENTIFIER); } -#line 667 "cpp_re.cpp" -yy7: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'n'){ - if(yych == 'i') goto yy909; - goto yy225; - } else { - if(yych <= 'o') goto yy910; - if(yych == 'r') goto yy911; - goto yy225; - } -yy8: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - switch(yych){ - case 'a': goto yy871; - case 'h': goto yy872; - case 'l': goto yy873; - case 'o': goto yy874; - default: goto yy225; - } -yy9: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'n'){ - if(yych == 'e') goto yy840; - goto yy225; - } else { - if(yych <= 'o') goto yy841; - if(yych == 'y') goto yy843; - goto yy225; - } -yy10: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'm'){ - if(yych == 'l') goto yy815; - goto yy225; - } else { - if(yych <= 'n') goto yy816; - if(yych == 'x') goto yy817; - goto yy225; - } -yy11: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - switch(yych){ - case 'a': goto yy796; - case 'l': goto yy797; - case 'o': goto yy798; - case 'r': goto yy799; - default: goto yy225; - } -yy12: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy792; - goto yy225; -yy13: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'f') goto yy782; - if(yych == 'n') goto yy784; - goto yy225; -yy14: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy778; - goto yy225; -yy15: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'u') goto yy771; - goto yy225; -yy16: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'd'){ - if(yych == 'a') goto yy752; - goto yy225; - } else { - if(yych <= 'e') goto yy753; - if(yych == 'o') goto yy754; - goto yy225; - } -yy17: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'p') goto yy738; - if(yych == 'r') goto yy739; - goto yy225; -yy18: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'r') goto yy717; - if(yych == 'u') goto yy718; - goto yy225; -yy19: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy689; - goto yy225; -yy20: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 's'){ - if(yych <= 'g') goto yy225; - if(yych <= 'h') goto yy650; - if(yych <= 'i') goto yy651; - goto yy225; - } else { - if(yych <= 't') goto yy652; - if(yych == 'w') goto yy653; - goto yy225; - } -yy21: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'h'){ - if(yych == 'e') goto yy613; - if(yych <= 'g') goto yy225; - goto yy614; - } else { - if(yych <= 'r'){ - if(yych <= 'q') goto yy225; - goto yy615; - } else { - if(yych == 'y') goto yy616; - goto yy225; - } - } -yy22: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy596; - if(yych == 's') goto yy597; - goto yy225; -yy23: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy578; - if(yych == 'o') goto yy579; - goto yy225; -yy24: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'c') goto yy566; - if(yych == 'h') goto yy567; - goto yy225; -yy25: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - switch(yych){ - case '_': goto yy477; - case 'a': goto yy478; - case 'b': goto yy479; - case 'c': goto yy480; - case 'd': goto yy481; - case 'f': goto yy482; - case 'i': goto yy483; - case 's': goto yy484; - default: goto yy225; - } -yy26: ++YYCURSOR; - goto yy27; -yy27: -#line 502 "cpp.re" -{ RET(T_LEFTBRACE); } -#line 817 "cpp_re.cpp" -yy28: yyaccept = 1; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '?') goto yy442; - goto yy29; -yy29: -#line 527 "cpp.re" -{ RET(T_QUESTION_MARK); } -#line 825 "cpp_re.cpp" -yy30: ++YYCURSOR; - if((yych = *YYCURSOR) <= ':'){ - if(yych == '%') goto yy438; - if(yych >= ':') goto yy436; - goto yy31; - } else { - if(yych <= ';') goto yy31; - if(yych <= '<') goto yy434; - if(yych <= '=') goto yy432; - goto yy31; - } -yy31: -#line 568 "cpp.re" -{ RET(T_LESS); } -#line 840 "cpp_re.cpp" -yy32: ++YYCURSOR; - goto yy33; -yy33: -#line 505 "cpp.re" -{ RET(T_RIGHTBRACE); } -#line 846 "cpp_re.cpp" -yy34: ++YYCURSOR; - if((yych = *YYCURSOR) <= '<'){ - if(yych == ':') goto yy423; - goto yy35; - } else { - if(yych <= '=') goto yy425; - if(yych <= '>') goto yy427; - goto yy35; - } -yy35: -#line 553 "cpp.re" -{ RET(T_PERCENT); } -#line 859 "cpp_re.cpp" -yy36: ++YYCURSOR; - goto yy37; -yy37: -#line 508 "cpp.re" -{ RET(T_LEFTBRACKET); } -#line 865 "cpp_re.cpp" -yy38: ++YYCURSOR; - goto yy39; -yy39: -#line 511 "cpp.re" -{ RET(T_RIGHTBRACKET); } -#line 871 "cpp_re.cpp" -yy40: ++YYCURSOR; - if((yych = *YYCURSOR) == ':') goto yy419; - if(yych == '>') goto yy421; - goto yy41; -yy41: -#line 525 "cpp.re" -{ RET(T_COLON); } -#line 879 "cpp_re.cpp" -yy42: yyaccept = 2; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'e'){ - if(yych <= '#'){ - if(yych <= 0x1F){ - if(yych == 0x09) goto yy296; - goto yy43; - } else { - if(yych <= ' ') goto yy296; - if(yych >= '#') goto yy307; - goto yy43; - } - } else { - if(yych <= '>'){ - if(yych == '/') goto yy296; - goto yy43; - } else { - if(yych <= '?') goto yy306; - if(yych >= 'd') goto yy296; - goto yy43; - } - } - } else { - if(yych <= 'p'){ - if(yych <= 'k'){ - if(yych == 'i') goto yy296; - goto yy43; - } else { - if(yych <= 'l') goto yy296; - if(yych >= 'p') goto yy296; - goto yy43; - } - } else { - if(yych <= 't'){ - if(yych == 'r') goto yy296; - goto yy43; - } else { - if(yych == 'v') goto yy43; - if(yych <= 'w') goto yy296; - goto yy43; - } - } - } -yy43: -#line 514 "cpp.re" -{ RET(T_POUND); } -#line 926 "cpp_re.cpp" -yy44: ++YYCURSOR; - goto yy45; -yy45: -#line 522 "cpp.re" -{ RET(T_LEFTPAREN); } -#line 932 "cpp_re.cpp" -yy46: ++YYCURSOR; - goto yy47; -yy47: -#line 523 "cpp.re" -{ RET(T_RIGHTPAREN); } -#line 938 "cpp_re.cpp" -yy48: ++YYCURSOR; - goto yy49; -yy49: -#line 524 "cpp.re" -{ RET(T_SEMICOLON); } -#line 944 "cpp_re.cpp" -yy50: yyaccept = 3; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '-'){ - if(yych == '*') goto yy290; - goto yy51; - } else { - if(yych <= '.') goto yy292; - if(yych <= '/') goto yy51; - if(yych <= '9') goto yy186; - goto yy51; - } -yy51: -#line 538 "cpp.re" -{ RET(T_DOT); } -#line 959 "cpp_re.cpp" -yy52: ++YYCURSOR; - if((yych = *YYCURSOR) == '+') goto yy286; - if(yych == '=') goto yy288; - goto yy53; -yy53: -#line 549 "cpp.re" -{ RET(T_PLUS); } -#line 967 "cpp_re.cpp" -yy54: ++YYCURSOR; - if((yych = *YYCURSOR) <= '<'){ - if(yych == '-') goto yy280; - goto yy55; - } else { - if(yych <= '=') goto yy282; - if(yych <= '>') goto yy278; - goto yy55; - } -yy55: -#line 550 "cpp.re" -{ RET(T_MINUS); } -#line 980 "cpp_re.cpp" -yy56: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy276; - goto yy57; -yy57: -#line 551 "cpp.re" -{ RET(T_STAR); } -#line 987 "cpp_re.cpp" -yy58: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy274; - goto yy59; -yy59: -#line 554 "cpp.re" -{ RET(T_XOR); } -#line 994 "cpp_re.cpp" -yy60: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy267; - goto yy225; -yy61: ++YYCURSOR; - if((yych = *YYCURSOR) == '&') goto yy263; - if(yych == '=') goto yy265; - goto yy62; -yy62: -#line 557 "cpp.re" -{ RET(T_AND); } -#line 1006 "cpp_re.cpp" -yy63: yyaccept = 4; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '>'){ - if(yych == '=') goto yy258; - goto yy64; - } else { - if(yych <= '?') goto yy255; - if(yych == '|') goto yy256; - goto yy64; - } -yy64: -#line 559 "cpp.re" -{ RET(T_OR); } -#line 1020 "cpp_re.cpp" -yy65: ++YYCURSOR; - goto yy66; -yy66: -#line 562 "cpp.re" -{ RET(T_COMPL); } -#line 1026 "cpp_re.cpp" -yy67: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy253; - goto yy68; -yy68: -#line 565 "cpp.re" -{ RET(T_NOT); } -#line 1033 "cpp_re.cpp" -yy69: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy251; - goto yy70; -yy70: -#line 567 "cpp.re" -{ RET(T_ASSIGN); } -#line 1040 "cpp_re.cpp" -yy71: ++YYCURSOR; - if((yych = *YYCURSOR) <= '<') goto yy72; - if(yych <= '=') goto yy245; - if(yych <= '>') goto yy247; - goto yy72; -yy72: -#line 569 "cpp.re" -{ RET(T_GREATER); } -#line 1049 "cpp_re.cpp" -yy73: ++YYCURSOR; - goto yy74; -yy74: -#line 601 "cpp.re" -{ RET(T_COMMA); } -#line 1055 "cpp_re.cpp" -yy75: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - goto yy225; -yy76: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '?'){ - if(yych <= '\''){ - if(yych == '"') goto yy95; - if(yych <= '&') goto yy6; - goto yy244; - } else { - if(yych <= '/') goto yy6; - if(yych <= '9') goto yy224; - if(yych <= '>') goto yy6; - goto yy227; - } - } else { - if(yych <= '\\'){ - if(yych <= '@') goto yy6; - if(yych <= 'Z') goto yy224; - if(yych <= '[') goto yy6; - goto yy226; - } else { - if(yych <= '_'){ - if(yych <= '^') goto yy6; - goto yy224; - } else { - if(yych <= '`') goto yy6; - if(yych <= 'z') goto yy224; - goto yy6; - } - } - } -yy77: yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy216; - if(yych == 'u') goto yy215; - goto yy78; -yy78: -#line 684 "cpp.re" -{ - /* if (0 != s->error_proc) - (*s->error_proc)(s, "Unexpected character: '%c'", *s->tok); - else - printf("unexpected character: '%c'\n", *s->tok); - */ - RET(TOKEN_FROM_ID(*s->tok, UnknownTokenType)); - } -#line 1104 "cpp_re.cpp" -yy79: yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'U'){ - if(yych <= '9'){ - if(yych <= '.'){ - if(yych >= '.') goto yy186; - goto yy80; - } else { - if(yych <= '/') goto yy80; - if(yych <= '7') goto yy208; - goto yy210; - } - } else { - if(yych <= 'K'){ - if(yych == 'E') goto yy183; - goto yy80; - } else { - if(yych <= 'L') goto yy190; - if(yych >= 'U') goto yy189; - goto yy80; - } - } - } else { - if(yych <= 'k'){ - if(yych <= 'X'){ - if(yych >= 'X') goto yy212; - goto yy80; - } else { - if(yych == 'e') goto yy183; - goto yy80; - } - } else { - if(yych <= 'u'){ - if(yych <= 'l') goto yy191; - if(yych >= 'u') goto yy189; - goto yy80; - } else { - if(yych == 'x') goto yy212; - goto yy80; - } - } - } -yy80: -#line 622 "cpp.re" -{ RET(T_INTLIT); } -#line 1150 "cpp_re.cpp" -yy81: yyaccept = 6; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'L'){ - if(yych <= '9'){ - if(yych == '.') goto yy186; - if(yych <= '/') goto yy80; - goto yy184; - } else { - if(yych == 'E') goto yy183; - if(yych <= 'K') goto yy80; - goto yy190; - } - } else { - if(yych <= 'e'){ - if(yych == 'U') goto yy189; - if(yych <= 'd') goto yy80; - goto yy183; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy80; - goto yy191; - } else { - if(yych == 'u') goto yy189; - goto yy80; - } - } - } -yy82: yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x0C){ - if(yych == 0x09) goto yy140; - if(yych <= 0x0A) goto yy78; - goto yy140; - } else { - if(yych <= 0x1F) goto yy78; - if(yych == '\'') goto yy78; - goto yy140; - } -yy83: yyaccept = 5; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 0x0A){ - if(yych == 0x09) goto yy96; - goto yy78; - } else { - if(yych <= 0x0C) goto yy96; - if(yych <= 0x1F) goto yy78; - goto yy96; - } -yy84: ++YYCURSOR; - yych = *YYCURSOR; - goto yy94; -yy85: -#line 661 "cpp.re" -{ RET(T_SPACE); } -#line 1205 "cpp_re.cpp" -yy86: ++YYCURSOR; - goto yy87; -yy87: -#line 664 "cpp.re" -{ - s->line++; - cursor.column = 1; - RET(T_NEWLINE); - } -#line 1215 "cpp_re.cpp" -yy88: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy92; - goto yy87; -yy89: ++YYCURSOR; - goto yy90; -yy90: -#line 671 "cpp.re" -{ - if(cursor != s->eof) - { - using namespace std; // some systems have printf in std - if (0 != s->error_proc) - (*s->error_proc)(s, "'\\000' in input stream"); - else - printf("Error: 0 in file\n"); - } - RET(T_EOF); - } -#line 1234 "cpp_re.cpp" -yy91: yych = *++YYCURSOR; - goto yy78; -yy92: yych = *++YYCURSOR; - goto yy87; -yy93: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy94; -yy94: if(yych <= 0x0A){ - if(yych == 0x09) goto yy93; - goto yy85; - } else { - if(yych <= 0x0C) goto yy93; - if(yych == ' ') goto yy93; - goto yy85; - } -yy95: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy96; -yy96: if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy97; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy97: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy110; - } else { - if(yych != '\\') goto yy95; - goto yy98; - } - } -yy98: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '`'){ - if(yych <= '7'){ - if(yych <= '&'){ - if(yych == '"') goto yy95; - goto yy2; - } else { - if(yych <= '\'') goto yy95; - if(yych <= '/') goto yy2; - goto yy105; - } - } else { - if(yych <= 'T'){ - if(yych == '?') goto yy103; - goto yy2; - } else { - if(yych <= 'U') goto yy102; - if(yych == '\\') goto yy95; - goto yy2; - } - } - } else { - if(yych <= 'r'){ - if(yych <= 'f'){ - if(yych <= 'b') goto yy95; - if(yych <= 'e') goto yy2; - goto yy95; - } else { - if(yych == 'n') goto yy95; - if(yych <= 'q') goto yy2; - goto yy95; - } - } else { - if(yych <= 'u'){ - if(yych <= 's') goto yy2; - if(yych <= 't') goto yy95; - goto yy101; - } else { - if(yych <= 'v') goto yy95; - if(yych == 'x') goto yy104; - goto yy2; - } - } - } -yy99: ++YYCURSOR; - goto yy100; -yy100: -#line 631 "cpp.re" -{ RET(T_STRINGLIT); } -#line 1347 "cpp_re.cpp" -yy101: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy136; - goto yy2; - } else { - if(yych <= 'F') goto yy136; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy136; - goto yy2; - } -yy102: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy129; - goto yy2; - } else { - if(yych <= 'F') goto yy129; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy129; - goto yy2; - } -yy103: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy109; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy104: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy107; - goto yy2; - } else { - if(yych <= 'F') goto yy107; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy107; - goto yy2; - } -yy105: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy95; - goto yy99; - } - } else { - if(yych <= '>'){ - if(yych <= '/') goto yy95; - if(yych >= '8') goto yy95; - goto yy106; - } else { - if(yych <= '?') goto yy97; - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy106: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy97; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy107: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy108; -yy108: if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy107; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy107; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych <= 'f') goto yy107; - goto yy95; - } - } - } -yy109: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy110; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy110: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy111; -yy111: if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy95; - goto yy99; - } - } else { - if(yych <= '>'){ - if(yych != '/') goto yy95; - goto yy112; - } else { - if(yych <= '?') goto yy110; - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy112: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy113; -yy113: if(yych <= '>'){ - if(yych <= 0x1F){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy95; - } else { - if(yych <= 0x0A) goto yy2; - if(yych <= 0x0C) goto yy95; - goto yy2; - } - } else { - if(yych <= '"'){ - if(yych <= '!') goto yy95; - goto yy116; - } else { - if(yych <= '/') goto yy95; - if(yych <= '7') goto yy105; - goto yy95; - } - } - } else { - if(yych <= '\\'){ - if(yych <= 'T'){ - if(yych <= '?') goto yy117; - goto yy95; - } else { - if(yych <= 'U') goto yy115; - if(yych <= '[') goto yy95; - goto yy112; - } - } else { - if(yych <= 'u'){ - if(yych <= 't') goto yy95; - goto yy114; - } else { - if(yych == 'x') goto yy107; - goto yy95; - } - } - } -yy114: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy126; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy126; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych <= 'f') goto yy126; - goto yy95; - } - } - } -yy115: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy119; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy119; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych <= 'f') goto yy119; - goto yy95; - } - } - } -yy116: yyaccept = 7; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy100; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy100; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy97; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy117: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy118; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy118: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '"'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - if(yych <= '!') goto yy95; - goto yy99; - } - } else { - if(yych <= '>'){ - if(yych == '/') goto yy112; - goto yy95; - } else { - if(yych <= '?') goto yy110; - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy119: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy120; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy120; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy120; - } - } - } -yy120: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy121; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy121; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy121; - } - } - } -yy121: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy122; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy122; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy122; - } - } - } -yy122: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy123; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy123; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy123; - } - } - } -yy123: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy124; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy124; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy124; - } - } - } -yy124: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy125; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy125; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy125; - } - } - } -yy125: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy97; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy126: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy127; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy127; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy127; - } - } - } -yy127: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy95; - if(yych <= 0x0A) goto yy2; - goto yy95; - } else { - if(yych <= '!'){ - if(yych <= 0x1F) goto yy2; - goto yy95; - } else { - if(yych <= '"') goto yy99; - if(yych <= '/') goto yy95; - goto yy128; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy97; - if(yych <= '@') goto yy95; - goto yy128; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy95; - goto yy98; - } else { - if(yych <= '`') goto yy95; - if(yych >= 'g') goto yy95; - goto yy128; - } - } - } -yy128: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '!'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy95; - goto yy2; - } else { - if(yych <= 0x0C) goto yy95; - if(yych <= 0x1F) goto yy2; - goto yy95; - } - } else { - if(yych <= '?'){ - if(yych <= '"') goto yy99; - if(yych <= '>') goto yy95; - goto yy97; - } else { - if(yych == '\\') goto yy98; - goto yy95; - } - } -yy129: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy130; - } else { - if(yych <= 'F') goto yy130; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy130; - } -yy130: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy131; - } else { - if(yych <= 'F') goto yy131; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy131; - } -yy131: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy132; - } else { - if(yych <= 'F') goto yy132; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy132; - } -yy132: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy133; - } else { - if(yych <= 'F') goto yy133; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy133; - } -yy133: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy134; - } else { - if(yych <= 'F') goto yy134; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy134; - } -yy134: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy135; - } else { - if(yych <= 'F') goto yy135; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy135; - } -yy135: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy95; - goto yy2; - } else { - if(yych <= 'F') goto yy95; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy95; - goto yy2; - } -yy136: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy137; - } else { - if(yych <= 'F') goto yy137; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy137; - } -yy137: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy138; - } else { - if(yych <= 'F') goto yy138; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy138; - } -yy138: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy95; - goto yy2; - } else { - if(yych <= 'F') goto yy95; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy95; - goto yy2; - } -yy139: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy140; -yy140: if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy141; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy141: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy154; - } else { - if(yych != '\\') goto yy139; - goto yy142; - } - } -yy142: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '`'){ - if(yych <= '7'){ - if(yych <= '&'){ - if(yych == '"') goto yy139; - goto yy2; - } else { - if(yych <= '\'') goto yy139; - if(yych <= '/') goto yy2; - goto yy147; - } - } else { - if(yych <= 'T'){ - if(yych == '?') goto yy145; - goto yy2; - } else { - if(yych <= 'U') goto yy144; - if(yych == '\\') goto yy139; - goto yy2; - } - } - } else { - if(yych <= 'r'){ - if(yych <= 'f'){ - if(yych <= 'b') goto yy139; - if(yych <= 'e') goto yy2; - goto yy139; - } else { - if(yych == 'n') goto yy139; - if(yych <= 'q') goto yy2; - goto yy139; - } - } else { - if(yych <= 'u'){ - if(yych <= 's') goto yy2; - if(yych <= 't') goto yy139; - goto yy143; - } else { - if(yych <= 'v') goto yy139; - if(yych == 'x') goto yy146; - goto yy2; - } - } - } -yy143: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy180; - goto yy2; - } else { - if(yych <= 'F') goto yy180; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy180; - goto yy2; - } -yy144: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy173; - goto yy2; - } else { - if(yych <= 'F') goto yy173; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy173; - goto yy2; - } -yy145: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy153; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy146: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy151; - goto yy2; - } else { - if(yych <= 'F') goto yy151; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy151; - goto yy2; - } -yy147: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - if(yych <= '&') goto yy139; - goto yy149; - } - } else { - if(yych <= '>'){ - if(yych <= '/') goto yy139; - if(yych >= '8') goto yy139; - goto yy148; - } else { - if(yych <= '?') goto yy141; - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy148: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy141; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy149: ++YYCURSOR; - goto yy150; -yy150: -#line 628 "cpp.re" -{ RET(T_CHARLIT); } -#line 2365 "cpp_re.cpp" -yy151: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy152; -yy152: if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy151; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy151; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych <= 'f') goto yy151; - goto yy139; - } - } - } -yy153: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy154; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy154: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy155; -yy155: if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - if(yych <= '&') goto yy139; - goto yy149; - } - } else { - if(yych <= '>'){ - if(yych != '/') goto yy139; - goto yy156; - } else { - if(yych <= '?') goto yy154; - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy156: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy157; -yy157: if(yych <= '>'){ - if(yych <= 0x1F){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy139; - } else { - if(yych <= 0x0A) goto yy2; - if(yych <= 0x0C) goto yy139; - goto yy2; - } - } else { - if(yych <= '\''){ - if(yych <= '&') goto yy139; - goto yy160; - } else { - if(yych <= '/') goto yy139; - if(yych <= '7') goto yy147; - goto yy139; - } - } - } else { - if(yych <= '\\'){ - if(yych <= 'T'){ - if(yych <= '?') goto yy161; - goto yy139; - } else { - if(yych <= 'U') goto yy159; - if(yych <= '[') goto yy139; - goto yy156; - } - } else { - if(yych <= 'u'){ - if(yych <= 't') goto yy139; - goto yy158; - } else { - if(yych == 'x') goto yy151; - goto yy139; - } - } - } -yy158: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy170; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy170; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych <= 'f') goto yy170; - goto yy139; - } - } - } -yy159: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy163; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy163; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych <= 'f') goto yy163; - goto yy139; - } - } - } -yy160: yyaccept = 8; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy150; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy150; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy141; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy161: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy162; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy162: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '\''){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - if(yych <= '&') goto yy139; - goto yy149; - } - } else { - if(yych <= '>'){ - if(yych == '/') goto yy156; - goto yy139; - } else { - if(yych <= '?') goto yy154; - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy163: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy164; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy164; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy164; - } - } - } -yy164: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy165; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy165; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy165; - } - } - } -yy165: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy166; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy166; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy166; - } - } - } -yy166: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy167; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy167; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy167; - } - } - } -yy167: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy168; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy168; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy168; - } - } - } -yy168: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy169; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy169; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy169; - } - } - } -yy169: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy141; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy170: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy171; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy171; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy171; - } - } - } -yy171: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '9'){ - if(yych <= 0x0C){ - if(yych == 0x09) goto yy139; - if(yych <= 0x0A) goto yy2; - goto yy139; - } else { - if(yych <= '&'){ - if(yych <= 0x1F) goto yy2; - goto yy139; - } else { - if(yych <= '\'') goto yy149; - if(yych <= '/') goto yy139; - goto yy172; - } - } - } else { - if(yych <= 'F'){ - if(yych == '?') goto yy141; - if(yych <= '@') goto yy139; - goto yy172; - } else { - if(yych <= '\\'){ - if(yych <= '[') goto yy139; - goto yy142; - } else { - if(yych <= '`') goto yy139; - if(yych >= 'g') goto yy139; - goto yy172; - } - } - } -yy172: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '&'){ - if(yych <= 0x0A){ - if(yych == 0x09) goto yy139; - goto yy2; - } else { - if(yych <= 0x0C) goto yy139; - if(yych <= 0x1F) goto yy2; - goto yy139; - } - } else { - if(yych <= '?'){ - if(yych <= '\'') goto yy149; - if(yych <= '>') goto yy139; - goto yy141; - } else { - if(yych == '\\') goto yy142; - goto yy139; - } - } -yy173: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy174; - } else { - if(yych <= 'F') goto yy174; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy174; - } -yy174: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy175; - } else { - if(yych <= 'F') goto yy175; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy175; - } -yy175: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy176; - } else { - if(yych <= 'F') goto yy176; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy176; - } -yy176: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy177; - } else { - if(yych <= 'F') goto yy177; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy177; - } -yy177: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy178; - } else { - if(yych <= 'F') goto yy178; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy178; - } -yy178: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy179; - } else { - if(yych <= 'F') goto yy179; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy179; - } -yy179: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy139; - goto yy2; - } else { - if(yych <= 'F') goto yy139; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy139; - goto yy2; - } -yy180: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy181; - } else { - if(yych <= 'F') goto yy181; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy181; - } -yy181: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy182; - } else { - if(yych <= 'F') goto yy182; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy182; - } -yy182: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy139; - goto yy2; - } else { - if(yych <= 'F') goto yy139; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy139; - goto yy2; - } -yy183: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych == '+') goto yy205; - goto yy2; - } else { - if(yych <= '-') goto yy205; - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy206; - goto yy2; - } -yy184: yyaccept = 6; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy185; -yy185: if(yych <= 'L'){ - if(yych <= '9'){ - if(yych == '.') goto yy186; - if(yych <= '/') goto yy80; - goto yy184; - } else { - if(yych == 'E') goto yy183; - if(yych <= 'K') goto yy80; - goto yy190; - } - } else { - if(yych <= 'e'){ - if(yych == 'U') goto yy189; - if(yych <= 'd') goto yy80; - goto yy183; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy80; - goto yy191; - } else { - if(yych == 'u') goto yy189; - goto yy80; - } - } - } -yy186: yyaccept = 9; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy187; -yy187: if(yych <= 'K'){ - if(yych <= 'D'){ - if(yych <= '/') goto yy188; - if(yych <= '9') goto yy186; - goto yy188; - } else { - if(yych <= 'E') goto yy198; - if(yych <= 'F') goto yy199; - goto yy188; - } - } else { - if(yych <= 'e'){ - if(yych <= 'L') goto yy200; - if(yych >= 'e') goto yy198; - goto yy188; - } else { - if(yych <= 'f') goto yy199; - if(yych == 'l') goto yy200; - goto yy188; - } - } -yy188: -#line 625 "cpp.re" -{ RET(T_FLOATLIT); } -#line 3142 "cpp_re.cpp" -yy189: yych = *++YYCURSOR; - if(yych == 'L') goto yy197; - if(yych == 'l') goto yy196; - goto yy80; -yy190: yych = *++YYCURSOR; - if(yych <= 'T'){ - if(yych == 'L') goto yy192; - goto yy80; - } else { - if(yych <= 'U') goto yy194; - if(yych == 'u') goto yy194; - goto yy80; - } -yy191: yych = *++YYCURSOR; - if(yych <= 'k'){ - if(yych == 'U') goto yy194; - goto yy80; - } else { - if(yych <= 'l') goto yy192; - if(yych == 'u') goto yy194; - goto yy80; - } -yy192: ++YYCURSOR; - if((yych = *YYCURSOR) == 'U') goto yy195; - if(yych == 'u') goto yy195; - goto yy193; -yy193: -#line 619 "cpp.re" -{ RET(T_LONGINTLIT); } -#line 3172 "cpp_re.cpp" -yy194: yych = *++YYCURSOR; - goto yy80; -yy195: yych = *++YYCURSOR; - goto yy193; -yy196: yych = *++YYCURSOR; - if(yych == 'l') goto yy195; - goto yy80; -yy197: yych = *++YYCURSOR; - if(yych == 'L') goto yy195; - goto yy80; -yy198: yych = *++YYCURSOR; - if(yych <= ','){ - if(yych == '+') goto yy202; - goto yy2; - } else { - if(yych <= '-') goto yy202; - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy203; - goto yy2; - } -yy199: yych = *++YYCURSOR; - if(yych == 'L') goto yy201; - if(yych == 'l') goto yy201; - goto yy188; -yy200: yych = *++YYCURSOR; - if(yych == 'F') goto yy201; - if(yych != 'f') goto yy188; - goto yy201; -yy201: yych = *++YYCURSOR; - goto yy188; -yy202: yych = *++YYCURSOR; - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy203; -yy203: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy204; -yy204: if(yych <= 'K'){ - if(yych <= '9'){ - if(yych <= '/') goto yy188; - goto yy203; - } else { - if(yych == 'F') goto yy199; - goto yy188; - } - } else { - if(yych <= 'f'){ - if(yych <= 'L') goto yy200; - if(yych <= 'e') goto yy188; - goto yy199; - } else { - if(yych == 'l') goto yy200; - goto yy188; - } - } -yy205: yych = *++YYCURSOR; - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy206; -yy206: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy207; -yy207: if(yych <= 'K'){ - if(yych <= '9'){ - if(yych <= '/') goto yy188; - goto yy206; - } else { - if(yych == 'F') goto yy199; - goto yy188; - } - } else { - if(yych <= 'f'){ - if(yych <= 'L') goto yy200; - if(yych <= 'e') goto yy188; - goto yy199; - } else { - if(yych == 'l') goto yy200; - goto yy188; - } - } -yy208: yyaccept = 6; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy209; -yy209: if(yych <= 'L'){ - if(yych <= '7'){ - if(yych == '.') goto yy186; - if(yych <= '/') goto yy80; - goto yy208; - } else { - if(yych <= 'D'){ - if(yych >= ':') goto yy80; - goto yy210; - } else { - if(yych <= 'E') goto yy183; - if(yych <= 'K') goto yy80; - goto yy190; - } - } - } else { - if(yych <= 'e'){ - if(yych == 'U') goto yy189; - if(yych <= 'd') goto yy80; - goto yy183; - } else { - if(yych <= 'l'){ - if(yych <= 'k') goto yy80; - goto yy191; - } else { - if(yych == 'u') goto yy189; - goto yy80; - } - } - } -yy210: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy211; -yy211: if(yych <= '9'){ - if(yych == '.') goto yy186; - if(yych <= '/') goto yy2; - goto yy210; - } else { - if(yych <= 'E'){ - if(yych <= 'D') goto yy2; - goto yy183; - } else { - if(yych == 'e') goto yy183; - goto yy2; - } - } -yy212: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy213; - } else { - if(yych <= 'F') goto yy213; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy213; - } -yy213: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 3) YYFILL(3); - yych = *YYCURSOR; - goto yy214; -yy214: if(yych <= 'T'){ - if(yych <= '@'){ - if(yych <= '/') goto yy80; - if(yych <= '9') goto yy213; - goto yy80; - } else { - if(yych <= 'F') goto yy213; - if(yych == 'L') goto yy190; - goto yy80; - } - } else { - if(yych <= 'k'){ - if(yych <= 'U') goto yy189; - if(yych <= '`') goto yy80; - if(yych <= 'f') goto yy213; - goto yy80; - } else { - if(yych <= 'l') goto yy191; - if(yych == 'u') goto yy189; - goto yy80; - } - } -yy215: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy241; - goto yy2; - } else { - if(yych <= 'F') goto yy241; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy241; - goto yy2; - } -yy216: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy217; - } else { - if(yych <= 'F') goto yy217; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy217; - } -yy217: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy218; - } else { - if(yych <= 'F') goto yy218; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy218; - } -yy218: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy219; - } else { - if(yych <= 'F') goto yy219; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy219; - } -yy219: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy220; - } else { - if(yych <= 'F') goto yy220; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy220; - } -yy220: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy221; - } else { - if(yych <= 'F') goto yy221; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy221; - } -yy221: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy222; - } else { - if(yych <= 'F') goto yy222; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy222; - } -yy222: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy223; - } else { - if(yych <= 'F') goto yy223; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy223; - } -yy223: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy224; - } else { - if(yych <= 'F') goto yy224; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy224; - } -yy224: yyaccept = 0; - YYMARKER = ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy225; -yy225: if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy6; - if(yych <= '9') goto yy224; - goto yy6; - } else { - if(yych <= '?') goto yy227; - if(yych <= '@') goto yy6; - goto yy224; - } - } else { - if(yych <= '^'){ - if(yych != '\\') goto yy6; - goto yy226; - } else { - if(yych == '`') goto yy6; - if(yych <= 'z') goto yy224; - goto yy6; - } - } -yy226: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == 'U') goto yy230; - if(yych == 'u') goto yy229; - goto yy2; -yy227: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych != '?') goto yy2; - goto yy228; -yy228: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '/') goto yy226; - goto yy2; -yy229: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy238; - goto yy2; - } else { - if(yych <= 'F') goto yy238; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy238; - goto yy2; - } -yy230: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy231; - } else { - if(yych <= 'F') goto yy231; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy231; - } -yy231: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy232; - } else { - if(yych <= 'F') goto yy232; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy232; - } -yy232: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy233; - } else { - if(yych <= 'F') goto yy233; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy233; - } -yy233: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy234; - } else { - if(yych <= 'F') goto yy234; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy234; - } -yy234: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy235; - } else { - if(yych <= 'F') goto yy235; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy235; - } -yy235: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy236; - } else { - if(yych <= 'F') goto yy236; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy236; - } -yy236: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy237; - } else { - if(yych <= 'F') goto yy237; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy237; - } -yy237: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy224; - goto yy2; - } else { - if(yych <= 'F') goto yy224; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy224; - goto yy2; - } -yy238: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy239; - } else { - if(yych <= 'F') goto yy239; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy239; - } -yy239: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy240; - } else { - if(yych <= 'F') goto yy240; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy240; - } -yy240: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy224; - goto yy2; - } else { - if(yych <= 'F') goto yy224; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy224; - goto yy2; - } -yy241: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy242; - } else { - if(yych <= 'F') goto yy242; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy242; - } -yy242: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych >= ':') goto yy2; - goto yy243; - } else { - if(yych <= 'F') goto yy243; - if(yych <= '`') goto yy2; - if(yych >= 'g') goto yy2; - goto yy243; - } -yy243: yych = *++YYCURSOR; - if(yych <= '@'){ - if(yych <= '/') goto yy2; - if(yych <= '9') goto yy224; - goto yy2; - } else { - if(yych <= 'F') goto yy224; - if(yych <= '`') goto yy2; - if(yych <= 'f') goto yy224; - goto yy2; - } -yy244: yych = *++YYCURSOR; - if(yych == '\'') goto yy2; - goto yy140; -yy245: ++YYCURSOR; - goto yy246; -yy246: -#line 591 "cpp.re" -{ RET(T_GREATEREQUAL); } -#line 3681 "cpp_re.cpp" -yy247: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy249; - goto yy248; -yy248: -#line 584 "cpp.re" -{ RET(T_SHIFTRIGHT); } -#line 3688 "cpp_re.cpp" -yy249: ++YYCURSOR; - goto yy250; -yy250: -#line 585 "cpp.re" -{ RET(T_SHIFTRIGHTASSIGN); } -#line 3694 "cpp_re.cpp" -yy251: ++YYCURSOR; - goto yy252; -yy252: -#line 587 "cpp.re" -{ RET(T_EQUAL); } -#line 3700 "cpp_re.cpp" -yy253: ++YYCURSOR; - goto yy254; -yy254: -#line 588 "cpp.re" -{ RET(T_NOTEQUAL); } -#line 3706 "cpp_re.cpp" -yy255: yych = *++YYCURSOR; - if(yych == '?') goto yy260; - goto yy2; -yy256: ++YYCURSOR; - goto yy257; -yy257: -#line 594 "cpp.re" -{ RET(T_OROR); } -#line 3715 "cpp_re.cpp" -yy258: ++YYCURSOR; - goto yy259; -yy259: -#line 580 "cpp.re" -{ RET(T_ORASSIGN); } -#line 3721 "cpp_re.cpp" -yy260: yych = *++YYCURSOR; - if(yych != '!') goto yy2; - goto yy261; -yy261: ++YYCURSOR; - goto yy262; -yy262: -#line 596 "cpp.re" -{ RET(T_OROR_TRIGRAPH); } -#line 3730 "cpp_re.cpp" -yy263: ++YYCURSOR; - goto yy264; -yy264: -#line 592 "cpp.re" -{ RET(T_ANDAND); } -#line 3736 "cpp_re.cpp" -yy265: ++YYCURSOR; - goto yy266; -yy266: -#line 578 "cpp.re" -{ RET(T_ANDASSIGN); } -#line 3742 "cpp_re.cpp" -yy267: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy268; -yy268: yyaccept = 10; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy269; - if(yych <= '9') goto yy224; - goto yy269; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy269; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy269; - } else { - if(yych <= '_') goto yy270; - if(yych <= '`') goto yy269; - if(yych <= 'z') goto yy224; - goto yy269; - } - } -yy269: -#line 556 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_XOR_ALT); } -#line 3773 "cpp_re.cpp" -yy270: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy271; -yy271: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'q') goto yy225; - goto yy272; -yy272: yyaccept = 11; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy273; - if(yych <= '9') goto yy224; - goto yy273; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy273; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy273; - } else { - if(yych == '`') goto yy273; - if(yych <= 'z') goto yy224; - goto yy273; - } - } -yy273: -#line 576 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_XORASSIGN_ALT); } -#line 3807 "cpp_re.cpp" -yy274: ++YYCURSOR; - goto yy275; -yy275: -#line 575 "cpp.re" -{ RET(T_XORASSIGN); } -#line 3813 "cpp_re.cpp" -yy276: ++YYCURSOR; - goto yy277; -yy277: -#line 572 "cpp.re" -{ RET(T_STARASSIGN); } -#line 3819 "cpp_re.cpp" -yy278: ++YYCURSOR; - if((yych = *YYCURSOR) == '*') goto yy284; - goto yy279; -yy279: -#line 612 "cpp.re" -{ RET(T_ARROW); } -#line 3826 "cpp_re.cpp" -yy280: ++YYCURSOR; - goto yy281; -yy281: -#line 600 "cpp.re" -{ RET(T_MINUSMINUS); } -#line 3832 "cpp_re.cpp" -yy282: ++YYCURSOR; - goto yy283; -yy283: -#line 571 "cpp.re" -{ RET(T_MINUSASSIGN); } -#line 3838 "cpp_re.cpp" -yy284: ++YYCURSOR; - goto yy285; -yy285: -#line 603 "cpp.re" -{ - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_ARROW); - } - else { - RET(T_ARROWSTAR); - } - } -#line 3852 "cpp_re.cpp" -yy286: ++YYCURSOR; - goto yy287; -yy287: -#line 599 "cpp.re" -{ RET(T_PLUSPLUS); } -#line 3858 "cpp_re.cpp" -yy288: ++YYCURSOR; - goto yy289; -yy289: -#line 570 "cpp.re" -{ RET(T_PLUSASSIGN); } -#line 3864 "cpp_re.cpp" -yy290: ++YYCURSOR; - goto yy291; -yy291: -#line 540 "cpp.re" -{ - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_DOT); - } - else { - RET(T_DOTSTAR); - } - } -#line 3878 "cpp_re.cpp" -yy292: yych = *++YYCURSOR; - if(yych != '.') goto yy2; - goto yy293; -yy293: ++YYCURSOR; - goto yy294; -yy294: -#line 526 "cpp.re" -{ RET(T_ELLIPSIS); } -#line 3887 "cpp_re.cpp" -yy295: ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 12) YYFILL(12); - yych = *YYCURSOR; - goto yy296; -yy296: if(yych <= 'i'){ - if(yych <= '.'){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy2; - goto yy295; - } else { - if(yych == ' ') goto yy295; - goto yy2; - } - } else { - if(yych <= 'd'){ - if(yych <= '/') goto yy297; - if(yych <= 'c') goto yy2; - goto yy304; - } else { - if(yych <= 'e') goto yy298; - if(yych <= 'h') goto yy2; - goto yy305; - } - } - } else { - if(yych <= 'q'){ - if(yych <= 'l'){ - if(yych <= 'k') goto yy2; - goto yy302; - } else { - if(yych == 'p') goto yy301; - goto yy2; - } - } else { - if(yych <= 'u'){ - if(yych <= 'r') goto yy299; - if(yych <= 't') goto yy2; - goto yy303; - } else { - if(yych == 'w') goto yy300; - goto yy2; - } - } - } -yy297: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '*') goto yy412; - goto yy2; -yy298: yych = *++YYCURSOR; - if(yych <= 'm'){ - if(yych == 'l') goto yy388; - goto yy2; - } else { - if(yych <= 'n') goto yy389; - if(yych == 'r') goto yy390; - goto yy2; - } -yy299: yych = *++YYCURSOR; - if(yych == 'e') goto yy382; - goto yy2; -yy300: yych = *++YYCURSOR; - if(yych == 'a') goto yy375; - goto yy2; -yy301: yych = *++YYCURSOR; - if(yych == 'r') goto yy369; - goto yy2; -yy302: yych = *++YYCURSOR; - if(yych == 'i') goto yy365; - goto yy2; -yy303: yych = *++YYCURSOR; - if(yych == 'n') goto yy360; - goto yy2; -yy304: yych = *++YYCURSOR; - if(yych == 'e') goto yy354; - goto yy2; -yy305: yych = *++YYCURSOR; - if(yych == 'f') goto yy313; - if(yych == 'n') goto yy312; - goto yy2; -yy306: yych = *++YYCURSOR; - if(yych == '?') goto yy309; - goto yy2; -yy307: ++YYCURSOR; - goto yy308; -yy308: -#line 517 "cpp.re" -{ RET(T_POUND_POUND); } -#line 3976 "cpp_re.cpp" -yy309: yych = *++YYCURSOR; - if(yych != '=') goto yy2; - goto yy310; -yy310: ++YYCURSOR; - goto yy311; -yy311: -#line 518 "cpp.re" -{ RET(T_POUND_POUND_TRIGRAPH); } -#line 3985 "cpp_re.cpp" -yy312: yych = *++YYCURSOR; - if(yych == 'c') goto yy324; - goto yy2; -yy313: yyaccept = 12; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy316; - if(yych == 'n') goto yy315; - goto yy314; -yy314: -#line 643 "cpp.re" -{ RET(T_PP_IF); } -#line 3997 "cpp_re.cpp" -yy315: yych = *++YYCURSOR; - if(yych == 'd') goto yy320; - goto yy2; -yy316: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy317; -yy317: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy318; -yy318: ++YYCURSOR; - goto yy319; -yy319: -#line 644 "cpp.re" -{ RET(T_PP_IFDEF); } -#line 4012 "cpp_re.cpp" -yy320: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy321; -yy321: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy322; -yy322: ++YYCURSOR; - goto yy323; -yy323: -#line 645 "cpp.re" -{ RET(T_PP_IFNDEF); } -#line 4024 "cpp_re.cpp" -yy324: yych = *++YYCURSOR; - if(yych != 'l') goto yy2; - goto yy325; -yy325: yych = *++YYCURSOR; - if(yych != 'u') goto yy2; - goto yy326; -yy326: yych = *++YYCURSOR; - if(yych != 'd') goto yy2; - goto yy327; -yy327: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy328; -yy328: yyaccept = 13; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '_') goto yy330; - goto yy332; -yy329: -#line 641 "cpp.re" -{ RET(T_PP_INCLUDE); } -#line 4044 "cpp_re.cpp" -yy330: yych = *++YYCURSOR; - if(yych == 'n') goto yy351; - goto yy2; -yy331: yyaccept = 13; - YYMARKER = ++YYCURSOR; - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - goto yy332; -yy332: if(yych <= '!'){ - if(yych <= 0x09){ - if(yych <= 0x08) goto yy329; - goto yy331; - } else { - if(yych == ' ') goto yy331; - goto yy329; - } - } else { - if(yych <= '/'){ - if(yych <= '"') goto yy335; - if(yych <= '.') goto yy329; - goto yy333; - } else { - if(yych == '<') goto yy334; - goto yy329; - } - } -yy333: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych == '*') goto yy344; - goto yy2; -yy334: yych = *++YYCURSOR; - if(yych == '>') goto yy2; - goto yy341; -yy335: yych = *++YYCURSOR; - if(yych == '"') goto yy2; - goto yy337; -yy336: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy337; -yy337: if(yych <= 0x0C){ - if(yych == 0x09) goto yy336; - if(yych <= 0x0A) goto yy2; - goto yy336; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '"') goto yy336; - goto yy338; - } -yy338: ++YYCURSOR; - goto yy339; -yy339: -#line 638 "cpp.re" -{ RET(T_PP_QHEADER); } -#line 4100 "cpp_re.cpp" -yy340: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy341; -yy341: if(yych <= 0x0C){ - if(yych == 0x09) goto yy340; - if(yych <= 0x0A) goto yy2; - goto yy340; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '>') goto yy340; - goto yy342; - } -yy342: ++YYCURSOR; - goto yy343; -yy343: -#line 635 "cpp.re" -{ RET(T_PP_HHEADER); } -#line 4119 "cpp_re.cpp" -yy344: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy345; -yy345: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy344; - goto yy346; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy348; - goto yy344; - } -yy346: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy347; -yy347: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy344; - goto yy346; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '*') goto yy344; - goto yy348; - } -yy348: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy349; -yy349: if(yych <= 0x1F){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy344; - if(yych >= 0x0E) goto yy2; - goto yy350; - } else { - if(yych <= '*'){ - if(yych <= ')') goto yy344; - goto yy348; - } else { - if(yych == '/') goto yy331; - goto yy344; - } - } -yy350: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy344; - goto yy346; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy348; - goto yy344; - } -yy351: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy352; -yy352: yych = *++YYCURSOR; - if(yych != 'x') goto yy2; - goto yy353; -yy353: yych = *++YYCURSOR; - if(yych == 't') goto yy331; - goto yy2; -yy354: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy355; -yy355: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy356; -yy356: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy357; -yy357: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy358; -yy358: ++YYCURSOR; - goto yy359; -yy359: -#line 649 "cpp.re" -{ RET(T_PP_DEFINE); } -#line 4202 "cpp_re.cpp" -yy360: yych = *++YYCURSOR; - if(yych != 'd') goto yy2; - goto yy361; -yy361: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy362; -yy362: yych = *++YYCURSOR; - if(yych != 'f') goto yy2; - goto yy363; -yy363: ++YYCURSOR; - goto yy364; -yy364: -#line 650 "cpp.re" -{ RET(T_PP_UNDEF); } -#line 4217 "cpp_re.cpp" -yy365: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy366; -yy366: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy367; -yy367: ++YYCURSOR; - goto yy368; -yy368: -#line 651 "cpp.re" -{ RET(T_PP_LINE); } -#line 4229 "cpp_re.cpp" -yy369: yych = *++YYCURSOR; - if(yych != 'a') goto yy2; - goto yy370; -yy370: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy371; -yy371: yych = *++YYCURSOR; - if(yych != 'm') goto yy2; - goto yy372; -yy372: yych = *++YYCURSOR; - if(yych != 'a') goto yy2; - goto yy373; -yy373: ++YYCURSOR; - goto yy374; -yy374: -#line 653 "cpp.re" -{ RET(T_PP_PRAGMA); } -#line 4247 "cpp_re.cpp" -yy375: yych = *++YYCURSOR; - if(yych != 'r') goto yy2; - goto yy376; -yy376: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy377; -yy377: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy378; -yy378: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy379; -yy379: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy380; -yy380: ++YYCURSOR; - goto yy381; -yy381: -#line 655 "cpp.re" -{ RET(T_PP_WARNING); } -#line 4268 "cpp_re.cpp" -yy382: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy383; -yy383: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy384; -yy384: yych = *++YYCURSOR; - if(yych != 'o') goto yy2; - goto yy385; -yy385: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy386; -yy386: ++YYCURSOR; - goto yy387; -yy387: -#line 657 "cpp.re" -{ RET(T_MSEXT_PP_REGION); } -#line 4286 "cpp_re.cpp" -yy388: yych = *++YYCURSOR; - if(yych == 'i') goto yy406; - if(yych == 's') goto yy407; - goto yy2; -yy389: yych = *++YYCURSOR; - if(yych == 'd') goto yy395; - goto yy2; -yy390: yych = *++YYCURSOR; - if(yych != 'r') goto yy2; - goto yy391; -yy391: yych = *++YYCURSOR; - if(yych != 'o') goto yy2; - goto yy392; -yy392: yych = *++YYCURSOR; - if(yych != 'r') goto yy2; - goto yy393; -yy393: ++YYCURSOR; - goto yy394; -yy394: -#line 652 "cpp.re" -{ RET(T_PP_ERROR); } -#line 4308 "cpp_re.cpp" -yy395: yych = *++YYCURSOR; - if(yych == 'i') goto yy396; - if(yych == 'r') goto yy397; - goto yy2; -yy396: yych = *++YYCURSOR; - if(yych == 'f') goto yy404; - goto yy2; -yy397: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy398; -yy398: yych = *++YYCURSOR; - if(yych != 'g') goto yy2; - goto yy399; -yy399: yych = *++YYCURSOR; - if(yych != 'i') goto yy2; - goto yy400; -yy400: yych = *++YYCURSOR; - if(yych != 'o') goto yy2; - goto yy401; -yy401: yych = *++YYCURSOR; - if(yych != 'n') goto yy2; - goto yy402; -yy402: ++YYCURSOR; - goto yy403; -yy403: -#line 658 "cpp.re" -{ RET(T_MSEXT_PP_ENDREGION); } -#line 4336 "cpp_re.cpp" -yy404: ++YYCURSOR; - goto yy405; -yy405: -#line 648 "cpp.re" -{ RET(T_PP_ENDIF); } -#line 4342 "cpp_re.cpp" -yy406: yych = *++YYCURSOR; - if(yych == 'f') goto yy410; - goto yy2; -yy407: yych = *++YYCURSOR; - if(yych != 'e') goto yy2; - goto yy408; -yy408: ++YYCURSOR; - goto yy409; -yy409: -#line 646 "cpp.re" -{ RET(T_PP_ELSE); } -#line 4354 "cpp_re.cpp" -yy410: ++YYCURSOR; - goto yy411; -yy411: -#line 647 "cpp.re" -{ RET(T_PP_ELIF); } -#line 4360 "cpp_re.cpp" -yy412: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy413; -yy413: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy412; - goto yy414; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy416; - goto yy412; - } -yy414: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy415; -yy415: if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy412; - goto yy414; - } else { - if(yych <= 0x1F) goto yy2; - if(yych != '*') goto yy412; - goto yy416; - } -yy416: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - goto yy417; -yy417: if(yych <= 0x1F){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy412; - if(yych >= 0x0E) goto yy2; - goto yy418; - } else { - if(yych <= '*'){ - if(yych <= ')') goto yy412; - goto yy416; - } else { - if(yych == '/') goto yy295; - goto yy412; - } - } -yy418: ++YYCURSOR; - if(YYLIMIT == YYCURSOR) YYFILL(1); - yych = *YYCURSOR; - if(yych <= 0x0D){ - if(yych <= 0x08) goto yy2; - if(yych <= 0x0C) goto yy412; - goto yy414; - } else { - if(yych <= 0x1F) goto yy2; - if(yych == '*') goto yy416; - goto yy412; - } -yy419: ++YYCURSOR; - goto yy420; -yy420: -#line 529 "cpp.re" -{ - if (s->act_in_c99_mode) { - --YYCURSOR; - RET(T_COLON); - } - else { - RET(T_COLON_COLON); - } - } -#line 4430 "cpp_re.cpp" -yy421: ++YYCURSOR; - goto yy422; -yy422: -#line 513 "cpp.re" -{ RET(T_RIGHTBRACKET_ALT); } -#line 4436 "cpp_re.cpp" -yy423: yyaccept = 14; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'h'){ - if(yych <= '$'){ - if(yych <= 0x09){ - if(yych >= 0x09) goto yy296; - goto yy424; - } else { - if(yych == ' ') goto yy296; - goto yy424; - } - } else { - if(yych <= '/'){ - if(yych <= '%') goto yy429; - if(yych >= '/') goto yy296; - goto yy424; - } else { - if(yych <= 'c') goto yy424; - if(yych <= 'e') goto yy296; - goto yy424; - } - } - } else { - if(yych <= 'q'){ - if(yych <= 'l'){ - if(yych <= 'i') goto yy296; - if(yych >= 'l') goto yy296; - goto yy424; - } else { - if(yych == 'p') goto yy296; - goto yy424; - } - } else { - if(yych <= 'u'){ - if(yych <= 'r') goto yy296; - if(yych >= 'u') goto yy296; - goto yy424; - } else { - if(yych == 'w') goto yy296; - goto yy424; - } - } - } -yy424: -#line 515 "cpp.re" -{ RET(T_POUND_ALT); } -#line 4483 "cpp_re.cpp" -yy425: ++YYCURSOR; - goto yy426; -yy426: -#line 574 "cpp.re" -{ RET(T_PERCENTASSIGN); } -#line 4489 "cpp_re.cpp" -yy427: ++YYCURSOR; - goto yy428; -yy428: -#line 507 "cpp.re" -{ RET(T_RIGHTBRACE_ALT); } -#line 4495 "cpp_re.cpp" -yy429: yych = *++YYCURSOR; - if(yych != ':') goto yy2; - goto yy430; -yy430: ++YYCURSOR; - goto yy431; -yy431: -#line 521 "cpp.re" -{ RET(T_POUND_POUND_ALT); } -#line 4504 "cpp_re.cpp" -yy432: ++YYCURSOR; - goto yy433; -yy433: -#line 590 "cpp.re" -{ RET(T_LESSEQUAL); } -#line 4510 "cpp_re.cpp" -yy434: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy440; - goto yy435; -yy435: -#line 583 "cpp.re" -{ RET(T_SHIFTLEFT); } -#line 4517 "cpp_re.cpp" -yy436: ++YYCURSOR; - goto yy437; -yy437: -#line 510 "cpp.re" -{ RET(T_LEFTBRACKET_ALT); } -#line 4523 "cpp_re.cpp" -yy438: ++YYCURSOR; - goto yy439; -yy439: -#line 504 "cpp.re" -{ RET(T_LEFTBRACE_ALT); } -#line 4529 "cpp_re.cpp" -yy440: ++YYCURSOR; - goto yy441; -yy441: -#line 586 "cpp.re" -{ RET(T_SHIFTLEFTASSIGN); } -#line 4535 "cpp_re.cpp" -yy442: yych = *++YYCURSOR; - switch(yych){ - case '!': goto yy455; - case '\'': goto yy453; - case '(': goto yy447; - case ')': goto yy449; - case '-': goto yy457; - case '/': goto yy459; - case '<': goto yy443; - case '=': goto yy451; - case '>': goto yy445; - default: goto yy2; - } -yy443: ++YYCURSOR; - goto yy444; -yy444: -#line 503 "cpp.re" -{ RET(T_LEFTBRACE_TRIGRAPH); } -#line 4554 "cpp_re.cpp" -yy445: ++YYCURSOR; - goto yy446; -yy446: -#line 506 "cpp.re" -{ RET(T_RIGHTBRACE_TRIGRAPH); } -#line 4560 "cpp_re.cpp" -yy447: ++YYCURSOR; - goto yy448; -yy448: -#line 509 "cpp.re" -{ RET(T_LEFTBRACKET_TRIGRAPH); } -#line 4566 "cpp_re.cpp" -yy449: ++YYCURSOR; - goto yy450; -yy450: -#line 512 "cpp.re" -{ RET(T_RIGHTBRACKET_TRIGRAPH); } -#line 4572 "cpp_re.cpp" -yy451: yyaccept = 15; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'e'){ - if(yych <= '#'){ - if(yych <= 0x1F){ - if(yych == 0x09) goto yy296; - goto yy452; - } else { - if(yych <= ' ') goto yy296; - if(yych >= '#') goto yy472; - goto yy452; - } - } else { - if(yych <= '>'){ - if(yych == '/') goto yy296; - goto yy452; - } else { - if(yych <= '?') goto yy471; - if(yych >= 'd') goto yy296; - goto yy452; - } - } - } else { - if(yych <= 'p'){ - if(yych <= 'k'){ - if(yych == 'i') goto yy296; - goto yy452; - } else { - if(yych <= 'l') goto yy296; - if(yych >= 'p') goto yy296; - goto yy452; - } - } else { - if(yych <= 't'){ - if(yych == 'r') goto yy296; - goto yy452; - } else { - if(yych == 'v') goto yy452; - if(yych <= 'w') goto yy296; - goto yy452; - } - } - } -yy452: -#line 516 "cpp.re" -{ RET(T_POUND_TRIGRAPH); } -#line 4619 "cpp_re.cpp" -yy453: ++YYCURSOR; - if((yych = *YYCURSOR) == '=') goto yy469; - goto yy454; -yy454: -#line 555 "cpp.re" -{ RET(T_XOR_TRIGRAPH); } -#line 4626 "cpp_re.cpp" -yy455: yyaccept = 16; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '>'){ - if(yych == '=') goto yy464; - goto yy456; - } else { - if(yych <= '?') goto yy461; - if(yych == '|') goto yy462; - goto yy456; - } -yy456: -#line 561 "cpp.re" -{ RET(T_OR_TRIGRAPH); } -#line 4640 "cpp_re.cpp" -yy457: ++YYCURSOR; - goto yy458; -yy458: -#line 563 "cpp.re" -{ RET(T_COMPL_TRIGRAPH); } -#line 4646 "cpp_re.cpp" -yy459: yyaccept = 17; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'U') goto yy216; - if(yych == 'u') goto yy215; - goto yy460; -yy460: -#line 613 "cpp.re" -{ RET(T_ANY_TRIGRAPH); } -#line 4655 "cpp_re.cpp" -yy461: yych = *++YYCURSOR; - if(yych == '?') goto yy466; - goto yy2; -yy462: ++YYCURSOR; - goto yy463; -yy463: -#line 595 "cpp.re" -{ RET(T_OROR_TRIGRAPH); } -#line 4664 "cpp_re.cpp" -yy464: ++YYCURSOR; - goto yy465; -yy465: -#line 582 "cpp.re" -{ RET(T_ORASSIGN_TRIGRAPH); } -#line 4670 "cpp_re.cpp" -yy466: yych = *++YYCURSOR; - if(yych != '!') goto yy2; - goto yy467; -yy467: ++YYCURSOR; - goto yy468; -yy468: -#line 598 "cpp.re" -{ RET(T_OROR_TRIGRAPH); } -#line 4679 "cpp_re.cpp" -yy469: ++YYCURSOR; - goto yy470; -yy470: -#line 577 "cpp.re" -{ RET(T_XORASSIGN_TRIGRAPH); } -#line 4685 "cpp_re.cpp" -yy471: yych = *++YYCURSOR; - if(yych == '?') goto yy474; - goto yy2; -yy472: ++YYCURSOR; - goto yy473; -yy473: -#line 519 "cpp.re" -{ RET(T_POUND_POUND_TRIGRAPH); } -#line 4694 "cpp_re.cpp" -yy474: yych = *++YYCURSOR; - if(yych != '=') goto yy2; - goto yy475; -yy475: ++YYCURSOR; - goto yy476; -yy476: -#line 520 "cpp.re" -{ RET(T_POUND_POUND_TRIGRAPH); } -#line 4703 "cpp_re.cpp" -yy477: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - switch(yych){ - case 'a': goto yy478; - case 'b': goto yy479; - case 'c': goto yy480; - case 'd': goto yy481; - case 'e': goto yy530; - case 'f': goto yy528; - case 'i': goto yy527; - case 'l': goto yy531; - case 's': goto yy484; - case 't': goto yy529; - default: goto yy225; - } -yy478: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 's') goto yy524; - goto yy225; -yy479: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy519; - goto yy225; -yy480: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy514; - goto yy225; -yy481: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy506; - goto yy225; -yy482: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy498; - goto yy225; -yy483: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy492; - goto yy225; -yy484: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy485; -yy485: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy486; -yy486: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy487; -yy487: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy488; -yy488: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy489; -yy489: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy490; -yy490: yyaccept = 18; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy491; - if(yych <= '9') goto yy224; - goto yy491; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy491; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy491; - } else { - if(yych == '`') goto yy491; - if(yych <= 'z') goto yy224; - goto yy491; - } - } -yy491: -#line 494 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_STDCALL : T_IDENTIFIER); } -#line 4792 "cpp_re.cpp" -yy492: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy493; -yy493: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy494; -yy494: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy495; -yy495: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy496; -yy496: yyaccept = 19; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy497; - if(yych <= '9') goto yy224; - goto yy497; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy497; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy497; - } else { - if(yych == '`') goto yy497; - if(yych <= 'z') goto yy224; - goto yy497; - } - } -yy497: -#line 499 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_INLINE : T_IDENTIFIER); } -#line 4834 "cpp_re.cpp" -yy498: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy499; -yy499: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy500; -yy500: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy501; -yy501: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy502; -yy502: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy503; -yy503: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy504; -yy504: yyaccept = 20; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy505; - if(yych <= '9') goto yy224; - goto yy505; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy505; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy505; - } else { - if(yych == '`') goto yy505; - if(yych <= 'z') goto yy224; - goto yy505; - } - } -yy505: -#line 493 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_FASTCALL : T_IDENTIFIER); } -#line 4884 "cpp_re.cpp" -yy506: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy507; -yy507: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy508; -yy508: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy509; -yy509: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy510; -yy510: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy511; -yy511: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy512; -yy512: yyaccept = 21; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy513; - if(yych <= '9') goto yy224; - goto yy513; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy513; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy513; - } else { - if(yych == '`') goto yy513; - if(yych <= 'z') goto yy224; - goto yy513; - } - } -yy513: -#line 491 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_DECLSPEC : T_IDENTIFIER); } -#line 4934 "cpp_re.cpp" -yy514: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy515; -yy515: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy516; -yy516: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy517; -yy517: yyaccept = 22; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy518; - if(yych <= '9') goto yy224; - goto yy518; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy518; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy518; - } else { - if(yych == '`') goto yy518; - if(yych <= 'z') goto yy224; - goto yy518; - } - } -yy518: -#line 492 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_CDECL : T_IDENTIFIER); } -#line 4972 "cpp_re.cpp" -yy519: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy520; -yy520: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy521; -yy521: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy522; -yy522: yyaccept = 23; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy523; - if(yych <= '9') goto yy224; - goto yy523; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy523; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy523; - } else { - if(yych == '`') goto yy523; - if(yych <= 'z') goto yy224; - goto yy523; - } - } -yy523: -#line 490 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_BASED : T_IDENTIFIER); } -#line 5010 "cpp_re.cpp" -yy524: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'm') goto yy225; - goto yy525; -yy525: yyaccept = 24; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy526; - if(yych <= '9') goto yy224; - goto yy526; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy526; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy526; - } else { - if(yych == '`') goto yy526; - if(yych <= 'z') goto yy224; - goto yy526; - } - } -yy526: -#line 500 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_ASM : T_IDENTIFIER); } -#line 5040 "cpp_re.cpp" -yy527: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy553; - goto yy225; -yy528: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy498; - if(yych == 'i') goto yy546; - goto yy225; -yy529: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'r') goto yy543; - goto yy225; -yy530: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'x') goto yy537; - goto yy225; -yy531: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy532; -yy532: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy533; -yy533: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'v') goto yy225; - goto yy534; -yy534: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy535; -yy535: yyaccept = 25; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy536; - if(yych <= '9') goto yy224; - goto yy536; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy536; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy536; - } else { - if(yych == '`') goto yy536; - if(yych <= 'z') goto yy224; - goto yy536; - } - } -yy536: -#line 498 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_LEAVE : T_IDENTIFIER); } -#line 5099 "cpp_re.cpp" -yy537: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy538; -yy538: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy539; -yy539: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy540; -yy540: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy541; -yy541: yyaccept = 26; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy542; - if(yych <= '9') goto yy224; - goto yy542; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy542; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy542; - } else { - if(yych == '`') goto yy542; - if(yych <= 'z') goto yy224; - goto yy542; - } - } -yy542: -#line 496 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_EXCEPT : T_IDENTIFIER); } -#line 5141 "cpp_re.cpp" -yy543: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'y') goto yy225; - goto yy544; -yy544: yyaccept = 27; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy545; - if(yych <= '9') goto yy224; - goto yy545; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy545; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy545; - } else { - if(yych == '`') goto yy545; - if(yych <= 'z') goto yy224; - goto yy545; - } - } -yy545: -#line 495 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_TRY : T_IDENTIFIER); } -#line 5171 "cpp_re.cpp" -yy546: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy547; -yy547: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy548; -yy548: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy549; -yy549: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy550; -yy550: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'y') goto yy225; - goto yy551; -yy551: yyaccept = 28; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy552; - if(yych <= '9') goto yy224; - goto yy552; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy552; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy552; - } else { - if(yych == '`') goto yy552; - if(yych <= 'z') goto yy224; - goto yy552; - } - } -yy552: -#line 497 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_FINALLY : T_IDENTIFIER); } -#line 5217 "cpp_re.cpp" -yy553: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'l') goto yy493; - if(yych != 't') goto yy225; - goto yy554; -yy554: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - switch(yych){ - case '1': goto yy555; - case '3': goto yy556; - case '6': goto yy557; - case '8': goto yy558; - default: goto yy225; - } -yy555: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '6') goto yy564; - goto yy225; -yy556: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '2') goto yy562; - goto yy225; -yy557: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == '4') goto yy560; - goto yy225; -yy558: yyaccept = 29; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy559; - if(yych <= '9') goto yy224; - goto yy559; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy559; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy559; - } else { - if(yych == '`') goto yy559; - if(yych <= 'z') goto yy224; - goto yy559; - } - } -yy559: -#line 486 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_INT8 : T_IDENTIFIER); } -#line 5269 "cpp_re.cpp" -yy560: yyaccept = 30; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy561; - if(yych <= '9') goto yy224; - goto yy561; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy561; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy561; - } else { - if(yych == '`') goto yy561; - if(yych <= 'z') goto yy224; - goto yy561; - } - } -yy561: -#line 489 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_INT64 : T_IDENTIFIER); } -#line 5295 "cpp_re.cpp" -yy562: yyaccept = 31; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy563; - if(yych <= '9') goto yy224; - goto yy563; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy563; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy563; - } else { - if(yych == '`') goto yy563; - if(yych <= 'z') goto yy224; - goto yy563; - } - } -yy563: -#line 488 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_INT32 : T_IDENTIFIER); } -#line 5321 "cpp_re.cpp" -yy564: yyaccept = 32; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy565; - if(yych <= '9') goto yy224; - goto yy565; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy565; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy565; - } else { - if(yych == '`') goto yy565; - if(yych <= 'z') goto yy224; - goto yy565; - } - } -yy565: -#line 487 "cpp.re" -{ RET(s->enable_ms_extensions ? T_MSEXT_INT16 : T_IDENTIFIER); } -#line 5347 "cpp_re.cpp" -yy566: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'h') goto yy572; - goto yy225; -yy567: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy568; -yy568: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy569; -yy569: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy570; -yy570: yyaccept = 33; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy571; - if(yych <= '9') goto yy224; - goto yy571; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy571; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy571; - } else { - if(yych == '`') goto yy571; - if(yych <= 'z') goto yy224; - goto yy571; - } - } -yy571: -#line 484 "cpp.re" -{ RET(T_WHILE); } -#line 5389 "cpp_re.cpp" -yy572: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy573; -yy573: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy574; -yy574: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != '_') goto yy225; - goto yy575; -yy575: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy576; -yy576: yyaccept = 34; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy577; - if(yych <= '9') goto yy224; - goto yy577; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy577; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy577; - } else { - if(yych == '`') goto yy577; - if(yych <= 'z') goto yy224; - goto yy577; - } - } -yy577: -#line 483 "cpp.re" -{ RET(T_WCHART); } -#line 5431 "cpp_re.cpp" -yy578: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'r') goto yy590; - goto yy225; -yy579: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy580; - if(yych == 'l') goto yy581; - goto yy225; -yy580: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy588; - goto yy225; -yy581: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy582; -yy582: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy583; -yy583: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy584; -yy584: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy585; -yy585: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy586; -yy586: yyaccept = 35; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy587; - if(yych <= '9') goto yy224; - goto yy587; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy587; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy587; - } else { - if(yych == '`') goto yy587; - if(yych <= 'z') goto yy224; - goto yy587; - } - } -yy587: -#line 482 "cpp.re" -{ RET(T_VOLATILE); } -#line 5490 "cpp_re.cpp" -yy588: yyaccept = 36; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy589; - if(yych <= '9') goto yy224; - goto yy589; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy589; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy589; - } else { - if(yych == '`') goto yy589; - if(yych <= 'z') goto yy224; - goto yy589; - } - } -yy589: -#line 481 "cpp.re" -{ RET(T_VOID); } -#line 5516 "cpp_re.cpp" -yy590: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy591; -yy591: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'u') goto yy225; - goto yy592; -yy592: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy593; -yy593: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy594; -yy594: yyaccept = 37; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy595; - if(yych <= '9') goto yy224; - goto yy595; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy595; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy595; - } else { - if(yych == '`') goto yy595; - if(yych <= 'z') goto yy224; - goto yy595; - } - } -yy595: -#line 480 "cpp.re" -{ RET(T_VIRTUAL); } -#line 5558 "cpp_re.cpp" -yy596: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy602; - if(yych == 's') goto yy603; - goto yy225; -yy597: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy598; -yy598: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy599; -yy599: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'g') goto yy225; - goto yy600; -yy600: yyaccept = 38; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy601; - if(yych <= '9') goto yy224; - goto yy601; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy601; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy601; - } else { - if(yych == '`') goto yy601; - if(yych <= 'z') goto yy224; - goto yy601; - } - } -yy601: -#line 479 "cpp.re" -{ RET(T_USING); } -#line 5601 "cpp_re.cpp" -yy602: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy610; - goto yy225; -yy603: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy604; -yy604: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'g') goto yy225; - goto yy605; -yy605: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy606; -yy606: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy607; -yy607: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy608; -yy608: yyaccept = 39; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy609; - if(yych <= '9') goto yy224; - goto yy609; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy609; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy609; - } else { - if(yych == '`') goto yy609; - if(yych <= 'z') goto yy224; - goto yy609; - } - } -yy609: -#line 478 "cpp.re" -{ RET(T_UNSIGNED); } -#line 5651 "cpp_re.cpp" -yy610: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy611; -yy611: yyaccept = 40; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy612; - if(yych <= '9') goto yy224; - goto yy612; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy612; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy612; - } else { - if(yych == '`') goto yy612; - if(yych <= 'z') goto yy224; - goto yy612; - } - } -yy612: -#line 477 "cpp.re" -{ RET(T_UNION); } -#line 5681 "cpp_re.cpp" -yy613: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'm') goto yy643; - goto yy225; -yy614: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy636; - if(yych == 'r') goto yy637; - goto yy225; -yy615: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'u') goto yy631; - if(yych == 'y') goto yy632; - goto yy225; -yy616: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy617; -yy617: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy618; -yy618: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'h'){ - if(yych != 'd') goto yy225; - goto yy619; - } else { - if(yych <= 'i') goto yy620; - if(yych == 'n') goto yy621; - goto yy225; - } -yy619: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy628; - goto yy225; -yy620: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy626; - goto yy225; -yy621: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy622; -yy622: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'm') goto yy225; - goto yy623; -yy623: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy624; -yy624: yyaccept = 41; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy625; - if(yych <= '9') goto yy224; - goto yy625; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy625; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy625; - } else { - if(yych == '`') goto yy625; - if(yych <= 'z') goto yy224; - goto yy625; - } - } -yy625: -#line 476 "cpp.re" -{ RET(T_TYPENAME); } -#line 5759 "cpp_re.cpp" -yy626: yyaccept = 42; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy627; - if(yych <= '9') goto yy224; - goto yy627; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy627; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy627; - } else { - if(yych == '`') goto yy627; - if(yych <= 'z') goto yy224; - goto yy627; - } - } -yy627: -#line 475 "cpp.re" -{ RET(T_TYPEID); } -#line 5785 "cpp_re.cpp" -yy628: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'f') goto yy225; - goto yy629; -yy629: yyaccept = 43; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy630; - if(yych <= '9') goto yy224; - goto yy630; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy630; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy630; - } else { - if(yych == '`') goto yy630; - if(yych <= 'z') goto yy224; - goto yy630; - } - } -yy630: -#line 474 "cpp.re" -{ RET(T_TYPEDEF); } -#line 5815 "cpp_re.cpp" -yy631: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy634; - goto yy225; -yy632: yyaccept = 44; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy633; - if(yych <= '9') goto yy224; - goto yy633; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy633; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy633; - } else { - if(yych == '`') goto yy633; - if(yych <= 'z') goto yy224; - goto yy633; - } - } -yy633: -#line 473 "cpp.re" -{ RET(T_TRY); } -#line 5845 "cpp_re.cpp" -yy634: yyaccept = 45; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy635; - if(yych <= '9') goto yy224; - goto yy635; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy635; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy635; - } else { - if(yych == '`') goto yy635; - if(yych <= 'z') goto yy224; - goto yy635; - } - } -yy635: -#line 472 "cpp.re" -{ RET(T_TRUE); } -#line 5871 "cpp_re.cpp" -yy636: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 's') goto yy641; - goto yy225; -yy637: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'o') goto yy225; - goto yy638; -yy638: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'w') goto yy225; - goto yy639; -yy639: yyaccept = 46; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy640; - if(yych <= '9') goto yy224; - goto yy640; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy640; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy640; - } else { - if(yych == '`') goto yy640; - if(yych <= 'z') goto yy224; - goto yy640; - } - } -yy640: -#line 471 "cpp.re" -{ RET(T_THROW); } -#line 5909 "cpp_re.cpp" -yy641: yyaccept = 47; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy642; - if(yych <= '9') goto yy224; - goto yy642; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy642; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy642; - } else { - if(yych == '`') goto yy642; - if(yych <= 'z') goto yy224; - goto yy642; - } - } -yy642: -#line 470 "cpp.re" -{ RET(T_THIS); } -#line 5935 "cpp_re.cpp" -yy643: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy644; -yy644: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy645; -yy645: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy646; -yy646: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy647; -yy647: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy648; -yy648: yyaccept = 48; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy649; - if(yych <= '9') goto yy224; - goto yy649; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy649; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy649; - } else { - if(yych == '`') goto yy649; - if(yych <= 'z') goto yy224; - goto yy649; - } - } -yy649: -#line 469 "cpp.re" -{ RET(T_TEMPLATE); } -#line 5981 "cpp_re.cpp" -yy650: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy685; - goto yy225; -yy651: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'g') goto yy675; - if(yych == 'z') goto yy676; - goto yy225; -yy652: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy659; - if(yych == 'r') goto yy660; - goto yy225; -yy653: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy654; -yy654: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy655; -yy655: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy656; -yy656: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'h') goto yy225; - goto yy657; -yy657: yyaccept = 49; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy658; - if(yych <= '9') goto yy224; - goto yy658; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy658; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy658; - } else { - if(yych == '`') goto yy658; - if(yych <= 'z') goto yy224; - goto yy658; - } - } -yy658: -#line 468 "cpp.re" -{ RET(T_SWITCH); } -#line 6037 "cpp_re.cpp" -yy659: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 't') goto yy665; - goto yy225; -yy660: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'u') goto yy225; - goto yy661; -yy661: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy662; -yy662: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy663; -yy663: yyaccept = 50; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy664; - if(yych <= '9') goto yy224; - goto yy664; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy664; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy664; - } else { - if(yych == '`') goto yy664; - if(yych <= 'z') goto yy224; - goto yy664; - } - } -yy664: -#line 467 "cpp.re" -{ RET(T_STRUCT); } -#line 6079 "cpp_re.cpp" -yy665: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy666; -yy666: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy667; -yy667: yyaccept = 51; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy668; - if(yych <= '9') goto yy224; - goto yy668; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy668; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy668; - } else { - if(yych <= '_') goto yy669; - if(yych <= '`') goto yy668; - if(yych <= 'z') goto yy224; - goto yy668; - } - } -yy668: -#line 465 "cpp.re" -{ RET(T_STATIC); } -#line 6114 "cpp_re.cpp" -yy669: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy670; -yy670: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy671; -yy671: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy672; -yy672: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy673; -yy673: yyaccept = 52; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy674; - if(yych <= '9') goto yy224; - goto yy674; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy674; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy674; - } else { - if(yych == '`') goto yy674; - if(yych <= 'z') goto yy224; - goto yy674; - } - } -yy674: -#line 466 "cpp.re" -{ RET(T_STATICCAST); } -#line 6156 "cpp_re.cpp" -yy675: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy681; - goto yy225; -yy676: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy677; -yy677: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'o') goto yy225; - goto yy678; -yy678: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'f') goto yy225; - goto yy679; -yy679: yyaccept = 53; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy680; - if(yych <= '9') goto yy224; - goto yy680; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy680; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy680; - } else { - if(yych == '`') goto yy680; - if(yych <= 'z') goto yy224; - goto yy680; - } - } -yy680: -#line 464 "cpp.re" -{ RET(T_SIZEOF); } -#line 6198 "cpp_re.cpp" -yy681: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy682; -yy682: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy683; -yy683: yyaccept = 54; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy684; - if(yych <= '9') goto yy224; - goto yy684; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy684; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy684; - } else { - if(yych == '`') goto yy684; - if(yych <= 'z') goto yy224; - goto yy684; - } - } -yy684: -#line 463 "cpp.re" -{ RET(T_SIGNED); } -#line 6232 "cpp_re.cpp" -yy685: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy686; -yy686: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy687; -yy687: yyaccept = 55; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy688; - if(yych <= '9') goto yy224; - goto yy688; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy688; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy688; - } else { - if(yych == '`') goto yy688; - if(yych <= 'z') goto yy224; - goto yy688; - } - } -yy688: -#line 462 "cpp.re" -{ RET(T_SHORT); } -#line 6266 "cpp_re.cpp" -yy689: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'h'){ - if(yych != 'g') goto yy225; - goto yy690; - } else { - if(yych <= 'i') goto yy691; - if(yych == 't') goto yy692; - goto yy225; - } -yy690: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy711; - goto yy225; -yy691: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy697; - goto yy225; -yy692: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'u') goto yy225; - goto yy693; -yy693: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy694; -yy694: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy695; -yy695: yyaccept = 56; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy696; - if(yych <= '9') goto yy224; - goto yy696; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy696; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy696; - } else { - if(yych == '`') goto yy696; - if(yych <= 'z') goto yy224; - goto yy696; - } - } -yy696: -#line 461 "cpp.re" -{ RET(T_RETURN); } -#line 6322 "cpp_re.cpp" -yy697: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy698; -yy698: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy699; -yy699: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy700; -yy700: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy701; -yy701: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy702; -yy702: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy703; -yy703: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy704; -yy704: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != '_') goto yy225; - goto yy705; -yy705: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy706; -yy706: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy707; -yy707: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy708; -yy708: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy709; -yy709: yyaccept = 57; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy710; - if(yych <= '9') goto yy224; - goto yy710; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy710; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy710; - } else { - if(yych == '`') goto yy710; - if(yych <= 'z') goto yy224; - goto yy710; - } - } -yy710: -#line 460 "cpp.re" -{ RET(T_REINTERPRETCAST); } -#line 6396 "cpp_re.cpp" -yy711: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy712; -yy712: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy713; -yy713: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy714; -yy714: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy715; -yy715: yyaccept = 58; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy716; - if(yych <= '9') goto yy224; - goto yy716; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy716; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy716; - } else { - if(yych == '`') goto yy716; - if(yych <= 'z') goto yy224; - goto yy716; - } - } -yy716: -#line 459 "cpp.re" -{ RET(T_REGISTER); } -#line 6438 "cpp_re.cpp" -yy717: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy724; - if(yych == 'o') goto yy725; - goto yy225; -yy718: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'b') goto yy225; - goto yy719; -yy719: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy720; -yy720: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy721; -yy721: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy722; -yy722: yyaccept = 59; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy723; - if(yych <= '9') goto yy224; - goto yy723; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy723; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy723; - } else { - if(yych == '`') goto yy723; - if(yych <= 'z') goto yy224; - goto yy723; - } - } -yy723: -#line 458 "cpp.re" -{ RET(T_PUBLIC); } -#line 6485 "cpp_re.cpp" -yy724: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'v') goto yy733; - goto yy225; -yy725: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy726; -yy726: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy727; -yy727: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy728; -yy728: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy729; -yy729: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy730; -yy730: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy731; -yy731: yyaccept = 60; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy732; - if(yych <= '9') goto yy224; - goto yy732; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy732; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy732; - } else { - if(yych == '`') goto yy732; - if(yych <= 'z') goto yy224; - goto yy732; - } - } -yy732: -#line 457 "cpp.re" -{ RET(T_PROTECTED); } -#line 6539 "cpp_re.cpp" -yy733: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy734; -yy734: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy735; -yy735: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy736; -yy736: yyaccept = 61; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy737; - if(yych <= '9') goto yy224; - goto yy737; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy737; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy737; - } else { - if(yych == '`') goto yy737; - if(yych <= 'z') goto yy224; - goto yy737; - } - } -yy737: -#line 456 "cpp.re" -{ RET(T_PRIVATE); } -#line 6577 "cpp_re.cpp" -yy738: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy745; - goto yy225; -yy739: yyaccept = 62; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy740; - if(yych <= '9') goto yy224; - goto yy740; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy740; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy740; - } else { - if(yych <= '_') goto yy741; - if(yych <= '`') goto yy740; - if(yych <= 'z') goto yy224; - goto yy740; - } - } -yy740: -#line 597 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_OROR_ALT); } -#line 6608 "cpp_re.cpp" -yy741: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy742; -yy742: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'q') goto yy225; - goto yy743; -yy743: yyaccept = 63; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy744; - if(yych <= '9') goto yy224; - goto yy744; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy744; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy744; - } else { - if(yych == '`') goto yy744; - if(yych <= 'z') goto yy224; - goto yy744; - } - } -yy744: -#line 581 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ORASSIGN_ALT); } -#line 6642 "cpp_re.cpp" -yy745: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy746; -yy746: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy747; -yy747: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy748; -yy748: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'o') goto yy225; - goto yy749; -yy749: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy750; -yy750: yyaccept = 64; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy751; - if(yych <= '9') goto yy224; - goto yy751; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy751; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy751; - } else { - if(yych == '`') goto yy751; - if(yych <= 'z') goto yy224; - goto yy751; - } - } -yy751: -#line 455 "cpp.re" -{ RET(T_OPERATOR); } -#line 6688 "cpp_re.cpp" -yy752: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'm') goto yy763; - goto yy225; -yy753: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'w') goto yy761; - goto yy225; -yy754: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy755; -yy755: yyaccept = 65; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy756; - if(yych <= '9') goto yy224; - goto yy756; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy756; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy756; - } else { - if(yych <= '_') goto yy757; - if(yych <= '`') goto yy756; - if(yych <= 'z') goto yy224; - goto yy756; - } - } -yy756: -#line 566 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_NOT_ALT); } -#line 6727 "cpp_re.cpp" -yy757: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy758; -yy758: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'q') goto yy225; - goto yy759; -yy759: yyaccept = 66; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy760; - if(yych <= '9') goto yy224; - goto yy760; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy760; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy760; - } else { - if(yych == '`') goto yy760; - if(yych <= 'z') goto yy224; - goto yy760; - } - } -yy760: -#line 589 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_NOTEQUAL_ALT); } -#line 6761 "cpp_re.cpp" -yy761: yyaccept = 67; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy762; - if(yych <= '9') goto yy224; - goto yy762; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy762; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy762; - } else { - if(yych == '`') goto yy762; - if(yych <= 'z') goto yy224; - goto yy762; - } - } -yy762: -#line 454 "cpp.re" -{ RET(T_NEW); } -#line 6787 "cpp_re.cpp" -yy763: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy764; -yy764: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy765; -yy765: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy766; -yy766: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy767; -yy767: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy768; -yy768: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy769; -yy769: yyaccept = 68; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy770; - if(yych <= '9') goto yy224; - goto yy770; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy770; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy770; - } else { - if(yych == '`') goto yy770; - if(yych <= 'z') goto yy224; - goto yy770; - } - } -yy770: -#line 453 "cpp.re" -{ RET(T_NAMESPACE); } -#line 6837 "cpp_re.cpp" -yy771: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy772; -yy772: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy773; -yy773: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'b') goto yy225; - goto yy774; -yy774: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy775; -yy775: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy776; -yy776: yyaccept = 69; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy777; - if(yych <= '9') goto yy224; - goto yy777; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy777; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy777; - } else { - if(yych == '`') goto yy777; - if(yych <= 'z') goto yy224; - goto yy777; - } - } -yy777: -#line 452 "cpp.re" -{ RET(T_MUTABLE); } -#line 6883 "cpp_re.cpp" -yy778: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy779; -yy779: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'g') goto yy225; - goto yy780; -yy780: yyaccept = 70; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy781; - if(yych <= '9') goto yy224; - goto yy781; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy781; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy781; - } else { - if(yych == '`') goto yy781; - if(yych <= 'z') goto yy224; - goto yy781; - } - } -yy781: -#line 451 "cpp.re" -{ RET(T_LONG); } -#line 6917 "cpp_re.cpp" -yy782: yyaccept = 71; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy783; - if(yych <= '9') goto yy224; - goto yy783; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy783; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy783; - } else { - if(yych == '`') goto yy783; - if(yych <= 'z') goto yy224; - goto yy783; - } - } -yy783: -#line 448 "cpp.re" -{ RET(T_IF); } -#line 6943 "cpp_re.cpp" -yy784: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'l') goto yy785; - if(yych == 't') goto yy786; - goto yy225; -yy785: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy788; - goto yy225; -yy786: yyaccept = 72; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy787; - if(yych <= '9') goto yy224; - goto yy787; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy787; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy787; - } else { - if(yych == '`') goto yy787; - if(yych <= 'z') goto yy224; - goto yy787; - } - } -yy787: -#line 450 "cpp.re" -{ RET(T_INT); } -#line 6978 "cpp_re.cpp" -yy788: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy789; -yy789: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy790; -yy790: yyaccept = 73; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy791; - if(yych <= '9') goto yy224; - goto yy791; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy791; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy791; - } else { - if(yych == '`') goto yy791; - if(yych <= 'z') goto yy224; - goto yy791; - } - } -yy791: -#line 449 "cpp.re" -{ RET(T_INLINE); } -#line 7012 "cpp_re.cpp" -yy792: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy793; -yy793: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'o') goto yy225; - goto yy794; -yy794: yyaccept = 74; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy795; - if(yych <= '9') goto yy224; - goto yy795; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy795; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy795; - } else { - if(yych == '`') goto yy795; - if(yych <= 'z') goto yy224; - goto yy795; - } - } -yy795: -#line 447 "cpp.re" -{ RET(T_GOTO); } -#line 7046 "cpp_re.cpp" -yy796: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'l') goto yy811; - goto yy225; -yy797: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy807; - goto yy225; -yy798: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'r') goto yy805; - goto yy225; -yy799: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy800; -yy800: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy801; -yy801: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy802; -yy802: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy803; -yy803: yyaccept = 75; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy804; - if(yych <= '9') goto yy224; - goto yy804; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy804; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy804; - } else { - if(yych == '`') goto yy804; - if(yych <= 'z') goto yy224; - goto yy804; - } - } -yy804: -#line 446 "cpp.re" -{ RET(T_FRIEND); } -#line 7100 "cpp_re.cpp" -yy805: yyaccept = 76; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy806; - if(yych <= '9') goto yy224; - goto yy806; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy806; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy806; - } else { - if(yych == '`') goto yy806; - if(yych <= 'z') goto yy224; - goto yy806; - } - } -yy806: -#line 445 "cpp.re" -{ RET(T_FOR); } -#line 7126 "cpp_re.cpp" -yy807: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy808; -yy808: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy809; -yy809: yyaccept = 77; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy810; - if(yych <= '9') goto yy224; - goto yy810; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy810; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy810; - } else { - if(yych == '`') goto yy810; - if(yych <= 'z') goto yy224; - goto yy810; - } - } -yy810: -#line 444 "cpp.re" -{ RET(T_FLOAT); } -#line 7160 "cpp_re.cpp" -yy811: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy812; -yy812: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy813; -yy813: yyaccept = 78; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy814; - if(yych <= '9') goto yy224; - goto yy814; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy814; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy814; - } else { - if(yych == '`') goto yy814; - if(yych <= 'z') goto yy224; - goto yy814; - } - } -yy814: -#line 443 "cpp.re" -{ RET(T_FALSE); } -#line 7194 "cpp_re.cpp" -yy815: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 's') goto yy837; - goto yy225; -yy816: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'u') goto yy834; - goto yy225; -yy817: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'p') goto yy818; - if(yych == 't') goto yy819; - goto yy225; -yy818: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'l') goto yy824; - if(yych == 'o') goto yy825; - goto yy225; -yy819: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy820; -yy820: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy821; -yy821: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy822; -yy822: yyaccept = 79; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy823; - if(yych <= '9') goto yy224; - goto yy823; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy823; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy823; - } else { - if(yych == '`') goto yy823; - if(yych <= 'z') goto yy224; - goto yy823; - } - } -yy823: -#line 442 "cpp.re" -{ RET(T_EXTERN); } -#line 7250 "cpp_re.cpp" -yy824: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'i') goto yy829; - goto yy225; -yy825: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy826; -yy826: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy827; -yy827: yyaccept = 80; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy828; - if(yych <= '9') goto yy224; - goto yy828; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy828; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy828; - } else { - if(yych == '`') goto yy828; - if(yych <= 'z') goto yy224; - goto yy828; - } - } -yy828: -#line 441 "cpp.re" -{ RET(T_EXPORT); } -#line 7288 "cpp_re.cpp" -yy829: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy830; -yy830: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy831; -yy831: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy832; -yy832: yyaccept = 81; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy833; - if(yych <= '9') goto yy224; - goto yy833; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy833; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy833; - } else { - if(yych == '`') goto yy833; - if(yych <= 'z') goto yy224; - goto yy833; - } - } -yy833: -#line 440 "cpp.re" -{ RET(T_EXPLICIT); } -#line 7326 "cpp_re.cpp" -yy834: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'm') goto yy225; - goto yy835; -yy835: yyaccept = 82; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy836; - if(yych <= '9') goto yy224; - goto yy836; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy836; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy836; - } else { - if(yych == '`') goto yy836; - if(yych <= 'z') goto yy224; - goto yy836; - } - } -yy836: -#line 439 "cpp.re" -{ RET(T_ENUM); } -#line 7356 "cpp_re.cpp" -yy837: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy838; -yy838: yyaccept = 83; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy839; - if(yych <= '9') goto yy224; - goto yy839; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy839; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy839; - } else { - if(yych == '`') goto yy839; - if(yych <= 'z') goto yy224; - goto yy839; - } - } -yy839: -#line 438 "cpp.re" -{ RET(T_ELSE); } -#line 7386 "cpp_re.cpp" -yy840: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'f') goto yy860; - if(yych == 'l') goto yy861; - goto yy225; -yy841: yyaccept = 84; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= '['){ - if(yych <= '>'){ - if(yych <= '/') goto yy842; - if(yych <= '9') goto yy224; - goto yy842; - } else { - if(yych <= '?') goto yy227; - if(yych <= '@') goto yy842; - if(yych <= 'Z') goto yy224; - goto yy842; - } - } else { - if(yych <= '`'){ - if(yych <= '\\') goto yy226; - if(yych == '_') goto yy224; - goto yy842; - } else { - if(yych == 'u') goto yy855; - if(yych <= 'z') goto yy224; - goto yy842; - } - } -yy842: -#line 435 "cpp.re" -{ RET(T_DO); } -#line 7419 "cpp_re.cpp" -yy843: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy844; -yy844: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy845; -yy845: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'm') goto yy225; - goto yy846; -yy846: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy847; -yy847: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy848; -yy848: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != '_') goto yy225; - goto yy849; -yy849: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy850; -yy850: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy851; -yy851: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy852; -yy852: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy853; -yy853: yyaccept = 85; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy854; - if(yych <= '9') goto yy224; - goto yy854; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy854; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy854; - } else { - if(yych == '`') goto yy854; - if(yych <= 'z') goto yy224; - goto yy854; - } - } -yy854: -#line 437 "cpp.re" -{ RET(T_DYNAMICCAST); } -#line 7485 "cpp_re.cpp" -yy855: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'b') goto yy225; - goto yy856; -yy856: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy857; -yy857: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy858; -yy858: yyaccept = 86; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy859; - if(yych <= '9') goto yy224; - goto yy859; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy859; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy859; - } else { - if(yych == '`') goto yy859; - if(yych <= 'z') goto yy224; - goto yy859; - } - } -yy859: -#line 436 "cpp.re" -{ RET(T_DOUBLE); } -#line 7523 "cpp_re.cpp" -yy860: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy866; - goto yy225; -yy861: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy862; -yy862: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy863; -yy863: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy864; -yy864: yyaccept = 87; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy865; - if(yych <= '9') goto yy224; - goto yy865; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy865; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy865; - } else { - if(yych == '`') goto yy865; - if(yych <= 'z') goto yy224; - goto yy865; - } - } -yy865: -#line 434 "cpp.re" -{ RET(T_DELETE); } -#line 7565 "cpp_re.cpp" -yy866: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'u') goto yy225; - goto yy867; -yy867: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy868; -yy868: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy869; -yy869: yyaccept = 88; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy870; - if(yych <= '9') goto yy224; - goto yy870; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy870; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy870; - } else { - if(yych == '`') goto yy870; - if(yych <= 'z') goto yy224; - goto yy870; - } - } -yy870: -#line 433 "cpp.re" -{ RET(T_DEFAULT); } -#line 7603 "cpp_re.cpp" -yy871: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'r') goto yy225; - if(yych <= 's') goto yy902; - if(yych <= 't') goto yy903; - goto yy225; -yy872: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy899; - goto yy225; -yy873: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy895; - goto yy225; -yy874: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'l') goto yy225; - if(yych <= 'm') goto yy876; - if(yych >= 'o') goto yy225; - goto yy875; -yy875: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'r') goto yy225; - if(yych <= 's') goto yy880; - if(yych <= 't') goto yy881; - goto yy225; -yy876: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'p') goto yy225; - goto yy877; -yy877: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy878; -yy878: yyaccept = 89; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy879; - if(yych <= '9') goto yy224; - goto yy879; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy879; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy879; - } else { - if(yych == '`') goto yy879; - if(yych <= 'z') goto yy224; - goto yy879; - } - } -yy879: -#line 564 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_COMPL_ALT); } -#line 7663 "cpp_re.cpp" -yy880: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 't') goto yy887; - goto yy225; -yy881: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'i') goto yy225; - goto yy882; -yy882: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'n') goto yy225; - goto yy883; -yy883: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'u') goto yy225; - goto yy884; -yy884: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy885; -yy885: yyaccept = 90; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy886; - if(yych <= '9') goto yy224; - goto yy886; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy886; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy886; - } else { - if(yych == '`') goto yy886; - if(yych <= 'z') goto yy224; - goto yy886; - } - } -yy886: -#line 432 "cpp.re" -{ RET(T_CONTINUE); } -#line 7709 "cpp_re.cpp" -yy887: yyaccept = 91; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy888; - if(yych <= '9') goto yy224; - goto yy888; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy888; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy888; - } else { - if(yych <= '_') goto yy889; - if(yych <= '`') goto yy888; - if(yych <= 'z') goto yy224; - goto yy888; - } - } -yy888: -#line 430 "cpp.re" -{ RET(T_CONST); } -#line 7736 "cpp_re.cpp" -yy889: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy890; -yy890: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy891; -yy891: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy892; -yy892: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy893; -yy893: yyaccept = 92; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy894; - if(yych <= '9') goto yy224; - goto yy894; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy894; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy894; - } else { - if(yych == '`') goto yy894; - if(yych <= 'z') goto yy224; - goto yy894; - } - } -yy894: -#line 431 "cpp.re" -{ RET(T_CONSTCAST); } -#line 7778 "cpp_re.cpp" -yy895: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy896; -yy896: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 's') goto yy225; - goto yy897; -yy897: yyaccept = 93; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy898; - if(yych <= '9') goto yy224; - goto yy898; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy898; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy898; - } else { - if(yych == '`') goto yy898; - if(yych <= 'z') goto yy224; - goto yy898; - } - } -yy898: -#line 429 "cpp.re" -{ RET(T_CLASS); } -#line 7812 "cpp_re.cpp" -yy899: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy900; -yy900: yyaccept = 94; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy901; - if(yych <= '9') goto yy224; - goto yy901; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy901; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy901; - } else { - if(yych == '`') goto yy901; - if(yych <= 'z') goto yy224; - goto yy901; - } - } -yy901: -#line 428 "cpp.re" -{ RET(T_CHAR); } -#line 7842 "cpp_re.cpp" -yy902: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'e') goto yy907; - goto yy225; -yy903: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'c') goto yy225; - goto yy904; -yy904: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'h') goto yy225; - goto yy905; -yy905: yyaccept = 95; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy906; - if(yych <= '9') goto yy224; - goto yy906; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy906; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy906; - } else { - if(yych == '`') goto yy906; - if(yych <= 'z') goto yy224; - goto yy906; - } - } -yy906: -#line 427 "cpp.re" -{ RET(T_CATCH); } -#line 7880 "cpp_re.cpp" -yy907: yyaccept = 96; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy908; - if(yych <= '9') goto yy224; - goto yy908; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy908; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy908; - } else { - if(yych == '`') goto yy908; - if(yych <= 'z') goto yy224; - goto yy908; - } - } -yy908: -#line 426 "cpp.re" -{ RET(T_CASE); } -#line 7906 "cpp_re.cpp" -yy909: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 't') goto yy919; - goto yy225; -yy910: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'o') goto yy916; - goto yy225; -yy911: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy912; -yy912: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'a') goto yy225; - goto yy913; -yy913: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'k') goto yy225; - goto yy914; -yy914: yyaccept = 97; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy915; - if(yych <= '9') goto yy224; - goto yy915; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy915; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy915; - } else { - if(yych == '`') goto yy915; - if(yych <= 'z') goto yy224; - goto yy915; - } - } -yy915: -#line 425 "cpp.re" -{ RET(T_BREAK); } -#line 7952 "cpp_re.cpp" -yy916: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'l') goto yy225; - goto yy917; -yy917: yyaccept = 98; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy918; - if(yych <= '9') goto yy224; - goto yy918; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy918; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy918; - } else { - if(yych == '`') goto yy918; - if(yych <= 'z') goto yy224; - goto yy918; - } - } -yy918: -#line 424 "cpp.re" -{ RET(T_BOOL); } -#line 7982 "cpp_re.cpp" -yy919: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'a') goto yy920; - if(yych == 'o') goto yy921; - goto yy225; -yy920: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'n') goto yy924; - goto yy225; -yy921: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'r') goto yy225; - goto yy922; -yy922: yyaccept = 99; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy923; - if(yych <= '9') goto yy224; - goto yy923; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy923; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy923; - } else { - if(yych == '`') goto yy923; - if(yych <= 'z') goto yy224; - goto yy923; - } - } -yy923: -#line 560 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_OR_ALT); } -#line 8021 "cpp_re.cpp" -yy924: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'd') goto yy225; - goto yy925; -yy925: yyaccept = 100; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy926; - if(yych <= '9') goto yy224; - goto yy926; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy926; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy926; - } else { - if(yych == '`') goto yy926; - if(yych <= 'z') goto yy224; - goto yy926; - } - } -yy926: -#line 558 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_AND_ALT); } -#line 8051 "cpp_re.cpp" -yy927: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'd') goto yy935; - goto yy225; -yy928: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych == 'm') goto yy933; - goto yy225; -yy929: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 't') goto yy225; - goto yy930; -yy930: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'o') goto yy225; - goto yy931; -yy931: yyaccept = 101; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy932; - if(yych <= '9') goto yy224; - goto yy932; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy932; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy932; - } else { - if(yych == '`') goto yy932; - if(yych <= 'z') goto yy224; - goto yy932; - } - } -yy932: -#line 423 "cpp.re" -{ RET(T_AUTO); } -#line 8093 "cpp_re.cpp" -yy933: yyaccept = 102; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy934; - if(yych <= '9') goto yy224; - goto yy934; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy934; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy934; - } else { - if(yych == '`') goto yy934; - if(yych <= 'z') goto yy224; - goto yy934; - } - } -yy934: -#line 422 "cpp.re" -{ RET(T_ASM); } -#line 8119 "cpp_re.cpp" -yy935: yyaccept = 103; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy936; - if(yych <= '9') goto yy224; - goto yy936; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy936; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy936; - } else { - if(yych <= '_') goto yy937; - if(yych <= '`') goto yy936; - if(yych <= 'z') goto yy224; - goto yy936; - } - } -yy936: -#line 593 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ANDAND_ALT); } -#line 8146 "cpp_re.cpp" -yy937: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'e') goto yy225; - goto yy938; -yy938: yyaccept = 0; - yych = *(YYMARKER = ++YYCURSOR); - if(yych != 'q') goto yy225; - goto yy939; -yy939: yyaccept = 104; - yych = *(YYMARKER = ++YYCURSOR); - if(yych <= 'Z'){ - if(yych <= '>'){ - if(yych <= '/') goto yy940; - if(yych <= '9') goto yy224; - goto yy940; - } else { - if(yych <= '?') goto yy227; - if(yych >= 'A') goto yy224; - goto yy940; - } - } else { - if(yych <= '^'){ - if(yych == '\\') goto yy226; - goto yy940; - } else { - if(yych == '`') goto yy940; - if(yych <= 'z') goto yy224; - goto yy940; - } - } -yy940: -#line 579 "cpp.re" -{ RET(s->act_in_c99_mode ? T_IDENTIFIER : T_ANDASSIGN_ALT); } -#line 8180 "cpp_re.cpp" -yy941: ++YYCURSOR; - goto yy942; -yy942: -#line 573 "cpp.re" -{ RET(T_DIVIDEASSIGN); } -#line 8186 "cpp_re.cpp" -yy943: ++YYCURSOR; - goto yy944; -yy944: -#line 420 "cpp.re" -{ goto cppcomment; } -#line 8192 "cpp_re.cpp" -yy945: ++YYCURSOR; - goto yy946; -yy946: -#line 419 "cpp.re" -{ goto ccomment; } -#line 8198 "cpp_re.cpp" -} -#line 692 "cpp.re" - - -ccomment: - -#line 8205 "cpp_re.cpp" -{ - YYCTYPE yych; - goto yy947; - ++YYCURSOR; -yy947: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= 0x0C){ - if(yych <= 0x08){ - if(yych <= 0x00) goto yy956; - goto yy949; - } else { - if(yych == 0x0A) goto yy952; - goto yy955; - } - } else { - if(yych <= 0x1F){ - if(yych <= 0x0D) goto yy954; - goto yy949; - } else { - if(yych == '*') goto yy950; - goto yy955; - } - } -yy949:yy950: ++YYCURSOR; - if((yych = *YYCURSOR) == '/') goto yy959; - goto yy951; -yy951: -#line 707 "cpp.re" -{ goto ccomment; } -#line 8236 "cpp_re.cpp" -yy952: ++YYCURSOR; - goto yy953; -yy953: -#line 699 "cpp.re" -{ - /*if(cursor == s->eof) RET(T_EOF);*/ - /*s->tok = cursor; */ - s->line += count_backslash_newlines(s, cursor) +1; - cursor.column = 1; - goto ccomment; - } -#line 8248 "cpp_re.cpp" -yy954: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy958; - goto yy953; -yy955: yych = *++YYCURSOR; - goto yy951; -yy956: ++YYCURSOR; - goto yy957; -yy957: -#line 710 "cpp.re" -{ - using namespace std; // some systems have printf in std - if(cursor == s->eof) - { - if (s->error_proc) - (*s->error_proc)(s, "Unterminated comment"); - else - printf("Error: Unterminated comment\n"); - } - else - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CCOMMENT); - } -#line 8279 "cpp_re.cpp" -yy958: yych = *++YYCURSOR; - goto yy953; -yy959: ++YYCURSOR; - goto yy960; -yy960: -#line 696 "cpp.re" -{ RET(T_CCOMMENT); } -#line 8287 "cpp_re.cpp" -} -#line 732 "cpp.re" - - -cppcomment: - -#line 8294 "cpp_re.cpp" -{ - YYCTYPE yych; - goto yy961; - ++YYCURSOR; -yy961: - if((YYLIMIT - YYCURSOR) < 2) YYFILL(2); - yych = *YYCURSOR; - if(yych <= 0x0A){ - if(yych <= 0x00) goto yy969; - if(yych <= 0x08) goto yy963; - if(yych <= 0x09) goto yy967; - goto yy964; - } else { - if(yych <= 0x0C) goto yy967; - if(yych <= 0x0D) goto yy966; - if(yych >= ' ') goto yy967; - goto yy963; - } -yy963:yy964: ++YYCURSOR; - goto yy965; -yy965: -#line 737 "cpp.re" -{ - /*if(cursor == s->eof) RET(T_EOF); */ - /*s->tok = cursor; */ - s->line++; - cursor.column = 1; - RET(T_CPPCOMMENT); - } -#line 8324 "cpp_re.cpp" -yy966: yych = *++YYCURSOR; - if(yych == 0x0A) goto yy971; - goto yy965; -yy967: ++YYCURSOR; - goto yy968; -yy968: -#line 745 "cpp.re" -{ goto cppcomment; } -#line 8333 "cpp_re.cpp" -yy969: ++YYCURSOR; - goto yy970; -yy970: -#line 748 "cpp.re" -{ - using namespace std; // some systems have printf in std - if(cursor != s->eof) - { - if (s->error_proc) - (*s->error_proc)(s, "'\\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 */ - RET(T_CPPCOMMENT); - } -#line 8352 "cpp_re.cpp" -yy971: ++YYCURSOR; - yych = *YYCURSOR; - goto yy965; -} -#line 762 "cpp.re" - - -} /* end of scan */ - -/////////////////////////////////////////////////////////////////////////////// -} // namespace re2clex -} // namespace cpplexer -} // namespace wave -} // namespace boost - -#undef RET -#undef BSIZE -#undef YYCTYPE -#undef YYCURSOR -#undef YYLIMIT -#undef YYMARKER -#undef YYFILL - diff --git a/src/instantiate_cpp_exprgrammar.cpp b/src/instantiate_cpp_exprgrammar.cpp deleted file mode 100644 index 737c894..0000000 --- a/src/instantiate_cpp_exprgrammar.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - -#include -#include - -#include -#include - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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) -// -/////////////////////////////////////////////////////////////////////////////// - -typedef boost::wave::cpplexer::lex_token<> token_type; - -template struct boost::wave::grammars::expression_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/src/instantiate_cpp_grammar.cpp b/src/instantiate_cpp_grammar.cpp deleted file mode 100644 index 4746dd6..0000000 --- a/src/instantiate_cpp_grammar.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - -#include - -#include -#include - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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_iterator< - boost::wave::cpplexer::lex_token<> > - lexer_type; -template struct boost::wave::grammars::cpp_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/src/instantiate_cpp_literalgrs.cpp b/src/instantiate_cpp_literalgrs.cpp deleted file mode 100644 index c634b47..0000000 --- a/src/instantiate_cpp_literalgrs.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - -#include - -#include -#include - -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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; - -template struct boost::wave::grammars::intlit_grammar_gen; -template struct boost::wave::grammars::chlit_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/src/instantiate_defined_grammar.cpp b/src/instantiate_defined_grammar.cpp deleted file mode 100644 index 7ba6854..0000000 --- a/src/instantiate_defined_grammar.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - -#include - -#include -#include - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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< - boost::wave::cpplexer::lex_token<> > - lexer_type; -template struct boost::wave::grammars::defined_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/src/instantiate_predef_macros.cpp b/src/instantiate_predef_macros.cpp deleted file mode 100644 index 4427326..0000000 --- a/src/instantiate_predef_macros.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 - -#if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - -#include - -#include -#include - -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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::cpplexer::lex_iterator< - boost::wave::cpplexer::lex_token<> > - lexer_type; -template struct boost::wave::grammars::predefined_macros_grammar_gen; - -#endif // #if BOOST_WAVE_SEPARATE_GRAMMAR_INSTANTIATION != 0 - diff --git a/src/instantiate_re2c_lexer.cpp b/src/instantiate_re2c_lexer.cpp deleted file mode 100644 index e522cd5..0000000 --- a/src/instantiate_re2c_lexer.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - Explicit instantiation of the lex_functor generation function - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 // configuration data - -#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 - -#include - -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// The following file needs to be included only once throughout the whole -// program. -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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< - BOOST_WAVE_STRINGTYPE::iterator>; - -#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/src/instantiate_re2c_lexer_str.cpp b/src/instantiate_re2c_lexer_str.cpp deleted file mode 100644 index a504f32..0000000 --- a/src/instantiate_re2c_lexer_str.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Boost.Wave: A Standard compliant C++ preprocessor library - Explicit instantiation of the lex_functor generation function - - http://www.boost.org/ - - Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the 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 // configuration data - -#if BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 - -#include - -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////////// -// The following file needs to be included only once throughout the whole -// program. -#include - -/////////////////////////////////////////////////////////////////////////////// -// -// 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::cpplexer::new_lexer_gen; - -#endif // BOOST_WAVE_SEPARATE_LEXER_INSTANTIATION != 0 diff --git a/test/build/Jamfile b/test/build/Jamfile deleted file mode 100644 index 3c21628..0000000 --- a/test/build/Jamfile +++ /dev/null @@ -1,136 +0,0 @@ -# Boost.Wave: A Standard compliant C++ preprocessor library -# -# Boost Wave Library Test Jamfile -# -# http://www.boost.org/ -# -# Copyright (c) 2001-2005 Hartmut Kaiser. Distributed under the Boost -# Software License, Version 1.0. (See accompanying file -# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -subproject libs/wave/test/build ; - -# bring in the rules for testing -import testing ; - -# Make tests run by default. -DEPENDS all : test ; - -# -# These are the sources to compile for the testwave application -# -TESTWAVE_SOURCES = testwave testwave_app ; - -# -# This is the directory where the test files reside -# -TESTWAVE_DIR = $(BOOST_ROOT)/libs/wave/test/testwave/testfiles - ; - -# -# This are the arguments for the testwave executable -# -TESTWAVE_ARGUMENTS = - -d9 # use -d4 for verbose results - -S$(TESTWAVE_DIR) - -S$(BOOST_ROOT) -I$(BOOST_ROOT) - ; - -# -# These are the names of the different unit tests to run -# -TESTWAVE_FILES = test.cfg - ; - -# -# this template defines the options common to all wave lexer tests: -# -template wave-lexer-test - : - ../../build/boost_wave # sources - : - $(BOOST_ROOT) - $(BOOST_ROOT) - <*>off # workaround for compiler bug - std::locale-support - : - static - single - debug # build variants - ; - -# -# this template defines the options common to all wave tests: -# -template wave-test - : - ../../build/boost_wave # sources - ../../../program_options/build/boost_program_options - ../../../filesystem/build/boost_filesystem - : - $(BOOST_ROOT) - $(BOOST_ROOT) - <*>off # workaround for compiler bug - std::locale-support - : - static - single - debug # build variants - ; - -# -# Wave test suite -# -test-suite wave - : - # test the wave preprocessing component - [ - run - # sources -