1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
5 <meta http-equiv=
"Content-Language" content=
"en-us">
6 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
7 <meta name=
"GENERATOR" content=
"Microsoft FrontPage 6.0">
8 <meta name=
"ProgId" content=
"FrontPage.Editor.Document">
10 <title>TokenizerFunction Concept
</title>
13 <body bgcolor=
"#FFFFFF" text=
"#000000" link=
"#0000EE" vlink=
"#551A8B" alink=
15 <p><img src=
"../../boost.png" alt=
"C++ Boost" width=
"277" height=
"86"></p>
17 <h1 align=
"center">TokenizerFunction Concept
</h1>
19 <p>A TokenizerFunction is a functor whose purpose is to parse a given
20 sequence until exactly
1 token has been found or the end is reached. It
21 then updates the token, and informs the caller of the location in the
22 sequence of the next element immediately after the last element of the
23 sequence that was parsed for the current token.
</p>
25 <h2>Refinement of
</h2>
27 <p>Assignable, CopyConstructable
</p>
31 <table border=
"1" summary=
"">
33 <td valign=
"top"><tt>X
</tt></td>
35 <td valign=
"top">A type that is a model of TokenizerFunction
</td>
39 <td valign=
"top"><tt>func
</tt></td>
41 <td valign=
"top">Object of type
<tt>X
</tt></td>
45 <td valign=
"top"><tt>tok
</tt></td>
47 <td valign=
"top">Object of Token
</td>
53 <td>iterator that points to the first unparsed element of the sequence
60 <td>iterator that points to the past the end of the sequence being
67 <p>A token is the result of parsing a sequence.
</p>
69 <h2>Valid expressions
</h2>
71 <p>In addition to the expression in Assignable and CopyConstructable the
72 following expressions are valid
</p>
74 <table border=
"1" summary=
"">
84 <td valign=
"top">Functor
</td>
86 <td valign=
"top"><tt>func(next, end, tok)
</tt></td>
88 <td valign=
"top"><tt>bool
</tt></td>
92 <td valign=
"top">reset
</td>
94 <td valign=
"top"><tt>reset()
</tt></td>
96 <td valign=
"top"><tt>void
</tt></td>
100 <h2>Expression semantics
</h2>
102 <p>In addition to the expression semantics in Assignable and
103 CopyConstructable, TokenizerFunction has the following expression
106 <table border=
"1" summary=
"">
112 <th>Precondition
</th>
116 <th>Postcondition
</th>
122 <td><tt>func(next, end, tok)
</tt></td>
124 <td><tt>next
</tt> and
<tt>end
</tt> are valid iterators to the same
125 sequence. next is a reference the function is free to modify. tok is
128 <td>The return value indicates whether a new token was found in the
129 sequence [next,end)
</td>
131 <td>If the return value is true, the new token is assigned to tok. next
132 is always updated to the position where parsing should start on the
133 subsequent call.
</td>
139 <td><tt>reset()
</tt></td>
141 <td><tt>None
</tt></td>
143 <td>Clears out all state variables that are used by the object in
144 parsing the current sequence.
</td>
146 <td>A new sequence to parse can be given.
</td>
150 <h2>Complexity guarantees
</h2>
152 <p>No guarantees. Models of TokenizerFunction are free to define their own
157 <p><a href=
"escaped_list_separator.htm">escaped_list_separator
</a></p>
159 <p><a href=
"offset_separator.htm">offset_separator
</a></p>
162 "char_delimiters_separator.htm">char_delimiters_separator
</a></p>
167 <p><a href=
"http://validator.w3.org/check?uri=referer"><img border=
"0" src=
168 "../../doc/images/valid-html401.png" alt=
"Valid HTML 4.01 Transitional"
169 height=
"31" width=
"88"></a></p>
172 <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %B, %Y" startspan -->25
173 December,
2006<!--webbot bot="Timestamp" endspan i-checksum="38518" --></p>
175 <p><i>Copyright
© 2001 John R. Bandela
</i></p>
177 <p><i>Distributed under the Boost Software License, Version
1.0. (See
178 accompanying file
<a href=
"../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
180 "http://www.boost.org/LICENSE_1_0.txt">http://www.boost.org/LICENSE_1_0.txt
</a>)
</i></p>