1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>String Parsers</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="../qi_parsers.html" title="Qi Parsers"> 9<link rel="prev" href="numeric.html" title="Numeric Parsers"> 10<link rel="next" href="auxiliary.html" title="Auxiliary Parsers"> 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="numeric.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../qi_parsers.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="auxiliary.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.quick_reference.qi_parsers.string"></a><a class="link" href="string.html" title="String Parsers">String 28 Parsers</a> 29</h5></div></div></div> 30<div class="informaltable"><table class="table"> 31<colgroup> 32<col> 33<col> 34<col> 35</colgroup> 36<thead><tr> 37<th> 38 <p> 39 Expression 40 </p> 41 </th> 42<th> 43 <p> 44 Attribute 45 </p> 46 </th> 47<th> 48 <p> 49 Description 50 </p> 51 </th> 52</tr></thead> 53<tbody> 54<tr> 55<td> 56 <p> 57 <a class="link" href="../../reference/string/string.html" title="String Parsers (string, lit)"><code class="computeroutput"><span class="identifier">str</span></code></a> 58 </p> 59 </td> 60<td> 61 <p> 62 <code class="computeroutput"><span class="identifier">Unused</span></code> 63 </p> 64 </td> 65<td> 66 <p> 67 Matches <code class="computeroutput"><span class="identifier">str</span></code> 68 </p> 69 </td> 70</tr> 71<tr> 72<td> 73 <p> 74 <a class="link" href="../../reference/string/string.html" title="String Parsers (string, lit)"><code class="computeroutput"><span class="identifier">lit</span><span class="special">(</span><span class="identifier">str</span><span class="special">)</span></code></a> 75 </p> 76 </td> 77<td> 78 <p> 79 <code class="computeroutput"><span class="identifier">Unused</span></code> 80 </p> 81 </td> 82<td> 83 <p> 84 Matches <code class="computeroutput"><span class="identifier">str</span></code> 85 </p> 86 </td> 87</tr> 88<tr> 89<td> 90 <p> 91 <a class="link" href="../../reference/string/string.html" title="String Parsers (string, lit)"><code class="computeroutput"><span class="identifier">string</span><span class="special">(</span><span class="identifier">str</span><span class="special">)</span></code></a> 92 </p> 93 </td> 94<td> 95 <p> 96 <code class="computeroutput"><span class="identifier">Str</span></code> 97 </p> 98 </td> 99<td> 100 <p> 101 Matches <code class="computeroutput"><span class="identifier">str</span></code> 102 </p> 103 </td> 104</tr> 105<tr> 106<td> 107 <p> 108 <a class="link" href="../../reference/string/symbols.html" title="Symbols Parser (symbols)"><code class="computeroutput"><span class="identifier">symbols</span><span class="special"><></span></code></a> 109 </p> 110 </td> 111<td> 112 <p> 113 N/A 114 </p> 115 </td> 116<td> 117 <p> 118 Declare a symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>. 119 <code class="computeroutput"><span class="identifier">Ch</span></code> is the underlying 120 char type of the symbol table keys. <code class="computeroutput"><span class="identifier">T</span></code> 121 is the data type associated with each key. 122 </p> 123 </td> 124</tr> 125<tr> 126<td> 127 <p> 128</p> 129<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">sym</span><span class="special">.</span><span class="identifier">add</span> 130 <span class="special">(</span><span class="identifier">str1</span><span class="special">,</span> <span class="identifier">val1</span><span class="special">)</span> 131 <span class="special">(</span><span class="identifier">str2</span><span class="special">,</span> <span class="identifier">val2</span><span class="special">)</span> 132 <span class="comment">/*...more...*/</span> 133<span class="special">;</span> 134</pre> 135<p> 136 </p> 137 </td> 138<td> 139 <p> 140 N/A 141 </p> 142 </td> 143<td> 144 <p> 145 Add symbols into a symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>. 146 val1 and val2 are optional data of type <code class="computeroutput"><span class="identifier">T</span></code>, 147 the data type associated with each key. 148 </p> 149 </td> 150</tr> 151<tr> 152<td> 153 <p> 154 <code class="computeroutput"><span class="identifier">sym</span></code> 155 </p> 156 </td> 157<td> 158 <p> 159 <code class="computeroutput"><span class="identifier">T</span></code> 160 </p> 161 </td> 162<td> 163 <p> 164 Matches entries in the symbol table, <code class="computeroutput"><span class="identifier">sym</span></code>. 165 If successful, returns the data associated with the key 166 </p> 167 </td> 168</tr> 169</tbody> 170</table></div> 171</div> 172<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 173<td align="left"></td> 174<td align="right"><div class="copyright-footer">Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser<p> 175 Distributed under the Boost Software License, Version 1.0. (See accompanying 176 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>) 177 </p> 178</div></td> 179</tr></table> 180<hr> 181<div class="spirit-nav"> 182<a accesskey="p" href="numeric.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../qi_parsers.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="auxiliary.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 183</div> 184</body> 185</html> 186