Update section numbering

This commit is contained in:
William S Fulton 2019-02-10 01:03:06 +00:00
commit 940e32477d
20 changed files with 810 additions and 1017 deletions

View file

@ -7,7 +7,7 @@
</head>
<body bgcolor="#ffffff">
<H1><a name="Extending">43 Extending SWIG to support new languages</a></H1>
<H1><a name="Extending">38 Extending SWIG to support new languages</a></H1>
<!-- INDEX -->
<div class="sectiontoc">
<ul>
@ -81,7 +81,7 @@
<H2><a name="Extending_nn2">43.1 Introduction</a></H2>
<H2><a name="Extending_nn2">38.1 Introduction</a></H2>
<p>
@ -97,7 +97,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">43.2 Prerequisites</a></H2>
<H2><a name="Extending_nn3">38.2 Prerequisites</a></H2>
<p>
@ -127,7 +127,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">43.3 The Big Picture</a></H2>
<H2><a name="Extending_nn4">38.3 The Big Picture</a></H2>
<p>
@ -164,7 +164,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">43.4 Execution Model</a></H2>
<H2><a name="Extending_nn5">38.4 Execution Model</a></H2>
<p>
@ -209,7 +209,7 @@ latter stage of compilation.
The next few sections briefly describe some of these stages.
</p>
<H3><a name="Extending_nn6">43.4.1 Preprocessing</a></H3>
<H3><a name="Extending_nn6">38.4.1 Preprocessing</a></H3>
<p>
@ -290,7 +290,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">43.4.2 Parsing</a></H3>
<H3><a name="Extending_nn7">38.4.2 Parsing</a></H3>
<p>
@ -391,7 +391,7 @@ returning a <tt>foo</tt> and taking types <tt>a</tt> and <tt>b</tt> as
arguments).
</p>
<H3><a name="Extending_nn8">43.4.3 Parse Trees</a></H3>
<H3><a name="Extending_nn8">38.4.3 Parse Trees</a></H3>
<p>
@ -646,7 +646,7 @@ $ swig -c++ -python -debug-module 4 example.i
</pre>
</div>
<H3><a name="Extending_nn9">43.4.4 Attribute namespaces</a></H3>
<H3><a name="Extending_nn9">38.4.4 Attribute namespaces</a></H3>
<p>
@ -665,7 +665,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">43.4.5 Symbol Tables</a></H3>
<H3><a name="Extending_nn10">38.4.5 Symbol Tables</a></H3>
<p>
@ -756,7 +756,7 @@ example.i:5. Previous declaration is foo_i(int )
</pre>
</div>
<H3><a name="Extending_nn11">43.4.6 The %feature directive</a></H3>
<H3><a name="Extending_nn11">38.4.6 The %feature directive</a></H3>
<p>
@ -812,7 +812,7 @@ For example, the exception code above is simply
stored without any modifications.
</p>
<H3><a name="Extending_nn12">43.4.7 Code Generation</a></H3>
<H3><a name="Extending_nn12">38.4.7 Code Generation</a></H3>
<p>
@ -934,7 +934,7 @@ public :
The role of these functions is described shortly.
</p>
<H3><a name="Extending_nn13">43.4.8 SWIG and XML</a></H3>
<H3><a name="Extending_nn13">38.4.8 SWIG and XML</a></H3>
<p>
@ -947,7 +947,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">43.5 Primitive Data Structures</a></H2>
<H2><a name="Extending_nn14">38.5 Primitive Data Structures</a></H2>
<p>
@ -993,7 +993,7 @@ typedef Hash Typetab;
</pre>
</div>
<H3><a name="Extending_nn15">43.5.1 Strings</a></H3>
<H3><a name="Extending_nn15">38.5.1 Strings</a></H3>
<p>
@ -1134,7 +1134,7 @@ Returns the number of replacements made (if any).
</div>
<H3><a name="Extending_nn16">43.5.2 Hashes</a></H3>
<H3><a name="Extending_nn16">38.5.2 Hashes</a></H3>
<p>
@ -1211,7 +1211,7 @@ Returns the list of hash table keys.
</div>
<H3><a name="Extending_nn17">43.5.3 Lists</a></H3>
<H3><a name="Extending_nn17">38.5.3 Lists</a></H3>
<p>
@ -1300,7 +1300,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">43.5.4 Common operations</a></H3>
<H3><a name="Extending_nn18">38.5.4 Common operations</a></H3>
The following operations are applicable to all datatypes.
@ -1355,7 +1355,7 @@ objects and report errors.
Gets the line number associated with <tt>x</tt>.
</div>
<H3><a name="Extending_nn19">43.5.5 Iterating over Lists and Hashes</a></H3>
<H3><a name="Extending_nn19">38.5.5 Iterating over Lists and Hashes</a></H3>
To iterate over the elements of a list or a hash table, the following functions are used:
@ -1400,7 +1400,7 @@ for (j = First(j); j.item; j= Next(j)) {
</div>
<H3><a name="Extending_nn20">43.5.6 I/O</a></H3>
<H3><a name="Extending_nn20">38.5.6 I/O</a></H3>
Special I/O functions are used for all internal I/O. These operations
@ -1534,7 +1534,7 @@ Printf(f, "%s\n", s);
Similarly, the preprocessor and parser all operate on string-files.
</p>
<H2><a name="Extending_nn21">43.6 Navigating and manipulating parse trees</a></H2>
<H2><a name="Extending_nn21">38.6 Navigating and manipulating parse trees</a></H2>
Parse trees are built as collections of hash tables. Each node is a hash table in which
@ -1668,7 +1668,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">43.7 Working with attributes</a></H2>
<H2><a name="Extending_nn22">38.7 Working with attributes</a></H2>
<p>
@ -1785,7 +1785,7 @@ the attribute is optional. <tt>Swig_restore()</tt> must always be called after
function.
</div>
<H2><a name="Extending_nn23">43.8 Type system</a></H2>
<H2><a name="Extending_nn23">38.8 Type system</a></H2>
<p>
@ -1794,7 +1794,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">43.8.1 String encoding of types</a></H3>
<H3><a name="Extending_nn24">38.8.1 String encoding of types</a></H3>
<p>
@ -1895,7 +1895,7 @@ make the final type, the two parts are just joined together using
string concatenation.
</p>
<H3><a name="Extending_nn25">43.8.2 Type construction</a></H3>
<H3><a name="Extending_nn25">38.8.2 Type construction</a></H3>
<p>
@ -2064,7 +2064,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">43.8.3 Type tests</a></H3>
<H3><a name="Extending_nn26">38.8.3 Type tests</a></H3>
<p>
@ -2151,7 +2151,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">43.8.4 Typedef and inheritance</a></H3>
<H3><a name="Extending_nn27">38.8.4 Typedef and inheritance</a></H3>
<p>
@ -2253,7 +2253,7 @@ Fully reduces <tt>ty</tt> according to typedef rules. Resulting datatype
will consist only of primitive typenames.
</div>
<H3><a name="Extending_nn28">43.8.5 Lvalues</a></H3>
<H3><a name="Extending_nn28">38.8.5 Lvalues</a></H3>
<p>
@ -2290,7 +2290,7 @@ Literal y; // type = 'Literal', ltype='p.char'
</pre>
</div>
<H3><a name="Extending_nn29">43.8.6 Output functions</a></H3>
<H3><a name="Extending_nn29">38.8.6 Output functions</a></H3>
<p>
@ -2352,7 +2352,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">43.9 Parameters</a></H2>
<H2><a name="Extending_nn30">38.9 Parameters</a></H2>
<p>
@ -2451,7 +2451,7 @@ included. Used to emit prototypes.
Returns the number of required (non-optional) arguments in <tt>p</tt>.
</div>
<H2><a name="Extending_nn31">43.10 Writing a Language Module</a></H2>
<H2><a name="Extending_nn31">38.10 Writing a Language Module</a></H2>
<p>
@ -2466,7 +2466,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">43.10.1 Execution model</a></H3>
<H3><a name="Extending_nn32">38.10.1 Execution model</a></H3>
<p>
@ -2476,7 +2476,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_starting_out">43.10.2 Starting out</a></H3>
<H3><a name="Extending_starting_out">38.10.2 Starting out</a></H3>
<p>
@ -2584,7 +2584,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">43.10.3 Command line options</a></H3>
<H3><a name="Extending_nn34">38.10.3 Command line options</a></H3>
<p>
@ -2643,7 +2643,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">43.10.4 Configuration and preprocessing</a></H3>
<H3><a name="Extending_nn35">38.10.4 Configuration and preprocessing</a></H3>
<p>
@ -2692,7 +2692,7 @@ an implementation file <tt>python.cxx</tt> and a configuration file
<tt>python.swg</tt>.
</p>
<H3><a name="Extending_nn36">43.10.5 Entry point to code generation</a></H3>
<H3><a name="Extending_nn36">38.10.5 Entry point to code generation</a></H3>
<p>
@ -2750,7 +2750,7 @@ int Python::top(Node *n) {
</pre>
</div>
<H3><a name="Extending_nn37">43.10.6 Module I/O and wrapper skeleton</a></H3>
<H3><a name="Extending_nn37">38.10.6 Module I/O and wrapper skeleton</a></H3>
<!-- please report bugs in this section to mgossage -->
@ -2898,7 +2898,7 @@ functionWrapper : void Shape_y_set(Shape *self, double y)
</pre>
</div>
<H3><a name="Extending_nn38">43.10.7 Low-level code generators</a></H3>
<H3><a name="Extending_nn38">38.10.7 Low-level code generators</a></H3>
<!-- please report bugs in this section to mgossage -->
@ -3052,7 +3052,7 @@ but without the typemaps, there is still work to do.
</p>
<H3><a name="Extending_configuration_files">43.10.8 Configuration files</a></H3>
<H3><a name="Extending_configuration_files">38.10.8 Configuration files</a></H3>
<!-- please report bugs in this section to ttn -->
@ -3196,7 +3196,7 @@ politely displays the ignoring language message.
</dl>
<H3><a name="Extending_nn40">43.10.9 Runtime support</a></H3>
<H3><a name="Extending_nn40">38.10.9 Runtime support</a></H3>
<p>
@ -3205,7 +3205,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">43.10.10 Standard library files</a></H3>
<H3><a name="Extending_nn41">38.10.10 Standard library files</a></H3>
<p>
@ -3224,7 +3224,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">43.10.11 User examples</a></H3>
<H3><a name="Extending_nn42">38.10.11 User examples</a></H3>
<p>
@ -3253,7 +3253,7 @@ during this process, see the section on <a href="#Extending_configuration_files"
files</a>.
</p>
<H3><a name="Extending_test_suite">43.10.12 Test driven development and the test-suite</a></H3>
<H3><a name="Extending_test_suite">38.10.12 Test driven development and the test-suite</a></H3>
<p>
@ -3312,7 +3312,7 @@ It is therefore essential that the runtime tests are written in a manner that di
but error/exception out with an error message on stderr on failure.
</p>
<H4><a name="Extending_running_test_suite">43.10.12.1 Running the test-suite</a></H4>
<H4><a name="Extending_running_test_suite">38.10.12.1 Running the test-suite</a></H4>
<p>
@ -3504,7 +3504,7 @@ It can be run in the same way as the other language test-suites, replacing [lang
The test cases used and the way it works is described in <tt>Examples/test-suite/errors/Makefile.in</tt>.
</p>
<H3><a name="Extending_nn43">43.10.13 Documentation</a></H3>
<H3><a name="Extending_nn43">38.10.13 Documentation</a></H3>
<p>
@ -3536,7 +3536,7 @@ Some topics that you'll want to be sure to address include:
if available.
</ul>
<H3><a name="Extending_coding_style_guidelines">43.10.14 Coding style guidelines</a></H3>
<H3><a name="Extending_coding_style_guidelines">38.10.14 Coding style guidelines</a></H3>
<p>
@ -3561,7 +3561,7 @@ should be avoided as unlike the SWIG developers, users will never have consisten
</p>
<H3><a name="Extending_language_status">43.10.15 Target language status</a></H3>
<H3><a name="Extending_language_status">38.10.15 Target language status</a></H3>
<p>
@ -3570,7 +3570,7 @@ the <a href="Introduction.html#Introduction_target_languages">Target language in
This section provides more details on how this status is given.
</p>
<H4><a name="Extending_supported_status">43.10.15.1 Supported status</a></H4>
<H4><a name="Extending_supported_status">38.10.15.1 Supported status</a></H4>
<p>
@ -3617,7 +3617,7 @@ A target language is given the 'Supported' status when
</li>
</ul>
<H4><a name="Extending_experimental_status">43.10.15.2 Experimental status</a></H4>
<H4><a name="Extending_experimental_status">38.10.15.2 Experimental status</a></H4>
<p>
@ -3682,7 +3682,7 @@ Some minimum requirements and notes about languages with the 'Experimental' stat
</li>
</ul>
<H3><a name="Extending_prerequisites">43.10.16 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
<H3><a name="Extending_prerequisites">38.10.16 Prerequisites for adding a new language module to the SWIG distribution</a></H3>
<p>
@ -3746,7 +3746,7 @@ the existing tests.
</p>
<H2><a name="Extending_debugging_options">43.11 Debugging Options</a></H2>
<H2><a name="Extending_debugging_options">38.11 Debugging Options</a></H2>
<p>
@ -3773,7 +3773,7 @@ There are various command line options which can aid debugging a SWIG interface
The complete list of command line options for SWIG are available by running <tt>swig -help</tt>.
</p>
<H2><a name="Extending_nn46">43.12 Guide to parse tree nodes</a></H2>
<H2><a name="Extending_nn46">38.12 Guide to parse tree nodes</a></H2>
<p>
@ -4181,7 +4181,7 @@ extern "X" { ... } declaration.
</pre>
</div>
<H2><a name="Extending_further_info">43.13 Further Development Information</a></H2>
<H2><a name="Extending_further_info">38.13 Further Development Information</a></H2>
<p>