2
0
mirror of https://github.com/boostorg/wave.git synced 2026-01-19 04:42:16 +00:00

bcbboost branch rebased on current release

[SVN r49389]
This commit is contained in:
Nicola Musatti
2008-10-19 14:43:01 +00:00
22 changed files with 2253 additions and 2228 deletions

View File

@@ -15,17 +15,25 @@ TODO (known issues):
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'.
- Change the cpp_exception::what() function to return more meaningful error
texts.
- Do a sourceforge release.
-------------------------------------------------------------------------------
CHANGELOG
Boost V1.36
- Wave Version 2.0
Boost V1.37.0
- Updated examples to reflect the recent changes in the used multi_pass
iterator.
- Fixed documentation links still pointing to the old Boost CVS (thanks to
Jürgen Hunold for providing the patch).
Boost V1.36.0
- Wave Version 2.0 is a new major release introducing some breaking API changes,
preventing it to be used with Boost versions earlier than V1.36.0. The API
and hook interface have been streamlined for more consistency. See the
documentation for more details.
- Added an additional template parameter to the context object, allowing to
specify any possibly derived type. This change propagates to the preprocessing
hooks, which now get passed the most derived context type as its first
@@ -47,7 +55,8 @@ Boost V1.36
preprocessing two consecutive tokens.
- Adjusted Spirit header includes to point to conform to the new directory
structure, removed support for Spirit versions earlier than V1.7.
- Started to migrate to new multi_pass iterators from Spirit V2.0.
Boost V1.35.0
- Wave Version 1.3
- Changed the return value of the 'evaluated_conditional_expression()' pp hook

View File

@@ -11,8 +11,8 @@
project boost/wave
: requirements
<link>shared:<define>BOOST_ALL_DYN_LINK=1
<toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc-8.0:<define>_CRT_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
: source-location ../src
;

File diff suppressed because one or more lines are too long

View File

@@ -5,33 +5,39 @@
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="theme/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="100%" border="0" cellspacing="2" background="theme/bkd2.gif">
<tr>
<td width="21"> <h1></h1></td>
<td width="885"> <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="6">The
Context Policy (new, upcoming interface) </font></b></font></td>
<td width="96"><a href="http://www.boost.org"><img src="theme/wave.gif" width="93" height="68" align="right" border="0"></a></td>
</tr>
<table background="theme/bkd2.gif" border="0" cellspacing="2" width="100%">
<tbody>
<tr>
<td width="21">&nbsp;</td>
<td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>The
Context Policy </b></font></td>
<td width="96"><a href="http://www.boost.org"><img src="theme/wave.gif" align="right" border="0" height="68" width="93"></a></td>
</tr>
</tbody>
</table>
<br>
<table border="0">
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_inptpolcy.html"><img src="theme/l_arr.gif" width="20" height="19" border="0"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
<tbody>
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_inptpolcy.html"><img src="theme/l_arr.gif" border="0" height="19" width="20"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</tbody>
</table>
<blockquote>
<blockquote>
<p><a href="class_reference_ctxpolicy.html#introduction">Introduction</a><br>
<a href="class_reference_ctxpolicy.html#header_synopsis">Header 'wave/preprocessing_hooks.hpp'
synopsis</a><br>
<a href="class_reference_ctxpolicy.html#member_functions">Member functions</a></p>
</blockquote>
<h2><b><a name="introduction"></a>Introduction</b></h2>
<p>Please note that the following description relates to the new preprocessing hooks interface used by default starting with the Boost V1.35.0 release. If you are interested in the older interface please look <a href="class_ref_ctxpolicy_depr.html">here</a>. </p>
<p>Please note that the following description relates to the new
preprocessing hooks interface used by default starting with the Boost
V1.35.0 release. If you are interested in the older interface please
look <a href="class_ref_ctxpolicy_depr.html">here</a>. </p>
<p>The context policy is used to provide callback hooks, which are called from inside the library into the user code, whenever</p>
<ul>
<li>a preprocessor directive has been recognized, </li>
@@ -43,169 +49,111 @@
<li>a token has to be skipped because it is contained in a non-evaluated conditional block, </li>
<li> a pragma of the form <tt>'wave option[(value)]'</tt> has been recognized. </li>
</ul>
<p>This policy type is used as a template parameter to the <a href="class_reference_context.html"><tt>boost::wave::context&lt;&gt;</tt></a>
object, where the default policy provides empty hook functions only.</p>
<h2><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/preprocessing_hooks.hpp?view=markup">wave/preprocessing_hooks.hpp</a>
synopsis</h2>
<pre>
<span class="keyword">namespace</span> boost {
<span class="keyword">namespace</span> wave {
<span class="keyword">namespace</span> context_policies {
<span class="keyword">struct</span> default_preprocessing_hooks {
<span class="comment">// general hook functions</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_directive">found_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx,
TokenT <span class="keyword">const </span>&amp;directive);<br>
<span class="comment">// test, whether a given token may be skipped</span><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#may_skip_whitespace">may_skip_whitespace</a> (ContextT <span class="keyword">const</span>&amp; ctx,
TokenT &amp;token, <span class="keyword">bool</span> &amp;skipped_newline);<br>
</span><span class="comment">// Conditional compilation</span><span class="keyword">
template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#evaluated_conditional_expression">evaluated_conditional_expression</a>(
ContextT <span class="keyword">const</span> &amp;ctx, ContainerT <span class="keyword">const</span>&amp; expression, <br> <span class="keyword">bool</span> expression_value);<br>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#skipped_token">skipped_token</a>(ContextT <span class="keyword">const</span> &amp;ctx,
TokenT <span class="keyword">const</span></span>&amp; token);<br>
<span class="comment">// macro expansion tracing</span><span class="keyword">
<p>This policy type is used as a template parameter to the <a href="class_reference_context.html"><tt>boost::wave::context&lt;&gt;</tt></a> object, where the default policy provides empty hook functions only.</p>
<h2><a name="header_synopsis"></a>Header <a href="http://svn.boost.org/trac/boost/browser/trunk/boost/wave/preprocessing_hooks.hpp">wave/preprocessing_hooks.hpp</a> synopsis</h2>
<pre><span class="keyword">namespace</span> boost {<br><span class="keyword">namespace</span> wave {<br><span class="keyword">namespace</span> context_policies {<br> <br> <span class="keyword">struct</span> default_preprocessing_hooks {<br><br> <span class="comment">// general hook functions</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_directive">found_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> TokenT <span class="keyword">const </span>&amp;directive);<br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ExceptionT&gt;<br> void <a href="class_reference_ctxpolicy.html#trow_exception">throw_exception</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ExceptionT <span class="keyword">const</span>&amp; e);<br><br> <span class="comment">// test, whether a given token may be skipped</span><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#may_skip_whitespace">may_skip_whitespace</a> (ContextT <span class="keyword">const</span>&amp; ctx,<br> TokenT &amp;token, <span class="keyword">bool</span> &amp;skipped_newline);<br>
<span class="comment">// Conditional compilation</span><span class="keyword">
template</span> &lt;<br> <span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <br> <span class="keyword">typename</span> ContainerT<br> &gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#evaluated_conditional_expression">evaluated_conditional_expression</a>(<br> ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span>&amp; directive, <br> ContainerT <span class="keyword">const</span>&amp; expression, <span class="keyword">bool</span> expression_value);<br>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#skipped_token">skipped_token</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> TokenT <span class="keyword">const</span>&amp; token);<br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> TokenT <span class="keyword">const</span>&amp; <a href="class_reference_ctxpolicy.html#generated_token">generated_token</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> TokenT <span class="keyword">const</span>&amp; token);<br><br> <span class="comment">// macro expansion tracing</span><span class="keyword">
template</span> &lt;<span class="keyword">
typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT,
<span class="keyword">typename</span> IteratorT
&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#expanding_function_like_macro">expanding_function_like_macro</a>(
ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;macrodef,
<span class="keyword">std::vector</span>&lt;TokenT&gt; <span class="keyword">const</span> &amp;formal_args,
ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall,
<span class="keyword">std::vector</span>&lt;ContainerT&gt; <span class="keyword">const</span> &amp;arguments,
IteratorT <span class="keyword">const</span> &amp;seqstart, Iterator <span class="keyword">const</span> &amp;seqend);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#expanding_object_like_macro">expanding_object_like_macro</a>(
ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;macro,
ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#expanded_macro">expanded_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx,
ContainerT <span class="keyword">const</span> &amp;result);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#expanded_macro">rescanned_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx,
ContainerT <span class="keyword">const</span> &amp;result);
<span class="comment">// include file tracing functions</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#opened_include_file">found_include_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx,
std::string <span class="keyword">const</span> &amp;filename, <span class="keyword">bool</span> include_next);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">void </span><a href="class_reference_ctxpolicy.html#opened_include_file">opened_include_file</a>(ContextT <span class="keyword">const</span> &amp;ctx,
std::string <span class="keyword">const</span> &amp;relname, std::string const&amp; absname,
std::size_t include_depth, <span class="keyword">bool</span> is_system_include);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#returning_from_include_file">returning_from_include_file</a>(ContextT <span class="keyword">const</span> &amp;ctx);
<span class="comment">// interpretation of #pragma's of the form </span>
typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT,<br> <span class="keyword">typename</span> IteratorT<br> &gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#expanding_function_like_macro">expanding_function_like_macro</a>(<br> ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;macrodef, <br> <span class="keyword">std::vector</span>&lt;TokenT&gt; <span class="keyword">const</span> &amp;formal_args, <br> ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall, <br> <span class="keyword">std::vector</span>&lt;ContainerT&gt; <span class="keyword">const</span> &amp;arguments,<br> IteratorT <span class="keyword">const</span> &amp;seqstart, Iterator <span class="keyword">const</span> &amp;seqend);<br> <br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#expanding_object_like_macro">expanding_object_like_macro</a>(<br> ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;macro, <br> ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall);<br> <br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#expanded_macro">expanded_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ContainerT <span class="keyword">const</span> &amp;result);<br> <br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#expanded_macro">rescanned_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ContainerT <span class="keyword">const</span> &amp;result);<br><br> <span class="comment">// include file tracing functions</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#opened_include_file">found_include_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> std::string <span class="keyword">const</span> &amp;filename, <span class="keyword">bool</span> include_next);<br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">void </span><a href="class_reference_ctxpolicy.html#opened_include_file">opened_include_file</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> std::string <span class="keyword">const</span> &amp;relname, std::string const&amp; absname,<br> <span class="keyword">bool</span> is_system_include); <br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#returning_from_include_file">returning_from_include_file</a>(ContextT <span class="keyword">const</span> &amp;ctx);<br><br> <span class="comment">// interpretation of #pragma's of the form </span>
<span class="comment">// 'wave option[(value)]'</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#interpret_pragma">interpret_pragma</a>(ContextT <span class="keyword">const</span> &amp;ctx, ContainerT &amp;pending,
<span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;option,
ContainerT <span class="keyword">const</span> &amp;values,
<span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;pragma_token);
<span class="comment">// macro definition hooks</span>
<span class="keyword">template</span> &lt;
<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">
typename</span> ParametersT, <span class="keyword">typename</span> DefinitionT
&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#defined_macro">defined_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;name, <span class="keyword">
bool</span> is_functionlike, ParametersT <span class="keyword">const</span> &amp;parameters,
DefinitionT <span class="keyword">const</span> &amp;definition, <span class="keyword">bool</span> is_predefined);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#undefined_macro">undefined_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx,
TokenT<span class="keyword"> const</span> &amp;name);
<span class="comment">// #error and #warning directive hooks</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_warning_directive">found_warning_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx,
ContainerT <span class="keyword">const</span> &amp;message);
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_error_directive">found_error_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx,
ContainerT <span class="keyword">const</span> &amp;message);
<span class="comment">// #line directive hook</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#found_line_directive">found_line_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx,
ContainerT <span class="keyword">const</span> &amp;arguments, <span class="keyword">unsigned int</span> line,
std::string <span class="keyword">const</span>&amp; filename);
};
}}} <span class="comment">// namespace boost::wave::context_policies</span></pre>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#interpret_pragma">interpret_pragma</a>(ContextT <span class="keyword">const</span> &amp;ctx, ContainerT &amp;pending, <br> <span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;option, <br> ContainerT <span class="keyword">const</span> &amp;values, <br> <span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;pragma_token);<br><br> <span class="comment">// macro definition hooks</span>
<span class="keyword">template</span> &lt;<br> <span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">
typename</span> ParametersT, <span class="keyword">typename</span> DefinitionT<br> &gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#defined_macro">defined_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx, TokenT <span class="keyword">const</span> &amp;name, <span class="keyword">
bool</span> is_functionlike, ParametersT <span class="keyword">const</span> &amp;parameters, <br> DefinitionT <span class="keyword">const</span> &amp;definition, <span class="keyword">bool</span> is_predefined);<br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#undefined_macro">undefined_macro</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> TokenT<span class="keyword"> const</span> &amp;name);<br><br> <span class="comment">// #error and #warning directive hooks</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_warning_directive">found_warning_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ContainerT <span class="keyword">const</span> &amp;message);<br><br> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_error_directive">found_error_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ContainerT <span class="keyword">const</span> &amp;message);<br><br> <span class="comment">// #line directive hook</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#found_line_directive">found_line_directive</a>(ContextT <span class="keyword">const</span> &amp;ctx, <br> ContainerT <span class="keyword">const</span> &amp;arguments, <span class="keyword">unsigned int</span> line,<br> std::string <span class="keyword">const</span>&amp; filename);<br> };<br><br>}}} <span class="comment">// namespace boost::wave::context_policies</span></pre>
<h2><a name="member_functions"></a>Member functions</h2>
<h3>General hook functions </h3>
<p><a name="found_directive"></a><strong>found_directive</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">bool</span> found_directive(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const </span>&amp;directive);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">bool</span> found_directive(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const </span>&amp;directive);<br>
</pre>
<blockquote>
<p>The function <tt>found_directive</tt> is called, whenever the preprocessor has detected one of the preprocessing directives (<span class="preprocessor">#define</span>, <span class="preprocessor">#undef</span>, <span class="preprocessor">#if</span>, <span class="preprocessor">#idef</span>, <span class="preprocessor">#ifndef</span>, <span class="preprocessor">#elif</span>, <span class="preprocessor">#endif</span>, <span class="preprocessor">#error</span>, <span class="preprocessor">#include</span>, <span class="preprocessor">#pragma</span> or <span class="preprocessor">#warning</span>) .</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>directive</tt> refers to the token containing the detected preprocessing directive. </p>
<p>If the return value is <tt>true</tt>, the directive will be skipped altogether, i.e. no preprocessing is done. The overall directive is replaced by a single newline character. If the return value is <tt>false</tt>, the directive is processed in the normal manner. </p>
<p>If the return value is <tt>true</tt>, the directive will be
skipped altogether, i.e. no preprocessing is done. The overall
directive is replaced by a single newline character. If the return
value is <tt>false</tt>, the directive is processed in the normal manner. </p>
</blockquote>
<p><a name="throw_exception"></a><strong>throw_exception</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ExceptionT&gt;<br> void throw_exception(ContextT <span class="keyword">const</span> &amp;ctx, <br> ExceptionT <span class="keyword">const</span>&amp; e);</pre>
<blockquote>
<p>he function&nbsp;<tt>throw_exception</tt> is called, whenever a preprocessing exception occurs .</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.&nbsp; </p>
<p>The parameter&nbsp;<tt>e</tt> is the exception object containing detailed error information. </p>
</blockquote>
<p><a name="may_skip_whitespace" id="may_skip"></a><strong>may_skipwhitespace</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">bool</span> may_skip_whitespace(ContextT <span class="keyword">const</span>&amp; ctx, TokenT &amp;token,
<span class="keyword">bool</span>&amp; skipped_newline);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">bool</span> may_skip_whitespace(ContextT <span class="keyword">const</span>&amp; ctx, TokenT &amp;token, <br> <span class="keyword">bool</span>&amp; skipped_newline);<br>
</pre>
<blockquote>
<p>The function <tt>may_skipwhitespace</tt> will be called by the library, whenever a token is about to be returned to the calling application. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Wave V1.2.4 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Wave V1.2.4 release. </p>
<p>The <tt>token</tt> parameter holds a reference to the current token. The policy is free to change this token if needed.</p>
<p>The <tt>skipped_newline</tt> parameter holds a reference to a boolean value which should be set to true by the policy function whenever a newline is going to be skipped. </p>
<p>The <tt>skipped_newline</tt> parameter holds a reference to a
boolean value which should be set to true by the policy function
whenever a newline is going to be skipped. </p>
<p>If the return value is <tt>true</tt>, the given token is skipped and the preprocessing continues to the next token. If the return value is <tt>false</tt>, the given token is returned to the calling application. Caution has to be used, because by returning <span class="keyword">true</span> the policy function is able to force skipping even significant tokens not only whitespace. </p>
</blockquote>
<h3>Conditional compilation hook functions </h3>
<p><a name="evaluated_conditional_expression"></a><strong>evaluated_conditional_expression</strong></p>
<pre><span class="keyword"> template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br><span class="keyword"> bool</span> evaluated_conditional_expression(ContextT <span class="keyword">const</span>&amp; ctx,
ContainerT <span class="keyword">const</span>&amp; expression, <span class="keyword">bool</span> expression_value);
<pre><span class="keyword"> template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;<br><span class="keyword"> bool</span> evaluated_conditional_expression(ContextT <span class="keyword">const</span>&amp; ctx, <br> TokenT <span class="keyword">const</span>&amp; directive, ContainerT <span class="keyword">const</span>&amp; expression, <span class="keyword"><br> bool</span> expression_value);<br>
</pre>
<blockquote>
<p>The function <tt>evaluated_conditional_expression</tt> is called, whenever the preprocessor has encountered a <span class="preprocessor">#if</span>, <span class="preprocessor">#elif</span>, <span class="preprocessor">#ifdef</span> or <span class="preprocessor">#ifndef</span> directive. This hook gets passed the non-expanded conditional expression (as it was given in the analysed source file) and the result of the evaluation of this expression in the current preprocessing context.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The function <tt>evaluated_conditional_expression</tt> is called, whenever the preprocessor has encountered a <span class="preprocessor">#if</span>, <span class="preprocessor">#elif</span>, <span class="preprocessor">#ifdef</span> or <span class="preprocessor">#ifndef</span> directive. This hook gets passed the non-expanded conditional
expression (as it was given in the analysed source file) and the result
of the evaluation of this expression in the current preprocessing
context.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>token</tt> parameter holds a reference to the evaluated directive token.&nbsp;</p>
<p>The parameter <tt>expression</tt> holds the non-expanded token sequence
comprising the evaluated expression.</p>
<p>The parameter <tt>expression_value</tt> contains the result of the evaluation of
the expression in the current preprocessing context. </p>
<p>The return value defines, whether the given expression has to be evaluated again, allowing to decide which of the conditional branches should be expanded. You need to return '<span class="keyword">true</span>' from this hook function to force the expression to be re-evaluated. Note, this was changed from a '<span class="keyword">void</span>' for the Boost V1.35.0 release. <br>
<p>The return value defines, whether the given expression has to be
evaluated again, allowing to decide which of the conditional branches
should be expanded. You need to return '<span class="keyword">true</span>' from this hook function to force the expression to be re-evaluated. Note, this was changed from a '<span class="keyword">void</span>' for the Boost V1.35.0 release. <br>
</p>
</blockquote>
<p><a name="skipped_token"></a><strong>skipped_token</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">void</span> skipped_token(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span>&amp; token);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">void</span> skipped_token(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span>&amp; token);<br>
</pre>
<blockquote>
<p>The function <tt>skipped_token</tt> is called, whenever a token is about to be skipped due to a false preprocessor condition (code fragments to be
skipped inside the not evaluated conditional <span class="preprocessor">#if</span>/<span class="preprocessor">#else</span>/<span class="preprocessor">#endif</span> branches).</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
skipped inside the not evaluated conditional <span class="preprocessor">#if</span>/<span class="preprocessor">#else</span>/<span class="preprocessor">#endif</span> branches).</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>token</tt> refers to the token to be skipped.</p>
</blockquote>
<p><a name="generated_token"></a><strong>generated_token</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> TokenT <span class="keyword">const</span>&amp; generated_token(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span>&amp; token);<br>
</pre>
<blockquote>
<p>The function <tt>generated_token</tt> is called, whenever a token is about to be returned from the library.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>token</tt> refers to the token about to be
returned from the library. This function may alter the token, but in
this case it must be implemented with a non-const reference for the
token parameter, allowing to modify the token in place.</p>
<p>The default behavior is to return the passed token reference unchanged to the caller.</p>
</blockquote>
<h3>Macro expansion tracking functions</h3>
<p><a name="expanding_function_like_macro"></a><b>expanding_function_like_macro</b></p>
<pre><span class="keyword"> template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> expanding_function_like_macro(
ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;macrodef,
<span class="keyword">std::vector</span>&lt;TokenT&gt; <span class="keyword">const</span> &amp;formal_args,
ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall,
<span class="keyword">std::vector</span>&lt;ContainerT&gt; <span class="keyword">const</span> &amp;arguments,
IteratorT <span class="keyword">const</span> &amp;seqstart, Iterator <span class="keyword">const</span> &amp;seqend);</pre>
<blockquote>
<pre><span class="keyword"> template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> expanding_function_like_macro(<br> ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;macrodef, <br> <span class="keyword">std::vector</span>&lt;TokenT&gt; <span class="keyword">const</span> &amp;formal_args, <br> ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall, <br> <span class="keyword">std::vector</span>&lt;ContainerT&gt; <span class="keyword">const</span> &amp;arguments,<br> IteratorT <span class="keyword">const</span> &amp;seqstart, Iterator <span class="keyword">const</span> &amp;seqend);</pre>
<blockquote>
<p>The function <tt>expanding_function_like_macro</tt> is called, whenever a
function-like macro is to be expanded, i.e. <i>before</i> the actual expansion
starts.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>macroname</tt> 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.</p>
@@ -224,20 +172,21 @@
<p>The parameters <tt>seqstart</tt> and <tt>seqend</tt> point into the input token
stream allowing to access the whole token sequence comprising the macro
invocation (starting with the opening parenthesis and ending after the
closing one).</p>
<p>If the return value is <tt>true</tt>, the macro is not expanded, i.e. the overall macro invocation sequence, including the parameters are copied to the output without further processing . If the return value is <tt>false</tt>, the macro is expanded as expected. <br>
closing one).</p>
<p>If the return value is <tt>true</tt>, the macro is not expanded,
i.e. the overall macro invocation sequence, including the parameters
are copied to the output without further processing . If the return
value is <tt>false</tt>, the macro is expanded as expected. <br>
</p>
</blockquote>
<p><a name="expanding_object_like_macro"></a><b>expanding_object_like_macro</b></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> expanding_object_like_macro(
ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;macro,
ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> expanding_object_like_macro(<br> ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;macro, <br> ContainerT <span class="keyword">const</span> &amp;definition, TokenT <span class="keyword">const</span> &amp;macrocall);<br>
</pre>
<blockquote>
<blockquote>
<p>The function <tt>expanding_object_like_macro</tt> is called, whenever a object-like
macro is to be expanded, i.e. <i>before</i> the actual expansion starts.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>macroname</tt> 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.</p>
@@ -248,95 +197,88 @@
It contains the token which identifies the macro call inside the preprocessed
input stream. </p>
<p>If the return value is <tt>true</tt>, the macro is not expanded, i.e. the macro symbol is copied to the output without further processing. If the return value is <tt>false</tt>, the macro is expanded as expected. <br>
</p>
</p>
</blockquote>
<p><a name="expanded_macro"></a><b>expanded_macro</b></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> expanded_macro(ContextT <span class="keyword">const</span>&amp; ctx, ContainerT <span class="keyword">const</span> &amp;result);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> expanded_macro(ContextT <span class="keyword">const</span>&amp; ctx, ContainerT <span class="keyword">const</span> &amp;result);<br>
</pre>
<blockquote>
<blockquote>
<p>The function <tt>expanded_macro</tt> 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 <i>before</i>
the rescanning process starts.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
macros herein are replaced by its corresponding expansion results, but <i>before</i> the rescanning process starts.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>result</tt> contains the the result of the macro expansion
so far. This is a standard STL container containing the generated token sequence.</p>
</blockquote>
<p><a name="rescanned_macro"></a><b>rescanned_macro</b></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> rescanned_macro(ContextT <span class="keyword">const</span>&amp; ctx, ContainerT <span class="keyword">const</span> &amp;result);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> rescanned_macro(ContextT <span class="keyword">const</span>&amp; ctx, ContainerT <span class="keyword">const</span> &amp;result);<br>
</pre>
<blockquote>
<blockquote>
<p>The function <tt>rescanned_macro</tt> is called whenever the rescanning
of a macro is finished, i.e. the macro expansion is complete.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>result</tt> contains the the result of the whole macro
expansion. This is a standard STL container containing the generated token
sequence.</p>
</blockquote>
<h3>Include file tracing functions</h3>
<p><a name="opened_include_file" id="found_include_directive"></a><strong>found_include_directive</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">bool</span> found_include_directive(ContextT <span class="keyword">const</span>&amp; ctx,
std::string <span class="keyword">const</span> &amp;filename, <span class="keyword">bool</span> include_next);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">bool</span> found_include_directive(ContextT <span class="keyword">const</span>&amp; ctx, <br> std::string <span class="keyword">const</span> &amp;filename, <span class="keyword">bool</span> include_next);<br>
</pre>
<blockquote>
<p>The function <tt>found_include_directive</tt> is called whenever whenever a #include directive was located..</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>filename</tt> contains the (expanded) file name found after
the <span class="preprocessor">#include</span> directive. This has the format <tt>&lt;file&gt;</tt>, <tt>&quot;file&quot;</tt> or <tt>file</tt>.
The formats <tt>&lt;file&gt;</tt> or <tt>&quot;file&quot;</tt> are used for <span class="preprocessor">#include</span> directives found
the <span class="preprocessor">#include</span> directive. This has the format <tt>&lt;file&gt;</tt>, <tt>"file"</tt> or <tt>file</tt>.
The formats <tt>&lt;file&gt;</tt> or <tt>"file"</tt> are used for <span class="preprocessor">#include</span> directives found
in the preprocessed token stream, the format <tt>file</tt> is used for files
specified through the --force_include command line argument.</p>
<p>The parameter <tt>include_next</tt> is set to true if the found directive was
a <span class="preprocessor">#include_next</span> directive and the <tt>BOOST_WAVE_SUPPORT_INCLUDE_NEXT</tt> preprocessing constant was defined to something != 0.</p>
<p>If the return value is <tt>true</tt>, the include directive is not executed, i.e. the file to include is not loaded nor processed. The overall directive is replaced by a single newline character. If the return value is <tt>false</tt>, the directive is executed in a normal manner. <br>
a <span class="preprocessor">#include_next</span> directive and the <tt>BOOST_WAVE_SUPPORT_INCLUDE_NEXT</tt> preprocessing constant was defined to something != 0.</p>
<p>If the return value is <tt>true</tt>, the include directive is not
executed, i.e. the file to include is not loaded nor processed. The
overall directive is replaced by a single newline character. If the
return value is <tt>false</tt>, the directive is executed in a normal manner. <br>
</p>
</blockquote>
<p><a name="opened_include_file" id="opened_include_file"></a><strong>opened_include_file</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">void</span> opened_include_file(ContextT <span class="keyword">const</span>&amp; ctx,
std::string <span class="keyword">const</span> &amp;rel_filename, std::string <span class="keyword">const</span> &amp;abs_filename,
std::size_t include_depth, <span class="keyword">bool</span> is_system_include);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">void</span> opened_include_file(ContextT <span class="keyword">const</span>&amp; ctx, <br> std::string <span class="keyword">const</span> &amp;rel_filename, std::string <span class="keyword">const</span> &amp;abs_filename, <br> <span class="keyword">bool</span> is_system_include);<br>
</pre>
<blockquote>
<blockquote>
<p>The function <tt>opened_include_file</tt> is called whenever a file referred
by an <span class="preprocessor">#include</span> directive was successfully located and opened.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>rel_filename</tt> 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.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>rel_filename</tt> 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.</p>
<p>The parameter <tt>abs_filename</tt> contains the (normalised) full file system path of the
opened file.</p>
<p>The <tt>include_depth</tt> parameter contains the current include file depth.
</p>
opened file.</p>
<p>The <tt>is_system_include</tt> parameter denotes, if the given file was found
as a result of a <tt>#include&nbsp;&lt;...&gt;</tt> directive.</p>
</blockquote>
<p><a name="returning_from_include_file" id="returning_from_include_file"></a><strong>returning_from_include_file</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;
<span class="keyword">void</span> returning_from_include_file(ContextT <span class="keyword">const</span>&amp; ctx);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT&gt;<br> <span class="keyword">void</span> returning_from_include_file(ContextT <span class="keyword">const</span>&amp; ctx);<br>
</pre>
<blockquote>
<blockquote>
<p>The function <tt>returning_from_include_file</tt> is called whenever an
included file is about to be closed after it's processing is complete.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
</blockquote>
<h3>Interpretation of #pragma's</h3>
<p><strong><a name="interpret_pragma"></a>interpret_pragma</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
bool <a href="class_reference_ctxpolicy.html#interpret_pragma">interpret_pragma</a>(ContextT <span class="keyword">const</span> &amp;ctx, ContainerT &amp;pending,
<span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;option,
ContainerT <span class="keyword">const</span> &amp;values,
<span class="keyword">typename</span> ContextT::token_type<span class="keyword"> const</span> &amp;pragma_token);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> bool <a href="class_reference_ctxpolicy.html#interpret_pragma">interpret_pragma</a>(ContextT <span class="keyword">const</span> &amp;ctx, ContainerT &amp;pending, <br> <span class="keyword">typename</span> ContextT::token_type <span class="keyword">const</span> &amp;option, <br> ContainerT <span class="keyword">const</span> &amp;values, <br> <span class="keyword">typename</span> ContextT::token_type<span class="keyword"> const</span> &amp;pragma_token);<br>
</pre>
<blockquote>
<p>The function <tt>interpret_pragma</tt> is called whenever an unrecognized
<tt>#pragma&nbsp;wave&nbsp;...</tt> or operator <tt>_Pragma(&quot;wave&nbsp;...&quot;)</tt>
is found in the input stream.</p>
<blockquote>
<p>The function <tt>interpret_pragma</tt> is called whenever an unrecognized <tt>#pragma&nbsp;wave&nbsp;...</tt> or operator <tt>_Pragma("wave&nbsp;...")</tt> is found in the input stream.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. </p>
<p>The <tt>pending</tt> parameter may be used to push tokens back into the input
stream which are to be used as the replacement text for the whole <tt>#pragma&nbsp;wave()</tt>
directive. If this sequence is left empty, no replacement takes place, i.e.
stream which are to be used as the replacement text for the whole <tt>#pragma&nbsp;wave()</tt> directive. If this sequence is left empty, no replacement takes place, i.e.
the interpreted directive is removed from the generated token stream.</p>
<p>The <tt>option</tt> parameter contains the name of the interpreted pragma.</p>
<p>The <tt>values</tt> parameter holds the value of the parameter provided to
@@ -350,92 +292,87 @@
</blockquote>
<h3>Macro definition </h3>
<p><strong><a name="defined_macro" id="defined_macro"></a>defined_macro</strong></p>
<pre> <span class="keyword">template</span> &lt;
<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ParametersT, <span class="keyword">
typename</span> DefinitionT
&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#defined_macro">defined_macro</a>(ContextT <span class="keyword">const</span>&amp; ctx,
TokenT <span class="keyword">const</span> &amp;name, <span class="keyword">bool</span> is_functionlike,
ParametersT <span class="keyword">const</span> &amp;parameters, DefinitionT <span class="keyword">const</span> &amp;definition,
<span class="keyword">bool</span> is_predefined);
<pre> <span class="keyword">template</span> &lt;<br> <span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ParametersT, <span class="keyword">
typename</span> DefinitionT<br> &gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#defined_macro">defined_macro</a>(ContextT <span class="keyword">const</span>&amp; ctx, <br> TokenT <span class="keyword">const</span> &amp;name, <span class="keyword">bool</span> is_functionlike,<br> ParametersT <span class="keyword">const</span> &amp;parameters, DefinitionT <span class="keyword">const</span> &amp;definition,<br> <span class="keyword">bool</span> is_predefined);<br>
</pre>
<blockquote> <p>The function <tt>defined_macro</tt> is called whenever a macro was defined successfully.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<blockquote>
<p>The function <tt>defined_macro</tt> is called whenever a macro was defined successfully.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>name</tt> is a reference to the token holding the macro name.</p>
<p>The parameter <tt>is_functionlike</tt> is set to true whenever the newly
defined macro is defined as a function like macro.</p>
<p>The parameter <tt>parameters</tt> 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.</p>
definition. If the macro has no parameters or if it is a object like
macro, then this container is empty.</p>
<p>The parameter <tt>definition</tt> contains the token sequence given as the
replacement sequence (definition part) of the newly defined macro.</p>
replacement sequence (definition part) of the newly defined macro.</p>
<p>The parameter <tt>is_predefined</tt> is set to true for all macros predefined
during the initialisation pahase of the library.<br>
during the initialisation pahase of the library.<br>
</p>
</blockquote>
<p><strong><a name="undefined_macro" id="undefined_macro"></a>undefined_macro</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#undefined_macro">undefined_macro</a>(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;name);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> TokenT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#undefined_macro">undefined_macro</a>(ContextT <span class="keyword">const</span>&amp; ctx, TokenT <span class="keyword">const</span> &amp;name);<br>
</pre>
<blockquote>
<p>The function <tt>undefined_macro</tt> is called whenever a macro definition
was removed successfully.</p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user.
Note, this parameter was added for the Boost V1.35.0 release. </p>
<p>The parameter <tt>name</tt> holds the token of the macro which definition was removed.<br>
</p>
</blockquote>
<p><strong><a name="found_warning_directive" id="found_warning_directive"></a>found_warning_drective</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_warning_directive">found_warning_directive</a>(ContextT <span class="keyword">const</span>&amp; ctx,
ContainerT <span class="keyword">const</span> &amp;message);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_warning_directive">found_warning_directive</a>(ContextT <span class="keyword">const</span>&amp; ctx, <br> ContainerT <span class="keyword">const</span> &amp;message);<br>
</pre>
<blockquote>
<p>The function <tt>found_warning_directive </tt> is called whenever a <span class="preprocessor">#warning </span>directive has been encountered. Note, this function was added for the Boost V1.35.0 release. This function will be called only if the <tt>BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE</tt> compile time constant was defined to something not equal to zero (see the <a href="compiletime_config.html">Compile Time Configuration</a> for more information). </p>
<p>The function <tt>found_warning_directive </tt> is called whenever a <span class="preprocessor">#warning </span>directive
has been encountered. Note, this function was added for the Boost
V1.35.0 release. This function will be called only if the <tt>BOOST_WAVE_SUPPORT_WARNING_DIRECTIVE</tt> compile time constant was defined to something not equal to zero (see the <a href="compiletime_config.html">Compile Time Configuration</a> for more information). </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. </p>
<p>The parameter <tt>message</tt> references the argument token sequence of the encountered <span class="preprocessor">#warning</span> directive.</p>
<p>If the return value is <tt>false</tt>, the library throws a preprocessor
exception of the type <code>warning_directive</code> (normal execution continues), if the return value is <tt>true</tt> the execution continues as if no <span class="preprocessor">#warning</span> directive has been found and the overall directive is replaced by a single newline. </p>
exception of the type <code>warning_directive</code> (normal execution continues), if the return value is <tt>true</tt> the execution continues as if no <span class="preprocessor">#warning</span> directive has been found and the overall directive is replaced by a single newline. </p>
</blockquote>
<p><strong><a name="found_error_directive" id="found_error_directive"></a>found_error_drective</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_error_directive">found_error_directive</a>(ContextT <span class="keyword">const</span>&amp; ctx,
ContainerT <span class="keyword">const</span> &amp;message);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">bool</span> <a href="class_reference_ctxpolicy.html#found_error_directive">found_error_directive</a>(ContextT <span class="keyword">const</span>&amp; ctx, <br> ContainerT <span class="keyword">const</span> &amp;message);<br>
</pre>
<blockquote>
<p>The function <tt>found_error_directive </tt> is called whenever a <span class="preprocessor">#error </span>directive has been encountered. Note, this function was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. </p>
<p>The parameter <tt>message</tt> references the argument token sequence of the encountered <span class="preprocessor">#error</span> directive.</p>
<p>If the return value is <tt>false</tt>, the library throws a preprocessor
exception of the type <code>error_directive</code> (normal execution continues), if the return value is <tt>true</tt> the execution continues as if no <span class="preprocessor">#error</span> directive has been found and the overall directive is replaced by a single newline. </p>
exception of the type <code>error_directive</code> (normal execution continues), if the return value is <tt>true</tt> the execution continues as if no <span class="preprocessor">#error</span> directive has been found and the overall directive is replaced by a single newline. </p>
</blockquote>
<p><strong><a name="found_line_directive" id="found_line_directive"></a>found_line_drective</strong></p>
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#found_error_directive"><strong>found_line_drective</strong></a>(ContextT <span class="keyword">const</span>&amp; ctx,
ContainerT <span class="keyword">const</span> &amp;arguments, <span class="keyword">unsigned int</span> line,
std::string <span class="keyword">const</span>&amp; filename);
<pre> <span class="keyword">template</span> &lt;<span class="keyword">typename</span> ContextT, <span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#found_error_directive"><strong>found_line_drective</strong></a>(ContextT <span class="keyword">const</span>&amp; ctx, <br> ContainerT <span class="keyword">const</span> &amp;arguments, <span class="keyword">unsigned int</span> line,<br> std::string <span class="keyword">const</span>&amp; filename);<br>
</pre>
<blockquote>
<p>The function <tt>found_line_directive </tt> is called whenever a <span class="preprocessor">#line </span>directive has been encountered. Note, this function was added for the Boost V1.35.0 release. </p>
<p>The <tt>ctx</tt> parameter provides a reference to the <tt>context_type</tt> used during instantiation of the preprocessing iterators by the user. </p>
<p>The parameter <tt>arguments</tt> references the argument token sequence of the encountered <span class="preprocessor">#line</span> directive.</p>
<p>The parameter <tt>line</tt> contains the recognized line number from the <span class="preprocessor">#line</span> directive.</p>
<p>The parameter <tt>filename</tt> references the recognized file name from the <span class="preprocessor">#line</span> directive (if there was one given).<br>
<p>The parameter <tt>line</tt> contains the recognized line number from the <span class="preprocessor">#line</span> directive.</p>
<p>The parameter <tt>filename</tt> references the recognized file name from the <span class="preprocessor">#line</span> directive (if there was one given).<br>
</p>
</blockquote>
<table border="0">
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_inptpolcy.html"><img src="theme/l_arr.gif" width="20" height="19" border="0"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
<tbody>
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_inptpolcy.html"><img src="theme/l_arr.gif" border="0" height="19" width="20"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</tbody>
</table>
<hr size="1">
<p class="copyright">Copyright &copy; 2003-2008 Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Sunday, December 2, 2007 19:12<!-- #EndDate -->
</span></p>
<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>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:13<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -35,7 +35,7 @@
<p>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.</p>
<h2><b><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/util/file_position.hpp?view=markup">wave/util/file_position.hpp</a>
<h2><b><a name="header_synopsis"></a>Header <a href="http://svn.boost.org/trac/boost/browser/trunk/boost/wave/util/file_position.hpp">wave/util/file_position.hpp</a>
synopsis</b></h2>
<pre><span class="keyword">namespace</span> <span class="identifier">boost</span> {
<span class="keyword">namespace</span> <span class="identifier">wave</span> {
@@ -113,7 +113,7 @@
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Thursday, December 1, 2005 11:52<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:14<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -39,7 +39,7 @@
input sequence. If this template parameter is not given while instantiating
the context object, it defaults to the <tt>iteration_context_policies::load_file_to_string</tt>
type. </p>
<h2><b><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/util/iteration_context.hpp?view=markup">wave/iteration_context.hpp</a>
<h2><b><a name="header_synopsis"></a>Header <a href="http://svn.boost.org/trac/boost/browser/trunk/boost/wave/util/iteration_context.hpp">wave/iteration_context.hpp</a>
synopsis</b></h2>
<p>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
@@ -126,7 +126,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 -->Sunday, May 15, 2005 12:23<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:14<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -34,7 +34,7 @@
<h2><b><a name="introduction"></a>Introduction</b></h2>
<p>Every lexer, which should be used in conjunction with the <tt>Wave</tt> library, has to return tokens formed from the input stream. These tokens should conform to the synopsis described in the topic <a href="class_reference_tokentype.html">The Token Type</a>. The lexer type should expose an interface which conforms at least to a <tt>forward_iterator</tt> (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.</p>
<h2><a name="header_synopsis"></a>Wave lexer
synopsis (header: <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/cpplexer/cpp_lex_interface.hpp?view=markup">wave/cpplexer/cpp_lexer_interface.hpp</a>)</h2>
synopsis (header: <a href="http://svn.boost.org/trac/boost/browser/trunk/boost/wave/cpplexer/cpp_lex_interface.hpp">wave/cpplexer/cpp_lexer_interface.hpp</a>)</h2>
<pre> <span class="keyword">struct</span> lex_iterator
{
<span class="keyword">typedef</span> boost::wave::lex_token&lt;&gt; <a href="class_reference_lexer.html#public_typedefs">token_type</a>;
@@ -53,7 +53,7 @@
};
</pre>
<p>Please note, that the <tt>lex_iterator</tt> defined in the library header <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/cpplexer/cpp_lex_interface.hpp?view=markup">wave/cpplexer/cpp_lexer_interface.hpp</a> 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.</p>
<p>Please note, that the <tt>lex_iterator</tt> defined in the library header <a href="http://svn.boost.org/trac/boost/browser/trunk/boost/wave/cpplexer/cpp_lex_interface.hpp">wave/cpplexer/cpp_lexer_interface.hpp</a> 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.</p>
<p>If you want to use Wave in conjunction with your own lexing component this will have to conform to the interface described above only. </p>
<h2><a name="public_typedefs" id="public_typedefs"></a>Public Typedefs</h2>
<p>Besides the typedefs mandated for a <tt>forward_iterator</tt> by the C++ standard every lexer to be used with the <tt>Wave</tt> library should define the following typedefs: </p>
@@ -97,7 +97,7 @@
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Thursday, December 1, 2005 11:53<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:15<!-- #EndDate -->
</span>
</p>
</body>

View File

@@ -50,7 +50,7 @@
library, which is used in conjunction with the two predefined C++ lexers contained
in the <tt>Wave</tt> library too. If you need to use your own token type, it
is required to implement the interafce described below.</p>
<h2><b><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/wave/cpplexer/cpp_lex_token.hpp?view=markup">wave/cpplexer/cpp_lex_token.hpp</a>
<h2><b><a name="header_synopsis"></a>Header <a href="svn.boost.org/trac/boost/browser/trunk/boost/wave/cpplexer/cpp_lex_token.hpp">wave/cpplexer/cpp_lex_token.hpp</a>
synopsis</b></h2>
<pre><span class="keyword">namespace</span> boost {
<span class="keyword">namespace</span> wave {
@@ -170,7 +170,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 -->Thursday, December 1, 2005 11:48<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Sunday, October 12, 2008 20:15<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -149,7 +149,7 @@ even if these do not have the <span class="literal">'ll'</span> suffix.</p>
</table>
<P dir="ltr"><b><a name="using_custom_lexer"></a>Using a different token type or lexer type in conjunction with Wave </b></P>
<P dir="ltr">It is possible to use the <tt>Wave</tt> 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 <tt>boost::wave::context&lt;&gt;</tt> object. The token type used by the library is derived from the <tt>token_type</tt> typedef to be provided by the lexer type. If you want to provide your own token type only, you may use the <tt>boost::wave::lex_iterator&lt;&gt;</tt> type contained with the library. This type needs to be parametrized with the token type to use. </P>
<P dir="ltr">To show, how this may be done, the <tt>Wave</tt> library contains several samples illustrating this possibility. The <tt>cpp_tokens</tt> sample shows the usage of a custom lexer and a custom token types. The lexer type used is functionally fully compatible to the <tt>re2c</tt> <a href="references.html#re2c">[3]</a> based lexer used by default. It is implemented based on the <tt>SLex</tt> <a href="references.html#slex">[5]</a> lexer example written by Dan Nuffer. The token type used therein is functionally equivalent to the default token type except for an additional <tt>operator&lt;&lt;</tt> used for dumping the information carried by the token.</P>
<P dir="ltr">The <tt>Wave</tt> library contains several samples illustrating these possibilities. The <tt>cpp_tokens</tt> sample shows the usage of a custom lexer and a custom token types. The lexer type used is functionally fully compatible to the <tt>re2c</tt> <a href="references.html#re2c">[3]</a> based lexer used by default. It is implemented based on the <tt>SLex</tt> <a href="references.html#slex">[5]</a> lexer example written by Dan Nuffer. The token type used therein is functionally equivalent to the default token type except for an additional <tt>operator&lt;&lt;</tt> used for dumping the information carried by the token.</P>
<P dir="ltr"><b><a name="compilation_models"></a>Separation and inclusion compilation
models</b></P>
<P dir="ltr">The <tt>Wave</tt> C++ preprocessor iterator library is build almost
@@ -219,8 +219,8 @@ even if these do not have the <span class="literal">'ll'</span> suffix.</p>
<td width="75%" class="table_cells"> <p><code><span class="keyword">template</span> wave::grammars::expression_grammar_gen&lt<tt>TokenT</tt>&gt;;<br>
<span class="keyword"> template</span> wave::grammars::intlit_grammar_gen&lt;<tt>TokenT</tt>&gt;;<br>
<span class="keyword"> template</span> wave::grammars::chlit_grammar_gen&lt;<tt>TokenT</tt>&gt;;<br>
<span class="keyword"> <code>template</code><code></code><code> wave::grammars::cpp_grammar_gen&lt;<tt>LexIteratorT</tt>&gt;;<br>
</code>template</span> wave::grammars::predefined_macros_grammar_gen&lt;<tt>LexIteratorT</tt>&gt;;<br>
<span class="keyword"> template</span> wave::grammars::cpp_grammar_gen&lt;<tt>LexIteratorT</tt>&gt;;<br>
<span class="keyword"> template</span> wave::grammars::predefined_macros_grammar_gen&lt;<tt>LexIteratorT</tt>&gt;;<br>
<span class="keyword"> template</span> wave::grammars::defined_grammar_gen&lt;<tt>LexIteratorT</tt>&gt;;</code></p></td>
</tr>
</table>
@@ -244,7 +244,7 @@ even if these do not have the <span class="literal">'ll'</span> suffix.</p>
<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, January 31, 2008 16:50<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:38<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -1,28 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Preface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="theme/style.css" rel="stylesheet" type="text/css">
<title>Preface</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="theme/style.css" rel="stylesheet" type="text/css">
</head>
<body text="#000000" background="theme/bkd.gif">
<table width="100%" border="0" cellspacing="2" background="theme/bkd2.gif">
<tr>
<td width="21"> <h1></h1></td>
<body background="theme/bkd.gif" text="#000000">
<table background="theme/bkd2.gif" border="0" cellspacing="2" width="100%">
<tbody>
<tr>
<td width="21">
<h1></h1>
</td>
<td width="885"> <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="6">Preface</font></b></font></td>
<td width="96"><a href="http://www.boost.org"><img src="theme/wave.gif" width="93" height="68" align="right" border="0"></a></td>
<td width="96"><a href="http://www.boost.org"><img src="theme/wave.gif" align="right" border="0" height="68" width="93"></a></td>
</tr>
</tbody>
</table>
<br>
<table border="0">
<tr>
<tbody>
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><img src="theme/l_arr_disabled.gif" width="20" height="19" border="0"></td>
<td width="30"><img src="theme/l_arr_disabled.gif" border="0" height="19" width="20"></td>
<td width="30"><a href="introduction.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</tbody>
</table>
<p>During the last time many new features have been developed as additions to the <tt>Spirit</tt>
<a href="references.html#spirit">[4]</a> parser construction framework and we
felt more and more, that it would be very helpful, to have a 'real world' example,
@@ -31,6 +58,7 @@
interest of developers to have a modern, open source C++ preprocessor library
to play with.&nbsp; So we had the idea to implement a C++ preprocessor to fit
this needs&nbsp;-&nbsp;<tt>Wave</tt> was born.</p>
<p align="justify">The <tt>Wave</tt> C++ preprocessor library uses the <a href="http://www.boost.org/">
</a> <tt>Spirit<a href="references.html#spirit">[4]</a></tt> parser construction
library to implement a C++ lexer with ISO/ANSI Standards conformant preprocessing
@@ -38,22 +66,30 @@
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). </p>
<p align="justify"> 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
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: </p>
<blockquote>
<p><b><img src="theme/bullet.gif" width="13" height="13" id="IMG1">&nbsp;</b>Inclusion
<p><b><img src="theme/bullet.gif" id="IMG1" height="13" width="13">&nbsp;</b>Inclusion
of header files<br>
<b><img src="theme/bullet.gif" width="13" height="13" id="IMG1">&nbsp;</b>Macro
<b><img src="theme/bullet.gif" id="IMG1" height="13" width="13">&nbsp;</b>Macro
expansion<br>
<b><img src="theme/bullet.gif" width="13" height="13" id="IMG1">&nbsp;</b>Conditional
<b><img src="theme/bullet.gif" id="IMG1" height="13" width="13">&nbsp;</b>Conditional
compilation<br>
<b><img src="theme/bullet.gif" width="13" height="13" id="IMG1">&nbsp;</b>Line
<b><img src="theme/bullet.gif" id="IMG1" height="13" width="13">&nbsp;</b>Line
control</p>
</blockquote>
<p>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 <a href="references.html#pp_lib">[7]</a>
@@ -61,49 +97,87 @@
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.</p>
<p>The C++ Standard <a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC%2B14882%2D1998">[2] </a> was adopted back in 1998, but there is still no (known to me) commercial 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. Two open source projects are exceptions of this: gcc and Clang (a subproject of LLVM), both providing preprocessors with very good standards conformance. </p>
<p>The C++ Standard <a href="http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC%2B14882%2D1998">[2] </a>
was adopted back in 1998, but there is still no (known to me)
commercial 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. Two open source projects are exceptions of this: gcc
and Clang (a subproject of LLVM), both providing preprocessors with
very good standards conformance. </p>
<p align="justify">So the main goals for the <tt>Wave</tt> project are:</p>
<blockquote>
<p><b><img src="theme/bullet.gif" width="13" height="13" id="IMG1">&nbsp;</b>full
<p><b><img src="theme/bullet.gif" id="IMG1" height="13" width="13">&nbsp;</b>full
conformance with the C++ standard (ISO/IEC 14882:1998) <a href="references.html#iso_cpp">[1]</a>
and with the C99 standard (INCITS/ISO/IEC 9899:1999) <a href="references.html#iso_c">[2]</a><br>
<b><img src="theme/bullet.gif" width="13" height="13">&nbsp;</b>usage of <tt>Spirit<a href="references.html#spirit">[4]</a></tt>
<b><img src="theme/bullet.gif" height="13" width="13">&nbsp;</b>usage of <tt>Spirit<a href="references.html#spirit">[4]</a></tt>
for the parsing parts of the game (certainly :-)<br>
<b><img src="theme/bullet.gif" width="13" height="13">&nbsp;</b>maximal usage
<b><img src="theme/bullet.gif" height="13" width="13">&nbsp;</b>maximal usage
of STL and/or <tt>Boost</tt> libraries (for compactness and maintainability)<br>
<b><img src="theme/bullet.gif" width="13" height="13">&nbsp;</b>straightforward
<b><img src="theme/bullet.gif" height="13" width="13">&nbsp;</b>straightforward
extendability for the implementation of additional features<br>
<b><img src="theme/bullet.gif" width="13" height="13">&nbsp;</b>building a
<b><img src="theme/bullet.gif" height="13" width="13">&nbsp;</b>building a
flexible library for different C++ lexing and preprocessing needs</p>
</blockquote>
<p>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 <a href="references.html#pp_lib">[7]</a> et.al. Nevertheless recent work has lead to surprising performance enhancements (if compared
<p>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 <a href="references.html#pp_lib">[7]</a> 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.</p>
<p>As tests showed, the <tt>Wave</tt> 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). </p>
<table border="0">
<tr>
<tbody>
<tr>
<td width="10"></td>
<td width="30"><a href="../index.html"><img src="theme/u_arr.gif" border="0"></a></td>
<td width="30"><img src="theme/l_arr_disabled.gif" width="20" height="19" border="0"></td>
<td width="30"><img src="theme/l_arr_disabled.gif" border="0" height="19" width="20"></td>
<td width="30"><a href="introduction.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</tbody>
</table>
<hr size="1">
<p class="copyright">Copyright &copy; 2003-2008 Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<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 -->Sunday, December 2, 2007 19:03<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -71,13 +71,13 @@ The following code snippet is taken from the <tt>quick_start</tt> sample, which
<span class="identifier">context_type</span><span class="special">;</span>
context_type ctx(input.begin(), input.end(), <span class="string">&quot;input.cpp&quot;</span>);
<span class="comment"> // At this point you may want to set the parameters of the
<span class="comment">
// At this point you may want to set the parameters of the
// preprocessing as include paths and/or predefined macros.
</span> ctx.add_include_path(<span class="literal">&quot;...&quot;</span>);
ctx.add_macro_definition(...);
<span class="comment"> // Get the preprocessor iterators and use them to generate
<span class="comment">
// Get the preprocessor iterators and use them to generate
// the token sequence.
</span> context_type::iterator_type first = ctx.begin();
context_type::iterator_type last = ctx.end();
@@ -115,7 +115,7 @@ Note though, that this filename is used
<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 -->Sunday, December 2, 2007 19:06<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:34<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -248,14 +248,14 @@ is now disabled by default because it may cause a potential security threat. The
<p dir="ltr"> There is a shorthand for specifying a configuration file on the
command line: simply use the '@' character immediatly before the corresponding
file name.</p>
<p dir="ltr"> The options found in a configuration file are interpreted, as
<p dir="ltr"> The options found in a configuration file are interpreted as
if they were place instead of the configuration file option on the command
line.</p>
</blockquote>
<p dir="ltr">The <tt>Wave</tt> driver program at startup looks for a configuration
file named 'wave.cfg' in every directory up the file system hierarchy starting
from the directory where the input file is located. The first file found stops
the search. If a file exists, it is treated as a normal
the search. If a 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 <tt>Wave</tt> preprocessor driver.</p>
@@ -273,7 +273,7 @@ is now disabled by default because it may cause a potential security threat. The
<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 -->Tuesday, June 26, 2007 20:19<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:40<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -99,7 +99,7 @@ public:
{
return mp.shared->ftor->has_include_guards(guard_name);
}
#endif
#endif
};
///////////////////////////////////////////////////////////////////////////////
@@ -156,7 +156,7 @@ struct make_multi_pass
typedef boost::spirit::multi_pass_policies::no_check check_policy;
#endif
typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy;
typedef boost::spirit::multi_pass_policies::default_policy<
ownership_policy, check_policy, input_policy, storage_policy>
policy_type;
@@ -169,20 +169,20 @@ class lex_iterator
: public make_multi_pass<impl::lex_iterator_functor_shim<TokenT> >::type
{
typedef impl::lex_iterator_functor_shim<TokenT> input_policy_type;
typedef typename make_multi_pass<input_policy_type>::type base_type;
typedef typename make_multi_pass<input_policy_type>::functor_data_type
functor_data_type;
typedef typename input_policy_type::unique unique_functor_type;
typedef typename input_policy_type::shared shared_functor_type;
public:
typedef TokenT token_type;
lex_iterator()
{}
template <typename IteratorT>
lex_iterator(IteratorT const &first, IteratorT const &last,
typename TokenT::position_type const &pos,
@@ -199,7 +199,7 @@ public:
void set_position(typename TokenT::position_type const &pos)
{
typedef typename TokenT::position_type position_type;
// set the new position in the current token
token_type& currtoken = this->base_type::dereference(*this);
position_type currpos = currtoken.get_position();
@@ -207,7 +207,7 @@ public:
currpos.set_file(pos.get_file());
currpos.set_line(pos.get_line());
currtoken.set_position(currpos);
// set the new position for future tokens as well
if (token_type::string_type::npos !=
currtoken.get_value().find_first_of('\n'))
@@ -216,7 +216,7 @@ public:
}
unique_functor_type::set_position(*this, currpos);
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
// return, whether the current file has include guards
// this function returns meaningful results only if the file was scanned
@@ -225,7 +225,7 @@ public:
{
return unique_functor_type::has_include_guards(*this, guard_name);
}
#endif
#endif
};
///////////////////////////////////////////////////////////////////////////////

View File

@@ -1,110 +1,106 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Wave V1.2</title>
<title>Wave V2.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="doc/theme/style.css" rel="stylesheet" type="text/css">
</head>
<body text="#000000" background="doc/theme/bkd.gif">
<table width="100%" border="0" cellspacing="2" background="doc/theme/bkd2.gif">
<tr>
<td width="21"> <h1></h1></td>
<td width="885"> <font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="6">Wave
V1.3</font></b></font></td>
<td width="96"><a href="http://www.boost.org"><img src="doc/theme/wave.gif" width="93" height="68" align="right" border="0"></a></td>
</tr>
<body style="color: rgb(0, 0, 0); background-image: url(doc/theme/bkd.gif);">
<table background="doc/theme/bkd2.gif" border="0" cellspacing="2" width="100%">
<tbody>
<tr>
<td width="21">&nbsp;</td>
<td width="885"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><b>Wave V2.0</b></font></td>
<td width="96"><a href="http://www.boost.org"><img src="doc/theme/wave.gif" align="right" border="0" height="68" width="93"></a></td>
</tr>
</tbody>
</table>
<br>
<table width="75%" border="0" align="center">
<tr>
<td class="table_title">Table of Contents</td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/preface.html">Preface</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/introduction.html">Introduction</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/quickstart.html">Quick Start</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b><font face="Geneva, Arial, Helvetica, san-serif">Class
References </font></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_context.html">The Context
Object</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_inptpolcy.html">The Input
Policy </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_ctxpolicy.html">The Context
Policy (new, upcoming interface) </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_ref_ctxpolicy_depr.html">The Context
Policy (current, but depreciated interface) </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_lexer.html">The Lexer Iterator Interface
</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_tokentype.html">The Token
Type</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/token_ids.html">The Token Identifiers </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_filepos.html">The File
Position</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b><a href="doc/predefined_macros.html">Predefined Macros</a></b></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/macro_expansion_process.html">The Macro
Expansion Process</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/compiletime_config.html">Compile Time Configuration</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/samples.html">Samples</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b>The Wave Driver Executable</b></td>
</tr>
<tr>
<td class="toc_cells_L1"><b><a href="doc/wave_driver.html">The Wave Driver Command
Line </a></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><b><a href="doc/tracing_facility.html">The Tracing Facility</a></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/supported_pragmas.html">Supported Pragma
Directives </a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/acknowledgements.html">Acknowledgments</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/references.html">References</a> </td>
</tr>
<table align="center" border="0" width="75%">
<tbody>
<tr>
<td class="table_title">Table of Contents</td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/preface.html">Preface</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/introduction.html">Introduction</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/quickstart.html">Quick Start</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b><font face="Geneva, Arial, Helvetica, san-serif">Class References </font></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_context.html">The Context Object</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_inptpolcy.html">The Input Policy </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_ctxpolicy.html">The Context Policy</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_lexer.html">The Lexer Iterator
Interface </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_tokentype.html">The Token Type</a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/token_ids.html">The Token Identifiers </a></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/class_reference_filepos.html">The File Position</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b><a href="doc/predefined_macros.html">Predefined Macros</a></b></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/macro_expansion_process.html">The Macro Expansion
Process</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/compiletime_config.html">Compile Time Configuration</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/samples.html">Samples</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><b>The Wave Driver
Executable</b></td>
</tr>
<tr>
<td class="toc_cells_L1"><b><a href="doc/wave_driver.html">The Wave Driver Command Line </a></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><b><a href="doc/tracing_facility.html">The Tracing Facility</a></b></td>
</tr>
<tr>
<td class="toc_cells_L1"><a href="doc/supported_pragmas.html">Supported Pragma
Directives </a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/acknowledgements.html">Acknowledgments</a></td>
</tr>
<tr>
<td class="toc_cells_L0"><a href="doc/references.html">References</a> </td>
</tr>
</tbody>
</table>
<br>
<hr size="1">
<p class="copyright">Copyright &copy; 2003-2008 Hartmut Kaiser<br>
<p class="copyright">Copyright &copy; 2003-2008
Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<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 -->Sunday, December 2, 2007 18:57<!-- #EndDate -->
</span></p>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Tuesday, July 29, 2008 20:31<!-- #EndDate -->
</span></p>
</body>
</html>

View File

@@ -670,7 +670,7 @@ public:
}
break;
}
result = token_type(id, token_val, pos);
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
return guards.detect_guard(result);
@@ -678,13 +678,13 @@ public:
return result;
#endif
}
// skip the T_CONTLINE token
} while (true);
}
return result = token_type(); // return T_EOI
}
void set_position(PositionT const &pos)
{
// set position has to change the file name and line number only

View File

@@ -64,7 +64,7 @@ public:
typedef lex_input_interface<TokenT>* shared;
BOOST_WAVE_EOF_PREFIX result_type const eof;
template <typename MultiPass>
static result_type& get_next(MultiPass& mp, result_type& result)
{
@@ -84,14 +84,14 @@ public:
{
mp.shared->ftor->set_position(pos);
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
template <typename MultiPass>
static bool has_include_guards(MultiPass& mp, std::string& guard_name)
{
return mp.shared->ftor->has_include_guards(guard_name);
}
#endif
#endif
private:
boost::shared_ptr<lex_input_interface<TokenT> > functor_ptr;
@@ -149,7 +149,7 @@ struct make_multi_pass
typedef boost::spirit::multi_pass_policies::no_check check_policy;
#endif
typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy;
typedef boost::spirit::multi_pass_policies::default_policy<
ownership_policy, check_policy, input_policy, storage_policy>
policy_type;
@@ -169,13 +169,13 @@ class slex_iterator
typedef typename input_policy_type::unique unique_functor_type;
typedef typename input_policy_type::shared shared_functor_type;
public:
typedef TokenT token_type;
slex_iterator()
{}
template <typename IteratorT>
slex_iterator(IteratorT const &first, IteratorT const &last,
typename TokenT::position_type const &pos,
@@ -192,22 +192,22 @@ public:
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();
token_type& currtoken = this->base_type::dereference(*this);
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);
currtoken.set_position(currpos);
// set the new position for future tokens as well
if (token_type::string_type::npos !=
currtoken.get_value().find_first_of('\n'))
{
currpos.set_line(pos.get_line() + 1);
}
unique_functor_type::get_functor().set_position(currpos);
unique_functor_type::set_position(*this, currpos);
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
@@ -216,9 +216,9 @@ public:
// completely
bool has_include_guards(std::string& guard_name) const
{
return unique_functor_type::has_include_guards(guard_name);
return unique_functor_type::has_include_guards(*this, guard_name);
}
#endif
#endif
};
///////////////////////////////////////////////////////////////////////////////

View File

@@ -602,9 +602,8 @@ public:
~lexertl_functor() {}
// get the next token from the input stream
token_type get()
token_type& get(token_type& result)
{
token_type token;
if (lexer_.is_initialized() && !at_eof) {
do {
// generate and return the next token
@@ -710,18 +709,19 @@ public:
}
break;
}
result = token_type(id, token_val, pos);
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
return guards.detect_guard(token_type(id, token_val, pos));
return guards.detect_guard(result);
#else
return token_type(id, token_val, pos);
return result;
#endif
}
} while (true); // skip the T_CONTLINE token
}
return token; // return T_EOI
return result = token_type(); // return T_EOI
}
void set_position(Position const &pos)
{
// set position has to change the file name and line number only

View File

@@ -17,7 +17,7 @@
#include <boost/assert.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/spirit/include/classic_multi_pass.hpp>
#include <boost/spirit/include/support_multi_pass.hpp>
#include <boost/wave/language_support.hpp>
#include <boost/wave/util/file_position.hpp>
@@ -47,14 +47,11 @@ namespace impl {
template <typename TokenT>
class iterator_functor_shim
{
typedef typename TokenT::position_type position_type;
public:
template <typename IteratorT>
iterator_functor_shim(IteratorT const &first, IteratorT const &last,
typename TokenT::position_type const &pos,
wave::language_support language)
: functor_ptr(lexertl_input_interface<TokenT>
::new_lexer(first, last, pos, language))
#if 0 != __DECCXX_VER || defined(__PGI)
iterator_functor_shim()
#if /*0 != __DECCXX_VER || */defined(__PGI)
, eof()
#endif // 0 != __DECCXX_VER
{}
@@ -62,27 +59,38 @@ public:
// interface to the boost::spirit::classic::multi_pass_policies::functor_input
// policy
typedef TokenT result_type;
typedef iterator_functor_shim unique;
typedef lex_input_interface<TokenT>* shared;
BOOST_WAVE_EOF_PREFIX result_type const eof;
result_type operator()()
template <typename MultiPass>
static result_type& get_next(MultiPass& mp, result_type& result)
{
BOOST_ASSERT(0 != functor_ptr.get());
return functor_ptr->get();
return mp.shared->ftor->get(result);
}
void set_position(typename TokenT::position_type const &pos)
// this will be called whenever the last reference to a multi_pass will
// be released
template <typename MultiPass>
static void destroy(MultiPass& mp)
{
delete mp.shared->ftor;
}
template <typename MultiPass>
static void set_position(MultiPass& mp, position_type const &pos)
{
BOOST_ASSERT(0 != functor_ptr.get());
functor_ptr->set_position(pos);
mp.shared->ftor->set_position(pos);
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
bool has_include_guards(std::string& guard_name) const
template <typename MultiPass>
static bool has_include_guards(MultiPass& mp, std::string& guard_name)
{
BOOST_ASSERT(0 != functor_ptr.get());
return functor_ptr->has_include_guards(guard_name);
return mp.shared->ftor->has_include_guards(guard_name);
}
#endif
#endif
private:
boost::shared_ptr<lex_input_interface<TokenT> > functor_ptr;
@@ -121,31 +129,62 @@ typename iterator_functor_shim<TokenT>::result_type const
//
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Divide the given functor type into its components (unique and shared)
// and build a std::pair from these parts
template <typename FunctorData>
struct make_multi_pass
{
typedef
std::pair<typename FunctorData::unique, typename FunctorData::shared>
functor_data_type;
typedef typename FunctorData::result_type result_type;
typedef boost::spirit::multi_pass_policies::split_functor_input input_policy;
typedef boost::spirit::multi_pass_policies::ref_counted ownership_policy;
#if defined(BOOST_WAVE_DEBUG)
typedef boost::spirit::multi_pass_policies::buf_id_check check_policy;
#else
typedef boost::spirit::multi_pass_policies::no_check check_policy;
#endif
typedef boost::spirit::multi_pass_policies::split_std_deque storage_policy;
typedef boost::spirit::multi_pass_policies::default_policy<
ownership_policy, check_policy, input_policy, storage_policy>
policy_type;
typedef boost::spirit::multi_pass<functor_data_type, policy_type> type;
};
template <typename TokenT>
class lex_iterator
: public boost::spirit::classic::multi_pass<
impl::iterator_functor_shim<TokenT>,
boost::wave::util::functor_input
>
: public make_multi_pass<impl::iterator_functor_shim<TokenT> >::type
{
typedef impl::iterator_functor_shim<TokenT> input_policy_type;
typedef
boost::spirit::classic::multi_pass<input_policy_type,
boost::wave::util::functor_input>
base_type;
typedef lex_iterator<TokenT> self_type;
typedef typename make_multi_pass<input_policy_type>::type base_type;
typedef typename make_multi_pass<input_policy_type>::functor_data_type
functor_data_type;
typedef typename input_policy_type::unique unique_functor_type;
typedef typename input_policy_type::shared shared_functor_type;
public:
typedef TokenT token_type;
lex_iterator()
{}
template <typename IteratorT>
lex_iterator(IteratorT const &first, IteratorT const &last,
typename TokenT::position_type const &pos,
boost::wave::language_support language)
: base_type(input_policy_type(first, last, pos, language))
: base_type(
functor_data_type(
unique_functor_type(),
lexertl_input_interface<TokenT>
::new_lexer(first, last, pos, language)
)
)
{}
void set_position(typename TokenT::position_type const &pos)
@@ -153,7 +192,7 @@ public:
typedef typename TokenT::position_type position_type;
// set the new position in the current token
token_type& currtoken = base_type::get_input();
token_type& currtoken = this->base_type::dereference(*this);
position_type currpos = currtoken.get_position();
currpos.set_file(pos.get_file());
@@ -166,18 +205,18 @@ public:
{
currpos.set_line(pos.get_line() + 1);
}
base_type::get_functor().set_position(currpos);
unique_functor_type::set_position(*this, currpos);
}
#if BOOST_WAVE_SUPPORT_PRAGMA_ONCE != 0
// Return, whether the current file has include guards. This function
// returns meaningful results only if the file was scanned completely.
// For now we always return false, but this can be fixed easily later on.
bool has_include_guards(std::string& guard_name) const
{
return base_type::get_functor().has_include_guards(guard_name);
return base_type::get_functor().has_include_guards(*this, guard_name);
}
#endif
#endif
};
///////////////////////////////////////////////////////////////////////////////

View File

@@ -15,7 +15,7 @@
// provided in the preprocess_pragma_output_hooks policy class. This
// #pragma preprocesses the provided arguments in the current context.
#pragma wave pp ( \
"#define A() \"some text\" and more\n" \
"#define A() \"some text\" and more\n" \
"#define B() 1.0\n" \
) \
/**/

View File

@@ -65,13 +65,13 @@ boost::wave::util::file_position_type current_position;
typedef boost::wave::context<std::string::iterator, lex_iterator_type>
context_type;
// The preprocessor iterator shouldn't be constructed directly. It is
// to be generated through a wave::context<> object. This wave:context<>
// object is to be used additionally to initialize and define different
// parameters of the actual preprocessing (not done here).
// 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.
// 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]);
// Get the preprocessor iterators and use them to generate

File diff suppressed because it is too large Load Diff

View File

@@ -9,8 +9,9 @@
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
project
:
requirements
: requirements
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
;
exe wave