Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/api/private/bison.BisonParser-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ <h2 class="class">Class BisonParser</h2>
<td><b><a href="bison.BisonParser-class.html#bisonHFile"><code>bisonHFile</code></a></b> = <span title="'tmp.tab.h'"><code><span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
<td><b><a href="bison.BisonParser-class.html#bisonHFile1"><code>bisonHFile1</code></a></b> = <span title="'tokens.h'"><code><span class="variable-quote">'</span>tokens.h<span class="variable-quote">'</span> </code>
<td><b><a href="bison.BisonParser-class.html#bisonHFile1"><code>bisonHFile1</code></a></b> = <span title="'tmp.tab.h'"><code><span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>classobj</code></font></td>
<td><a name="defaultNodeClass"></a><b><code>defaultNodeClass</code></b> = <a href="bison.BisonNode-class.html"><code>bison.BisonNode</code></a></td></tr>
Expand Down Expand Up @@ -584,10 +584,10 @@ <h3>bisonHFile1</h3>
<code>str</code>

</dd>
<span title="'tokens.h'"> <dt><b>Value:</b></dt>
<span title="'tmp.tab.h'"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
<span class="variable-quote">'</span>tokens.h<span class="variable-quote">'</span> </pre>
<span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
Expand Down
6 changes: 3 additions & 3 deletions doc/api/public/bison.BisonParser-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ <h2 class="class">Class BisonParser</h2>
<td><b><a href="bison.BisonParser-class.html#bisonHFile"><code>bisonHFile</code></a></b> = <span title="'tmp.tab.h'"><code><span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>str</code></font></td>
<td><b><a href="bison.BisonParser-class.html#bisonHFile1"><code>bisonHFile1</code></a></b> = <span title="'tokens.h'"><code><span class="variable-quote">'</span>tokens.h<span class="variable-quote">'</span> </code>
<td><b><a href="bison.BisonParser-class.html#bisonHFile1"><code>bisonHFile1</code></a></b> = <span title="'tmp.tab.h'"><code><span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </code>
</span></td></tr>
<tr><td align="right" valign="top" width="15%"><font size="-1"><code>classobj</code></font></td>
<td><a name="defaultNodeClass"></a><b><code>defaultNodeClass</code></b> = <a href="bison.BisonNode-class.html"><code>bison.BisonNode</code></a></td></tr>
Expand Down Expand Up @@ -550,10 +550,10 @@ <h3>bisonHFile1</h3>
<code>str</code>

</dd>
<span title="'tokens.h'"> <dt><b>Value:</b></dt>
<span title="'tmp.tab.h'"> <dt><b>Value:</b></dt>
<dd><table><tr><td>
<pre class="variable">
<span class="variable-quote">'</span>tokens.h<span class="variable-quote">'</span> </pre>
<span class="variable-quote">'</span>tmp.tab.h<span class="variable-quote">'</span> </pre>
</td></tr></table></dd>
</span> </dl>
</dd>
Expand Down
10 changes: 5 additions & 5 deletions doc/walkthrough.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ <h3>1.3. Preparing Your Tokeniser File</h3>
#include &lt;string.h&gt;
#include "Python.h"
#define YYSTYPE void *
#include "tokens.h"
#include "tmp.tab.h"
extern void *py_parser;
extern void (*py_input)(PyObject *parser, char *buf, int *result, int max_size);
#define returntoken(tok) yylval = PyUnicode_FromString(strdup(yytext)); return (tok);
Expand All @@ -231,11 +231,11 @@ <h3>1.3. Preparing Your Tokeniser File</h3>
just give them opaque pointers, and <b>void *</b> will suffice just fine.

<b><pre>
#include "tokens.h"</pre></b>
#include "tmp.tab.h"</pre></b>

When PyBison first instantiates any given parser class (and auto-generates, processes,
compiles, links the grammar/scanner files into a dynamic lib), the bison program generates
a header file of token definitions, which gets renamed to <b>tokens.h</b>. Your scanner
a header file of token definitions, which gets renamed to <b>tmp.tab.h</b>. Your scanner
script will need this file, so the token macros will be defined and resolved to the correct
token numbers.

Expand Down Expand Up @@ -690,7 +690,7 @@ <h3>2.8. Add Flex Script</h3>
#include &lt;string.h&gt;
#include "Python.h"
#define YYSTYPE void *
#include "tokens.h"
#include "tmp.tab.h"
extern void *py_parser;
extern void (*py_input)(PyObject *parser, char *buf, int *result, int max_size);
#define returntoken(tok) yylval = PyUnicode_FromString(strdup(yytext)); return (tok);
Expand Down Expand Up @@ -775,7 +775,7 @@ <h3>2.8. Add Flex Script</h3>
#include &lt;string.h&gt;
#include "Python.h"
#define YYSTYPE void *
#include "tokens.h"
#include "tmp.tab.h"
extern void *py_parser;
extern void (*py_input)(PyObject *parser, char *buf, int *result, int max_size);
#define returntoken(tok) yylval = PyUnicode_FromString(strdup(yytext)); return (tok);
Expand Down
4 changes: 2 additions & 2 deletions src/bison/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ class BisonParser(object):
bisonHFile = 'tmp.tab.h'

# C output file from bison gets renamed to this.
bisonCFile1 = bisonCFile # 'tmp.bison.c'
bisonCFile1 = bisonCFile # 'tmp.tab.c'
# Bison-generated header file gets renamed to this.
bisonHFile1 = bisonHFile # 'tokens.h'
bisonHFile1 = bisonHFile # 'tmp.tab.h'

# flex file names
flexFile = 'tmp.l'
Expand Down