Skip to content

Commit

Permalink
Wave V1.1.17.
Browse files Browse the repository at this point in the history
[SVN r28744]
  • Loading branch information
hkaiser committed May 8, 2005
1 parent 1aa523c commit e26d617
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 57 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ TODO (known issues):

CHANGELOG

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

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 overflow in #if/#elif
expressions.
Expand Down
4 changes: 2 additions & 2 deletions doc/acknowledgements.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<p><b>Martin Wille</b> for helping with the port to Linux, testing on Linux and for contributing
the automated test scripts.</p>
<p><b>Vladimir Prus</b> for helping with the command line and config file options
analysis fro the <tt>Wave</tt> driver executable.</p>
analysis for the <tt>Wave</tt> driver executable.</p>
<p><b>Juan Carlos Arevalo-Baeza</b>, who wrote the Spirit cpp_lexer sample,
from which are taken some ideas.</p>
<p> <strong>Andrei Alexandrescu</strong> for allowing to use his flex_string class,
Expand Down Expand Up @@ -85,7 +85,7 @@
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</font> </p>
<span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Wednesday, March 16, 2005 8:16<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 17:39<!-- #EndDate -->
</span>
</body>
</html>
28 changes: 20 additions & 8 deletions doc/class_reference_context.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ <h2><b><a name="member_functions"></a>Member functions</b></h2>
<p><b><a name="constructor" id="constructor"></a>Constructor</b></p>
<pre> context(IteratorT <span class="keyword">const</span> &amp;first,
IteratorT <span class="keyword">const</span> &amp;last,
<span class="keyword"><!-- #BeginDate format:fcAm1m -->Monday, April 4, 2005 7:45<!-- #EndDate -->e>
<span class="keyword"><!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 17:58<!-- #EndDate -->e>
<p>Constructs a context object on top of the input stream given by the pair
of auxilliary iterators <tt>[first,&nbsp;last)</tt>. The iterators should
be at least <tt>forward_iterator</tt> type iterators. The filename parameter
Expand Down Expand Up @@ -399,13 +399,25 @@ <h3>Control extended options</h3>
support_cpp = support_normal,

<span class="comment">// support flags for C99</span>
support_variadics = 0x02,
support_c99 = support_variadics,
};</pre>
support_long_long = 0x02,
support_variadics = 0x04,
support_c99 = support_variadics |
support_long_long | 0x08,

<span class="comment"> // the mask for the main language settings</span>
support_option_mask = 0xFF00,<br>
<span class="comment"> // additional fine tuning of the general behaviour</span>
support_option_preserve_comments = 0x0100,<br> support_option_no_character_validation = 0x0200,<br> support_option_convert_trigraphs = 0x0400<br> };</pre>
<p>When used with <tt>support_variadics</tt> the support for variadics, placemarkers
and the <tt>operator _Pragma()</tt> is enabled in normal C++ mode. The <tt>support_c99</tt>
switches to the C99 language support.</p>
</blockquote>
and the <tt>operator _Pragma()</tt> is enabled in normal C++ mode. When used with the <tt>support_long_long</tt> the support for long long suffixes is enabled in C++ mode. </p>
<p>The <tt>support_c99</tt> switches to the C99 language support, which enables variadics, placemarkers, the <tt>operator _Pragma</tt> and long long suffixes by default. Additionally it disables the C++ specific tokens such as <tt>'-&gt;*'</tt>, <tt>'.*'</tt>, <tt>'::'</tt> etc. </p>
<p>The <tt>support_option_...</tt> values are to be used in conjunction with the main language settings (<tt>support_normal</tt> and <tt>support_c99</tt>) . </p>
<ul>
<li>If the <tt>support_option_preserve_comments</tt> flag is set, the <tt>Wave</tt> 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. </li>
<li>If the <tt>support_option_no_character_validation</tt> flag is set , the <tt>Wave</tt> library doesn't validate universal character literals (given in the form of <tt>'u1234'</tt> or <tt>'U12345678'</tt>) 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.</li>
<li>If the <tt>support_option_convert_trigraphs</tt> flag is set, the <tt>Wave</tt> library replaces all occurences of trigraph characters with their non-trigraph character sequence (i.e. <tt>'??='</tt> is replaced by <tt>'#'</tt> etc.) . By default no replacement is performed. </li>
</ul>
</blockquote>
<p><strong>Note:</strong> 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. </p>
<p><a name="set_max_include_nesting_depth" id="set_max_include_nesting_depth"></a>set_max_include_nesting_depth<br>
g et_max_include_nesting_depth</p>
Expand All @@ -431,7 +443,7 @@ <h3>Control extended options</h3>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Monday, April 4, 2005 7:45<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 17:58<!-- #EndDate -->
</span>
</p>
<p>&nbsp;</p>
Expand Down
17 changes: 13 additions & 4 deletions doc/token_ids.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,25 @@
<td class="table_cells" > <p>IntegerLiteralTokenType</p></td>
<td class="table_cells" ><code>10</code></td>
</tr>
<tr>
<td class="table_cells" > <p>T_HEXAINT </p></td>
<td class="table_cells" > <p>IntegerLiteralTokenType</p></td>
<tr>
<td class="table_cells" >
<p>T_HEXAINT </p></td>
<td class="table_cells" >
<p>IntegerLiteralTokenType</p></td>
<td class="table_cells" ><code>0x1234</code></td>
</tr>
<tr>
<td class="table_cells" > <p>T_INTLIT </p></td>
<td class="table_cells" > <p>IntegerLiteralTokenType</p></td>
<td class="table_cells" ><code>T_OCTALINT, T_DECIMALINT or T_HEXAINT</code></td>
</tr>
<tr>
<td class="table_cells" >
<p>T_LONGINTLIT</p></td>
<td class="table_cells" >
<p>IntegerLiteralTokenType</p></td>
<td class="table_cells" ><code>0x1234LL</code></td>
</tr>
<tr>
<td class="table_cells" > <p>T_STRINGLIT </p></td>
<td class="table_cells" > <p>StringLiteralTokenType</p></td>
Expand Down Expand Up @@ -966,7 +975,7 @@
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Monday, January 17, 2005 16:39<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 19:47<!-- #EndDate -->
</span></p>
</body>
</html>
10 changes: 5 additions & 5 deletions doc/tracing_facility.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
the corresponding formal and actual parameters are listed.</li>
<li>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 intended by one level. Note though, that the macro expansion
of the actual arguments is traced, regardless of the fact, if this argument
is really to be inserted into the replacement list only after its expansion
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]: &quot;A parameter
in the replacement list, unless preceded by a <tt>#</tt> or <tt>##</tt> preprocessing
token or followed by a <tt>##</tt> preprocessing token, is replaced by the
Expand Down Expand Up @@ -154,10 +154,10 @@
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Wednesday, February 9, 2005 23:37<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 19:55<!-- #EndDate -->
</span>
</p>
</body>
</html>

<!-- #BeginDate format:fcAm1m -->Wednesday, February 9, 2005 23:37<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 19:55<!-- #EndDate -->
3 changes: 2 additions & 1 deletion doc/wave_driver.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
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 [-]
Expand Down Expand Up @@ -230,7 +231,7 @@
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Friday, March 25, 2005 19:35<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, May 8, 2005 19:55<!-- #EndDate -->
</span></p>
</body>
</html>
6 changes: 2 additions & 4 deletions include/boost/wave/cpplexer/re2clex/cpp_re2c_lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,14 @@ lexer<IteratorT, PositionT>::get()
break;
#endif

case T_LONGINTLIT: // supported in C99 and variadics mode
case T_LONGINTLIT: // supported in C99 and long_long mode
value = string_type((char const *)scanner.tok,
scanner.cur-scanner.tok);
#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
if (!boost::wave::need_variadics(language)) {
if (!boost::wave::need_long_long(language)) {
// syntax error: not allowed in C++ mode
BOOST_WAVE_LEXER_THROW(lexing_exception, invalid_long_long_literal,
value.c_str(), scanner.line, -1, filename.c_str());
}
#endif
break;

case T_OCTALINT:
Expand Down
53 changes: 35 additions & 18 deletions include/boost/wave/grammars/cpp_chlit_grammar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,82 +151,99 @@ struct chlit_grammar :
ch_p('\\')
>> ( ch_p('a') // BEL
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x07))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x07))
]
| ch_p('b') // BS
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x08))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x08))
]
| ch_p('t') // HT
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x09))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x09))
]
| ch_p('n') // NL
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x0a))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x0a))
]
| ch_p('v') // VT
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x0b))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x0b))
]
| ch_p('f') // FF
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x0c))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x0c))
]
| ch_p('r') // CR
[
impl::compose(self.value, self.long_lit, var(self.overflow), val(0x0d))
impl::compose(self.value, self.long_lit,
var(self.overflow), val(0x0d))
]
| ch_p('?')
[
impl::compose(self.value, self.long_lit, var(self.overflow), val('?'))
impl::compose(self.value, self.long_lit,
var(self.overflow), val('?'))
]
| ch_p('\'')
[
impl::compose(self.value, self.long_lit, var(self.overflow), val('\''))
impl::compose(self.value, self.long_lit,
var(self.overflow), val('\''))
]
| ch_p('\"')
[
impl::compose(self.value, self.long_lit, var(self.overflow), val('\"'))
impl::compose(self.value, self.long_lit,
var(self.overflow), val('\"'))
]
| ch_p('\\')
[
impl::compose(self.value, self.long_lit, var(self.overflow), val('\\'))
impl::compose(self.value, self.long_lit,
var(self.overflow), val('\\'))
]
| ch_p('x')
>> if_p(self.long_lit)
[
hex_wchar_parser_type()
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
]
.else_p
[
hex_char_parser_type()
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
]
| ch_p('u')
>> uint_parser<unsigned int, 16, 4, 4>()
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
| ch_p('U')
>> uint_parser<unsigned int, 16, 8, 8>()
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
| uint_parser<unsigned int, 8, 1, 3>()
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
)
)
| ~eps_p(ch_p('\'')) >> anychar_p
[
impl::compose(self.value, self.long_lit, var(self.overflow), arg1)
impl::compose(self.value, self.long_lit,
var(self.overflow), arg1)
]
)
>> ch_p('\'')
Expand All @@ -240,7 +257,7 @@ struct chlit_grammar :
{ return ch_lit; }
};

// flag for signaling integer overflow during value composition
// flag signaling integer overflow during value composition
mutable bool overflow;
};

Expand Down
34 changes: 32 additions & 2 deletions include/boost/wave/language_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ enum language_support {
support_normal = 0x01,
support_cpp = support_normal,

support_long_long = 0x02,

#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0
// support flags for C99
support_variadics = 0x02,
support_c99 = support_variadics | 0x04,
support_variadics = 0x04,
support_c99 = support_variadics | support_long_long | 0x08,
#endif

support_option_mask = 0xFF00,
Expand All @@ -47,6 +49,34 @@ need_cpp(language_support language)
return (language & ~support_option_mask) == support_cpp;
}

///////////////////////////////////////////////////////////////////////////////
//
// need_long_long
//
// Extract, if the language to support needs long long support
//
///////////////////////////////////////////////////////////////////////////////
inline bool
need_long_long(language_support language)
{
return (language & support_long_long) ? true : false;
}

///////////////////////////////////////////////////////////////////////////////
//
// enable_long_long
//
// Set long long support in the language to support
//
///////////////////////////////////////////////////////////////////////////////
inline language_support
enable_long_long(language_support language, bool enable = true)
{
if (enable)
return static_cast<language_support>(language | support_long_long);
return static_cast<language_support>(language & ~support_long_long);
}

#if BOOST_WAVE_SUPPORT_VARIADICS_PLACEMARKERS != 0

///////////////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit e26d617

Please sign in to comment.