tools.html (5200B)
1 <!DOCTYPE html> 2 <html> 3 <!-- Created by GNU Texinfo 7.0.2, https://www.gnu.org/software/texinfo/ --> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 6 <!-- Released 2023 under AGPL3 --> 7 <title>tools (vise)</title> 8 9 <meta name="description" content="tools (vise)"> 10 <meta name="keywords" content="tools (vise)"> 11 <meta name="resource-type" content="document"> 12 <meta name="distribution" content="global"> 13 <meta name="Generator" content="makeinfo"> 14 <meta name="viewport" content="width=device-width,initial-scale=1"> 15 16 <link href="index.html" rel="start" title="Top"> 17 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> 18 <link href="index.html" rel="up" title="Top"> 19 <link href="dev.html" rel="prev" title="dev"> 20 <style type="text/css"> 21 <!-- 22 div.example {margin-left: 3.2em} 23 --> 24 </style> 25 26 27 </head> 28 29 <body lang="en"> 30 <div class="chapter-level-extent" id="tools"> 31 <div class="nav-panel"> 32 <p> 33 Previous: <a href="dev.html" accesskey="p" rel="prev">Development</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> 34 </div> 35 <hr> 36 <h2 class="chapter" id="Development-tools">12 Development tools</h2> 37 38 <p>Located in the <samp class="file">dev/</samp> directory of the source code repository. 39 </p> 40 41 <ul class="mini-toc"> 42 <li><a href="#Test-data-generation" accesskey="1">Test data generation</a></li> 43 <li><a href="#Interactive-runner" accesskey="2">Interactive runner</a></li> 44 <li><a href="#Assembler" accesskey="3">Assembler</a></li> 45 <li><a href="#Disassembler" accesskey="4">Disassembler</a></li> 46 <li><a href="#Interactive-case-examples" accesskey="5">Interactive case examples</a></li> 47 </ul> 48 <div class="section-level-extent" id="Test-data-generation"> 49 <h3 class="section">12.1 Test data generation</h3> 50 51 <div class="example"> 52 <pre class="example-preformatted">go run ./dev/gendata/ <directory> 53 </pre></div> 54 55 <p>Outputs bytecodes and templates for test data scenarios used in ‘engine‘ unit tests. 56 </p> 57 58 </div> 59 <div class="section-level-extent" id="Interactive-runner"> 60 <h3 class="section">12.2 Interactive runner</h3> 61 62 <div class="example"> 63 <pre class="example-preformatted">go run ./dev/interactive [-d <data_directory>] [--root <root_symbol>] [--session-id <session_id>] [--persist] 64 </pre></div> 65 66 <p>Creates a new interactive session using <code class="code">engine.DefaultEngine</code>, starting execution at symbol <code class="code">root_symbol</code> 67 </p> 68 <p><code class="code">data_directory</code> points to a directory where templates and bytecode is to be found (in the same format as generated by <samp class="file">dev/gendata</samp>). 69 </p> 70 <p>If <code class="code">data_directory</code> is not set, current directory will be used. 71 </p> 72 <p>if <code class="code">root_symbol</code> is not set, the symbol <code class="code">root</code> will be used. 73 </p> 74 <p>if <code class="code">session_id</code> is set, mutable data will be stored and retrieved keyed by the given identifer (if implemented). 75 </p> 76 <p>If <code class="code">persist</code> is set, the execution state will be persisted across sessions. 77 </p> 78 79 </div> 80 <div class="section-level-extent" id="Assembler"> 81 <h3 class="section">12.3 Assembler</h3> 82 83 <div class="example"> 84 <pre class="example-preformatted">go run ./dev/asm <assembly_file> 85 </pre></div> 86 87 <p>Will output bytecode on STDOUT generated from a valid assembly file. 88 </p> 89 90 </div> 91 <div class="section-level-extent" id="Disassembler"> 92 <h3 class="section">12.4 Disassembler</h3> 93 94 <div class="example"> 95 <pre class="example-preformatted">go run ./dev/disasm/ <binary_file> 96 </pre></div> 97 98 <p>Will list all the instructions on STDOUT from a valid binary file. 99 </p> 100 101 </div> 102 <div class="section-level-extent" id="Interactive-case-examples"> 103 <h3 class="section">12.5 Interactive case examples</h3> 104 105 <p>Found in <samp class="file">examples/</samp>. 106 </p> 107 <p>Be sure to <code class="code">make examples</code> before running them. 108 </p> 109 <p>Can be run with: 110 </p> 111 <div class="example"> 112 <pre class="example-preformatted">go run ./examples/<case> [...] 113 </pre></div> 114 115 <p>except helloworld which is run as 116 </p> 117 <div class="example"> 118 <pre class="example-preformatted">go run ./dev/interactive -d ./examples/helloworld [...] 119 </pre></div> 120 121 <p>The available options are the same as for the <samp class="file">dev/interactive</samp> tool. 122 </p> 123 <p>Contents of the case directory: 124 </p> 125 <dl class="table"> 126 <dt><samp class="file">*.vis</samp></dt> 127 <dd><p>assembly code. 128 </p></dd> 129 <dt><samp class="file">*.bin</samp></dt> 130 <dd><p>bytecode for each node symbol (only available after make). 131 </p></dd> 132 <dt><samp class="file">*.txt.orig</samp></dt> 133 <dd><p>default contents of a single data entry. 134 </p></dd> 135 <dt><samp class="file">*.txt</samp></dt> 136 <dd><p>current contents of a single data entry (only available after make). 137 </p></dd> 138 </dl> 139 </div> 140 </div> 141 <hr> 142 <div class="nav-panel"> 143 <p> 144 Previous: <a href="dev.html">Development</a>, Up: <a href="index.html">Introduction</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> 145 </div> 146 147 148 149 </body> 150 </html>