Imported Upstream version 1.57.0
[platform/upstream/boost.git] / doc / html / Expr.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Concept Expr</title>
5 <link rel="stylesheet" href="../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
8 <link rel="up" href="proto/reference.html" title="Reference">
9 <link rel="prev" href="Domain.html" title="Concept Domain">
10 <link rel="next" href="ObjectTransform.html" title="Concept ObjectTransform">
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="Domain.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="proto/reference.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="ObjectTransform.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="refentry">
26 <a name="Expr"></a><div class="titlepage"></div>
27 <div class="refnamediv">
28 <h2><span class="refentrytitle">Concept Expr</span></h2>
29 <p>Expr</p>
30 </div>
31 <div class="refsect1">
32 <a name="idp393577504"></a><h2>Description</h2>
33 <p>
34       An Expr represents a tagged node in an expression tree.
35       The children of the Expr must themselves satisfy the
36       Expr concept. The Expr has an arity representing the
37       number of children. If the number of children is zero,
38       the Expr also has a value. An Expr also has an associated
39       <a class="link" href="Domain.html" title="Concept Domain">Domain</a>.
40     </p>
41 </div>
42 <div class="refsect1">
43 <a name="idp393579600"></a><h2>Associated types</h2>
44 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
45 <li class="listitem">
46 <p><span class="bold"><strong>proto_tag</strong></span></p>
47 <pre class="literallayout">Expr::proto_tag</pre>
48 <p>
49       </p>
50 <p>The tag type of the Expr.</p>
51 <p>
52     </p>
53 </li>
54 <li class="listitem">
55 <p><span class="bold"><strong>proto_args</strong></span></p>
56 <pre class="literallayout">Expr::proto_args</pre>
57 <p>
58       </p>
59 <p>A typelist representing either the types of the child nodes, or,
60         if the arity of the Expr is 0, of the value of the terminal.</p>
61 <p>
62     </p>
63 </li>
64 <li class="listitem">
65 <p><span class="bold"><strong>proto_arity</strong></span></p>
66 <pre class="literallayout">Expr::proto_arity</pre>
67 <p>
68       </p>
69 <p>
70         The arity (number of child nodes) of the Expr.
71         <code class="computeroutput">proto_arity</code> is an MPL Integral Constant.
72       </p>
73 <p>
74     </p>
75 </li>
76 <li class="listitem">
77 <p><span class="bold"><strong>proto_grammar</strong></span></p>
78 <pre class="literallayout">Expr::proto_grammar</pre>
79 <p>
80       </p>
81 <p>
82         A typedef for an instantiation of
83         <code class="computeroutput"><a class="link" href="boost/proto/basic_expr.html" title="Struct template basic_expr">
84           proto::basic_expr&lt;&gt;
85         </a></code>
86         that is equivalent to Expr. Expression types are equivalent if they have the
87         same <code class="computeroutput">proto_tag</code>, <code class="computeroutput">proto_args</code>, and <code class="computeroutput">proto_arity</code>.
88       </p>
89 <p>
90     </p>
91 </li>
92 <li class="listitem">
93 <p><span class="bold"><strong>proto_base_expr</strong></span></p>
94 <pre class="literallayout">Expr::proto_base_expr</pre>
95 <p>
96       </p>
97 <p>
98         A typedef for an instantiation of
99         <code class="computeroutput"><a class="link" href="boost/proto/expr.html" title="Struct template expr">proto::expr&lt;&gt;</a></code> or
100         <code class="computeroutput"><a class="link" href="boost/proto/basic_expr.html" title="Struct template basic_expr">proto::basic_expr&lt;&gt;</a></code>
101         that is equivalent to Expr. Expression types are equivalent if they have the
102         same <code class="computeroutput">proto_tag</code>, <code class="computeroutput">proto_args</code>, and <code class="computeroutput">proto_arity</code>.
103       </p>
104 <p>
105     </p>
106 </li>
107 <li class="listitem">
108 <p><span class="bold"><strong>proto_derived_expr</strong></span></p>
109 <pre class="literallayout">Expr::proto_derived_expr</pre>
110 <p>
111       </p>
112 <p>
113         A typedef for <code class="computeroutput">Expr</code>.
114       </p>
115 <p>
116     </p>
117 </li>
118 <li class="listitem">
119 <p><span class="bold"><strong>proto_domain</strong></span></p>
120 <pre class="literallayout">Expr::proto_domain</pre>
121 <p>
122       </p>
123 <p>
124         The Domain of the Expr. <code class="computeroutput">proto_domain</code>
125         models <a class="link" href="Domain.html" title="Concept Domain">Domain</a>.
126       </p>
127 <p>
128     </p>
129 </li>
130 <li class="listitem">
131 <p><span class="bold"><strong>proto_childN</strong></span></p>
132 <pre class="literallayout">Expr::proto_childN</pre>
133 <p>
134       </p>
135 <p>The type of the Nth child of Expr. Requires 
136         <code class="computeroutput">0 == N::value || N::value &lt; proto_arity::value</code></p>
137 <p>
138     </p>
139 </li>
140 </ul></div>
141 </div>
142 <div class="refsect1">
143 <a name="idp393609776"></a><h2>Notation</h2>
144 <div class="variablelist"><dl class="variablelist">
145 <dt><span class="term">Expr</span></dt>
146 <dd>A type playing the role of expession-type in the <a class="link" href="Expr.html" title="Concept Expr">Expr</a> concept.</dd>
147 <dt><span class="term">Tag</span></dt>
148 <dd>A type playing the role of tag-type in the <a class="link" href="Expr.html" title="Concept Expr">Expr</a> concept.</dd>
149 <dt><span class="term">Domain</span></dt>
150 <dd>A type playing the role of domain-type in the <a class="link" href="Expr.html" title="Concept Expr">Expr</a> concept.</dd>
151 <dt><span class="term">N</span></dt>
152 <dd>A type playing the role of mpl-integral-constant-type in the <a class="link" href="Expr.html" title="Concept Expr">Expr</a> concept.</dd>
153 <dt><span class="term"><code class="varname">e</code></span></dt>
154 <dd>Object of type Expr</dd>
155 </dl></div>
156 </div>
157 <div class="refsect1">
158 <a name="idp393617984"></a><h2>Valid expressions</h2>
159 <div class="informaltable"><table class="table">
160 <colgroup>
161 <col>
162 <col>
163 <col>
164 <col>
165 </colgroup>
166 <thead><tr>
167 <th>Name</th>
168 <th>Expression</th>
169 <th>Type</th>
170 <th>Semantics</th>
171 </tr></thead>
172 <tbody>
173 <tr>
174 <td><p>Get N-th Child</p></td>
175 <td><p>boost::proto::child&lt; N &gt;(e)</p></td>
176 <td><p><span class="type">proto_childN</span></p></td>
177 <td><p>Extracts the Nth child from this Expr.
178       Requires <code class="computeroutput">N::value &lt; proto_arity::value</code>.</p></td>
179 </tr>
180 <tr>
181 <td><p>Get Terminal Value</p></td>
182 <td><p>boost::proto::value(e)</p></td>
183 <td><p><span class="type">proto_child0</span></p></td>
184 <td><p>
185       Extracts the value from a terminal Expr.
186       Requires <code class="computeroutput">0 == proto_arity::value</code>.
187     </p></td>
188 </tr>
189 <tr>
190 <td><p>Get Base</p></td>
191 <td><p>e.proto_base()</p></td>
192 <td><p><span class="type">proto_base_expr</span></p></td>
193 <td><p>
194         Returns an object of type
195         <code class="computeroutput"><a class="link" href="boost/proto/expr.html" title="Struct template expr">proto::expr&lt;&gt;</a></code> or
196         <code class="computeroutput"><a class="link" href="boost/proto/basic_expr.html" title="Struct template basic_expr">proto::basic_expr&lt;&gt;</a></code>
197         that is equivalent to <code class="computeroutput">e</code>.
198     </p></td>
199 </tr>
200 </tbody>
201 </table></div>
202 </div>
203 <div class="refsect1">
204 <a name="idp393631008"></a><h2>Models</h2>
205 <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><span class="simplelist"><span class="type">boost::proto::literal&lt; int &gt;</span></span></li></ul></div>
206 </div>
207 </div>
208 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
209 <td align="left"></td>
210 <td align="right"><div class="copyright-footer">Copyright &#169; 2008 Eric Niebler<p>
211         Distributed under the Boost Software License, Version 1.0. (See accompanying
212         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>)
213       </p>
214 </div></td>
215 </tr></table>
216 <hr>
217 <div class="spirit-nav">
218 <a accesskey="p" href="Domain.html"><img src="../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="proto/reference.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="ObjectTransform.html"><img src="../../doc/src/images/next.png" alt="Next"></a>
219 </div>
220 </body>
221 </html>