Skip to content

Commit

Permalink
Merged the new whitespca handling policy with the existing preprocess…
Browse files Browse the repository at this point in the history
…ing hooks.

[SVN r31864]
  • Loading branch information
hkaiser committed Dec 1, 2005
1 parent 06d43eb commit a8880c2
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 179 deletions.
8 changes: 6 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ CHANGELOG
the built Wave library and dll.
- Added the whitespace handling policy to the context object.
- Change the --preserve option of the wave tool to take a single integer
argument (0: no whitespace is preserved, 1: comments only are preserved,
argument (0: no whitespace is preserved, 1: only comments are preserved,
2: all whitespace is preserved)

- Edited the command line option descriptions of the wave driver.
- Fixed broken tags in documentation (magically inserted by DreamWeaver).
- Merged the new whitespace_handling policy with the existing preprocessing
hooks. The name of the new preprocessing hook ist may_skip_whitespace().

Boost V1.33.1
- Version 1.2.1
- Fixed bug reported as Sourceforge bug 1274584.
Expand Down
15 changes: 3 additions & 12 deletions doc/class_reference_context.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ <h2><b><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/

<span class="keyword">template</span> &lt;
<span class="keyword">typename</span> Iterator, <span class="keyword">typename</span> LexIterator,
<span class="keyword">typename</span> InputPolicy, <span class="keyword">typename</span> TracePolicy,
<span class="keyword">typename</span> WhitespacePolicy
<span class="keyword">typename</span> InputPolicy, <span class="keyword">typename</span> TracePolicy
&gt;
<span class="keyword">class</span> context <span class="special">:</span> <span class="keyword">public</span> InputPolicy
{
Expand All @@ -67,8 +66,7 @@ <h2><b><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/
<a href="class_reference_context.html#constructor">context</a>(Iterator<span class="keyword"> const</span> &amp;first_,
Iterator <span class="keyword">const</span> &amp;last_,
<span class="keyword">char const</span> *fname = <span class="string">"&lt;Unknown&gt;"</span>,
TracePolicy <span class="keyword">const</span>&amp; trace = TracePolicy(),
WhitespacePolicy <span class="keyword">const</span>&amp; ws = WhitespacePolicy())
TracePolicy <span class="keyword">const</span>&amp; trace = TracePolicy())

<span class="comment">// iterator interface</span>
iterator_type <a href="class_reference_context.html#iterator_interface_begin">begin</a>() <span class="keyword">const</span>;
Expand Down Expand Up @@ -131,10 +129,6 @@ <h2><b><a name="template_parameters"></a>Template parameters</b></h2>
<td class="table_cells"><p>The type of the trace policy class, which allows
to customize the trace output generated while expanding macros. The requirements for this policy are described <a href="class_reference_ctxpolicy.html">here</a>.</p></td>
</tr>
<tr>
<td class="table_cells"><code>WhitespacePolicy</code></td>
<td class="table_cells"><p>The type of the whitespcae policy class, which allows to to customize the whitespace handling done by the context iterators. The requirements for this policy are described <a href="class_reference_ctxws_policy.html">here</a>.</p></td>
</tr>
</table>
<p>For further information about the lexer type to use, please refer to the <a href="class_reference_lexer.html">The
Lexer Interface </a>.</p>
Expand All @@ -145,9 +139,6 @@ <h2><b><a name="template_parameters"></a>Template parameters</b></h2>
policy type is used, i.e. by default there is no tracing performed. For further
information about the hooking policy, please refer to the topic <a href="class_reference_ctxpolicy.html">The
Context Policy</a>. </p>
<p>If the template parameter WhitespacePolicy is omitted, the <tt>boost::wave::util::eat_whitespace</tt> template is used, i.e. by default all whitespace except comments (depends on the settings of the language parameter to the context constructor) is skipped. For further
information about the tracing policy, please refer to the topic <a href="class_reference_ctxws_policy.html">The
Whitespace handling Policy</a>. </p>
<h2><a name="public_typedefs"></a>Public Typedefs</h2>
<p>The <tt>boost::wave::context</tt> template defines the following public typedefs, which may be useful while using this class:</p>
<table width="90%" border="0" align="center">
Expand Down Expand Up @@ -455,7 +446,7 @@ <h3>Control extended options</h3>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Wednesday, November 30, 2005 13:57<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Thursday, December 1, 2005 10:53<!-- #EndDate -->
</span>
</p>
<p>&nbsp;</p>
Expand Down
23 changes: 17 additions & 6 deletions doc/class_reference_ctxpolicy.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<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_ctxws_policy.html"><img src="theme/r_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</table>
<blockquote>
Expand All @@ -34,6 +34,7 @@ <h2><b><a name="introduction"></a>Introduction</b></h2>
<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 were recognized, </li>
<li>a token is about to be returned from the preprocessor, </li>
<li>a macro get's defined or undefind, </li>
<li>a macro is expanded or rescanned,</li>
<li>an include file is opened or left, </li>
Expand All @@ -55,11 +56,13 @@ <h2><a name="header_synopsis"></a>Header <a href="http://cvs.sourceforge.net/vie
<span class="comment">// general hook functions</span>
<span class="keyword">template</span> &lt;<span class="keyword">typename</span> TokenT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#found_directive">found_directive</a>(TokenT <span class="keyword">const </span>&amp;directive);<br><span class="keyword">
<span class="comment">// test, whether a given token may be skipped</span><br> bool <a href="class_reference_ctxpolicy.html#may_skip_whitespace">may_skip_whitespace</a> (TokenT &amp;token, bool &amp;skipped_newline);<br>
</span><span class="comment">// Conditional compilation</span><span class="keyword">
template</span> &lt;<span class="keyword">typename</span> ContainerT&gt;<br> <span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#evaluated_conditional_expression">evaluated_conditional_expression</a>(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> TokenT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#skipped_token">skipped_token</a>(TokenT <span class="keyword">const</span>&amp; token);<br>
<span class="comment">// macro expansion tra<!-- #BeginDate format:fcAm1m -->Wednesday, November 30, 2005 15:15<!-- #EndDate -->pan> TokenT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#skipped_token">skipped_token</a>(TokenT <span class="keyword">const</span></span>&amp; token);<br>
<span class="comment">// macro expansion tracing</span><span class="keyword">
template</span> &lt;<span class="keyword">typename</span> TokenT, <span class="keyword">typename</span> ContainerT&gt;
<span class="keyword">void</span> <a href="class_reference_ctxpolicy.html#expanding_function_like_macro">expanding_function_like_macro</a>(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,
Expand Down Expand Up @@ -116,6 +119,15 @@ <h3>General hook functions </h3>
<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 parameter <tt>directive</tt> refers to the token containing the detected preprocessing directive. </p>
</blockquote>
<p><a name="may_skip_whitespace" id="may_skip"></a><strong>may_skipwhitespace</strong></p>
<pre> <span class="keyword">bool</span> may_skip_whitespace(TokenT &amp;token, <span class="keyword">bool</span>&amp; skipped_newline);
</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>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>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> ContainerT&gt;<br><span class="keyword"> void</span> evaluated_conditional_expression(ContainerT <span class="keyword">const</span>&amp; expression, <br><span class="keyword"> bool</span> expression_value);
Expand Down Expand Up @@ -308,16 +320,15 @@ <h3>Macro definition </h3>
<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_ctxws_policy.html"><img src="theme/r_arr.gif" border="0"></a></td>
<td width="30"><a href="class_reference_lexer.html"><img src="theme/r_arr.gif" border="0"></a></td>
</tr>
</table>
<hr size="1">
<p class="copyright">Copyright &copy; 2003-2005 Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Wednesday, November 30, 2005 15:15<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Thursday, December 1, 2005 11:49<!-- #EndDate -->
</span></p>
</body>
</html>
90 changes: 0 additions & 90 deletions doc/class_reference_ctxws_policy.html

This file was deleted.

8 changes: 4 additions & 4 deletions doc/class_reference_filepos.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h2><a name="template_parameters"></a>Template parameters</h2>
which gives the string type to use for storing the file name member of the file
position. If this parameter isn't given, it defaults to a <tt>std::string</tt>.
Please note, that the type given as the template parameter must be compatible
with a <tt>std::string</tt>.</p>
with a <tt>std::string. </tt>Please note, that the type given as the template parameter must be compatible with a <tt>std::string</tt>.</p>
<p>You may use your own position types if appropriate, but in any case these should implement the same interface as the <tt>file_position</tt> template described here. </p>
<h2><a name="member_functions"></a>Member functions</h2>
<h3><a name="constructors"></a>Constructors</h3>
Expand Down Expand Up @@ -111,9 +111,9 @@ <h3><a name="constructors"></a>Constructors</h3>
<hr size="1">
<p class="copyright">Copyright &copy; 2003-2005 Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span><!-- #BeginDate format:fcAm1m -->Sunday, May 15, 2005 12:23<!-- #EndDate -->e format:fcAm1m -->Thursday, May 12, 2005 9:14<!-- #EndDate -->
<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 -->
</span></p>
</body>
</html>
<!-- #BeginDate format:fcAm1m -->Sunday, May 15, 2005 12:23<!-- #EndDate -->
9 changes: 6 additions & 3 deletions doc/class_reference_lexer.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ <h2><a name="member_functions"></a>Member functions</h2>
<p class="copyright">Copyright &copy; 2003-2005 Hartmut Kaiser<br>
<br>
<font size="2">Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) </font> </p>
<span class="updated"></span>
<p class="copyright"><span class="updated">Last updated:
<!-- #BeginDate format:fcAm1m -->Sunday, May 15, 2005 12:23<!-- #EndDate -->
<<!-- #BeginDate format:fcAm1m -->Sunday, May 15, 2005 12:23<!-- #EndDate -->
<!-- #BeginDate format:fcAm1m -->Thursday, December 1, 2005 11:53<!-- #EndDate -->
</span>
</p>
</body>
</html>

Loading

0 comments on commit a8880c2

Please sign in to comment.