Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


Diff of /doc/html/about_pyke/modifying_pyke.html [27c31b] .. [bd3505] Maximize Restore

  Switch to side-by-side view

--- a/doc/html/about_pyke/modifying_pyke.html
+++ b/doc/html/about_pyke/modifying_pyke.html
@@ -81,6 +81,8 @@
 <li><a class="reference internal" href="#which-repository-do-i-use">Which Repository Do I Use?</a></li>
+<li><a class="reference internal" href="#compiling-ply-tables-files">Compiling PLY Tables Files</a></li>
+<li><a class="reference internal" href="#compiling-the-compiler-krb-file">Compiling the Compiler.krb File</a></li>
 <li><a class="reference external" href="modifying_pyke.html#running-unit-tests">Running Unit Tests</a></li>
 <li><a class="reference external" href="modifying_pyke.html#rebuilding-the-html-documentation">Rebuilding the HTML Documentation</a></li>
@@ -90,7 +92,7 @@
 <p>With <a class="reference external" href="">Mercurial</a>, you clone the entire repository locally on your computer.
 Then you can make changes and commit those changes to your local repository.
 If you think those changes might be interesting to everybody, make your local
-repository (or a clone of it) publically available (either on your own server,
+repository (or a clone of it) publicly available (either on your own server,
 or on one of the <a class="reference external" href="">Mercurial Hosting Sites</a>) and send me an email.  I will
 pull your changes, examine them, and push them to the master repository on
@@ -161,7 +163,7 @@
 <p class="last"><tt class="docutils literal"><span class="pre">Run_pre_test</span></tt> assumes that you either have the keywording options set
 in your personal .hgrc file, or have clone hooks in place to copy these
-into the .hg/hgrc file of all clones within your pyke workarea.  See
+into the .hg/hgrc file of all clones within your pyke work area.  See
 <a class="reference internal" href="#mercurial-keyword-extension">Mercurial Keyword Extension</a>, above.</p>
@@ -189,9 +191,71 @@
+<div class="section" id="compiling-ply-tables-files">
+<h2>Compiling PLY Tables Files</h2>
+<p>Pyke uses <a class="reference external" href="">PLY</a> (Python Lex and Yacc) as it's parser generator.  PLY compiles
+the Pyke grammars into a set of three tables files:</p>
+<ul class="simple">
+<li> (from</li>
+<li> (from</li>
+<li> (from</li>
+<p>A copy of PLY is included in the source directory (pyke/krb_compiler/ply) so
+that there there can be no version mismatch between the version of PLY used to
+compile these tables files and the version of PLY installed on your machine.</p>
+<p>To regenerate these tables files, at the top-level source directory:</p>
+<pre class="literal-block">
+$ python
+&gt;&gt;&gt; from pyke.krb_compiler import kfbparser, krbparser, scanner
+&gt;&gt;&gt; scanner.init(scanner, 0, True)
+&gt;&gt;&gt; krbparser.init(krbparser, True)
+&gt;&gt;&gt; kfbparser.init(kfbparser, True)
+<p>or just run the &quot;testall&quot; program from the doctest-tools package:</p>
+<pre class="literal-block">
+$ cd pyke/krb_compiler
+$ testall
+<div class="section" id="compiling-the-compiler-krb-file">
+<h2>Compiling the Compiler.krb File</h2>
+<p>Pyke uses itself to compile your <a class="reference external" href="../knowledge_bases/index.html">knowledge base</a> sources (<a class="reference external" href="../pyke_syntax/kfb_syntax.html">.kfb</a>, <a class="reference external" href="../pyke_syntax/kqb_syntax.html">.kqb</a>
+and <a class="reference external" href="../pyke_syntax/krb_syntax/index.html">.krb</a> files) into Python source files.</p>
+<p>The knowledge base file that Pyke uses for this is
+pyke/krb_compiler/compiler.krb.  This gets compiled into, which
+is stored in the source code repository.</p>
+<!-- this code is hidden and will create the pyke/krb_compiler/compiled_krb
+directory, if needed, for the code section following:
+>>> import os, os.path
+>>> os.chdir('../../..')
+>>> root='pyke/krb_compiler'
+>>> dir=root + '/compiled_krb'
+>>> os.path.isdir(root)
+>>> if not os.path.isdir(dir): os.mkdir(dir) -->
+<p>To recompile the file, from the top-level source directory:</p>
+<pre class="literal-block">
+$ mkdir pyke/krb_compiler/compiled_krb
+$ python
+&gt;&gt;&gt; from pyke import krb_compiler
+&gt;&gt;&gt; krb_compiler.compile_krb('compiler', 'pyke.krb_compiler.compiled_krb',
+...                          'pyke/krb_compiler/compiled_krb',
+...                          'pyke/krb_compiler/compiler.krb')
+$ mv pyke/krb_compiler/compiled_krb/ pyke/krb_compiler
+<!-- this code is also hidden and deletes the
+pyke/krb_compiler/compiled_krb/ file and
+pyke/krb_compiler/compiled_krb directory created above.
+>>> os.path.isdir(root)
+>>> os.remove(dir + '/')
+>>> os.rmdir(dir) -->
 <div class="section" id="running-unit-tests">
 <h2>Running Unit Tests</h2>
-<p>The <a class="reference external" href="">doctest-tools</a> package is required to run the unit tests (see
+<p>The <a class="reference external" href="">doctest-tools</a> package is required to run the unit tests (see
 <a class="reference external" href="installing_pyke.html#other-required-packages">Other Required Packages</a> for more details).</p>
 <p>The <tt class="docutils literal"><span class="pre">testall</span></tt> and <tt class="docutils literal"><span class="pre">testdoc</span></tt> scripts from <tt class="docutils literal"><span class="pre">doctest-tools</span></tt> can be run
@@ -214,14 +278,16 @@
 <pre class="literal-block">
 $ bin/gen_html
+<p>This takes about 9 seconds.  It:</p>
 <ol class="arabic simple">
 <li>Temporarily appends hyperlink references onto all of the *.txt files.</li>
 <li>Runs <tt class="docutils literal"><span class="pre">r2w</span></tt> to regenerate the files in <tt class="docutils literal"><span class="pre">doc/html</span></tt><ul>
 <li>except for those in <tt class="docutils literal"><span class="pre">doc/html/stylesheets</span></tt> and <tt class="docutils literal"><span class="pre">doc/html/images</span></tt>.</li>
-<li>Then strips all of the hyperlink references from the *.txt files.</li>
+<li>Strips all of the hyperlink references from the *.txt files.</li>
+<li>Creates a new sitemap.xml file with all of the dates that the files were
+last modified.</li>
 <div class="note">
 <p class="first admonition-title">Note</p>
@@ -232,6 +298,12 @@
 so that you can browse the documentation locally without having to run
 <tt class="docutils literal"><span class="pre">bin/gen_html</span></tt>.  So you only need these procedures if you change the
 documentation (i.e., change the .txt files in doc/source).</p>
+<p>To test all of the code examples in the documents, use the <tt class="docutils literal"><span class="pre">testall</span></tt>
+command from the <a class="reference external" href="">doctest-tools</a> package:</p>
+<pre class="literal-block">
+$ cd doc
+$ testall
@@ -274,7 +346,7 @@
   <div id="last-modified">
     Page last modified
-    Mon, Nov 02 2009.
+    Tue, Nov 03 2009.