• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Parser Directive Inhibiting Skipping Without Pre-skip (no_skip[])</title>
5<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../../../index.html" title="Spirit 2.5.8">
8<link rel="up" href="../directive.html" title="Parser Directives">
9<link rel="prev" href="lexeme.html" title="Parser Directive Inhibiting Skipping (lexeme[])">
10<link rel="next" href="no_case.html" title="Parser Directive Inhibiting Case Sensitivity (no_case[])">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="lexeme.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../directive.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="no_case.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h5 class="title">
27<a name="spirit.qi.reference.directive.no_skip"></a><a class="link" href="no_skip.html" title="Parser Directive Inhibiting Skipping Without Pre-skip (no_skip[])">Parser Directive
28          Inhibiting Skipping Without Pre-skip (<code class="computeroutput"><span class="identifier">no_skip</span><span class="special">[]</span></code>)</a>
29</h5></div></div></div>
30<h6>
31<a name="spirit.qi.reference.directive.no_skip.h0"></a>
32            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.description"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.description">Description</a>
33          </h6>
34<p>
35            The <code class="computeroutput"><span class="identifier">no_skip</span><span class="special">[]</span></code>
36            directive turns off white space skipping. The difference to <a class="link" href="lexeme.html" title="Parser Directive Inhibiting Skipping (lexeme[])"><code class="computeroutput"><span class="identifier">lexeme</span></code></a> is that it does not do
37            pre-skipping in any case. Otherwise it is completely equivalent to the
38            <a class="link" href="lexeme.html" title="Parser Directive Inhibiting Skipping (lexeme[])"><code class="computeroutput"><span class="identifier">lexeme</span></code></a>
39            directive.
40          </p>
41<h6>
42<a name="spirit.qi.reference.directive.no_skip.h1"></a>
43            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.header"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.header">Header</a>
44          </h6>
45<pre class="programlisting"><span class="comment">// forwards to &lt;boost/spirit/home/qi/directive/no_skip.hpp&gt;</span>
46<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">qi_no_skip</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
47</pre>
48<p>
49            Also, see <a class="link" href="../../../structure/include.html" title="Include">Include Structure</a>.
50          </p>
51<h6>
52<a name="spirit.qi.reference.directive.no_skip.h2"></a>
53            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.namespace"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.namespace">Namespace</a>
54          </h6>
55<div class="informaltable"><table class="table">
56<colgroup><col></colgroup>
57<thead><tr><th>
58                    <p>
59                      Name
60                    </p>
61                  </th></tr></thead>
62<tbody><tr><td>
63                    <p>
64                      <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">no_skip</span> <span class="comment">//
65                      alias: boost::spirit::qi::no_skip</span></code>
66                    </p>
67                  </td></tr></tbody>
68</table></div>
69<h6>
70<a name="spirit.qi.reference.directive.no_skip.h3"></a>
71            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.model_of"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.model_of">Model
72            of</a>
73          </h6>
74<div class="blockquote"><blockquote class="blockquote"><p>
75              <a class="link" href="../parser_concepts/unaryparser.html" title="UnaryParser"><code class="computeroutput"><span class="identifier">UnaryParser</span></code></a>
76            </p></blockquote></div>
77<div class="variablelist">
78<p class="title"><b>Notation</b></p>
79<dl class="variablelist">
80<dt><span class="term"><code class="computeroutput"><span class="identifier">a</span></code></span></dt>
81<dd><p>
82                  A <a class="link" href="../parser_concepts/parser.html" title="Parser"><code class="computeroutput"><span class="identifier">Parser</span></code></a>.
83                </p></dd>
84</dl>
85</div>
86<h6>
87<a name="spirit.qi.reference.directive.no_skip.h4"></a>
88            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.expression_semantics"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.expression_semantics">Expression
89            Semantics</a>
90          </h6>
91<p>
92            Semantics of an expression is defined only where it differs from, or
93            is not defined in <a class="link" href="../parser_concepts/unaryparser.html" title="UnaryParser"><code class="computeroutput"><span class="identifier">UnaryParser</span></code></a>.
94          </p>
95<div class="informaltable"><table class="table">
96<colgroup>
97<col>
98<col>
99</colgroup>
100<thead><tr>
101<th>
102                    <p>
103                      Expression
104                    </p>
105                  </th>
106<th>
107                    <p>
108                      Semantics
109                    </p>
110                  </th>
111</tr></thead>
112<tbody><tr>
113<td>
114                    <p>
115                      <code class="computeroutput"><span class="identifier">no_skip</span><span class="special">[</span><span class="identifier">a</span><span class="special">]</span></code>
116                    </p>
117                  </td>
118<td>
119                    <p>
120                      Turns off white space skipping for the subject parser, <code class="computeroutput"><span class="identifier">a</span></code> (and all its children).
121                      This directive does not pre-skips.
122                    </p>
123                  </td>
124</tr></tbody>
125</table></div>
126<h6>
127<a name="spirit.qi.reference.directive.no_skip.h5"></a>
128            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.attributes"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.attributes">Attributes</a>
129          </h6>
130<p>
131            See <a class="link" href="../../quick_reference/compound_attribute_rules.html#spirit.qi.quick_reference.compound_attribute_rules.notation">Compound
132            Attribute Notation</a>.
133          </p>
134<div class="informaltable"><table class="table">
135<colgroup>
136<col>
137<col>
138</colgroup>
139<thead><tr>
140<th>
141                    <p>
142                      Expression
143                    </p>
144                  </th>
145<th>
146                    <p>
147                      Attribute
148                    </p>
149                  </th>
150</tr></thead>
151<tbody><tr>
152<td>
153                    <p>
154                      <code class="computeroutput"><span class="identifier">no_skip</span><span class="special">[</span><span class="identifier">a</span><span class="special">]</span></code>
155                    </p>
156                  </td>
157<td>
158                    <p>
159</p>
160<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">a</span><span class="special">:</span> <span class="identifier">A</span> <span class="special">--&gt;</span> <span class="identifier">no_skip</span><span class="special">[</span><span class="identifier">a</span><span class="special">]:</span> <span class="identifier">A</span>
161<span class="identifier">a</span><span class="special">:</span> <span class="identifier">Unused</span> <span class="special">--&gt;</span> <span class="identifier">no_skip</span><span class="special">[</span><span class="identifier">a</span><span class="special">]:</span> <span class="identifier">Unused</span></pre>
162<p>
163                    </p>
164                  </td>
165</tr></tbody>
166</table></div>
167<h6>
168<a name="spirit.qi.reference.directive.no_skip.h6"></a>
169            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.complexity"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.complexity">Complexity</a>
170          </h6>
171<div class="blockquote"><blockquote class="blockquote"><p>
172              The complexity is defined by the complexity of the subject parser,
173              <code class="computeroutput"><span class="identifier">a</span></code>
174            </p></blockquote></div>
175<h6>
176<a name="spirit.qi.reference.directive.no_skip.h7"></a>
177            <span class="phrase"><a name="spirit.qi.reference.directive.no_skip.example"></a></span><a class="link" href="no_skip.html#spirit.qi.reference.directive.no_skip.example">Example</a>
178          </h6>
179<div class="note"><table border="0" summary="Note">
180<tr>
181<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../images/note.png"></td>
182<th align="left">Note</th>
183</tr>
184<tr><td align="left" valign="top"><p>
185              The test harness for the example(s) below is presented in the <a class="link" href="../basics.html#spirit.qi.reference.basics.examples">Basics Examples</a>
186              section.
187            </p></td></tr>
188</table></div>
189<p>
190            Some using declarations:
191          </p>
192<p>
193</p>
194<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">qi</span><span class="special">::</span><span class="identifier">no_skip</span><span class="special">;</span>
195<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">qi</span><span class="special">::</span><span class="identifier">char_</span><span class="special">;</span>
196</pre>
197<p>
198          </p>
199<p>
200            Simple usage of <code class="computeroutput"><span class="identifier">no_skip</span><span class="special">[]</span></code>:
201          </p>
202<p>
203            The use of no_skip here will prevent skipping of whitespace in front
204            and in between the characters of the string <code class="computeroutput"><span class="char">'
205            abc '</span></code>.
206          </p>
207<p>
208</p>
209<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">str</span><span class="special">;</span>
210<span class="identifier">test_phrase_parser_attr</span><span class="special">(</span><span class="string">"'  abc  '"</span><span class="special">,</span>
211    <span class="char">'\''</span> <span class="special">&gt;&gt;</span> <span class="identifier">no_skip</span><span class="special">[+~</span><span class="identifier">char_</span><span class="special">(</span><span class="char">'\''</span><span class="special">)]</span> <span class="special">&gt;&gt;</span> <span class="char">'\''</span><span class="special">,</span> <span class="identifier">str</span><span class="special">);</span>
212<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">str</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>    <span class="comment">// will output: &gt;  abc  &lt;</span>
213</pre>
214<p>
215          </p>
216</div>
217<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
218<td align="left"></td>
219<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
220        Distributed under the Boost Software License, Version 1.0. (See accompanying
221        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
222      </p>
223</div></td>
224</tr></table>
225<hr>
226<div class="spirit-nav">
227<a accesskey="p" href="lexeme.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../directive.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="no_case.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
228</div>
229</body>
230</html>
231