Put the chapters back in order after erroneously incorrectly reordering them in last checkin
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10294 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9d4fe6576d
commit
c99fe90574
35 changed files with 1572 additions and 1571 deletions
|
|
@ -6,7 +6,7 @@
|
|||
</head>
|
||||
|
||||
<body bgcolor="#ffffff">
|
||||
<H1><a name="Extending"></a>7 Extending SWIG to support new languages</H1>
|
||||
<H1><a name="Extending"></a>34 Extending SWIG to support new languages</H1>
|
||||
<!-- INDEX -->
|
||||
<div class="sectiontoc">
|
||||
<ul>
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
|
||||
|
||||
<H2><a name="Extending_nn2"></a>7.1 Introduction</H2>
|
||||
<H2><a name="Extending_nn2"></a>34.1 Introduction</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -89,7 +89,7 @@ Also, this chapter is not meant to be a hand-holding tutorial. As a starting po
|
|||
you should probably look at one of SWIG's existing modules.
|
||||
</p>
|
||||
|
||||
<H2><a name="Extending_nn3"></a>7.2 Prerequisites</H2>
|
||||
<H2><a name="Extending_nn3"></a>34.2 Prerequisites</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -119,7 +119,7 @@ obvious, but almost all SWIG directives as well as the low-level generation of
|
|||
wrapper code are driven by C++ datatypes.
|
||||
</p>
|
||||
|
||||
<H2><a name="Extending_nn4"></a>7.3 The Big Picture</H2>
|
||||
<H2><a name="Extending_nn4"></a>34.3 The Big Picture</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -156,7 +156,7 @@ role in making the system work. For example, both typemaps and declaration anno
|
|||
based on pattern matching and interact heavily with the underlying type system.
|
||||
</p>
|
||||
|
||||
<H2><a name="Extending_nn5"></a>7.4 Execution Model</H2>
|
||||
<H2><a name="Extending_nn5"></a>34.4 Execution Model</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -201,7 +201,7 @@ latter stage of compilation.
|
|||
The next few sections briefly describe some of these stages.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn6"></a>7.4.1 Preprocessing</H3>
|
||||
<H3><a name="Extending_nn6"></a>34.4.1 Preprocessing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -281,7 +281,7 @@ been expanded as well as everything else that goes into the low-level
|
|||
construction of the wrapper code.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn7"></a>7.4.2 Parsing</H3>
|
||||
<H3><a name="Extending_nn7"></a>34.4.2 Parsing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -382,7 +382,7 @@ returning a <tt>foo</tt> and taking types <tt>a</tt> and <tt>b</tt> as
|
|||
arguments).
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn8"></a>7.4.3 Parse Trees</H3>
|
||||
<H3><a name="Extending_nn8"></a>34.4.3 Parse Trees</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -636,7 +636,7 @@ $ swig -c++ -python -debug-module 4 example.i
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn9"></a>7.4.4 Attribute namespaces</H3>
|
||||
<H3><a name="Extending_nn9"></a>34.4.4 Attribute namespaces</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -655,7 +655,7 @@ that matches the name of the target language. For example, <tt>python:foo</tt>
|
|||
<tt>perl:foo</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn10"></a>7.4.5 Symbol Tables</H3>
|
||||
<H3><a name="Extending_nn10"></a>34.4.5 Symbol Tables</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -746,7 +746,7 @@ example.i:5. Previous declaration is foo_i(int )
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn11"></a>7.4.6 The %feature directive</H3>
|
||||
<H3><a name="Extending_nn11"></a>34.4.6 The %feature directive</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -802,7 +802,7 @@ For example, the exception code above is simply
|
|||
stored without any modifications.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn12"></a>7.4.7 Code Generation</H3>
|
||||
<H3><a name="Extending_nn12"></a>34.4.7 Code Generation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -924,7 +924,7 @@ public :
|
|||
The role of these functions is described shortly.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn13"></a>7.4.8 SWIG and XML</H3>
|
||||
<H3><a name="Extending_nn13"></a>34.4.8 SWIG and XML</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -937,7 +937,7 @@ internal data structures, it may be useful to keep XML in the back of
|
|||
your mind as a model.
|
||||
</p>
|
||||
|
||||
<H2><a name="Extending_nn14"></a>7.5 Primitive Data Structures</H2>
|
||||
<H2><a name="Extending_nn14"></a>34.5 Primitive Data Structures</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -983,7 +983,7 @@ typedef Hash Typetab;
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn15"></a>7.5.1 Strings</H3>
|
||||
<H3><a name="Extending_nn15"></a>34.5.1 Strings</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1124,7 +1124,7 @@ Returns the number of replacements made (if any).
|
|||
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn16"></a>7.5.2 Hashes</H3>
|
||||
<H3><a name="Extending_nn16"></a>34.5.2 Hashes</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1201,7 +1201,7 @@ Returns the list of hash table keys.
|
|||
</div>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn17"></a>7.5.3 Lists</H3>
|
||||
<H3><a name="Extending_nn17"></a>34.5.3 Lists</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1290,7 +1290,7 @@ If <tt>t</tt> is not a standard object, it is assumed to be a <tt>char *</tt>
|
|||
and is used to create a String object.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn18"></a>7.5.4 Common operations</H3>
|
||||
<H3><a name="Extending_nn18"></a>34.5.4 Common operations</H3>
|
||||
|
||||
|
||||
The following operations are applicable to all datatypes.
|
||||
|
|
@ -1345,7 +1345,7 @@ objects and report errors.
|
|||
Gets the line number associated with <tt>x</tt>.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn19"></a>7.5.5 Iterating over Lists and Hashes</H3>
|
||||
<H3><a name="Extending_nn19"></a>34.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:
|
||||
|
|
@ -1390,7 +1390,7 @@ for (j = First(j); j.item; j= Next(j)) {
|
|||
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn20"></a>7.5.6 I/O</H3>
|
||||
<H3><a name="Extending_nn20"></a>34.5.6 I/O</H3>
|
||||
|
||||
|
||||
Special I/O functions are used for all internal I/O. These operations
|
||||
|
|
@ -1526,7 +1526,7 @@ Similarly, the preprocessor and parser all operate on string-files.
|
|||
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn21"></a>7.6 Navigating and manipulating parse trees</H2>
|
||||
<H2><a name="Extending_nn21"></a>34.6 Navigating and manipulating parse trees</H2>
|
||||
|
||||
|
||||
Parse trees are built as collections of hash tables. Each node is a hash table in which
|
||||
|
|
@ -1660,7 +1660,7 @@ Deletes a node from the parse tree. Deletion reconnects siblings and properly u
|
|||
the parent so that sibling nodes are unaffected.
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn22"></a>7.7 Working with attributes</H2>
|
||||
<H2><a name="Extending_nn22"></a>34.7 Working with attributes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1777,7 +1777,7 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
|
|||
function.
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn23"></a>7.8 Type system</H2>
|
||||
<H2><a name="Extending_nn23"></a>34.8 Type system</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1786,7 +1786,7 @@ pointers, references, and pointers to members. A detailed discussion of
|
|||
type theory is impossible here. However, let's cover the highlights.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn24"></a>7.8.1 String encoding of types</H3>
|
||||
<H3><a name="Extending_nn24"></a>34.8.1 String encoding of types</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -1887,7 +1887,7 @@ make the final type, the two parts are just joined together using
|
|||
string concatenation.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn25"></a>7.8.2 Type construction</H3>
|
||||
<H3><a name="Extending_nn25"></a>34.8.2 Type construction</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2056,7 +2056,7 @@ Returns the prefix of a type. For example, if <tt>ty</tt> is
|
|||
<tt>ty</tt> is unmodified.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn26"></a>7.8.3 Type tests</H3>
|
||||
<H3><a name="Extending_nn26"></a>34.8.3 Type tests</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2143,7 +2143,7 @@ Checks if <tt>ty</tt> is a varargs type.
|
|||
Checks if <tt>ty</tt> is a templatized type.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn27"></a>7.8.4 Typedef and inheritance</H3>
|
||||
<H3><a name="Extending_nn27"></a>34.8.4 Typedef and inheritance</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2245,7 +2245,7 @@ Fully reduces <tt>ty</tt> according to typedef rules. Resulting datatype
|
|||
will consist only of primitive typenames.
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn28"></a>7.8.5 Lvalues</H3>
|
||||
<H3><a name="Extending_nn28"></a>34.8.5 Lvalues</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2282,7 +2282,7 @@ Literal y; // type = 'Literal', ltype='p.char'
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn29"></a>7.8.6 Output functions</H3>
|
||||
<H3><a name="Extending_nn29"></a>34.8.6 Output functions</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2344,7 +2344,7 @@ SWIG, but is most commonly associated with type-descriptor objects
|
|||
that appear in wrappers (e.g., <tt>SWIGTYPE_p_double</tt>).
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn30"></a>7.9 Parameters</H2>
|
||||
<H2><a name="Extending_nn30"></a>34.9 Parameters</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2443,7 +2443,7 @@ included. Used to emit prototypes.
|
|||
Returns the number of required (non-optional) arguments in <tt>p</tt>.
|
||||
</div>
|
||||
|
||||
<H2><a name="Extending_nn31"></a>7.10 Writing a Language Module</H2>
|
||||
<H2><a name="Extending_nn31"></a>34.10 Writing a Language Module</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2458,7 +2458,7 @@ describes the creation of a minimal Python module. You should be able to extra
|
|||
this to other languages.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn32"></a>7.10.1 Execution model</H3>
|
||||
<H3><a name="Extending_nn32"></a>34.10.1 Execution model</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2468,7 +2468,7 @@ the parsing of command line options, all aspects of code generation are controll
|
|||
different methods of the <tt>Language</tt> that must be defined by your module.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn33"></a>7.10.2 Starting out</H3>
|
||||
<H3><a name="Extending_nn33"></a>34.10.2 Starting out</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2576,7 +2576,7 @@ that activates your module. For example, <tt>swig -python foo.i</tt>. The
|
|||
messages from your new module should appear.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn34"></a>7.10.3 Command line options</H3>
|
||||
<H3><a name="Extending_nn34"></a>34.10.3 Command line options</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2635,7 +2635,7 @@ to mark the option as valid. If you forget to do this, SWIG will terminate wit
|
|||
unrecognized command line option error.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn35"></a>7.10.4 Configuration and preprocessing</H3>
|
||||
<H3><a name="Extending_nn35"></a>34.10.4 Configuration and preprocessing</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2684,7 +2684,7 @@ an implementation file <tt>python.cxx</tt> and a configuration file
|
|||
<tt>python.swg</tt>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn36"></a>7.10.5 Entry point to code generation</H3>
|
||||
<H3><a name="Extending_nn36"></a>34.10.5 Entry point to code generation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -2742,7 +2742,7 @@ int Python::top(Node *n) {
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn37"></a>7.10.6 Module I/O and wrapper skeleton</H3>
|
||||
<H3><a name="Extending_nn37"></a>34.10.6 Module I/O and wrapper skeleton</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to mgossage -->
|
||||
|
|
@ -2884,7 +2884,7 @@ functionWrapper : void Shape_y_set(Shape *self,double y)
|
|||
</pre>
|
||||
</div>
|
||||
|
||||
<H3><a name="Extending_nn38"></a>7.10.7 Low-level code generators</H3>
|
||||
<H3><a name="Extending_nn38"></a>34.10.7 Low-level code generators</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to mgossage -->
|
||||
|
|
@ -3038,7 +3038,7 @@ but without the typemaps, there is still work to do.
|
|||
</p>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn39"></a>7.10.8 Configuration files</H3>
|
||||
<H3><a name="Extending_nn39"></a>34.10.8 Configuration files</H3>
|
||||
|
||||
|
||||
<!-- please report bugs in this section to ttn -->
|
||||
|
|
@ -3188,7 +3188,7 @@ politely displays the ignoring language message.
|
|||
</dl>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn40"></a>7.10.9 Runtime support</H3>
|
||||
<H3><a name="Extending_nn40"></a>34.10.9 Runtime support</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3197,7 +3197,7 @@ Discuss the kinds of functions typically needed for SWIG runtime support (e.g.
|
|||
the SWIG files that implement those functions.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn41"></a>7.10.10 Standard library files</H3>
|
||||
<H3><a name="Extending_nn41"></a>34.10.10 Standard library files</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3216,7 +3216,7 @@ The following are the minimum that are usually supported:
|
|||
Please copy these and modify for any new language.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn42"></a>7.10.11 Examples and test cases</H3>
|
||||
<H3><a name="Extending_nn42"></a>34.10.11 Examples and test cases</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3245,7 +3245,7 @@ during this process, see the section on <a href="#n37a">configuration
|
|||
files</a>.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_nn43"></a>7.10.12 Documentation</H3>
|
||||
<H3><a name="Extending_nn43"></a>34.10.12 Documentation</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3277,7 +3277,7 @@ Some topics that you'll want to be sure to address include:
|
|||
if available.
|
||||
</ul>
|
||||
|
||||
<H3><a name="Extending_prerequisites"></a>7.10.13 Prerequisites for adding a new language module to the SWIG distribution</H3>
|
||||
<H3><a name="Extending_prerequisites"></a>34.10.13 Prerequisites for adding a new language module to the SWIG distribution</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3334,7 +3334,7 @@ should be added should there be an area not already covered by
|
|||
the existing tests.
|
||||
</p>
|
||||
|
||||
<H3><a name="Extending_coding_style_guidelines"></a>7.10.14 Coding style guidelines</H3>
|
||||
<H3><a name="Extending_coding_style_guidelines"></a>34.10.14 Coding style guidelines</H3>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
@ -3358,13 +3358,13 @@ The generated C/C++ code should also follow this style as close as possible. How
|
|||
should be avoided as unlike the SWIG developers, users will never have consistent tab settings.
|
||||
</p>
|
||||
|
||||
<H2><a name="Extending_nn44"></a>7.11 Typemaps</H2>
|
||||
<H2><a name="Extending_nn44"></a>34.11 Typemaps</H2>
|
||||
|
||||
|
||||
<H3><a name="Extending_nn45"></a>7.11.1 Proxy classes</H3>
|
||||
<H3><a name="Extending_nn45"></a>34.11.1 Proxy classes</H3>
|
||||
|
||||
|
||||
<H2><a name="Extending_nn46"></a>7.12 Guide to parse tree nodes</H2>
|
||||
<H2><a name="Extending_nn46"></a>34.12 Guide to parse tree nodes</H2>
|
||||
|
||||
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue