3 Copyright 2010 Eric Niebler
5 Distributed under the Boost
6 Software License, Version 1.0. (See accompanying
7 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 <concept name=
"Expr" category=
"utility">
10 <param name=
"Expr" role=
"expession-type"/>
11 <param name=
"Tag" role=
"tag-type"/>
12 <param name=
"Domain" role=
"domain-type"/>
13 <param name=
"N" role=
"mpl-integral-constant-type"/>
16 The type
<arg num=
"1"/> must be a model of
<self/>.
20 The type
<arg num=
"3"/> must be a model of
<conceptname>Domain
</conceptname>.
24 The type
<arg num=
"4"/> must be a model of MPL Integral Constant.
29 An Expr represents a tagged node in an expression tree.
30 The children of the Expr must themselves satisfy the
31 Expr concept. The Expr has an arity representing the
32 number of children. If the number of children is zero,
33 the Expr also has a value. An Expr also has an associated
34 <conceptname>Domain
</conceptname>.
38 <notation variables=
"e">
44 <associated-type name=
"proto_tag">
45 <get-member-type name=
"proto_tag">
49 <simpara>The tag type of the Expr.
</simpara>
53 <associated-type name=
"proto_args">
54 <get-member-type name=
"proto_args">
58 <simpara>A typelist representing either the types of the child nodes, or,
59 if the arity of the Expr is
0, of the value of the terminal.
</simpara>
63 <associated-type name=
"proto_arity">
64 <get-member-type name=
"proto_arity">
69 The arity (number of child nodes) of the Expr.
70 <computeroutput>proto_arity
</computeroutput> is an MPL Integral Constant.
75 <associated-type name=
"proto_grammar">
76 <get-member-type name=
"proto_grammar">
81 A typedef for an instantiation of
82 <classname alt=
"boost::proto::basic_expr">
83 <code>proto::basic_expr
<></code>
85 that is equivalent to Expr. Expression types are equivalent if they have the
86 same
<code>proto_tag
</code>,
<code>proto_args
</code>, and
<code>proto_arity
</code>.
91 <associated-type name=
"proto_base_expr">
92 <get-member-type name=
"proto_base_expr">
97 A typedef for an instantiation of
98 <classname alt=
"boost::proto::expr"><code>proto::expr
<></code></classname> or
99 <classname alt=
"boost::proto::basic_expr"><code>proto::basic_expr
<></code></classname>
100 that is equivalent to Expr. Expression types are equivalent if they have the
101 same
<code>proto_tag
</code>,
<code>proto_args
</code>, and
<code>proto_arity
</code>.
106 <associated-type name=
"proto_derived_expr">
107 <get-member-type name=
"proto_derived_expr">
112 A typedef for
<code>Expr
</code>.
117 <associated-type name=
"proto_domain">
118 <get-member-type name=
"proto_domain">
123 The Domain of the Expr.
<computeroutput>proto_domain
</computeroutput>
124 models
<conceptname>Domain
</conceptname>.
129 <associated-type name=
"proto_childN">
130 <get-member-type name=
"proto_childN">
134 <simpara>The type of the Nth child of Expr. Requires
135 <code>0 == N::value || N::value
< proto_arity::value
</code></simpara>
139 <valid-expression name=
"Get N-th Child">
140 <apply-function name=
"boost::proto::child< N >">
146 <require-same-type testable=
"yes">
147 <type name=
"proto_childN"/>
150 <semantics>Extracts the Nth child from this Expr.
151 Requires
<computeroutput>N::value
< proto_arity::value
</computeroutput>.
</semantics>
154 <valid-expression name=
"Get Terminal Value">
155 <apply-function name=
"boost::proto::value">
161 <require-same-type testable=
"yes">
162 <type name=
"proto_child0"/>
166 Extracts the value from a terminal Expr.
167 Requires
<computeroutput>0 == proto_arity::value
</computeroutput>.
171 <valid-expression name=
"Get Base">
172 <apply-method name=
"proto_base">
178 <require-same-type testable=
"yes">
179 <type name=
"proto_base_expr"/>
183 Returns an object of type
184 <classname alt=
"boost::proto::expr"><code>proto::expr
<></code></classname> or
185 <classname alt=
"boost::proto::basic_expr"><code>proto::basic_expr
<></code></classname>
186 that is equivalent to
<code>e
</code>.
191 <type name=
"boost::proto::literal< int >"/>