Ran the chapter-renumbering thing.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5308 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Logan Johnson 2003-11-12 20:46:30 +00:00
commit dc02c4655c
14 changed files with 601 additions and 550 deletions

View file

@ -28,40 +28,41 @@
<li><a href="#n16">Hashes</a>
<li><a href="#n17">Lists</a>
<li><a href="#n18">Common operations</a>
<li><a href="#n19">I/O</a>
<li><a href="#n19">Iterating over Lists and Hashes</a>
<li><a href="#n20">I/O</a>
</ul>
<li><a href="#n20">Navigating and manipulating parse trees</a>
<li><a href="#n21">Working with attributes</a>
<li><a href="#n22">Type system</a>
<li><a href="#n21">Navigating and manipulating parse trees</a>
<li><a href="#n22">Working with attributes</a>
<li><a href="#n23">Type system</a>
<ul>
<li><a href="#n23">String encoding of types</a>
<li><a href="#n24">Type construction</a>
<li><a href="#n25">Type tests</a>
<li><a href="#n26">Typedef and inheritance</a>
<li><a href="#n27">Lvalues</a>
<li><a href="#n28">Output functions</a>
<li><a href="#n24">String encoding of types</a>
<li><a href="#n25">Type construction</a>
<li><a href="#n26">Type tests</a>
<li><a href="#n27">Typedef and inheritance</a>
<li><a href="#n28">Lvalues</a>
<li><a href="#n29">Output functions</a>
</ul>
<li><a href="#n29">Parameters</a>
<li><a href="#n30">Writing a Language Module</a>
<li><a href="#n30">Parameters</a>
<li><a href="#n31">Writing a Language Module</a>
<ul>
<li><a href="#n31">Execution model</a>
<li><a href="#n32">Starting out</a>
<li><a href="#n33">Command line options</a>
<li><a href="#n34">Configuration and preprocessing</a>
<li><a href="#n35">Entry point to code generation</a>
<li><a href="#n36">Module I/O and wrapper skeleton</a>
<li><a href="#n37">Low-level code generators</a>
<li><a href="#n38">Configuration files</a>
<li><a href="#n39">Runtime support</a>
<li><a href="#n40">Standard library files</a>
<li><a href="#n41">Examples and test cases</a>
<li><a href="#n42">Documentation</a>
<li><a href="#n32">Execution model</a>
<li><a href="#n33">Starting out</a>
<li><a href="#n34">Command line options</a>
<li><a href="#n35">Configuration and preprocessing</a>
<li><a href="#n36">Entry point to code generation</a>
<li><a href="#n37">Module I/O and wrapper skeleton</a>
<li><a href="#n38">Low-level code generators</a>
<li><a href="#n39">Configuration files</a>
<li><a href="#n40">Runtime support</a>
<li><a href="#n41">Standard library files</a>
<li><a href="#n42">Examples and test cases</a>
<li><a href="#n43">Documentation</a>
</ul>
<li><a href="#n43">Typemaps</a>
<li><a href="#n44">Typemaps</a>
<ul>
<li><a href="#n44">Proxy classes</a>
<li><a href="#n45">Proxy classes</a>
</ul>
<li><a href="#n45">Guide to parse tree nodes</a>
<li><a href="#n46">Guide to parse tree nodes</a>
</ul>
<!-- INDEX -->
@ -1175,7 +1176,8 @@ objects and report errors.
Gets the line number associated with <tt>x</tt>.
</blockquote>
<H3>Iterating over Lists and Hashes</h3>
<a name="n19"></a><H3>23.5.5 Iterating over Lists and Hashes</H3>
To iterate over the elements of a list or a hash table, the following functions are used:
@ -1214,7 +1216,7 @@ for (j = First(j); j.item; j= Next(j)) {
</pre>
</blockquote>
<a name="n19"></a><H3>23.5.5 I/O</H3>
<a name="n20"></a><H3>23.5.6 I/O</H3>
Special I/O functions are used for all internal I/O. These operations
@ -1321,7 +1323,7 @@ Printf(f, "%s\n", s);
Similarly, the preprocessor and parser all operate on string-files.
<a name="n20"></a><H2>23.6 Navigating and manipulating parse trees</H2>
<a name="n21"></a><H2>23.6 Navigating and manipulating parse trees</H2>
Parse trees are built as collections of hash tables. Each node is a hash table in which
@ -1423,7 +1425,7 @@ Deletes a node from the parse tree. Deletion reconnects siblings and properly u
the parent so that sibling nodes are unaffected.
</blockquote>
<a name="n21"></a><H2>23.7 Working with attributes</H2>
<a name="n22"></a><H2>23.7 Working with attributes</H2>
Since parse tree nodes are just hash tables, attributes are accessed using the <tt>Getattr()</tt>,
@ -1522,14 +1524,14 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
function.
</blockquote>
<a name="n22"></a><H2>23.8 Type system</H2>
<a name="n23"></a><H2>23.8 Type system</H2>
SWIG implements the complete C++ type system including typedef, inheritance,
pointers, references, and pointers to members. A detailed discussion of
type theory is impossible here. However, let's cover the highlights.
<a name="n23"></a><H3>23.8.1 String encoding of types</H3>
<a name="n24"></a><H3>23.8.1 String encoding of types</H3>
<p>
@ -1617,7 +1619,7 @@ is processed in a few pieces. In this case, you have the base type
make the final type, the two parts are just joined together using
string concatenation.
<a name="n24"></a><H3>23.8.2 Type construction</H3>
<a name="n25"></a><H3>23.8.2 Type construction</H3>
The following functions are used to construct types. You should use
@ -1724,7 +1726,7 @@ Returns the prefix of a type. For example, if <tt>ty</tt> is
<tt>ty</tt> is unmodified.
</blockquote>
<a name="n25"></a><H3>23.8.3 Type tests</H3>
<a name="n26"></a><H3>23.8.3 Type tests</H3>
The following functions can be used to test properties of a datatype.
@ -1789,7 +1791,7 @@ Checks if <tt>ty</tt> is a varargs type.
Checks if <tt>ty</tt> is a templatized type.
</blockquote>
<a name="n26"></a><H3>23.8.4 Typedef and inheritance</H3>
<a name="n27"></a><H3>23.8.4 Typedef and inheritance</H3>
The behavior of <tt>typedef</tt> declaration is to introduce a type alias.
@ -1874,7 +1876,7 @@ Fully reduces <tt>ty</tt> according to typedef rules. Resulting datatype
will consist only of primitive typenames.
</blockquote>
<a name="n27"></a><H3>23.8.5 Lvalues</H3>
<a name="n28"></a><H3>23.8.5 Lvalues</H3>
When generating wrapper code, it is necessary to emit datatypes that can
@ -1905,7 +1907,7 @@ Literal y; // type = 'Literal', ltype='p.char'
</pre>
</blockquote>
<a name="n28"></a><H3>23.8.6 Output functions</H3>
<a name="n29"></a><H3>23.8.6 Output functions</H3>
The following functions produce strings that are suitable for output.
@ -1955,7 +1957,7 @@ SWIG, but is most commonly associated with type-descriptor objects
that appear in wrappers (e.g., <tt>SWIGTYPE_p_double</tt>).
</blockquote>
<a name="n29"></a><H2>23.9 Parameters</H2>
<a name="n30"></a><H2>23.9 Parameters</H2>
Several type-related functions involve parameter lists. These include
@ -2034,7 +2036,7 @@ included. Used to emit prototypes.
Returns the number of required (non-optional) arguments in <tt>p</tt>.
</blockquote>
<a name="n30"></a><H2>23.10 Writing a Language Module</H2>
<a name="n31"></a><H2>23.10 Writing a Language Module</H2>
This section briefly outlines the steps needed to create a bare-bones
@ -2043,7 +2045,7 @@ of existing modules. Since the code is relatively easy to read, this section
describes the creation of a minimal Python module. You should be able to extrapolate
this to other languages.
<a name="n31"></a><H3>23.10.1 Execution model</H3>
<a name="n32"></a><H3>23.10.1 Execution model</H3>
Code generation modules are defined by inheriting from the <tt>Language</tt> class,
@ -2051,7 +2053,7 @@ currently defined in the <tt>Source/Modules1.1</tt> directory of SWIG. Starting
the parsing of command line options, all aspects of code generation are controlled by
different methods of the <tt>Language</tt> that must be defined by your module.
<a name="n32"></a><H3>23.10.2 Starting out</H3>
<a name="n33"></a><H3>23.10.2 Starting out</H3>
To define a new language module, first create a minimal implementation using
@ -2143,7 +2145,7 @@ Once it finishes compiling, try running SWIG with the command-line option
that activates your module. For example, <tt>swig -python foo.i</tt>. The
messages from your new module should appear.
<a name="n33"></a><H3>23.10.3 Command line options</H3>
<a name="n34"></a><H3>23.10.3 Command line options</H3>
When SWIG starts, the command line options are passed to your language module. This occurs
@ -2197,7 +2199,7 @@ If a module recognizes an option, it should always call <tt>Swig_mark_arg()</tt>
to mark the option as valid. If you forget to do this, SWIG will terminate with an
unrecognized command line option error.
<a name="n34"></a><H3>23.10.4 Configuration and preprocessing</H3>
<a name="n35"></a><H3>23.10.4 Configuration and preprocessing</H3>
In addition to looking at command line options, the <tt>main()</tt> method is responsible
@ -2240,7 +2242,7 @@ Just to review, your language module should now consist of two files--
an implementation file <tt>python.cxx</tt> and a configuration file
<tt>python.swg</tt>.
<a name="n35"></a><H3>23.10.5 Entry point to code generation</H3>
<a name="n36"></a><H3>23.10.5 Entry point to code generation</H3>
SWIG is a multi-pass compiler. Once the <tt>main()</tt> method has
@ -2294,13 +2296,13 @@ int Python::top(Node *n) {
</blockquote>
</pre>
<a name="n36"></a><H3>23.10.6 Module I/O and wrapper skeleton</H3>
<a name="n37"></a><H3>23.10.6 Module I/O and wrapper skeleton</H3>
<a name="n37"></a><H3>23.10.7 Low-level code generators</H3>
<a name="n38"></a><H3>23.10.7 Low-level code generators</H3>
<a name="n38"></a><H3>23.10.8 Configuration files</H3>
<a name="n39"></a><H3>23.10.8 Configuration files</H3>
<!-- please report bugs in this section to ttn -->
@ -2426,14 +2428,14 @@ to handle some of these configuration tasks, but that point is now
long past. If you are interested in working on that, feel free to
raise the issue in the context of a next-generation clean-slate SWIG.<p>
<a name="n39"></a><H3>23.10.9 Runtime support</H3>
<a name="n40"></a><H3>23.10.9 Runtime support</H3>
Discuss the kinds of functions typically needed for SWIG runtime support (e.g.
<tt>SWIG_ConvertPtr()</tt> and <tt>SWIG_NewPointerObj()</tt>) and the names of
the SWIG files that implement those functions.
<a name="n40"></a><H3>23.10.10 Standard library files</H3>
<a name="n41"></a><H3>23.10.10 Standard library files</H3>
Discuss the standard library files that most language modules provide, e.g.
@ -2444,7 +2446,7 @@ Discuss the standard library files that most language modules provide, e.g.
<li> stl.i </li>
</ul>
<a name="n41"></a><H3>23.10.11 Examples and test cases</H3>
<a name="n42"></a><H3>23.10.11 Examples and test cases</H3>
Each of the language modules provides one or more examples. These examples
@ -2465,7 +2467,7 @@ By default, all of the examples are built and run when the user types
during this process, see the section on <a href="#n37a">configuration
files</a>.
<a name="n42"></a><H3>23.10.12 Documentation</H3>
<a name="n43"></a><H3>23.10.12 Documentation</H3>
Don't forget to write end-user documentation for your language module. Currently,
@ -2492,13 +2494,13 @@ Some topics that you'll want to be sure to address include:
if available.
</ul>
<a name="n43"></a><H2>23.11 Typemaps</H2>
<a name="n44"></a><H2>23.11 Typemaps</H2>
<a name="n44"></a><H3>23.11.1 Proxy classes</H3>
<a name="n45"></a><H3>23.11.1 Proxy classes</H3>
<a name="n45"></a><H2>23.12 Guide to parse tree nodes</H2>
<a name="n46"></a><H2>23.12 Guide to parse tree nodes</H2>
This section describes the different parse tree nodes and their attributes.
@ -2815,4 +2817,4 @@ extern "X" { ... } declaration.
<address>SWIG 1.3 - Last Modified : January 22, 2002</address>
</body>
</html>
</html>