schleifen

A toy interpreter for LOOP programs

git clone https://git.8pit.net/schleifen.git

 1# schleifen
 2
 3An interpreter for [LOOP programs][loop wikipedia] in [chicken scheme][call-cc].
 4
 5# Status
 6
 7Just a toy program for playing around with chicken scheme.
 8
 9# Usage
10
11	$ chicken-install -n
12	$ ./schleifen op1=40 op2=2 < examples/addition.loop
13
14# Syntax
15
16The following EBNF describes valid input:
17
18	variable_start = letter | "_";
19	variable = variable_start, { variable_start | digit };
20
21	literal = digit;
22	primitive_value = literal | variable;
23	expression = primitive_value, ( "+" | "-" ), primitive_value;
24	value = primitive_value | expression;
25
26	command = variable, ":=", value, operator
27	        | "LOOP", value, "DO" commands, "DONE";
28	commands = command, ";", { command, ";" };
29
30# License
31
32This program is free software: you can redistribute it and/or modify it
33under the terms of the GNU General Public License as published by the
34Free Software Foundation, either version 3 of the License, or (at your
35option) any later version.
36
37This program is distributed in the hope that it will be useful, but
38WITHOUT ANY WARRANTY; without even the implied warranty of
39MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
40Public License for more details.
41
42You should have received a copy of the GNU General Public License along
43with this program. If not, see <https://www.gnu.org/licenses/>.
44
45[loop wikipedia]: https://en.wikipedia.org/wiki/LOOP_(programming_language)
46[call-cc]: https://call-cc.org/
47[wikipedia syntax]: https://en.wikipedia.org/wiki/LOOP_(programming_language)#Syntax