Add sphinx documentation, integrated into our navigation and colour scheme
[ndcode_site.git] / sphinx / element.html
1
2 <!DOCTYPE html>
3
4 <html xmlns="http://www.w3.org/1999/xhtml">
5   <head>
6     <meta charset="utf-8" />
7     <title>The element module &#8212; Ï€yacc  documentation</title>
8     <link rel="stylesheet" href="_static/classic.css" type="text/css" />
9     <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
10     
11     <script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
12     <script src="_static/jquery.js"></script>
13     <script src="_static/underscore.js"></script>
14     <script src="_static/doctools.js"></script>
15     <script src="_static/language_data.js"></script>
16     
17     <link rel="index" title="Index" href="genindex.html" />
18     <link rel="search" title="Search" href="search.html" />
19     <link rel="next" title="The lr1 module" href="lr1.html" />
20     <link rel="prev" title="The cli module" href="cli.html" /> 
21   </head><body>
22     <div class="related" role="navigation" aria-label="related navigation">
23       <h3>Navigation</h3>
24       <ul>
25         <li class="right" style="margin-right: 10px">
26           <a href="genindex.html" title="General Index"
27              accesskey="I">index</a></li>
28         <li class="right" >
29           <a href="py-modindex.html" title="Python Module Index"
30              >modules</a> |</li>
31         <li class="right" >
32           <a href="lr1.html" title="The lr1 module"
33              accesskey="N">next</a> |</li>
34         <li class="right" >
35           <a href="cli.html" title="The cli module"
36              accesskey="P">previous</a> |</li>
37         <li class="nav-item nav-item-0"><a href="index.html">Ï€yacc  documentation</a> &#187;</li> 
38       </ul>
39     </div>  
40
41     <div class="document">
42       <div class="documentwrapper">
43         <div class="bodywrapper">
44           <div class="body" role="main">
45             
46   <div class="section" id="module-ndcode.piyacc.element">
47 <span id="the-element-module"></span><h1>The <code class="docutils literal notranslate"><span class="pre">element</span></code> module<a class="headerlink" href="#module-ndcode.piyacc.element" title="Permalink to this headline">¶</a></h1>
48 <p>Module which provides the base class for Ï€tree Abstract Syntax Trees (ASTs) and
49 provides serialization/deserialization. The code generated by Ï€tree will define
50 specific ASTs for your project, as derived classes of that defined here.</p>
51 <p>Generally you shouldn’t check this file in to your project. Instead, at around
52 the same time you run Ï€tree to generate your <code class="docutils literal notranslate"><span class="pre">t_def.py</span></code> or similar file, also
53 install this module by using the <code class="docutils literal notranslate"><span class="pre">pitree</span> <span class="pre">--install-element</span></code> command.</p>
54 <dl class="class">
55 <dt id="ndcode.piyacc.element.Element">
56 <em class="property">class </em><code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">Element</code><span class="sig-paren">(</span><em class="sig-param">text=None</em>, <em class="sig-param">children=None</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.Element" title="Permalink to this definition">¶</a></dt>
57 <dd><p>Class which holds a single node of a Ï€tree AST.</p>
58 <dl class="attribute">
59 <dt id="ndcode.piyacc.element.Element.children">
60 <code class="sig-name descname">children</code><em class="property"> = None</em><a class="headerlink" href="#ndcode.piyacc.element.Element.children" title="Permalink to this definition">¶</a></dt>
61 <dd><p>Contains the direct child nodes, also of class <code class="docutils literal notranslate"><span class="pre">Element</span></code> or a derived class
62 of <code class="docutils literal notranslate"><span class="pre">Element</span></code>.</p>
63 <ul class="simple">
64 <li><p>Often the number of children and their meanings will be known in advance. For
65 example, a <code class="docutils literal notranslate"><span class="pre">BinaryExpression</span></code> class might have left and right children,
66 accessed via <code class="docutils literal notranslate"><span class="pre">children[0]</span></code> and <code class="docutils literal notranslate"><span class="pre">children[1]</span></code>.</p></li>
67 <li><p>Sometimes the number of children can be arbitrary. For example, a
68 <code class="docutils literal notranslate"><span class="pre">Function</span></code> class might contain an arbitrary number of statements as direct
69 children.</p></li>
70 </ul>
71 <p>It is expected that the types of the children will be known statically. In the
72 <code class="docutils literal notranslate"><span class="pre">BinaryExpression</span></code> example, the children would be of class <code class="docutils literal notranslate"><span class="pre">Expression</span></code> or
73 a derived class of <code class="docutils literal notranslate"><span class="pre">Expression</span></code>. In the <code class="docutils literal notranslate"><span class="pre">Function</span></code> example, the children
74 would be of class <code class="docutils literal notranslate"><span class="pre">Statement</span></code> or a derived class of <code class="docutils literal notranslate"><span class="pre">Statement</span></code>. When the
75 children are implicitly a tuple the children can be typed independently of one
76 another. When they are implicitly a list they should ideally have uniform type.</p>
77 <p>If no <code class="docutils literal notranslate"><span class="pre">children</span></code> argument is passed to the constructor, it will default to
78 <code class="docutils literal notranslate"><span class="pre">None</span></code> and then be internally translated to a freshly constructed empty list
79 <code class="docutils literal notranslate"><span class="pre">[]</span></code>. This ensures that it is mutable and not shared with other instances.</p>
80 </dd></dl>
81
82 <dl class="method">
83 <dt id="ndcode.piyacc.element.Element.deserialize">
84 <code class="sig-name descname">deserialize</code><span class="sig-paren">(</span><em class="sig-param">element</em>, <em class="sig-param">ref_list</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.Element.deserialize" title="Permalink to this definition">¶</a></dt>
85 <dd><p>Internal routine that supports deserialization. It should not be called
86 directly â€“ use <code class="docutils literal notranslate"><span class="pre">element.deserialize()</span></code> instead. It will be overridden in a
87 derived class if the class has fields, to set the fields from the attributes
88 of the <code class="docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> node passed in as the <code class="docutils literal notranslate"><span class="pre">element</span></code> argument.</p>
89 </dd></dl>
90
91 <dl class="method">
92 <dt id="ndcode.piyacc.element.Element.serialize">
93 <code class="sig-name descname">serialize</code><span class="sig-paren">(</span><em class="sig-param">ref_list</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.Element.serialize" title="Permalink to this definition">¶</a></dt>
94 <dd><p>Internal routine that supports serialization. It should not be called directly
95 – use <code class="docutils literal notranslate"><span class="pre">element.serialize()</span></code> instead. This method converts <code class="docutils literal notranslate"><span class="pre">self</span></code> into an
96 <code class="docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> node, populated with the recursive conversion of its
97 children. It will be overridden in a derived class if the class has fields,
98 to populate the attributes of the returned <code class="docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> node.</p>
99 </dd></dl>
100
101 <dl class="attribute">
102 <dt id="ndcode.piyacc.element.Element.text">
103 <code class="sig-name descname">text</code><em class="property"> = None</em><a class="headerlink" href="#ndcode.piyacc.element.Element.text" title="Permalink to this definition">¶</a></dt>
104 <dd><p>Contains strings of text to interpolate between the child nodes. Must have
105 length <code class="docutils literal notranslate"><span class="pre">len(self.children)</span> <span class="pre">+</span> <span class="pre">1</span></code>. So, for example, if there are two child
106 nodes the contents of the node can be conceptualized as <code class="docutils literal notranslate"><span class="pre">text[0]</span> <span class="pre">children[0]</span>
107 <span class="pre">text[1]</span> <span class="pre">children[1]</span> <span class="pre">text[2]</span></code>.</p>
108 <ul class="simple">
109 <li><p>For nodes with children, the text is often not very significant and may be
110 set to all empty strings. For example, a <code class="docutils literal notranslate"><span class="pre">BinaryExpression</span></code> node could have
111 <code class="docutils literal notranslate"><span class="pre">self.text</span> <span class="pre">==</span> <span class="pre">['',</span> <span class="pre">'',</span> <span class="pre">'']</span></code> and only <code class="docutils literal notranslate"><span class="pre">children[0]</span></code> and <code class="docutils literal notranslate"><span class="pre">children[1]</span></code>
112 significant. On the other hand, it could store the operator as a string, such
113 as <code class="docutils literal notranslate"><span class="pre">'+'</span></code> or <code class="docutils literal notranslate"><span class="pre">'-'</span></code>, in the <code class="docutils literal notranslate"><span class="pre">text[1]</span></code> field, if needed. This would print
114 in a natural way. A combination of approaches is also possible, so that text
115 isn’t significant, but would be filled in before pretty-printing the tree.</p></li>
116 <li><p>For nodes with no children, often the <code class="docutils literal notranslate"><span class="pre">text[0]</span></code> value holds the content of
117 the node. For example, an <code class="docutils literal notranslate"><span class="pre">Identifier</span></code> node would usually store its
118 identifier string in <code class="docutils literal notranslate"><span class="pre">text[0]</span></code>. Again, this would print in a natural way.</p></li>
119 </ul>
120 <p>If no <code class="docutils literal notranslate"><span class="pre">text</span></code> argument is passed to the constructor, it will default to
121 <code class="docutils literal notranslate"><span class="pre">None</span></code> and then be internally translated to a freshly constructed list of
122 the correct number of empty strings. This ensures that it is the right length
123 and also that it is mutable and not shared with other instances.</p>
124 </dd></dl>
125
126 <dl class="attribute">
127 <dt id="ndcode.piyacc.element.Element.visited">
128 <code class="sig-name descname">visited</code><em class="property"> = None</em><a class="headerlink" href="#ndcode.piyacc.element.Element.visited" title="Permalink to this definition">¶</a></dt>
129 <dd><p>During serialization, this indicates nodes that have been encountered before,
130 so that DAGs or circular constructs can be serialized and reconstructed later.
131 It contains either <code class="docutils literal notranslate"><span class="pre">None</span></code> or <code class="docutils literal notranslate"><span class="pre">(element,</span> <span class="pre">ref,</span> <span class="pre">seen)</span></code>.</p>
132 <p>Note that it is not allowed to have multiple use of direct children (direct
133 children are nodes in the <code class="docutils literal notranslate"><span class="pre">self.children</span></code> list). That is, a node may have at
134 most one direct parent. Any DAGs or circular constructs must be via fields.
135 Fields are added by creating a derived class and overriding the serialization
136 methods appropriately (or using the Ï€tree generator, which does this for you).</p>
137 </dd></dl>
138
139 </dd></dl>
140
141 <dl class="function">
142 <dt id="ndcode.piyacc.element.concatenate">
143 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">concatenate</code><span class="sig-paren">(</span><em class="sig-param">children</em>, <em class="sig-param">factory=&lt;class 'ndcode.piyacc.element.Element'&gt;</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.concatenate" title="Permalink to this definition">¶</a></dt>
144 <dd><p>Convenience function to concatenate an arbitrary number of nodes into one.</p>
145 <p>The nodes are concatenated into a new empty node constructed by the <code class="docutils literal notranslate"><span class="pre">factory</span></code>
146 function that you specify. Only the text and children are taken from the nodes
147 being concatenated, the types of the nodes and any data in fields are ignored.</p>
148 <p>The <code class="docutils literal notranslate"><span class="pre">factory</span></code> argument is usually a constructor for an <code class="docutils literal notranslate"><span class="pre">Element</span></code>-derived
149 object, but it can also be any arbitrary function, and any further arguments
150 sent after the <code class="docutils literal notranslate"><span class="pre">factory</span></code> argument will be sent into the <code class="docutils literal notranslate"><span class="pre">factory</span></code> call.</p>
151 <p>For example, suppose node <code class="docutils literal notranslate"><span class="pre">a</span></code> has two children and node <code class="docutils literal notranslate"><span class="pre">b</span></code> has one. Then
152 the call <code class="docutils literal notranslate"><span class="pre">concatenate([a,</span> <span class="pre">b])</span></code> is equivalent to:</p>
153 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Element</span><span class="p">(</span>
154   <span class="n">children</span> <span class="o">=</span> <span class="p">[</span><span class="n">a</span><span class="o">.</span><span class="n">children</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">a</span><span class="o">.</span><span class="n">children</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">b</span><span class="o">.</span><span class="n">children</span><span class="p">[</span><span class="mi">0</span><span class="p">]],</span>
155   <span class="n">text</span> <span class="o">=</span> <span class="p">[</span><span class="n">a</span><span class="o">.</span><span class="n">text</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">a</span><span class="o">.</span><span class="n">text</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">a</span><span class="o">.</span><span class="n">text</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">+</span> <span class="n">b</span><span class="o">.</span><span class="n">text</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">b</span><span class="o">.</span><span class="n">text</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span>
156 <span class="p">)</span>
157 </pre></div>
158 </div>
159 </dd></dl>
160
161 <dl class="function">
162 <dt id="ndcode.piyacc.element.deserialize">
163 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">deserialize</code><span class="sig-paren">(</span><em class="sig-param">fin</em>, <em class="sig-param">factory=&lt;class 'ndcode.piyacc.element.Element'&gt;</em>, <em class="sig-param">encoding='unicode'</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.deserialize" title="Permalink to this definition">¶</a></dt>
164 <dd><p>Front end to the deserializer. Essentially, reverses the process of
165 <code class="docutils literal notranslate"><span class="pre">element.serialize()</span></code>. All the same comments apply to this function also.</p>
166 <p>The tricky part with deserializing is knowing what kind of object to construct.
167 For instance if the XML looks like this,</p>
168 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">root</span><span class="o">&gt;</span>
169   <span class="o">&lt;</span><span class="n">AnObject</span> <span class="n">ref</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="o">&gt;</span><span class="n">some</span> <span class="n">text</span><span class="o">&lt;/</span><span class="n">AnObject</span><span class="o">&gt;</span>
170 <span class="o">&lt;/</span><span class="n">root</span><span class="o">&gt;</span>
171 </pre></div>
172 </div>
173 <p>we want to find a constructor for a derived class of <code class="docutils literal notranslate"><span class="pre">Element</span></code> called
174 <code class="docutils literal notranslate"><span class="pre">AnObject</span></code>. This is the role of the <code class="docutils literal notranslate"><span class="pre">factory</span></code> function that you pass in to
175 <code class="docutils literal notranslate"><span class="pre">deserialize()</span></code>. It takes a tag name such as <code class="docutils literal notranslate"><span class="pre">'AnObject'</span></code>, followed by the
176 arguments to be passed into <code class="docutils literal notranslate"><span class="pre">AnObject</span></code>’s constructor. Typically the
177 <code class="docutils literal notranslate"><span class="pre">factory</span></code> function will be written like this:</p>
178 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">tag_to_class</span> <span class="o">=</span> <span class="p">{</span>
179   <span class="s1">&#39;AnObject&#39;</span><span class="p">:</span> <span class="n">AnObject</span>
180 <span class="p">}</span>
181 <span class="k">def</span> <span class="nf">factory</span><span class="p">(</span><span class="n">tag</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
182   <span class="k">return</span> <span class="n">tag_to_class</span><span class="p">[</span><span class="n">tag</span><span class="p">](</span><span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
183 </pre></div>
184 </div>
185 <p>It is also possible to have a more complex factory function, for instance if
186 you have defined an AST to use as a mini-language inside another AST, and you
187 want to defer object creation to the mini-language’s factory for those objects.</p>
188 </dd></dl>
189
190 <dl class="function">
191 <dt id="ndcode.piyacc.element.deserialize_ref">
192 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">deserialize_ref</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">ref_list</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.deserialize_ref" title="Permalink to this definition">¶</a></dt>
193 <dd><p>Internal routine to deserialize a reference and return an object of type
194 <code class="docutils literal notranslate"><span class="pre">Element</span></code> or a derived class of <code class="docutils literal notranslate"><span class="pre">Element</span></code>. It is meant to be called from
195 the <code class="docutils literal notranslate"><span class="pre">deserialize()</span></code> method of a derived class of <code class="docutils literal notranslate"><span class="pre">Element</span></code>, for
196 deserializing fields that are references to an AST node or AST subtree.</p>
197 <p>The reference has already been processed as an integer and hence the <code class="docutils literal notranslate"><span class="pre">value</span></code>
198 is the position in <code class="docutils literal notranslate"><span class="pre">ref_list</span></code> where the referenced object is to be found,
199 or <code class="docutils literal notranslate"><span class="pre">-1</span></code>. Returns that object from <code class="docutils literal notranslate"><span class="pre">ref_list</span></code>, or <code class="docutils literal notranslate"><span class="pre">None</span></code> for <code class="docutils literal notranslate"><span class="pre">-1</span></code>.</p>
200 </dd></dl>
201
202 <dl class="function">
203 <dt id="ndcode.piyacc.element.serialize">
204 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">serialize</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">fout</em>, <em class="sig-param">encoding='unicode'</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.serialize" title="Permalink to this definition">¶</a></dt>
205 <dd><p>Front end to the serializer. Pass in an AST that is to be serialized and an
206 output stream to place the serialized output on. The encoding should be passed
207 as either <code class="docutils literal notranslate"><span class="pre">'unicode'</span></code> for encoding to standard output or <code class="docutils literal notranslate"><span class="pre">'utf-8'</span></code> for
208 encoding to a file descriptor, this is a bit hacky and one should refer to the
209 code of <code class="docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> to see what it really does with this value.</p>
210 <p>The output stream will look something like:</p>
211 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">root</span><span class="o">&gt;</span>
212   <span class="o">&lt;</span><span class="n">AnObject</span> <span class="n">ref</span><span class="o">=</span><span class="s2">&quot;0&quot;</span><span class="o">&gt;&lt;</span><span class="n">ANestedObject</span> <span class="o">/&gt;&lt;/</span><span class="n">AnObject</span><span class="o">&gt;</span>
213   <span class="o">&lt;</span><span class="n">AnotherObject</span> <span class="n">ref</span><span class="o">=</span><span class="s2">&quot;1&quot;</span> <span class="o">/&gt;</span>
214 <span class="o">&lt;/</span><span class="n">root</span><span class="o">&gt;</span>
215 </pre></div>
216 </div>
217 <p>The object with the attribute <code class="docutils literal notranslate"><span class="pre">ref=&quot;0&quot;</span></code> corresponds to the <code class="docutils literal notranslate"><span class="pre">value</span></code>
218 parameter passed in here. Any direct children, grandchildren etc will be
219 serialized inside it. Objects which are accessed through fields from those
220 objects will be serialized separately and be given higher reference numbers.
221 Note that those secondary objects can also have direct children, which are
222 serialized inside those secondary objects, and so on. The <code class="docutils literal notranslate"><span class="pre">&lt;root&gt;...&lt;/root&gt;</span></code>
223 element then ends up being a collection of all objects with no direct parent.</p>
224 </dd></dl>
225
226 <dl class="function">
227 <dt id="ndcode.piyacc.element.serialize_ref">
228 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">serialize_ref</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">ref_list</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.serialize_ref" title="Permalink to this definition">¶</a></dt>
229 <dd><p>Internal routine to serialize a reference and return a value that can be placed
230 in the attribute dictionary of an <code class="docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> node. It is meant
231 to be called from the <code class="docutils literal notranslate"><span class="pre">serialize()</span></code> method of a derived class of <code class="docutils literal notranslate"><span class="pre">Element</span></code>,
232 for serializing fields that are references to an AST node or AST subtree.</p>
233 <p>This is a special case, since other kinds of values (<code class="docutils literal notranslate"><span class="pre">int</span></code>, <code class="docutils literal notranslate"><span class="pre">str</span></code> etc) can
234 be serialized by the <code class="docutils literal notranslate"><span class="pre">json</span></code> module, whereas references must be recursively
235 converted. If the reference has already been serialized its value is returned
236 directly, otherwise it will be added to the list <code class="docutils literal notranslate"><span class="pre">ref_list</span></code> and serialized.
237 The value returned is its position in <code class="docutils literal notranslate"><span class="pre">ref_list</span></code> (it behaves like serializing
238 an integer from that point on). The <code class="docutils literal notranslate"><span class="pre">None</span></code> value is serialized as <code class="docutils literal notranslate"><span class="pre">-1</span></code>.</p>
239 </dd></dl>
240
241 <dl class="function">
242 <dt id="ndcode.piyacc.element.to_text">
243 <code class="sig-prename descclassname">ndcode.piyacc.element.</code><code class="sig-name descname">to_text</code><span class="sig-paren">(</span><em class="sig-param">root</em><span class="sig-paren">)</span><a class="headerlink" href="#ndcode.piyacc.element.to_text" title="Permalink to this definition">¶</a></dt>
244 <dd><p>Convenience function to recursively extract all the text from a subtree.</p>
245 <p>The result is similar to serializing the subtree (itself, its direct children,
246 grandchildren etc) to XML, and then throwing away all XML tags and attributes.</p>
247 <p>For example, if there are two child nodes, the value returned will be:</p>
248 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">text</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">to_text</span><span class="p">(</span><span class="n">children</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span> <span class="n">text</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">to_text</span><span class="p">(</span><span class="n">children</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">text</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span>
249 </pre></div>
250 </div>
251 </dd></dl>
252
253 </div>
254
255
256           </div>
257         </div>
258       </div>
259       <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
260         <div class="sphinxsidebarwrapper">
261   <h4>Previous topic</h4>
262   <p class="topless"><a href="cli.html"
263                         title="previous chapter">The <code class="docutils literal notranslate"><span class="pre">cli</span></code> module</a></p>
264   <h4>Next topic</h4>
265   <p class="topless"><a href="lr1.html"
266                         title="next chapter">The <code class="docutils literal notranslate"><span class="pre">lr1</span></code> module</a></p>
267   <div role="note" aria-label="source link">
268     <h3>This Page</h3>
269     <ul class="this-page-menu">
270       <li><a href="_sources/element.rst.txt"
271             rel="nofollow">Show Source</a></li>
272     </ul>
273    </div>
274 <div id="searchbox" style="display: none" role="search">
275   <h3 id="searchlabel">Quick search</h3>
276     <div class="searchformwrapper">
277     <form class="search" action="search.html" method="get">
278       <input type="text" name="q" aria-labelledby="searchlabel" />
279       <input type="submit" value="Go" />
280     </form>
281     </div>
282 </div>
283 <script>$('#searchbox').show(0);</script>
284         </div>
285       </div>
286       <div class="clearer"></div>
287     </div>
288     <div class="related" role="navigation" aria-label="related navigation">
289       <h3>Navigation</h3>
290       <ul>
291         <li class="right" style="margin-right: 10px">
292           <a href="genindex.html" title="General Index"
293              >index</a></li>
294         <li class="right" >
295           <a href="py-modindex.html" title="Python Module Index"
296              >modules</a> |</li>
297         <li class="right" >
298           <a href="lr1.html" title="The lr1 module"
299              >next</a> |</li>
300         <li class="right" >
301           <a href="cli.html" title="The cli module"
302              >previous</a> |</li>
303         <li class="nav-item nav-item-0"><a href="index.html">Ï€yacc  documentation</a> &#187;</li> 
304       </ul>
305     </div>
306     <div class="footer" role="contentinfo">
307         &#169; Copyright 2020, NDCODE project.
308       Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.4.1.
309     </div>
310   </body>
311 </html>