inweb-bootstrap/docs/inweb/1-bsc.html

137 lines
12 KiB
HTML
Raw Normal View History

2019-02-04 22:26:45 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
2020-04-08 22:41:00 +00:00
<title>Basics</title>
<meta name="viewport" content="width=device-width initial-scale=1">
2019-02-04 22:26:45 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="en-gb">
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-10 20:29:28 +00:00
2019-02-04 22:26:45 +00:00
</head>
<body>
<nav role="navigation">
2020-04-13 16:06:45 +00:00
<h1><a href="../index.html">
<img src="../..//docs/docs-src/Figures/Octagram184x184.png" width=72 height=72">
</a></h1>
<ul><li><a href="index.html"><span class="selectedlink">inweb</span></a></li>
</ul><h2>Foundation Module</h2><ul>
<li><a href="../foundation-module/index.html">foundation</a></li>
<li><a href="../foundation-test/index.html">foundation-test</a></li>
2020-04-13 16:06:45 +00:00
</ul><h2>Example Webs</h2><ul>
2020-04-12 16:24:23 +00:00
<li><a href="../goldbach/index.html">goldbach</a></li>
<li><a href="../twinprimes/twinprimes.html">twinprimes</a></li>
2020-04-13 16:06:45 +00:00
</ul><h2>External</h2><ul>
<li><a href="https://github.com/ganelson/inweb">github</a></li>
2020-04-13 16:06:45 +00:00
</ul>
</nav>
<main role="main">
2020-04-08 22:41:00 +00:00
<!--Weave of 'Basics' generated by 7-->
2020-04-13 16:06:45 +00:00
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#1">Chapter 1: Top Level</a></li><li><b>Basics</b></li></ul><p class="purpose">Some fundamental definitions, mostly setting up for the Foundation module to manage memory for us.</p>
2019-02-04 22:26:45 +00:00
<ul class="toc"><li><a href="#SP1">&#167;1. Build identity</a></li><li><a href="#SP2">&#167;2. Setting up the memory manager</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. Build identity. </b>First we define the build, using a notation which tangles out to the current
build number as specified in the contents section of this web.
</p>
<pre class="definitions">
2020-04-06 11:26:10 +00:00
<span class="definitionkeyword">define</span> <span class="constant">INTOOL_NAME</span><span class="plain"> </span><span class="string">"inweb"</span>
<span class="definitionkeyword">define</span> <span class="constant">INWEB_BUILD</span><span class="plain"> </span><span class="string">"[[Version Number]]"</span>
2019-02-04 22:26:45 +00:00
</pre>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. Setting up the memory manager. </b>We need to itemise the structures we'll want to allocate. To explicate this
see Foundation, but these are all struct names with either <code class="display"><span class="extract">_MT</span></code> or, in one
case, <code class="display"><span class="extract">_array_MT</span></code> appended. MT stands for "memory type".
</p>
<pre class="definitions">
2020-04-06 11:26:10 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">breadcrumb_request_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">chapter_MT</span>
2020-04-12 16:24:23 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">colony_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">colony_member_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">colouring_language_block_MT</span>
2020-04-06 11:26:10 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">colouring_rule_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">enumeration_set_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">hash_table_entry_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">hash_table_entry_usage_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">language_function_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">language_type_MT</span>
2020-04-06 11:26:10 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">macro_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">macro_tokens_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">macro_usage_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">nonterminal_variable_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">para_macro_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">paragraph_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">paragraph_tagging_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">preform_nonterminal_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">programming_language_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">reserved_word_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">section_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">source_line_array_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">structure_element_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">tangle_target_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">tex_results_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">text_literal_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">theme_tag_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">weave_format_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">weave_pattern_MT</span>
2020-04-10 20:29:28 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">weave_plugin_MT</span>
2020-04-06 11:26:10 +00:00
<span class="definitionkeyword">enum</span> <span class="constant">weave_target_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">web_MT</span>
<span class="definitionkeyword">enum</span> <span class="constant">writeme_asset_MT</span>
2019-02-04 22:26:45 +00:00
</pre>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b>And then expand the following macros, all defined in Foundation. This
makes all the necessary constructor functions for creating objects of these
types.
</p>
<pre class="display">
2020-04-06 11:26:10 +00:00
<span class="identifier">ALLOCATE_IN_ARRAYS</span><span class="plain">(</span><span class="reserved">source_line</span><span class="plain">, </span><span class="constant">1000</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">breadcrumb_request</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">chapter</span><span class="plain">)</span>
2020-04-12 16:24:23 +00:00
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">colony</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">colony_member</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">colouring_language_block</span><span class="plain">)</span>
2020-04-06 11:26:10 +00:00
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">colouring_rule</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">enumeration_set</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">hash_table_entry_usage</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">hash_table_entry</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">language_function</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">language_type</span><span class="plain">)</span>
2020-04-06 11:26:10 +00:00
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">macro_tokens</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">macro_usage</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">macro</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">nonterminal_variable</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">para_macro</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">paragraph_tagging</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">paragraph</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">preform_nonterminal</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">programming_language</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">reserved_word</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">section</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">structure_element</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">tangle_target</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">tex_results</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">text_literal</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">theme_tag</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">weave_pattern</span><span class="plain">)</span>
2020-04-10 20:29:28 +00:00
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">weave_plugin</span><span class="plain">)</span>
2020-04-06 11:26:10 +00:00
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">weave_target</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">web</span><span class="plain">)</span>
<span class="identifier">ALLOCATE_INDIVIDUALLY</span><span class="plain">(</span><span class="reserved">writeme_asset</span><span class="plain">)</span>
2019-02-04 22:26:45 +00:00
</pre>
<p class="inwebparagraph"></p>
2019-03-12 23:32:12 +00:00
<hr class="tocbar">
<ul class="toc"><li><i>(This section begins Chapter 1: Top Level.)</i></li><li><a href="1-pc.html">Continue with 'Program Control'</a></li></ul><hr class="tocbar">
<!--End of weave-->
</main>
2019-02-04 22:26:45 +00:00
</body>
</html>