123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
- <title>Nonterminals</title>
- <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
- <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
- <link rel="home" href="../../index.html" title="Spirit X3 3.0.4">
- <link rel="up" href="../quick_reference.html" title="Quick Reference">
- <link rel="prev" href="compound_attribute_rules.html" title="Compound Attribute Rules">
- <link rel="next" href="semantic_actions.html" title="Parser Semantic 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="compound_attribute_rules.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../quick_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="semantic_actions.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- <div class="section">
- <div class="titlepage"><div><div><h3 class="title">
- <a name="spirit_x3.quick_reference.non_terminals"></a><a class="link" href="non_terminals.html" title="Nonterminals">Nonterminals</a>
- </h3></div></div></div>
- <div class="variablelist">
- <p class="title"><b>Notation</b></p>
- <dl class="variablelist">
- <dt><span class="term"><code class="computeroutput"><span class="identifier">Attr</span></code></span></dt>
- <dd><p>
- Synthesized attribute. The rule return type.
- </p></dd>
- <dt><span class="term"><code class="computeroutput"><span class="identifier">ID</span></code></span></dt>
- <dd><p>
- The rule ID
- </p></dd>
- <dt><span class="term"><code class="computeroutput"><span class="identifier">r</span><span class="special">,</span>
- <span class="identifier">r2</span></code></span></dt>
- <dd><p>
- Rules
- </p></dd>
- <dt><span class="term"><code class="computeroutput"><span class="identifier">r_def</span><span class="special">,</span>
- <span class="identifier">r2_def</span></code></span></dt>
- <dd><p>
- A rule definition. By convention a rule named <code class="computeroutput"><span class="identifier">r</span></code>
- should have corresponding rule definition named <code class="computeroutput"><span class="identifier">r_def</span></code>
- </p></dd>
- <dt><span class="term"><code class="computeroutput"><span class="identifier">p</span></code></span></dt>
- <dd><p>
- A parser expression
- </p></dd>
- </dl>
- </div>
- <div class="informaltable"><table class="table">
- <colgroup>
- <col>
- <col>
- </colgroup>
- <thead><tr>
- <th>
- <p>
- Expression
- </p>
- </th>
- <th>
- <p>
- Description
- </p>
- </th>
- </tr></thead>
- <tbody>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="identifier">rule</span><span class="special"><</span><span class="identifier">ID</span><span class="special">,</span>
- <span class="identifier">Attr</span><span class="special">></span>
- <span class="keyword">const</span> <span class="identifier">r</span>
- <span class="special">=</span> <span class="identifier">name</span><span class="special">;</span></code>
- </p>
- </td>
- <td>
- <p>
- Rule declaration. <code class="computeroutput"><span class="identifier">ID</span></code>
- is required. <code class="computeroutput"><span class="identifier">Attr</span></code>
- is optional and defaults to <code class="computeroutput"><span class="identifier">unused_type</span></code>.
- <code class="computeroutput"><span class="identifier">name</span></code> is an optional
- string that gives the rule its name, useful for debugging and error
- handling.
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="identifier">r</span><span class="special">.</span><span class="identifier">name</span><span class="special">()</span></code>
- </p>
- </td>
- <td>
- <p>
- Getting the name of a rule
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="keyword">auto</span> <span class="keyword">const</span>
- <span class="identifier">r_def</span> <span class="special">=</span>
- <span class="identifier">p</span><span class="special">;</span></code>
- </p>
- </td>
- <td>
- <p>
- Rule definition
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <code class="computeroutput"><span class="identifier">BOOST_SPIRIT_DEFINE</span><span class="special">(</span><span class="identifier">r</span><span class="special">,</span> <span class="identifier">r2</span><span class="special">,</span> <span class="special">...)</span></code>
- </p>
- </td>
- <td>
- <p>
- Links one or more rules (<code class="computeroutput"><span class="identifier">r</span><span class="special">,</span> <span class="identifier">r2</span><span class="special">,</span> <span class="special">...</span></code>)
- with their definitions (<code class="computeroutput"><span class="identifier">r_def</span><span class="special">,</span> <span class="identifier">r2_def</span><span class="special">,</span> <span class="special">...</span></code>)
- </p>
- </td>
- </tr>
- </tbody>
- </table></div>
- </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-2018 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 <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="compound_attribute_rules.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../quick_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="semantic_actions.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
- </div>
- </body>
- </html>
|