esolang 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,391 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Esolang::Interpreters::Ook
8
+
9
+ &mdash; Documentation by YARD 0.9.34
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" />
16
+
17
+ <script type="text/javascript">
18
+ pathId = "Esolang::Interpreters::Ook";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (O)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Esolang.html" title="Esolang (module)">Esolang</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Interpreters.html" title="Esolang::Interpreters (module)">Interpreters</a></span></span>
41
+ &raquo;
42
+ <span class="title">Ook</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Esolang::Interpreters::Ook
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName"><span class='object_link'><a href="Brainfuck.html" title="Esolang::Interpreters::Brainfuck (class)">Brainfuck</a></span></span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next"><span class='object_link'><a href="BaseInterpreter.html" title="Esolang::Interpreters::BaseInterpreter (class)">BaseInterpreter</a></span></li>
78
+
79
+ <li class="next"><span class='object_link'><a href="Brainfuck.html" title="Esolang::Interpreters::Brainfuck (class)">Brainfuck</a></span></li>
80
+
81
+ <li class="next">Esolang::Interpreters::Ook</li>
82
+
83
+ </ul>
84
+ <a href="#" class="inheritanceTree">show all</a>
85
+
86
+ </dd>
87
+ </dl>
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ <dl>
100
+ <dt>Defined in:</dt>
101
+ <dd>lib/interpreters/ook_interpreter.rb</dd>
102
+ </dl>
103
+
104
+ </div>
105
+
106
+ <h2>Overview</h2><div class="docstring">
107
+ <div class="discussion">
108
+
109
+ <p>The Ook class represents an interpreter for the Ook! esoteric programming language, which is translated to Brainfuck for execution.</p>
110
+
111
+
112
+ </div>
113
+ </div>
114
+ <div class="tags">
115
+
116
+
117
+ </div>
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+ <h2>
126
+ Instance Method Summary
127
+ <small><a href="#" class="summary_toggle">collapse</a></small>
128
+ </h2>
129
+
130
+ <ul class="summary">
131
+
132
+ <li class="public ">
133
+ <span class="summary_signature">
134
+
135
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(code, input = &#39;&#39;) &#x21d2; Ook </a>
136
+
137
+
138
+
139
+ </span>
140
+
141
+
142
+ <span class="note title constructor">constructor</span>
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+ <span class="summary_desc"><div class='inline'>
152
+ <p>Initializes a new instance of the Ook interpreter.</p>
153
+ </div></span>
154
+
155
+ </li>
156
+
157
+
158
+ <li class="public ">
159
+ <span class="summary_signature">
160
+
161
+ <a href="#run-instance_method" title="#run (instance method)">#<strong>run</strong> &#x21d2; String </a>
162
+
163
+
164
+
165
+ </span>
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ <span class="summary_desc"><div class='inline'>
176
+ <p>Executes the interpretation of the Ook code.</p>
177
+ </div></span>
178
+
179
+ </li>
180
+
181
+
182
+ </ul>
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <div id="constructor_details" class="method_details_list">
198
+ <h2>Constructor Details</h2>
199
+
200
+ <div class="method_details first">
201
+ <h3 class="signature first" id="initialize-instance_method">
202
+
203
+ #<strong>initialize</strong>(code, input = &#39;&#39;) &#x21d2; <tt><span class='object_link'><a href="" title="Esolang::Interpreters::Ook (class)">Ook</a></span></tt>
204
+
205
+
206
+
207
+
208
+
209
+ </h3><div class="docstring">
210
+ <div class="discussion">
211
+
212
+ <p>Initializes a new instance of the Ook interpreter.</p>
213
+
214
+
215
+ </div>
216
+ </div>
217
+ <div class="tags">
218
+ <p class="tag_title">Parameters:</p>
219
+ <ul class="param">
220
+
221
+ <li>
222
+
223
+ <span class='name'>code</span>
224
+
225
+
226
+ <span class='type'>(<tt>String</tt>)</span>
227
+
228
+
229
+
230
+ &mdash;
231
+ <div class='inline'>
232
+ <p>The Ook code to interpret.</p>
233
+ </div>
234
+
235
+ </li>
236
+
237
+ <li>
238
+
239
+ <span class='name'>input</span>
240
+
241
+
242
+ <span class='type'>(<tt>String</tt>)</span>
243
+
244
+
245
+ <em class="default">(defaults to: <tt>&#39;&#39;</tt>)</em>
246
+
247
+
248
+ &mdash;
249
+ <div class='inline'>
250
+ <p>The input for the Ook program (optional).</p>
251
+ </div>
252
+
253
+ </li>
254
+
255
+ </ul>
256
+
257
+
258
+ </div><table class="source_code">
259
+ <tr>
260
+ <td>
261
+ <pre class="lines">
262
+
263
+
264
+ 14
265
+ 15
266
+ 16
267
+ 17</pre>
268
+ </td>
269
+ <td>
270
+ <pre class="code"><span class="info file"># File 'lib/interpreters/ook_interpreter.rb', line 14</span>
271
+
272
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='comma'>,</span> <span class='id identifier rubyid_input'>input</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
273
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_translate_to_brainfuck'>translate_to_brainfuck</span><span class='lparen'>(</span><span class='id identifier rubyid_code'>code</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='id identifier rubyid_input'>input</span><span class='rparen'>)</span>
274
+ <span class='ivar'>@input</span> <span class='op'>=</span> <span class='id identifier rubyid_input'>input</span>
275
+ <span class='kw'>end</span></pre>
276
+ </td>
277
+ </tr>
278
+ </table>
279
+ </div>
280
+
281
+ </div>
282
+
283
+
284
+ <div id="instance_method_details" class="method_details_list">
285
+ <h2>Instance Method Details</h2>
286
+
287
+
288
+ <div class="method_details first">
289
+ <h3 class="signature first" id="run-instance_method">
290
+
291
+ #<strong>run</strong> &#x21d2; <tt>String</tt>
292
+
293
+
294
+
295
+
296
+
297
+ </h3><div class="docstring">
298
+ <div class="discussion">
299
+
300
+ <p>Executes the interpretation of the Ook code.</p>
301
+
302
+
303
+ </div>
304
+ </div>
305
+ <div class="tags">
306
+
307
+ <p class="tag_title">Returns:</p>
308
+ <ul class="return">
309
+
310
+ <li>
311
+
312
+
313
+ <span class='type'>(<tt>String</tt>)</span>
314
+
315
+
316
+
317
+ &mdash;
318
+ <div class='inline'>
319
+ <p>The result of the Ook interpretation.</p>
320
+ </div>
321
+
322
+ </li>
323
+
324
+ </ul>
325
+
326
+ </div><table class="source_code">
327
+ <tr>
328
+ <td>
329
+ <pre class="lines">
330
+
331
+
332
+ 22
333
+ 23
334
+ 24
335
+ 25
336
+ 26
337
+ 27
338
+ 28
339
+ 29
340
+ 30
341
+ 31
342
+ 32
343
+ 33
344
+ 34
345
+ 35
346
+ 36
347
+ 37
348
+ 38
349
+ 39
350
+ 40</pre>
351
+ </td>
352
+ <td>
353
+ <pre class="code"><span class="info file"># File 'lib/interpreters/ook_interpreter.rb', line 22</span>
354
+
355
+ <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
356
+ <span class='kw'>while</span> <span class='id identifier rubyid_running?'>running?</span> <span class='kw'>do</span>
357
+ <span class='kw'>case</span> <span class='id identifier rubyid_command'>command</span>
358
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>,</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_input_to_tape'>input_to_tape</span>
359
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>.</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_tape_to_output_array'>tape_to_output_array</span>
360
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&gt;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_right'>move_right</span>
361
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>&lt;</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_move_left'>move_left</span>
362
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>+</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_increment'>increment</span>
363
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>-</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_decrement'>decrement</span>
364
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>[</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_loop_begin'>loop_begin</span>
365
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>]</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_loop_end'>loop_end</span>
366
+ <span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>?</span><span class='tstring_end'>&#39;</span></span> <span class='kw'>then</span> <span class='id identifier rubyid_banana'>banana</span>
367
+ <span class='kw'>end</span>
368
+
369
+ <span class='ivar'>@code_pointer</span> <span class='op'>+=</span> <span class='int'>1</span>
370
+ <span class='kw'>end</span>
371
+
372
+ <span class='id identifier rubyid_translate_output_bytes_to_chars'>translate_output_bytes_to_chars</span>
373
+ <span class='kw'>end</span></pre>
374
+ </td>
375
+ </tr>
376
+ </table>
377
+ </div>
378
+
379
+ </div>
380
+
381
+ </div>
382
+
383
+ <div id="footer">
384
+ Generated on Mon Jan 22 14:49:08 2024 by
385
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
386
+ 0.9.34 (ruby-3.1.2).
387
+ </div>
388
+
389
+ </div>
390
+ </body>
391
+ </html>