1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 16:44:21 +03:00
inform7/docs/compiler.html
Graham Nelson 1268a0f40e Colonised
2020-04-14 17:56:54 +01:00

579 lines
19 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Complete Program</title>
<meta name="viewport" content="width=device-width initial-scale=1">
<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"><style type="text/css">
/* This is a CSS file for pages woven by the literate programming tool inweb */
/* We'll start with syntax colouring, since everyone likes to toy with this: */
.cwebmacrotext { color: #000000; font-weight: bold; } /* The name of a web macro */
.functiontext { color: #C00000; } /* When a C function is being defined */
.string { color: #408040; } /* A double-quoted C literal string */
.character { color: #204020; } /* A single-quoted C literal character */
.constant { color: #204020; } /* A named constant */
.element { color: #40407f; } /* A C structure element */
.identifier { color: #4040ff; } /* An identifier */
.reserved { color: #600000; } /* A reserved word */
/* Comments at the end of lines are rendered like so: */
.comment {
font: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
color: #404040;
font-style:italic;
}
/* The name of a web macro when being used: */
.cwebmacro {
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
text-decoration: none;
color: #000000; font-weight: bold;
}
.cwebmacronumber {
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
font-size: 80%;
text-decoration: none;
color: #000000;
}
/* And when being defined: */
.cwebmacrodefn {
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
text-decoration: none;
color: #000000; font-weight: bold;
font-weight:bold;
}
/* Now some generalities: */
body {
background-color: #ffffff;
margin: 8px;
font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, Verdana, sans-serif;
font-size: 16px;
line-height: 24px;
background-color: transparent;
-webkit-font-smoothing: antialiased;
}
/* Forms of paragraph: */
p {
margin: 0;
padding-top: 5px;
padding-bottom: 5px;
clear: both;
}
/* Where an inweb paragraph begins: */
p.inwebparagraph {
width: 60em;
line-height: 150%;
padding-top: 15px;
padding-bottom: 5px;
}
/* If a web macro definition begins in its own paragraph, this is it: */
p.macrodefinition {
padding-top: 0px;
padding-bottom: 0px;
margin-left: 30px;
}
/* The endnotes at the foot of code: "The function foo_bar is used in ..." */
p.endnote {
font-size: 0.8em;
padding-top: 0px;
padding-bottom: 0px;
margin-left: 30px;
text-decoration:none;
color: #000000;
}
/* The Purpose slug: */
p.purpose {
width: 60em;
line-height: 150%;
font-size: 1em;
font-style:italic;
margin-left: 15px;
}
/* Blocks of code appear in these */
pre {
font-family: Monaco, monospace;
}
pre.display {
padding: 3px;
margin-top: 5px;
margin-bottom: 5px;
margin-left: 30px;
margin-right: 10px;
background: #f8f8f8;
border-width: 1px;
border-style: solid solid solid solid;
border-color: #ccc;
word-wrap: break-word;
white-space: pre-wrap;
}
pre.displaydefn {
padding: 3px;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 10px;
background: #f8f8f8;
border-width: 1px;
border-style: solid solid solid solid;
border-color: #ccc;
word-wrap: break-word;
white-space: pre-wrap;
}
pre.definitions {
padding-top: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 10px;
word-wrap: break-word;
white-space: pre-wrap;
}
/* The following are for breadcrumbs of links: */
ul, li {
list-style-type:none;
padding:0;
margin:0;
}
.crumbs {
border:1px solid #dedede;
height:3.45em;
}
.crumbs li {
float:left;
line-height:2.3em;
padding-left:.75em;
color:#333;
font-size: 1.5em;
}
.crumbs li a {
display:block;
padding:0 15px 0 0;
background:url(crumbs.gif) no-repeat right center;
}
.crumbs li a:link, #crumbs li a:visited {
text-decoration:none;
color:#333;
}
.crumbs li a:hover, #crumbs li a:focus {
color:#dd2c0d;
}
/* This is for items in lists from inweb source: */
ul.items {
margin-top: 3px;
margin-bottom: 3px;
}
ul.items li {
margin-top: 1px;
margin-bottom: 1px;
margin-left: 15px;
}
/* And this is for each section's table of contents: */
ul.toc {
margin-top: 3px;
margin-bottom: 3px;
}
ul.toc li {
float:left;
margin-left: 15px;
color:#000;
}
ul.toc li a {
display:block;
}
ul.toc li a:link, ul.toc li a:visited {
text-decoration:none;
color:#000;
}
ul.toc li a:hover, ul.toc li a:focus {
color:#dd2c0d;
}
hr.tocbar {
clear: both;
margin-top:3px;
margin-bottom:3px;
color:#333;
border:0
background-color:#333;
}
/* This is for cross-reference links ("This code is used in ...") */
p.endnote:link, p.endnote:visited, p.endnote:hover, p.endnote:focus {
text-decoration:none;
color:#000;
}
p.endnote a:link, p.endnote a:visited {
text-decoration:none;
color:#000;
}
p.endnote a:hover, p.endnote a:focus {
text-decoration:none;
color:#dd2c0d;
}
/* Now for the index page */
p.heading {
margin-top: 2px;
margin-bottom: 2px;
font-size: 20
}
p.chapter {
font-size: 14
}
p.tight {
font-size: 12
}
p.tightin {
padding-left: 25px;
font-size: 12
}
.chapterlist li {
padding-top: 8px;
padding-left: 16px;
}
.chaptertitle {
font-weight: bold;
}
.chapterlist .sectionlist li {
padding-left: 48px;
}
span.definitionkeyword {
color:#801010;
font-weight:bold;
}
span.extract {
font-size: 15px;
border: 1px solid #e8e8e8;
border-radius: 3px;
background-color: #eef;
width: 100%;
padding: 3px;
}
nav[role="navigation"] {
width: 180px;
position: fixed;
overflow: scroll;
left: 0;
top: 0;
bottom: 0;
background: #FAFAFA;
border-right: 1px solid #e6e6e6;
padding: 20px 30px
}
nav[role="navigation"] ul {
border-top: 1px solid #e6e6e6;
font-weight: 400;
margin-bottom: 30px;
list-style: none
}
nav[role="navigation"] ul ul {
list-style: none
}
nav[role="navigation"] ul li {
border-bottom: 1px solid #e6e6e6
}
nav[role="navigation"] ul li.active {
border-bottom: 1px solid #333
}
nav[role="navigation"] ul li.active a {
font-weight: 700
}
nav[role="navigation"] h1 a:link {
color: #333;
text-decoration: none;
display: block;
}
nav[role="navigation"] h1 a:visited {
color: #333
}
nav[role="navigation"] h1 a:active {
font-weight: 700
}
nav[role="navigation"] h1 a:hover {
color: #dd2c0d
}
nav[role="navigation"] ul li a:link {
color: #333;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 12px;
display: block;
padding: 10px 10px 2px 2px
}
nav[role="navigation"] ul li span.selectedlink {
color: #f25;
}
nav[role="navigation"] ul li span.unlink {
color: #f25;
text-decoration: none;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 12px;
display: block;
padding: 10px 10px 2px 2px
}
nav[role="navigation"] ul li a:visited {
color: #333
}
nav[role="navigation"] ul li a:active {
font-weight: 700
}
nav[role="navigation"] ul li a:hover {
color: #dd2c0d
}
nav[role="navigation"] ul li ul {
margin-bottom: 10px;
border-top: none
}
nav[role="navigation"] ul li ul li {
border-bottom: none;
padding: 0.1em
}
nav[role="navigation"] ul li ul li.active {
border-bottom: none
}
nav[role="navigation"] ul li ul li.active a {
font-weight: 700
}
nav[role="navigation"] ul li ul a:link {
color: #dd2c0d;
text-decoration: none;
text-transform: none;
letter-spacing: 0;
font-size: 12px;
display: block;
margin-left: 15px;
padding: 0 0 3px;
border-bottom: none;
font-weight: 300
}
nav[role="navigation"] ul li ul a:hover {
text-decoration: underline
}
nav[role="navigation"] h2 {
font-size: 0.95em;
text-transform: lowercase;
font-variant: small-caps;
color: #999;
padding-bottom: 0.5em
}
nav[role="navigation"] h1 {
margin-top: 0em
}
main {
max-width: 1024px;
min-width: 320px;
margin-left: 250px;
min-height: 100%;
height: auto !important;
height: 100%
}
#logo {
text-indent: -9999px;
height: 48px;
width: 100%;
margin-top: 20px;
margin-bottom: 0.5em;
padding-bottom: 10px
}
#logo a {
display: block;
width: 190px;
height: 48px;
background-image: url("/assets/images/swift.svg");
background-repeat: no-repeat;
background-size: 190px 48px;
background-position-x: -8px
}
</style>
</head>
<body>
<nav role="navigation">
<h1><a href="index.html">
<img src="docs-src/Figures/Inform.png" height=72">
</a></h1>
<ul><li><span class="unlink">compiler tools</span></li>
<li><a href="other.html">other tools</a></li>
<li><a href="extensions.html">extensions and kits</a></li>
<li><a href="units.html">unit test tools</a></li>
</ul><h2>Compiler Webs</h2><ul>
<li><a href="inbuild/index.html">inbuild</a></li>
<li><a href="inform7/index.html">inform7</a></li>
<li><a href="inter/index.html">inter</a></li>
</ul><h2>Inbuild Modules</h2><ul>
<li><a href="supervisor-module/index.html">supervisor</a></li>
</ul><h2>Inform7 Modules</h2><ul>
<li><a href="core-module/index.html">core</a></li>
<li><a href="inflections-module/index.html">inflections</a></li>
<li><a href="linguistics-module/index.html">linguistics</a></li>
<li><a href="kinds-module/index.html">kinds</a></li>
<li><a href="if-module/index.html">if</a></li>
<li><a href="multimedia-module/index.html">multimedia</a></li>
<li><a href="problems-module/index.html">problems</a></li>
<li><a href="index-module/index.html">index</a></li>
</ul><h2>Inter Modules</h2><ul>
<li><a href="bytecode-module/index.html">bytecode</a></li>
<li><a href="building-module/index.html">building</a></li>
<li><a href="codegen-module/index.html">codegen</a></li>
</ul><h2>Shared Modules</h2><ul>
<li><a href="arch-module/index.html">arch</a></li>
<li><a href="syntax-module/index.html">syntax</a></li>
<li><a href="words-module/index.html">words</a></li>
<li><a href="html-module/index.html">html</a></li>
<li><a href="../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'Complete Program' generated by 7-->
<ul class="crumbs"><li><a href="index.html">Home</a></li><li><b>The Inform 7 compiler</b></li></ul><p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b>The task of the Inform 7 compiler is to take natural-language source text
and "transpile" to down to lower-level, more orthodox code which another
compiler can take the rest of the way. Usually, but not necessarily, that
other compiler is the typeless but otherwise C-like Inform 6 (1996-2003).
</p>
<p class="inwebparagraph">Inform offers three compiler tools: <a href="inbuild/index.html" class="internal">inbuild</a>, <a href="inform7/index.html" class="internal">inform7</a>
and <a href="inter/index.html" class="internal">inter</a>. These represent the front end (build control, resource
management), the middle part (actual compilation), and the back end (code
generation, assimilation of kits), but really they are three points of access
to the same code base. See <a href="inbuild/M-ui.html" class="internal">Manual (in inbuild)</a>, <a href="inform7/M-cu.html" class="internal">Manual (in inform7)</a>, <a href="inter/M-ui.html" class="internal">Manual (in inter)</a>
and <a href="inbuild/M-rc.html" class="internal">Reference Card (in inbuild)</a>, <a href="inform7/M-rc.html" class="internal">Reference Card (in inform7)</a>, <a href="inter/M-rc.html" class="internal">Reference Card (in inter)</a>.
</p>
<p class="inwebparagraph">Each tool has its own CLI (or "command-line interface") but is otherwise
divided up into "modules", many shared between two or even all three tools.
<a href="inform7/index.html" class="internal">inform7</a> contains every module, and is thus the entire compiler, whereas
the other tools are subsets of it:
</p>
<pre class="display">
<span class="functiontext">INBUILD</span><span class="plain"> </span><span class="functiontext">INFORM7</span><span class="plain"> </span><span class="functiontext">INTER</span>
<span class="plain">+-------------+ +-------------+ +-------------+</span>
<span class="plain">| <a href="inbuild/index.html" class="internal">inbuild</a> | | <a href="inform7/index.html" class="internal">inform7</a> | | <a href="inter/index.html" class="internal">inter</a> |</span>
<span class="plain">| (</span><span class="element">cli</span><span class="plain">) | | (</span><span class="element">cli</span><span class="plain">) | | (</span><span class="element">cli</span><span class="plain">) |</span>
<span class="plain">+---+.............+----------+.............+---+ | |</span>
<span class="plain">| <a href="supervisor-module/index.html" class="internal">supervisor</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">+---+.............+----------+.............+---+ | |</span>
<span class="plain">| | | | | |</span>
<span class="plain">| | +---+.............+---+ | |</span>
<span class="plain">| | | <a href="core-module/index.html" class="internal">core</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="inflections-module/index.html" class="internal">inflections</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="linguistics-module/index.html" class="internal">linguistics</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="problems-module/index.html" class="internal">problems</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="kinds-module/index.html" class="internal">kinds</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="if-module/index.html" class="internal">if</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="multimedia-module/index.html" class="internal">multimedia</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | | <a href="index-module/index.html" class="internal">index</a>-</span><span class="element">module</span><span class="plain"> | | |</span>
<span class="plain">| | +---+.............+---+ | |</span>
<span class="plain">| | | | | |</span>
<span class="plain">| | +---+.............+----------+.............+---+</span>
<span class="plain">| | | <a href="bytecode-module/index.html" class="internal">bytecode</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">| | | <a href="building-module/index.html" class="internal">building</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">| | | <a href="codegen-module/index.html" class="internal">codegen</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">+-------------+ +----------------------------------------------+</span>
<span class="plain">+-----------------------------------------------------------------------+</span>
<span class="plain">| </span><span class="functiontext">SHARED</span><span class="plain"> </span><span class="element">shared</span><span class="plain"> <a href="syntax-module/index.html" class="internal">syntax</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">| </span><span class="element">shared</span><span class="plain"> <a href="words-module/index.html" class="internal">words</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">| </span><span class="element">shared</span><span class="plain"> <a href="arch-module/index.html" class="internal">arch</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">| </span><span class="element">shared</span><span class="plain"> <a href="html-module/index.html" class="internal">html</a>-</span><span class="element">module</span><span class="plain"> |</span>
<span class="plain">+-----------------------------------------------------------------------+</span>
<span class="plain">+-----------------------------------------------------------------------+</span>
<span class="plain">| </span><span class="functiontext">FOUNDATION</span><span class="plain"> <a href="../../inweb/docs/foundation-module/index.html" class="internal">foundation</a>-</span><span class="element">module</span><span class="plain"> (</span><span class="element">in</span><span class="plain"> </span><span class="element">inweb</span><span class="plain"> </span><span class="element">repository</span><span class="plain">) |</span>
<span class="plain">| (</span><span class="element">Posix</span><span class="plain"> </span><span class="element">or</span><span class="plain"> </span><span class="element">Windows</span><span class="plain">-</span><span class="element">related</span><span class="plain"> </span><span class="element">functions</span><span class="plain">) |</span>
<span class="plain">| (</span><span class="element">standard</span><span class="plain"> </span><span class="element">C</span><span class="plain"> </span><span class="element">library</span><span class="plain">) |</span>
<span class="plain">+-----------------------------------------------------------------------+</span>
</pre>
<p class="inwebparagraph">The three tools each use a "shared" library, made up of four modules
providing services useful for natural language-based programs. At one time
this was going to be called "Second Foundation" (or possibly "Foundation
and Empire"), because there is also <a href="../../inweb/docs/foundation-module/index.html" class="internal">foundation</a> underneath, a C library
of utility functions provided by the <a href="../../inweb/docs/index.html" class="internal">inweb</a> project.
</p>
<!--End of weave-->
</main>
</body>
</html>