1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
|
<?xml version="1.0" ?>
<!--
Copyright 2010 Eric Niebler
Distributed under the Boost
Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-->
<concept name="Expr" category="utility">
<param name="Expr" role="expession-type"/>
<param name="Tag" role="tag-type"/>
<param name="Domain" role="domain-type"/>
<param name="N" role="mpl-integral-constant-type"/>
<models-sentence>
The type <arg num="1"/> must be a model of <self/>.
</models-sentence>
<models-sentence>
The type <arg num="3"/> must be a model of <conceptname>Domain</conceptname>.
</models-sentence>
<models-sentence>
The type <arg num="4"/> must be a model of MPL Integral Constant.
</models-sentence>
<description>
<para>
An Expr represents a tagged node in an expression tree.
The children of the Expr must themselves satisfy the
Expr concept. The Expr has an arity representing the
number of children. If the number of children is zero,
the Expr also has a value. An Expr also has an associated
<conceptname>Domain</conceptname>.
</para>
</description>
<notation variables="e">
<sample-value>
<type name="Expr"/>
</sample-value>
</notation>
<associated-type name="proto_tag">
<get-member-type name="proto_tag">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>The tag type of the Expr.</simpara>
</description>
</associated-type>
<associated-type name="proto_args">
<get-member-type name="proto_args">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>A typelist representing either the types of the child nodes, or,
if the arity of the Expr is 0, of the value of the terminal.</simpara>
</description>
</associated-type>
<associated-type name="proto_arity">
<get-member-type name="proto_arity">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>
The arity (number of child nodes) of the Expr.
<computeroutput>proto_arity</computeroutput> is an MPL Integral Constant.
</simpara>
</description>
</associated-type>
<associated-type name="proto_grammar">
<get-member-type name="proto_grammar">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>
A typedef for an instantiation of
<classname alt="boost::proto::basic_expr">
<code>proto::basic_expr<></code>
</classname>
that is equivalent to Expr. Expression types are equivalent if they have the
same <code>proto_tag</code>, <code>proto_args</code>, and <code>proto_arity</code>.
</simpara>
</description>
</associated-type>
<associated-type name="proto_base_expr">
<get-member-type name="proto_base_expr">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>
A typedef for an instantiation of
<classname alt="boost::proto::expr"><code>proto::expr<></code></classname> or
<classname alt="boost::proto::basic_expr"><code>proto::basic_expr<></code></classname>
that is equivalent to Expr. Expression types are equivalent if they have the
same <code>proto_tag</code>, <code>proto_args</code>, and <code>proto_arity</code>.
</simpara>
</description>
</associated-type>
<associated-type name="proto_derived_expr">
<get-member-type name="proto_derived_expr">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>
A typedef for <code>Expr</code>.
</simpara>
</description>
</associated-type>
<associated-type name="proto_domain">
<get-member-type name="proto_domain">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>
The Domain of the Expr. <computeroutput>proto_domain</computeroutput>
models <conceptname>Domain</conceptname>.
</simpara>
</description>
</associated-type>
<associated-type name="proto_childN">
<get-member-type name="proto_childN">
<type name="Expr"/>
</get-member-type>
<description>
<simpara>The type of the Nth child of Expr. Requires
<code>0 == N::value || N::value < proto_arity::value</code></simpara>
</description>
</associated-type>
<valid-expression name="Get N-th Child">
<apply-function name="boost::proto::child< N >">
<sample-value>
<type name="Expr"/>
</sample-value>
</apply-function>
<return-type>
<require-same-type testable="yes">
<type name="proto_childN"/>
</require-same-type>
</return-type>
<semantics>Extracts the Nth child from this Expr.
Requires <computeroutput>N::value < proto_arity::value</computeroutput>.</semantics>
</valid-expression>
<valid-expression name="Get Terminal Value">
<apply-function name="boost::proto::value">
<sample-value>
<type name="Expr"/>
</sample-value>
</apply-function>
<return-type>
<require-same-type testable="yes">
<type name="proto_child0"/>
</require-same-type>
</return-type>
<semantics>
Extracts the value from a terminal Expr.
Requires <computeroutput>0 == proto_arity::value</computeroutput>.
</semantics>
</valid-expression>
<valid-expression name="Get Base">
<apply-method name="proto_base">
<sample-value>
<type name="Expr"/>
</sample-value>
</apply-method>
<return-type>
<require-same-type testable="yes">
<type name="proto_base_expr"/>
</require-same-type>
</return-type>
<semantics>
Returns an object of type
<classname alt="boost::proto::expr"><code>proto::expr<></code></classname> or
<classname alt="boost::proto::basic_expr"><code>proto::basic_expr<></code></classname>
that is equivalent to <code>e</code>.
</semantics>
</valid-expression>
<example-model>
<type name="boost::proto::literal< int >"/>
</example-model>
</concept>
|