| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> |
| <title>BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</title> |
| <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> |
| <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> |
| <link rel="home" href="../../../index.html" title="Chapter 1. Phoenix 3.0"> |
| <link rel="up" href="../expression.html" title="Phoenix Expressions"> |
| <link rel="prev" href="boost_phoenix_define_expression_ext.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION_EXT"> |
| <link rel="next" href="../actions.html" title="More on Actions"> |
| </head> |
| <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| <table cellpadding="2" width="100%"><tr> |
| <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td> |
| <td align="center"><a href="../../../../../../../index.html">Home</a></td> |
| <td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> |
| <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> |
| <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> |
| <td align="center"><a href="../../../../../../../more/index.htm">More</a></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="boost_phoenix_define_expression_ext.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../expression.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="../actions.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| <div class="section"> |
| <div class="titlepage"><div><div><h4 class="title"> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg"></a><a class="link" href="boost_phoenix_define_expression_ext_vararg.html" title="BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</a> |
| </h4></div></div></div> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.description"></a><h6> |
| <a name="id626103"></a> |
| <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.description">Description</a> |
| </h6> |
| <p> |
| <code class="computeroutput"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</span></code> |
| is a macro that can be used to generate all the necessary boilerplate to |
| create Phoenix Expressions |
| </p> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.synopsis"></a><h6> |
| <a name="id626139"></a> |
| <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.synopsis">Synopsis</a> |
| </h6> |
| <pre class="programlisting"><span class="identifier">BOOST_PHOENIX_DEFINE_EXPRESSION_EXT_VARARG</span><span class="special">(</span> |
| <span class="identifier">actor</span> |
| <span class="special">,</span> <span class="special">(</span><span class="identifier">namespace_seq</span><span class="special">)(</span><span class="identifier">name</span><span class="special">)</span> |
| <span class="special">,</span> <span class="special">(</span><span class="identifier">child_grammar0</span><span class="special">)</span> |
| <span class="special">(</span><span class="identifier">child_grammar1</span><span class="special">)</span> |
| <span class="special">...</span> |
| <span class="special">(</span><span class="identifier">child_grammarN</span><span class="special">)</span> |
| <span class="special">,</span> <span class="identifier">N</span> |
| <span class="special">)</span> |
| </pre> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.semantics"></a><h6> |
| <a name="id626281"></a> |
| <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.semantics">Semantics</a> |
| </h6> |
| <p> |
| The above macro generates the necessary code for an expression <code class="computeroutput"><span class="identifier">name</span></code> in namespace <code class="computeroutput"><span class="identifier">namespace_seq</span></code>. |
| <code class="computeroutput"><span class="identifier">N</span></code> is the maximum number |
| of variable children. All but the last elements in the grammar sequence |
| are required children of the expression, and the last denotes a variable |
| number of children. The number of children an expression of this kind can |
| hold is therefor <code class="computeroutput"><span class="identifier">N</span><span class="special">-</span><span class="number">1</span></code> plus the size of the sequence |
| </p> |
| <p> |
| The macro should be used at global scope. <code class="computeroutput"><span class="identifier">namespace_seq</span></code> |
| shall be the sequence of namespaces under which the following symbols will |
| be defined: |
| </p> |
| <pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">tag</span> |
| <span class="special">{</span> |
| <span class="keyword">struct</span> <span class="identifier">name</span><span class="special">;</span> |
| <span class="special">}</span> |
| |
| <span class="keyword">namespace</span> <span class="identifier">expression</span> |
| <span class="special">{</span> |
| <span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">A0</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">A1</span> <span class="special">...</span> <span class="keyword">typename</span> <span class="identifier">AN</span><span class="special">></span> |
| <span class="keyword">struct</span> <span class="identifier">name</span> |
| <span class="special">:</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">expr_ext</span><span class="special"><</span> |
| <span class="identifier">actor</span> |
| <span class="special">,</span> <span class="identifier">tag</span><span class="special">::</span><span class="identifier">name</span> |
| <span class="special">,</span> <span class="identifier">A0</span> |
| <span class="special">,</span> <span class="identifier">A1</span> |
| <span class="special">...</span> |
| <span class="special">,</span> <span class="identifier">AN</span> |
| <span class="special">></span> |
| <span class="special">{};</span> |
| <span class="special">}</span> |
| |
| <span class="keyword">namespace</span> <span class="identifier">rule</span> |
| <span class="special">{</span> |
| <span class="keyword">struct</span> <span class="identifier">name</span> |
| <span class="special">:</span> <span class="identifier">expression</span><span class="special">::</span><span class="identifier">name</span><span class="special"><</span> |
| <span class="identifier">child_grammar0</span> |
| <span class="special">,</span> <span class="identifier">child_grammar1</span> |
| <span class="special">...</span> |
| <span class="special">,</span> <span class="identifier">proto</span><span class="special">::</span><span class="identifier">vararg</span><span class="special"><</span><span class="identifier">child_grammarN</span><span class="special">></span> |
| <span class="special">></span> |
| <span class="special">{};</span> |
| <span class="special">}</span> |
| </pre> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.header"></a><h6> |
| <a name="id626746"></a> |
| <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.header">Header</a> |
| </h6> |
| <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">phoenix</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">expression</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> |
| </pre> |
| <a name="phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.example"></a><h6> |
| <a name="id626828"></a> |
| <a class="link" href="boost_phoenix_define_expression_ext_vararg.html#phoenix.inside.expression.boost_phoenix_define_expression_ext_vararg.example">Example</a> |
| </h6> |
| <p> |
| TBD |
| </p> |
| </div> |
| <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> |
| <td align="left"></td> |
| <td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2010 Joel de Guzman, Dan Marsden, Thomas Heller<p> |
| Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 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>) |
| </p> |
| </div></td> |
| </tr></table> |
| <hr> |
| <div class="spirit-nav"> |
| <a accesskey="p" href="boost_phoenix_define_expression_ext.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../expression.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="../actions.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> |
| </div> |
| </body> |
| </html> |