1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-17 06:24:24 +03:00
inform7/docs/codegen-module/4-fbi.html

88 lines
6.1 KiB
HTML
Raw Normal View History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
2020-04-14 19:56:54 +03:00
<title>Final Binary Inter</title>
2020-03-19 02:11:25 +02:00
<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">
2020-03-19 02:11:25 +02:00
<link href="../inweb.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-04-14 19:56:54 +03:00
</head>
<body>
2020-03-19 02:11:25 +02:00
<nav role="navigation">
2020-04-14 19:56:54 +03:00
<h1><a href="../index.html">
<img src="../docs-src/Figures/Inform.png" height=72">
</a></h1>
<ul><li><a href="../compiler.html">compiler tools</a></li>
2020-03-19 02:11:25 +02:00
<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>
2020-04-14 19:56:54 +03:00
</ul><h2>Compiler Webs</h2><ul>
2020-03-19 02:11:25 +02:00
<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>
2020-04-14 19:56:54 +03:00
</ul><h2>Inbuild Modules</h2><ul>
<li><a href="../supervisor-module/index.html">supervisor</a></li>
</ul><h2>Inform7 Modules</h2><ul>
2020-03-19 02:11:25 +02:00
<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>
2020-04-14 19:56:54 +03:00
<li><a href="../problems-module/index.html">problems</a></li>
2020-03-19 02:11:25 +02:00
<li><a href="../index-module/index.html">index</a></li>
2020-04-14 19:56:54 +03:00
</ul><h2>Inter Modules</h2><ul>
<li><a href="../bytecode-module/index.html">bytecode</a></li>
2020-03-19 02:11:25 +02:00
<li><a href="../building-module/index.html">building</a></li>
2020-04-14 19:56:54 +03:00
<li><a href="index.html"><span class="selectedlink">codegen</span></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>
2020-03-19 02:11:25 +02:00
<li><a href="../../../inweb/docs/foundation-module/index.html">foundation</a></li>
2020-04-14 19:56:54 +03:00
</ul>
2020-03-19 02:11:25 +02:00
</nav>
<main role="main">
2020-04-14 19:56:54 +03:00
<!--Weave of 'Final Binary Inter' generated by 7-->
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Inter Modules</a></li><li><a href="index.html">codegen</a></li><li><a href="index.html#4">Chapter 4: Final Code</a></li><li><b>Final Binary Inter</b></li></ul><p class="purpose">To create the range of possible targets into which Inter can be converted.</p>
<p class="inwebparagraph"><a id="SP1"></a><b>&#167;1. </b>This target is very simple: when we get the message to begin generation,
we simply ask the Inter module to output some text, and return true to
tell the generator that nothing more need be done.
</p>
<pre class="display">
2020-04-14 19:56:54 +03:00
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">CodeGen::Binary::create_target<button class="popup" onclick="togglePopup('usagePopup192')">...<span class="popuptext" id="usagePopup192">Usage of <b>CodeGen::Binary::create_target</b>:<br>Final Targets - <a href="4-ft.html#SP2">&#167;2</a></span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
<span class="reserved">code_generation_target</span><span class="plain"> *</span><span class="identifier">binary_inter_cgt</span><span class="plain"> = </span><span class="functiontext"><a href="4-ft.html#SP1">CodeGen::Targets::new</a></span><span class="plain">(</span><span class="identifier">I</span><span class="string">"binary"</span><span class="plain">);</span>
<span class="identifier">METHOD_ADD</span><span class="plain">(</span><span class="identifier">binary_inter_cgt</span><span class="plain">, </span><span class="constant">BEGIN_GENERATION_MTID</span><span class="plain">, </span><span class="functiontext"><a href="4-fbi.html#SP1">CodeGen::Binary::text</a></span><span class="plain">);</span>
<span class="plain">}</span>
2020-04-14 19:56:54 +03:00
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">CodeGen::Binary::text<button class="popup" onclick="togglePopup('usagePopup193')">...<span class="popuptext" id="usagePopup193">Usage of <b>CodeGen::Binary::text</b>:<br>none</span></button></span><span class="plain">(</span><span class="reserved">code_generation_target</span><span class="plain"> *</span><span class="identifier">cgt</span><span class="plain">, </span><span class="reserved">code_generation</span><span class="plain"> *</span><span class="identifier">gen</span><span class="plain">) {</span>
2020-04-07 03:06:09 +03:00
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">gen</span><span class="plain">-&gt;</span><span class="element">from_step</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"temporary generations cannot be output"</span><span class="plain">);</span>
<span class="identifier">Inter::Binary::write</span><span class="plain">(</span><span class="identifier">gen</span><span class="plain">-&gt;</span><span class="element">from_step</span><span class="plain">-&gt;</span><span class="element">parsed_filename</span><span class="plain">, </span><span class="identifier">gen</span><span class="plain">-&gt;</span><span class="element">from</span><span class="plain">);</span>
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">TRUE</span><span class="plain">;</span>
<span class="plain">}</span>
</pre>
<p class="inwebparagraph"></p>
<hr class="tocbar">
2019-08-28 12:35:44 +03:00
<ul class="toc"><li><a href="4-fti.html">Back to 'Final Textual Inter'</a></li><li><a href="4-fi.html">Continue with 'Final Inventory'</a></li></ul><hr class="tocbar">
<!--End of weave-->
2020-04-14 19:56:54 +03:00
<script>
function togglePopup(material_id) {
var popup = document.getElementById(material_id);
popup.classList.toggle("show");
}
</script>
<link href="Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
2020-03-19 02:11:25 +02:00
</main>
</body>
</html>