1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-05 16:44:21 +03:00
inform7/docs/inter/M-ia.html
2020-03-23 21:42:00 +00:00

263 lines
17 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>M/ip</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">
</head>
<body>
<nav role="navigation">
<h1><a href="../webs.html">Sources</a></h1>
<ul>
<li><a href="../compiler.html"><b>compiler</b></a></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="../inbuild-module/index.html">inbuild</a></li>
<li><a href="../arch-module/index.html">arch</a></li>
<li><a href="../words-module/index.html">words</a></li>
<li><a href="../syntax-module/index.html">syntax</a></li>
<li><a href="../html-module/index.html">html</a></li>
</ul>
<h2>Inform7 Modules</h2>
<ul>
<li><a href="../core-module/index.html">core</a></li>
<li><a href="../problems-module/index.html">problems</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="../index-module/index.html">index</a></li>
</ul>
<h2>Inter Modules</h2>
<ul>
<li><a href="../inter-module/index.html">inter</a></li>
<li><a href="../building-module/index.html">building</a></li>
<li><a href="../codegen-module/index.html">codegen</a></li>
</ul>
<h2>Foundation</h2>
<ul>
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
</ul>
</nav>
<main role="main">
<!--Weave of 'M/ia' generated by 7-->
<ul class="crumbs"><li><a href="../webs.html">Source</a></li><li><a href="../compiler.html">Compiler Tools</a></li><li><a href="index.html">inter</a></li><li><a href="index.html#M">Manual</a></li><li><b>Inform Annotations</b></li></ul><p class="purpose">The standard set of symbol annotations used within Inform.</p>
<ul class="toc"><li><a href="#SP1">&#167;1. Status</a></li><li><a href="#SP2">&#167;2. Miscellaneous constants</a></li><li><a href="#SP13">&#167;13. Constant lists</a></li><li><a href="#SP21">&#167;21. Primitive names</a></li><li><a href="#SP23">&#167;23. Local variables</a></li><li><a href="#SP26">&#167;26. Global variables</a></li><li><a href="#SP28">&#167;28. Kinds</a></li><li><a href="#SP31">&#167;31. Instances</a></li><li><a href="#SP35">&#167;35. Properties</a></li></ul><hr class="tocbar">
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. Status. </b>The Inter specification allows for any number of annotations to be used;
none are required.
</p>
<p class="inwebparagraph">The Inform compiler, however, has a standard set of annotations used to
pass hints from the front end of the compiler to the back end; hints which
mainly do not change the meaning of the program, but cause the eventual
Inform 6 code to be generated in a particular order, or using particular
syntaxes, to be make it easier to read or more compatible with code not
generated by I7.
</p>
<p class="inwebparagraph"><a id="SP2"></a><b>&#167;2. Miscellaneous constants. </b></p>
<p class="inwebparagraph"><a id="SP3"></a><b>&#167;3. </b><code class="display"><span class="extract">__hex</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Marks that the value of this constant
is most legible in hexadecimal rather than decimal. Inter itself uses
this when writing a textual inter fomr of the constant's declaration,
and the Inform back end uses it when compiling Inform 6, in that it will
compile to a hexadecimal literal like <code class="display"><span class="extract">$4F02</span></code> rather than a decimal one
like <code class="display"><span class="extract">20226</span></code>. There is no effect on the final program.
</p>
<p class="inwebparagraph"><a id="SP4"></a><b>&#167;4. </b><code class="display"><span class="extract">__signed</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Marks that the value of this constant
is most legible if printed as a signed decimal literal than as an
unsigned one.
</p>
<p class="inwebparagraph"><a id="SP5"></a><b>&#167;5. </b><code class="display"><span class="extract">__late</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Suggests that this should be placed late
on the final compiled code, rather than at its current place. (This clue
helps the I6 code generator to avoid not-yet-declared errors; I6 is quite
finicky about code ordering.)
</p>
<p class="inwebparagraph"><a id="SP6"></a><b>&#167;6. </b><code class="display"><span class="extract">__noun_filter</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a function. Marks that this
function is a noun filter in command parser grammar.
</p>
<p class="inwebparagraph"><a id="SP7"></a><b>&#167;7. </b><code class="display"><span class="extract">__scope_filter</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a function. Marks that this
function is a scope filter in command parser grammar.
</p>
<p class="inwebparagraph"><a id="SP8"></a><b>&#167;8. </b><code class="display"><span class="extract">__action</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Marks it as the name of an action.
</p>
<p class="inwebparagraph"><a id="SP9"></a><b>&#167;9. </b><code class="display"><span class="extract">__fake_action</span></code>. Applies to symbols already tagged <code class="display"><span class="extract">_action</span></code>, and marks
that their actions are I6 template fake actions. (It currently contains
just four of these.)
</p>
<p class="inwebparagraph"><a id="SP10"></a><b>&#167;10. </b><code class="display"><span class="extract">__assimilated</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Marks it as a symbol defined in
I6 template code which has been assimilated into memory inter.
</p>
<p class="inwebparagraph"><a id="SP11"></a><b>&#167;11. </b><code class="display"><span class="extract">__holding</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. This is part of a convoluted system
for handling references to constants not yet defined, in the sense that
the inter to define them has not yet been generated in memory. A "holding"
constant is used to reserve a name for later definition.
</p>
<p class="inwebparagraph"><a id="SP12"></a><b>&#167;12. </b><code class="display"><span class="extract">__delenda_est</span></code>. Applies to <code class="display"><span class="extract">constant</span></code>. Likewise; but marks a symbol for
later deletion rather than later definition.
</p>
<p class="inwebparagraph"><a id="SP13"></a><b>&#167;13. Constant lists. </b></p>
<p class="inwebparagraph"><a id="SP14"></a><b>&#167;14. </b><code class="display"><span class="extract">__buffer_array</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks
this to be compiled as virtual machine command parsing buffer.
</p>
<p class="inwebparagraph"><a id="SP15"></a><b>&#167;15. </b><code class="display"><span class="extract">__byte_array</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks
this to be compiled as an array of bytes.
</p>
<p class="inwebparagraph"><a id="SP16"></a><b>&#167;16. </b><code class="display"><span class="extract">__string_array</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks this
to be compiled as an array of bytes preceded by its size.
</p>
<p class="inwebparagraph"><a id="SP17"></a><b>&#167;17. </b><code class="display"><span class="extract">__table_array</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks this
to be compiled as an array of words preceded by its size.
</p>
<p class="inwebparagraph"><a id="SP18"></a><b>&#167;18. </b><code class="display"><span class="extract">__inline_array</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks that,
if this is compiled as a property value in Inform 6, it should use the inline
syntax (as is conventional for the I6 <code class="display"><span class="extract">name</span></code> property, for example).
</p>
<p class="inwebparagraph"><a id="SP19"></a><b>&#167;19. </b><code class="display"><span class="extract">__verb</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list. Asks this to be
compiled as Inform 6 command parser grammar.
</p>
<p class="inwebparagraph"><a id="SP20"></a><b>&#167;20. </b><code class="display"><span class="extract">__meta_verb</span></code>. Applies to <code class="display"><span class="extract">constant</span></code> which is a literal list and also has
the <code class="display"><span class="extract">__verb</span></code> annotation: means that this is a "meta-verb", and should be
compiled after the regular verbs.
</p>
<p class="inwebparagraph"><a id="SP21"></a><b>&#167;21. Primitive names. </b></p>
<p class="inwebparagraph"><a id="SP22"></a><b>&#167;22. </b><code class="display"><span class="extract">__bip</span></code>. Applies to <code class="display"><span class="extract">primitive</span></code>. This is used internally in the code
generator to match textual names such as <code class="display"><span class="extract">!bitwisenot</span></code> with functionality:
it's essentially a cache to avoid having to parse names over and over.
(BIP stands for "built in primitive".)
</p>
<p class="inwebparagraph"><a id="SP23"></a><b>&#167;23. Local variables. </b></p>
<p class="inwebparagraph"><a id="SP24"></a><b>&#167;24. </b><code class="display"><span class="extract">__call_parameter</span></code>. Applies to <code class="display"><span class="extract">local</span></code>. Inform's front end marks
call parameters this way in case optimisation stages in the back end might
need to know; and if nothing else, it enables the code generator to print
I6 comments showing the intention.
</p>
<p class="inwebparagraph"><a id="SP25"></a><b>&#167;25. </b><code class="display"><span class="extract">__implied_call_parameter</span></code>. Applies to <code class="display"><span class="extract">local</span></code>. Similarly. What
makes a call parameter "implied" is that it is not directly one of the
tokens from an Inform 7 function, but has been added for some implementation
reason. For example, a phrase option bitmap is passed as an implied call
parameter.
</p>
<p class="inwebparagraph"><a id="SP26"></a><b>&#167;26. Global variables. </b></p>
<p class="inwebparagraph"><a id="SP27"></a><b>&#167;27. </b><code class="display"><span class="extract">__explicit_variable</span></code>. Applies to <code class="display"><span class="extract">variable</span></code>. Marks this as having a name
already supplied in high-level I7 source text.
</p>
<p class="inwebparagraph"><a id="SP28"></a><b>&#167;28. Kinds. </b></p>
<p class="inwebparagraph"><a id="SP29"></a><b>&#167;29. </b><code class="display"><span class="extract">__weak_ID</span></code>. Applies to <code class="display"><span class="extract">kind</span></code>. The weak ID of a kind is a single small
non-negative integer which is unique to that kind's constructor; it can't
distinguish between lists of X and lists of Y, but in general it can
distinguish a list from a number, or a number from a text. This annotation
marks the name of a kind with the same weak ID value which will be used
at run-time for that kind.
</p>
<p class="inwebparagraph"><a id="SP30"></a><b>&#167;30. </b><code class="display"><span class="extract">__source_order</span></code>. Applies (undependently) to <code class="display"><span class="extract">property</span></code> and to <code class="display"><span class="extract">kind</span></code>:
a lower value for this annotation means that one property was defined earlier
in the Inform source text that the other, and similarly for kinds.
</p>
<p class="inwebparagraph"><a id="SP31"></a><b>&#167;31. Instances. </b></p>
<p class="inwebparagraph"><a id="SP32"></a><b>&#167;32. </b><code class="display"><span class="extract">__object_kind_counter</span></code>. Applies to <code class="display"><span class="extract">kind</span></code>. Towards the end of code
generation, it's convenient to count the subkinds of <code class="display"><span class="extract">K_object</span></code> in order
of their creation in the original source text. That count is recorded
here: <code class="display"><span class="extract">K1_thing</span></code> will get <code class="display"><span class="extract">__object_kind_counter=1</span></code>, and so on.
</p>
<p class="inwebparagraph"><a id="SP33"></a><b>&#167;33. </b><code class="display"><span class="extract">__arrow_count</span></code>. Applies to <code class="display"><span class="extract">instance</span></code> of objects; it's the depth in the
spatial containment tree, where 0 is the top level (usually rooms), 1 the
level for things immediately inside level-0 objects, and so on. So called
because the Inform 6 notation for containment is this many <code class="display"><span class="extract">-&gt;</span></code> arrows in
a row. This is applied only at the final stage of code generation.
</p>
<p class="inwebparagraph"><a id="SP34"></a><b>&#167;34. </b><code class="display"><span class="extract">__declaration_order</span></code>. Applies to <code class="display"><span class="extract">instance</span></code> of objects; it's the order
in which they are declared in the final Inform 6 code, with the first object
as 0, and so on. This is applied only at the final stage of code generation.
</p>
<p class="inwebparagraph"><a id="SP35"></a><b>&#167;35. Properties. </b></p>
<p class="inwebparagraph"><a id="SP36"></a><b>&#167;36. </b><code class="display"><span class="extract">__either_or</span></code>. Applies to <code class="display"><span class="extract">property</span></code>. Marks it as one which is either
held or not held.
</p>
<p class="inwebparagraph"><a id="SP37"></a><b>&#167;37. </b><code class="display"><span class="extract">__attribute</span></code>. Applies to <code class="display"><span class="extract">property</span></code>, and only to those also annotated
with <code class="display"><span class="extract">__either_or</span></code>. Asks to compile this at run-time as a virtual machine
attribute.
</p>
<p class="inwebparagraph"><a id="SP38"></a><b>&#167;38. </b><code class="display"><span class="extract">__explicit_attribute</span></code>. Applies to <code class="display"><span class="extract">property</span></code>, and only to those also
annotated with <code class="display"><span class="extract">__either_or</span></code>. Marks this as not only an attribute, but one
with a name already supplied in high-level I7 source text.
</p>
<p class="inwebparagraph"><a id="SP39"></a><b>&#167;39. </b><code class="display"><span class="extract">__property_name</span></code>. Applies to <code class="display"><span class="extract">property</span></code>. Where a property name came from
I7 source text, and thus has a friendly sort of name ("carrying capacity",
for example), the Inform front end applies this annotation. The back end
then uses it only to help run-time I6 code prpduce better error messages
if the program uses the property incorrectly.
</p>
<p class="inwebparagraph"><a id="SP40"></a><b>&#167;40. </b><code class="display"><span class="extract">__rto</span></code>. Applies to <code class="display"><span class="extract">property</span></code>, and marks it as a run-time only property:
that is, not one which is explicitly present in the Inform 7 source text,
but one which has been added to provide run-time support for some feature.
</p>
<p class="inwebparagraph"><a id="SP41"></a><b>&#167;41. </b><code class="display"><span class="extract">__source_order</span></code>. Applies (undependently) to <code class="display"><span class="extract">property</span></code> and to <code class="display"><span class="extract">kind</span></code>:
a lower value for this annotation means that one property was defined earlier
in the Inform source text that the other, and similarly for kinds.
</p>
<hr class="tocbar">
<ul class="toc"><li><a href="M-ip.html">Back to 'Inform Primitives'</a></li><li><a href="M-io.html">Continue with 'Inform Organisation'</a></li></ul><hr class="tocbar">
<!--End of weave-->
</main>
</body>
</html>