|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r68164 - in trunk/libs/spirit/doc/html/spirit: advanced/customize karma/reference/directive
From: admin_at_[hidden]
Date: 2011-01-14 19:03:13
Author: wash
Date: 2011-01-14 19:03:12 EST (Fri, 14 Jan 2011)
New Revision: 68164
URL: http://svn.boost.org/trac/boost/changeset/68164
Log:
Added html docs that I missed.
Added:
trunk/libs/spirit/doc/html/spirit/advanced/customize/attribute_as.html (contents, props changed)
trunk/libs/spirit/doc/html/spirit/karma/reference/directive/as.html (contents, props changed)
Added: trunk/libs/spirit/doc/html/spirit/advanced/customize/attribute_as.html
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/doc/html/spirit/advanced/customize/attribute_as.html 2011-01-14 19:03:12 EST (Fri, 14 Jan 2011)
@@ -0,0 +1,319 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Atomically Extract an Attribute Value from a Container (Karma)</title>
+<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="../../../index.html" title="Spirit 2.4.2">
+<link rel="up" href="../customize.html" title="Customization of Spirit's Attribute Handling">
+<link rel="prev" href="iterate/compare_iterators.html" title="Compare two Iterator pointing into a Container Attribute for Equality">
+<link rel="next" href="auto.html" title="Create Components from Attributes (Qi and Karma)">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="iterate/compare_iterators.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../customize.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="auto.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="spirit.advanced.customize.attribute_as"></a><a class="link" href="attribute_as.html" title="Atomically Extract an Attribute Value from a Container (Karma)">Atomically
+ Extract an Attribute Value from a Container (Karma)</a>
+</h4></div></div></div>
+<a name="spirit.advanced.customize.attribute_as.attribute_as"></a><h6>
+<a name="id1092176"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.attribute_as">attribute_as</a>
+ </h6>
+<p>
+ <code class="computeroutput"><span class="identifier">attribute_as</span></code> atomically
+ extracts an instance of a type from another type. This customization point
+ is used by the <a class="link" href="../../karma/reference/directive/as.html" title="Generator Directives Forcing Atomic Extraction (as<T>, as_string[], as_wstring[])"><code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>[]</span></code></a>
+ directive.
+ </p>
+<a name="spirit.advanced.customize.attribute_as.module_headers"></a><h6>
+<a name="id1092239"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.module_headers">Module
+ Headers</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">spirit</span><span class="special">/</span><span class="identifier">home</span><span class="special">/</span><span class="identifier">support</span><span class="special">/</span><span class="identifier">attributes_fwd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
+<p>
+ Also, see <a class="link" href="../../structure/include.html" title="Include">Include Structure</a>.
+ </p>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ This header file does not need to be included directly by any user program
+ as it is normally included by other Spirit header files relying on its
+ content.
+ </p></td></tr>
+</table></div>
+<a name="spirit.advanced.customize.attribute_as.namespace"></a><h6>
+<a name="id1092350"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.namespace">Namespace</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th>
+ <p>
+ Name
+ </p>
+ </th></tr></thead>
+<tbody><tr><td>
+ <p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">traits</span></code>
+ </p>
+ </td></tr></tbody>
+</table></div>
+<a name="spirit.advanced.customize.attribute_as.synopsis"></a><h6>
+<a name="id1092435"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.synopsis">Synopsis</a>
+ </h6>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Attribute</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Enable</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">attribute_as</span><span class="special">;</span>
+</pre>
+<a name="spirit.advanced.customize.attribute_as.template_parameters"></a><h6>
+<a name="id1092546"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.template_parameters">Template
+ parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Parameter
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Default
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">T</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The type of the attribute natively exposed by the component the
+ <code class="computeroutput"><span class="identifier">extract_from</span></code>
+ is invoked from.
+ </p>
+ </td>
+<td>
+ <p>
+ none
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">Attribute</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The type of the attribute to be used to generate output from.
+ </p>
+ </td>
+<td>
+ <p>
+ none
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">Enable</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Helper template parameter usable to selectively enable or disable
+ certain specializations of <code class="computeroutput"><span class="identifier">attribute_as</span></code>
+ utilizing SFINAE (i.e. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if</span></code>
+ or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">disable_if</span></code>).
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="keyword">void</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<a name="spirit.advanced.customize.attribute_as.notation"></a><h6>
+<a name="id1092780"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.notation">Notation</a>
+ </h6>
+<div class="variablelist">
+<p class="title"><b>Notation</b></p>
+<dl>
+<dt><span class="term"><code class="computeroutput"><span class="identifier">attr</span></code></span></dt>
+<dd><p>
+ An instance of type <code class="computeroutput"><span class="identifier">Attrib</span></code>.
+ </p></dd>
+</dl>
+</div>
+<a name="spirit.advanced.customize.attribute_as.expression_semantics"></a><h6>
+<a name="id1092839"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.expression_semantics">Expression
+ Semantics</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Expression
+ </p>
+ </th>
+<th>
+ <p>
+ Semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">attribute_as</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Attribute</span><span class="special">>::</span><span class="identifier">type</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The result type of the extraction.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">attribute_as</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Attribute</span><span class="special">>::</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">attr</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Extract and return an instance of <code class="computeroutput"><span class="identifier">type</span></code>.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">attribute_as</span><span class="special"><</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">Attribute</span><span class="special">>::</span><span class="identifier">valid_as</span><span class="special">(</span><span class="identifier">attr</span><span class="special">)</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Determine, at runtime, if the extraction of an instance of <code class="computeroutput"><span class="identifier">type</span></code> from <code class="computeroutput"><span class="identifier">attr</span></code>
+ would cause an error.
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<a name="spirit.advanced.customize.attribute_as.predefined_specializations"></a><h6>
+<a name="id1093118"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.predefined_specializations">Predefined
+ Specializations</a>
+ </h6>
+<p>
+ Spirit predefines specializations
+ of this customization point for several types. The following table lists
+ those types together with the types exposed and the corresponding semantics:
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Template Parameters
+ </p>
+ </th>
+<th>
+ <p>
+ Value
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">unused_type</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ The exposed typedef <code class="computeroutput"><span class="identifier">type</span></code>
+ is defined to <code class="computeroutput"><span class="identifier">unused_type</span></code>.
+ The function <code class="computeroutput"><span class="identifier">call</span><span class="special">()</span></code> returns an instance of <code class="computeroutput"><span class="identifier">unused_type</span></code>.
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<a name="spirit.advanced.customize.attribute_as.when_to_implement"></a><h6>
+<a name="id1093257"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.when_to_implement">When
+ to implement</a>
+ </h6>
+<p>
+ This customization point may need to be implemented when using the <a class="link" href="../../karma/reference/directive/as.html" title="Generator Directives Forcing Atomic Extraction (as<T>, as_string[], as_wstring[])"><code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>[]</span></code></a> directive.
+ </p>
+<a name="spirit.advanced.customize.attribute_as.example"></a><h6>
+<a name="id1093310"></a>
+ <a class="link" href="attribute_as.html#spirit.advanced.customize.attribute_as.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 © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="iterate/compare_iterators.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../customize.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="auto.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Added: trunk/libs/spirit/doc/html/spirit/karma/reference/directive/as.html
==============================================================================
--- (empty file)
+++ trunk/libs/spirit/doc/html/spirit/karma/reference/directive/as.html 2011-01-14 19:03:12 EST (Fri, 14 Jan 2011)
@@ -0,0 +1,356 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Generator Directives Forcing Atomic Extraction (as<T>, as_string[], as_wstring[])</title>
+<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
+<link rel="home" href="../../../../index.html" title="Spirit 2.4.2">
+<link rel="up" href="../directive.html" title="Generator Directives">
+<link rel="prev" href="columns.html" title="Generator Directive Separating Output Into Columns (columns[])">
+<link rel="next" href="../nonterminal.html" title="Nonterminal Generators">
+</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">Home</td>
+<td align="center">Libraries</td>
+<td align="center">People</td>
+<td align="center">FAQ</td>
+<td align="center">More</td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="columns.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../directive.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="../nonterminal.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h5 class="title">
+<a name="spirit.karma.reference.directive.as"></a><a class="link" href="as.html" title="Generator Directives Forcing Atomic Extraction (as<T>, as_string[], as_wstring[])">Generator Directives
+ Forcing Atomic Extraction (<code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>,</span> <span class="identifier">as_string</span><span class="special">[],</span> <span class="identifier">as_wstring</span><span class="special">[]</span></code>)</a>
+</h5></div></div></div>
+<a name="spirit.karma.reference.directive.as.description"></a><h6>
+<a name="id961284"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.description">Description</a>
+ </h6>
+<p>
+ The <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
+ class forces the atomic extraction of an object of type T from it's consumed
+ attribute. Usually, repetitive generators (such as <a class="link" href="../operator/kleene.html" title="Kleene Star Generator (*a)">Kleene
+ (<code class="computeroutput"><span class="special">*</span></code>)</a>, etc) or sequences
+ exposing a <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">A</span><span class="special">></span></code>
+ will extract elements from the container supplied as their consumed attribute
+ by looping through the containers iterators. In some cases, this may
+ be undesirable. The <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code> class creates a directive that will
+ pass an unnamed temporary object of type <code class="computeroutput"><span class="identifier">T</span></code>
+ to it's subject, if extracting <code class="computeroutput"><span class="identifier">T</span></code>
+ from it's consumed attribute determined at generation-time to be valid.
+ <a class="link" href="../../../advanced/customize/attribute_as.html" title="Atomically Extract an Attribute Value from a Container (Karma)"><code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">valid_as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>()</span></code></a>
+ is called by <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
+ to determine validity; if it returns false, the generator fails. Subsequent
+ extraction is performed by calling <a class="link" href="../../../advanced/customize/attribute_as.html" title="Atomically Extract an Attribute Value from a Container (Karma)"><code class="computeroutput"><span class="identifier">traits</span><span class="special">::</span><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>()</span></code></a>.
+ </p>
+<a name="spirit.karma.reference.directive.as.header"></a><h6>
+<a name="id961525"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.header">Header</a>
+ </h6>
+<pre class="programlisting"><span class="comment">// forwards to <boost/spirit/home/karma/directive/as.hpp>
+</span><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">karma_as</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre>
+<p>
+ Also, see <a class="link" href="../../../structure/include.html" title="Include">Include Structure</a>.
+ </p>
+<a name="spirit.karma.reference.directive.as.namespace"></a><h6>
+<a name="id961624"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.namespace">Namespace</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup><col></colgroup>
+<thead><tr><th>
+ <p>
+ Name
+ </p>
+ </th></tr></thead>
+<tbody>
+<tr><td>
+ <p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">as_string</span> <span class="comment">//
+ alias: boost::spirit::karma::as_string</span></code>
+ </p>
+ </td></tr>
+<tr><td>
+ <p>
+ <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">as_wstring</span> <span class="comment">//
+ alias: boost::spirit::karma::as_wstring</span></code>
+ </p>
+ </td></tr>
+</tbody>
+</table></div>
+<a name="spirit.karma.reference.directive.as.synopsis"></a><h6>
+<a name="id961760"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.synopsis">Synopsis</a>
+ </h6>
+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">></span>
+<span class="keyword">struct</span> <span class="identifier">as</span><span class="special">;</span>
+</pre>
+<a name="spirit.karma.reference.directive.as.template_parameters"></a><h6>
+<a name="id961828"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.template_parameters">Template
+ parameters</a>
+ </h6>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Parameter
+ </p>
+ </th>
+<th>
+ <p>
+ Description
+ </p>
+ </th>
+<th>
+ <p>
+ Default
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">T</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Attribute type.
+ </p>
+ </td>
+<td>
+ <p>
+ none
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<a name="spirit.karma.reference.directive.as.model_of"></a><h6>
+<a name="id961922"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.model_of">Model of</a>
+ </h6>
+<div class="blockquote"><blockquote class="blockquote"><p>
+ <a class="link" href="../generator_concepts/unarygenerator.html" title="UnaryGenerator"><code class="computeroutput"><span class="identifier">UnaryGenerator</span></code></a>
+ </p></blockquote></div>
+<div class="variablelist">
+<p class="title"><b>Notation</b></p>
+<dl>
+<dt><span class="term"><code class="computeroutput"><span class="identifier">a</span></code></span></dt>
+<dd><p>
+ A <a class="link" href="../generator_concepts/generator.html" title="Generator"><code class="computeroutput"><span class="identifier">Generator</span></code></a>.
+ </p></dd>
+<dt><span class="term"><code class="computeroutput"><span class="identifier">attr</span></code></span></dt>
+<dd><p>
+ The attribute supplied to the directive.
+ </p></dd>
+</dl>
+</div>
+<a name="spirit.karma.reference.directive.as.expression_semantics"></a><h6>
+<a name="id962029"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.expression_semantics">Expression
+ Semantics</a>
+ </h6>
+<p>
+ Semantics of an expression is defined only where it differs from, or
+ is not defined in <a class="link" href="../generator_concepts/unarygenerator.html" title="UnaryGenerator"><code class="computeroutput"><span class="identifier">UnaryGenerator</span></code></a>.
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Expression
+ </p>
+ </th>
+<th>
+ <p>
+ Semantics
+ </p>
+ </th>
+</tr></thead>
+<tbody>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>()[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Extract an instance of <code class="computeroutput"><span class="identifier">T</span></code>
+ from <code class="computeroutput"><span class="identifier">attr</span></code>,
+ and invoke the subject generator <code class="computeroutput"><span class="identifier">a</span></code>,
+ supplying the unnamed temporary as it's attribute.
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">as_string</span><span class="special">[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Equivalent to <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>()[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+</tr>
+<tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">as_wstring</span><span class="special">[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ Equivalent to <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span><span class="special">>()[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+</tr>
+</tbody>
+</table></div>
+<a name="spirit.karma.reference.directive.as.attributes"></a><h6>
+<a name="id962348"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.attributes">Attributes</a>
+ </h6>
+<p>
+ See <a class="link" href="../../quick_reference/compound_attribute_rules.html#spirit.karma.quick_reference.compound_attribute_rules.notation">Compound
+ Attribute Notation</a>.
+ </p>
+<div class="informaltable"><table class="table">
+<colgroup>
+<col>
+<col>
+</colgroup>
+<thead><tr>
+<th>
+ <p>
+ Expression
+ </p>
+ </th>
+<th>
+ <p>
+ Attribute
+ </p>
+ </th>
+</tr></thead>
+<tbody><tr>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>()[</span><span class="identifier">a</span><span class="special">]</span></code>
+ </p>
+ </td>
+<td>
+ <p>
+ <code class="computeroutput"><span class="identifier">a</span><span class="special">:</span>
+ <span class="identifier">A</span> <span class="special">--></span>
+ <span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">>()[</span><span class="identifier">a</span><span class="special">]:</span>
+ <span class="identifier">T</span></code>
+ </p>
+ </td>
+</tr></tbody>
+</table></div>
+<a name="spirit.karma.reference.directive.as.complexity"></a><h6>
+<a name="id962522"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.complexity">Complexity</a>
+ </h6>
+<div class="blockquote"><blockquote class="blockquote"><p>
+ The complexity is defined by the complexity of the subject generator,
+ <code class="computeroutput"><span class="identifier">a</span></code>, and the complexity
+ of the extraction unnamed temporary object of type <code class="computeroutput"><span class="identifier">T</span></code>
+ from the attribute <code class="computeroutput"><span class="identifier">attr</span></code>
+ </p></blockquote></div>
+<a name="spirit.karma.reference.directive.as.example"></a><h6>
+<a name="id962581"></a>
+ <a class="link" href="as.html#spirit.karma.reference.directive.as.example">Example</a>
+ </h6>
+<div class="note"><table border="0" summary="Note">
+<tr>
+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../images/note.png"></td>
+<th align="left">Note</th>
+</tr>
+<tr><td align="left" valign="top"><p>
+ The test harness for the example(s) below is presented in the <a class="link" href="../basics.html#spirit.karma.reference.basics.examples">Basics Examples</a>
+ section.
+ </p></td></tr>
+</table></div>
+<p>
+ Some using declarations:
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">utree</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">utree_type</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">utf8_symbol_type</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">karma</span><span class="special">::</span><span class="identifier">as</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">karma</span><span class="special">::</span><span class="identifier">as_string</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">karma</span><span class="special">::</span><span class="identifier">char_</span><span class="special">;</span>
+<span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">karma</span><span class="special">::</span><span class="identifier">double_</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ Simple usage of <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>,
+ <code class="computeroutput"><span class="identifier">as_string</span></code> and <code class="computeroutput"><span class="identifier">as_wstring</span></code>:
+ </p>
+<p>
+ To properly handle string concatenation with <a class="link" href="../../../support/utree.html" title="The utree data structure"><code class="computeroutput"><span class="identifier">utree</span></code></a>, we make use of <code class="computeroutput"><span class="identifier">as_string</span><span class="special">[]</span></code>.
+ We also use <code class="computeroutput"><span class="identifier">as</span><span class="special"><</span><span class="identifier">T</span><span class="special">></span></code>
+ to explicitly extract a <a class="link" href="../../../support/utree.html" title="The utree data structure"><code class="computeroutput"><span class="identifier">utree</span></code></a> symbol node.
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">as</span><span class="special"><</span><span class="identifier">utf8_symbol_type</span><span class="special">></span> <span class="identifier">as_symbol_type</span><span class="special">;</span>
+<span class="identifier">as_symbol_type</span> <span class="keyword">const</span> <span class="identifier">as_symbol</span> <span class="special">=</span> <span class="identifier">as_symbol_type</span><span class="special">();</span>
+
+<span class="identifier">utree</span> <span class="identifier">ut</span><span class="special">;</span>
+<span class="identifier">ut</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="string">"xyz"</span><span class="special">);</span>
+<span class="identifier">ut</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1.23</span><span class="special">);</span>
+
+<span class="identifier">test_generator_attr</span><span class="special">(</span><span class="string">"xyz1.23"</span><span class="special">,</span> <span class="identifier">as_string</span><span class="special">[*</span><span class="identifier">char_</span><span class="special">]</span> <span class="special"><<</span> <span class="identifier">double_</span><span class="special">,</span> <span class="identifier">ut</span><span class="special">);</span>
+<span class="identifier">test_generator_attr</span><span class="special">(</span><span class="string">"xyz1.23"</span><span class="special">,</span> <span class="identifier">as</span><span class="special"><</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">>()[*</span><span class="identifier">char_</span><span class="special">]</span> <span class="special"><<</span> <span class="identifier">double_</span><span class="special">,</span> <span class="identifier">ut</span><span class="special">);</span>
+
+<span class="identifier">ut</span><span class="special">.</span><span class="identifier">clear</span><span class="special">();</span>
+
+<span class="identifier">ut</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">utf8_symbol_type</span><span class="special">(</span><span class="string">"xyz"</span><span class="special">));</span>
+<span class="identifier">ut</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="number">1.23</span><span class="special">);</span>
+
+<span class="identifier">test_generator_attr</span><span class="special">(</span><span class="string">"xyz1.23"</span><span class="special">,</span> <span class="identifier">as_symbol</span><span class="special">[*</span><span class="identifier">char_</span><span class="special">]</span> <span class="special"><<</span> <span class="identifier">double_</span><span class="special">,</span> <span class="identifier">ut</span><span class="special">);</span>
+<span class="identifier">test_generator_attr</span><span class="special">(</span><span class="string">"xyz1.23"</span><span class="special">,</span> <span class="identifier">as</span><span class="special"><</span><span class="identifier">utf8_symbol_type</span><span class="special">>()[*</span><span class="identifier">char_</span><span class="special">]</span> <span class="special"><<</span> <span class="identifier">double_</span><span class="special">,</span> <span class="identifier">ut</span><span class="special">);</span>
+</pre>
+<p>
+ </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 © 2001-2011 Joel de Guzman, Hartmut Kaiser<p>
+ 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)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="columns.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../directive.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="../nonterminal.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk