-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathproject.json
154 lines (154 loc) · 5.65 KB
/
project.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{
"id": "haskell/burghard-wsa",
"name": "wsa",
"authors": ["Oliver Burghard"],
"license": "GPL",
"languages": ["Haskell"],
"tags": ["assembler", "programs"],
"date": "2003-04-24 18:52:03 +0000",
"spec_version": "0.3",
"source": [
"https://web.archive.org/web/20030629154300/http://www.burghard.info:80/code/whitespace/wsa/index.html",
"https://web.archive.org/web/20140610030912/http://www.burghard.info/Code/Whitespace/wsa.zip",
"https://web.archive.org/web/20110911114338/http://www.burghard.info/Code/Whitespace/",
"https://web.archive.org/web/20150717140342/http://compsoc.dur.ac.uk:80/whitespace/download.php",
"https://github.com/wspace/burghard-wsa",
"https://github.com/thaliaarchi/repo-archival/blob/main/scripts/wspace/burghard.sh",
"https://github.com/esovm/wsa"
],
"submodules": [{ "path": "wsa", "url": "https://github.com/wspace/burghard-wsa" }],
"whitespace": { "extension": "ws" },
"assembly": {
"mnemonics": {
"push": "Push <integer>",
"dup": "Doub",
"swap": "Swap",
"drop": "Pop",
"add": "Add",
"sub": "Sub",
"mul": "Mul",
"div": "Div",
"mod": "Mod",
"store": "Store",
"retrieve": "Retrive",
"label": "Label <label>",
"call": "Call <label>",
"jmp": "Jump <label>",
"jz": "JumpZ <label>",
"jn": "JumpN <label>",
"ret": "Ret",
"end": "Exit",
"printc": "OutC",
"printi": "OutN",
"readc": "InC",
"readi": "InN",
"dumpstack": "Debug_PrintStack",
"dumpheap": "Debug_PrintHeap"
},
"macros": [
{ "name": "Noop", "replace": [ ] },
{ "name": "Include", "args": ["<file>"] },
{ "name": "Option", "args": ["<option>"], "notes": "Declare <option> to be true" },
{ "name": "IfOption", "args": ["<option>"], "notes": "Evaluate section <option> is true" },
{ "name": "ElseIfOption", "args": ["<option>"], "notes": "Evaluate section <option> is true" },
{ "name": "EndOption", "args": ["<option>"], "notes": "Close section" },
{
"name": "PushS",
"args": ["<string>"],
"replace": ["push 0", "push <sn>", "…", "push <s1>", "push <s0>"]
},
{ "name": "Add", "args": ["<integer>"], "replace": ["push <integer>", "add"] },
{ "name": "Sub", "args": ["<integer>"], "replace": ["push <integer>", "sub"] },
{ "name": "Mul", "args": ["<integer>"], "replace": ["push <integer>", "mul"] },
{ "name": "Div", "args": ["<integer>"], "replace": ["push <integer>", "div"] },
{ "name": "Mod", "args": ["<integer>"], "replace": ["push <integer>", "mod"] },
{ "name": "Store", "args": ["<integer>"], "replace": ["push <integer>", "store"] },
{ "name": "Retrive", "args": ["<integer>"], "replace": ["push <integer>", "retrieve"] },
{ "name": "Test", "args": ["<integer>"], "replace": ["dup", "push <integer>", "sub"] },
{
"name": "JumpP",
"args": ["<label>"],
"replace": [
"dup",
"jn __trans__<next>__0__",
"dup",
"jz __trans__<next>__0__",
"drop",
"jmp <label>",
"__trans__<next>__0__:",
"drop"
],
"notes": "Jump if positive. <next> is the index of the next instruction."
},
{
"name": "JumpNP",
"args": ["<label>"],
"replace": ["jz __trans__<next>__1__", "jmp <label>", "__trans__<next>__1__:"],
"notes": "Jump if negative or positive. <next> is the index of the next instruction."
},
{ "name": "JumpPN", "notes": "Same as JumpNP" },
{
"name": "JumpNZ",
"args": ["<label>"],
"replace": [
"dup",
"jn __trans__<next>__2__",
"dup",
"jz __trans__<next>__2__",
"jmp __trans__<next>__3__",
"__trans__<next>__2__:",
"drop",
"jmp <label>",
"__trans__<next>__3__:",
"drop"
],
"notes": "Jump if negative or zero. <next> is the index of the next instruction."
},
{
"name": "JumpPZ",
"args": ["<label>"],
"replace": ["jn __trans__<next>__4__", "jmp <label>", "__trans__<next>__4__:"],
"notes": "Jump if positive or zero. <next> is the index of the next instruction."
},
{
"name": "ValueInteger",
"args": ["_<variable> <integer>"],
"replace": [ ],
"notes": "Integer constant definition"
},
{
"name": "ValueString",
"args": ["_<variable> <string>"],
"replace": [ ],
"notes": "String constant definition "
}
],
"patterns": {
"integer": "<integer_literal>|_<variable>",
"string": "\"[^\"]*\"|_<variable>",
"whitespace_between_tokens": "[ \\t]"
},
"case_sensitive_mnemonics": false,
"instruction_delimiter": "none",
"line_comments": [";", "--"],
"block_comments": [{ "start": "{-", "end": "-}", "nestable": true }],
"usage": ["assembler"],
"extension": "wsa",
"notes": "<integer_literal> is parsed with `(read s) :: Integer`. Assembler appends \"\\n\\n\\nquit\\n\\n\\n\" to the end of the .ws file."
},
"mappings": [
{
"space": "a",
"tab": "b",
"lf": "c",
"extension": "pws",
"notes": "Opcode and argument are separated with a space. Each instruction is followed by LF. Assembler appends \"\\n\\n\\n\" to the end of the .pws file."
}
],
"programs": [
{ "path": "examples/prim.wsa", "spec_version": "0.2" },
{ "path": "libs/memory.wsa", "spec_version": "0.2" },
{ "path": "libs/io.wsa", "spec_version": "0.2" }
],
"commands": [{ "bin": "trans", "input": "<file>.wsa", "output": "<file>.pws and <file>.ws" }]
}