Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73589 - in trunk: boost/wave libs/wave libs/wave/doc libs/wave/samples/cpp_tokens libs/wave/samples/cpp_tokens/slex
From: hartmut.kaiser_at_[hidden]
Date: 2011-08-06 21:27:32


Author: hkaiser
Date: 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
New Revision: 73589
URL: http://svn.boost.org/trac/boost/changeset/73589

Log:
Wave: adding support_option_emit_contnewlines for the SLex lexer only.
Text files modified:
   trunk/boost/wave/language_support.hpp | 6 ++++--
   trunk/libs/wave/ChangeLog | 8 ++++++++
   trunk/libs/wave/doc/class_reference_context.html | 6 ++++--
   trunk/libs/wave/index.html | 4 ++--
   trunk/libs/wave/samples/cpp_tokens/cpp_tokens.cpp | 1 +
   trunk/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp | 10 ++++++----
   6 files changed, 25 insertions(+), 10 deletions(-)

Modified: trunk/boost/wave/language_support.hpp
==============================================================================
--- trunk/boost/wave/language_support.hpp (original)
+++ trunk/boost/wave/language_support.hpp 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -26,7 +26,7 @@
 // support flags for C++98
     support_normal = 0x01,
     support_cpp = support_normal,
-
+
     support_option_long_long = 0x02,
 
 #if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
@@ -38,7 +38,8 @@
     support_cpp0x = support_option_variadics | support_option_long_long | 0x10,
 #endif
 
- support_option_mask = 0xFF80,
+ support_option_mask = 0xFFB0,
+ support_option_emit_contnewlines = 0x0040,
     support_option_insert_whitespace = 0x0080,
     support_option_preserve_comments = 0x0100,
     support_option_no_character_validation = 0x0200,
@@ -196,6 +197,7 @@
 BOOST_WAVE_OPTION(emit_pragma_directives) // support_option_emit_pragma_directives
 #endif
 BOOST_WAVE_OPTION(insert_whitespace) // support_option_insert_whitespace
+BOOST_WAVE_OPTION(emit_contnewlines) // support_option_emit_contnewlines
 
 #undef BOOST_WAVE_NEED_OPTION
 #undef BOOST_WAVE_ENABLE_OPTION

Modified: trunk/libs/wave/ChangeLog
==============================================================================
--- trunk/libs/wave/ChangeLog (original)
+++ trunk/libs/wave/ChangeLog 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -20,6 +20,14 @@
 
 CHANGELOG
 
+Boost V1.48.0
+ - V2.3.1
+ - Added the flag support_option_emit_contnewlines allowing to control whether
+ backslash newline sequences are emitted by the Wave library. The default is
+ as before: these tokens will be silently ignored (after the token positions
+ have been properly updated). Note: this option is supported by the SLex lexer
+ module only.
+
 Boost V1.47.0
 - V2.3.0
 - After preprocessing the body of any #pragma wave option() the wave tool now

Modified: trunk/libs/wave/doc/class_reference_context.html
==============================================================================
--- trunk/libs/wave/doc/class_reference_context.html (original)
+++ trunk/libs/wave/doc/class_reference_context.html 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -381,7 +381,8 @@
   <p>This functions allows to specify the language mode, in which
     the <tt>Wave</tt> library should work. The possible
     language modes are defined by the enumerated type <tt>language_support</tt>:</p>
- <pre> <span class="keyword">enum</span> language_support {<br> <span class="comment">// support flags for C++98</span><br> support_normal = 0x01,<br> support_cpp = support_normal,<br><span class="comment"><br> // support flags for C99</span><br> support_option_long_long = 0x02,<br> support_option_variadics = 0x04,<br> support_c99 = support_option_variadics | support_option_long_long | 0x08,<br><span class="comment"><br> // the mask for the main language settings</span><br> support_option_mask = 0xFF80,<br><br><span class="comment"> // additional fine tuning of the general behavior</span><br> support_option_insert_whitespace = 0x0080,<br> support_option_preserve_comments = 0x0100,<br> support_option_no_character_validation = 0x0200,<br> support_option_convert_trigraphs = 0x0400,<br> support_option_single_line = 0x0800,<br> support_option_prefer_pp_numbers = 0x1000,<br> support_option_emit_line_directiv
es = 0x2000,<br> support_option_include_guard_detection = 0x4000,<br> support_option_emit_pragma_directives = 0x8000<br> };</pre>
+ <pre> <span class="keyword">enum</span> language_support {<br> <span class="comment">// support flags for C++98</span><br> support_normal = 0x01,<br> support_cpp = support_normal,<br><span class="comment"><br> // support flags for C99</span><br> support_option_long_long = 0x02,<br> support_option_variadics = 0x04,<br> support_c99 = support_option_variadics | support_option_long_long | 0x08,<br><span class="comment"><br> // the mask for the main language settings</span><br> support_option_mask = 0xFFB0,<br><br><span class="comment"> // additional fine tuning of the general behavior</span>
+ support_option_emit_contline = 0x0040,<br> support_option_insert_whitespace = 0x0080,<br> support_option_preserve_comments = 0x0100,<br> support_option_no_character_validation = 0x0200,<br> support_option_convert_trigraphs = 0x0400,<br> support_option_single_line = 0x0800,<br> support_option_prefer_pp_numbers = 0x1000,<br> support_option_emit_line_directives = 0x2000,<br> support_option_include_guard_detection = 0x4000,<br> support_option_emit_pragma_directives = 0x8000<br> };</pre>
   <p>When used with <tt>support_option_variadics</tt> the support for variadics, placemarkers and the <tt>operator&nbsp;_Pragma()</tt> is enabled in normal C++ mode. When used with the <tt>support_option_long_long</tt> the support for long long suffixes is enabled in C++ mode. </p>
   <p>The <tt>support_c99</tt> switches on the C99
     language support, which enables variadics, placemarkers, the <tt>operator&nbsp;_Pragma</tt> and long long suffixes by default. Additionally it disables the C++
@@ -444,6 +445,7 @@
       the <tt>BOOST_WAVE_EMIT_PRAGMA_DIRECTIVES</tt> is defined
       during compilation to a value not equal to zero (see here for more
       information). </li>
+ <li>If the <tt>support_option_emit_contlines</tt> flag is set, the <tt>Wave</tt> library will emit all backslash newline sequences encountered in the input. It will generate a <tt>T_CONTLINE</tt> token for each of those character sequences. Please note that this option is supported by the custom SLex lexer module only. See the cpp_tokens example for a working example.</li>
   </ul>
   <p><strong> </strong>If the parameter <tt>reset_macros</tt> is true the <tt>set_language</tt> function internally
     resets the list of defined macros, so please be careful not to call it
@@ -476,7 +478,7 @@
 <span class="updated"></span>
 <p class="copyright"><span class="updated">Last
   updated:
- <!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:14<!-- #EndDate -->
+ <!-- #BeginDate format:fcAm1m -->Saturday, August 6, 2011 20:22<!-- #EndDate -->
   </span> </p>
 <p>&nbsp;</p>
 </body>

Modified: trunk/libs/wave/index.html
==============================================================================
--- trunk/libs/wave/index.html (original)
+++ trunk/libs/wave/index.html 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -10,7 +10,7 @@
   <tbody>
     <tr>
       <td width="21">&nbsp;</td>
- <td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.0</b></font></td>
+ <td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.3</b></font></td>
       <td width="96"></td>
     </tr>
   </tbody>
@@ -100,7 +100,7 @@
   http://www.boost.org/LICENSE_1_0.txt) </font> </p>
 <span class="updated"></span>
 <p class="copyright"><span class="updated">Last updated:
- <!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:31<!-- #EndDate -->
+ <!-- #BeginDate format:fcAm1m -->Saturday, August 6, 2011 20:16<!-- #EndDate -->
   </span></p>
 </body>
 </html>

Modified: trunk/libs/wave/samples/cpp_tokens/cpp_tokens.cpp
==============================================================================
--- trunk/libs/wave/samples/cpp_tokens/cpp_tokens.cpp (original)
+++ trunk/libs/wave/samples/cpp_tokens/cpp_tokens.cpp 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -94,6 +94,7 @@
     ctx.set_language(boost::wave::support_cpp0x);
     ctx.set_language(boost::wave::enable_preserve_comments(ctx.get_language()));
     ctx.set_language(boost::wave::enable_prefer_pp_numbers(ctx.get_language()));
+ ctx.set_language(boost::wave::enable_emit_contnewlines(ctx.get_language()));
 
     context_type::iterator_type first = ctx.begin();
     context_type::iterator_type last = ctx.end();

Modified: trunk/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp
==============================================================================
--- trunk/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp (original)
+++ trunk/libs/wave/samples/cpp_tokens/slex/cpp_slex_lexer.hpp 2011-08-06 21:27:31 EDT (Sat, 06 Aug 2011)
@@ -637,8 +637,10 @@
                     id = T_EOF; // end of input reached
 
             string_type token_val(value.c_str());
-
- if (T_CONTLINE != id) {
+
+ if (boost::wave::need_emit_contnewlines(language) ||
+ T_CONTLINE != id)
+ {
                 // The cast should avoid spurious warnings about missing case labels
                 // for the other token ids's.
                     switch (static_cast<unsigned int>(id)) {
@@ -673,7 +675,7 @@
                                 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
@@ -706,7 +708,7 @@
                         at_eof = true;
                         token_val.clear();
                         break;
-
+
                     case T_OR_TRIGRAPH:
                     case T_XOR_TRIGRAPH:
                     case T_LEFTBRACE_TRIGRAPH:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk