You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spectec/README.md
+8-92Lines changed: 8 additions & 92 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,42 +94,6 @@ Larger examples can be found in the [`spec`](spec) subdirectory.
94
94
95
95
Documentation can be found in the [`doc`](doc) subdirectory.
96
96
97
-
Regarding the use of the language:
98
-
99
-
*[Source Language](doc/Language.md)
100
-
*[Latex Backend](doc/Latex.md)
101
-
102
-
Regarding the internal representations usable by backends:
103
-
104
-
*[External Language](doc/EL.md)
105
-
*[Internal Language](doc/IL.md)
106
-
107
-
108
-
## Status
109
-
110
-
The implementation defines two AST representations:
111
-
112
-
* an external language (EL), suitable for backends generating latex,
113
-
* an internal language (IL), suitable for backends generating programs.
114
-
115
-
Currently, the implementation consists of merely the frontend, which performs:
116
-
117
-
* parsing,
118
-
* multiplicity checking,
119
-
* recursion analysis,
120
-
* type checking for the EL,
121
-
* elaboration from EL into IL,
122
-
* splicing expressions and definitions into files.
123
-
124
-
Lowering from EL into IL infers additional information and makes it explicit in the representation:
125
-
126
-
* resolve notational overloading and mixfix applications,
127
-
* resolve overloading of variant constructors and annotate them with their type,
128
-
* insert injections from variant subtypes into supertypes,
129
-
* insert injections from singletons into options/lists,
130
-
* insert binders and types for local variables in rules and functions,
131
-
* mark recursion groups and group definitions with rules, ordering everything by dependency.
132
-
133
97
134
98
## Building
135
99
@@ -177,73 +141,25 @@ To generate a specification document in Latex or Sphinx (to be built into pdf or
177
141
```
178
142
179
143
180
-
##Running Latex Backend
144
+
### Building the Spec
181
145
182
-
The tool can splice Latex formulas generated from, or expressed in terms of, the DSL into files. For example, invoking
146
+
The core spec document in this repo is build using SpecTec by default. To build:
183
147
```
184
-
watsup <source-files ...> -p <patch-files ...>
185
-
```
186
-
where `source-files` are the DSL files, and `patch-files` is a set of files to process (Latex, Sphinx, or other text formats), will splice Latex formulas or displaystyle definitions into the latter files.
An instruction sequence @@{:instr*} is well-typed with an instruction type @@{:t_1* -> t_2*} according to the following rules:
201
-
202
-
@@@{rule: InstrSeq_ok/empty InstrSeq_ok/seq}
203
-
204
-
@@@{rule: InstrSeq_ok/weak InstrSeq_ok/frame}
205
-
[...]
148
+
$ cd ../document/core
149
+
$ make main
206
150
```
207
-
The places to splice in formulas are indicated by _anchors_. For Latex, the two possible anchors are currently `@@` or `@@@`, which expand to `$...$` and `$$...$$`, respectively (for Sphinx, replace the anchor tokens with `$` and `$$`).
208
-
209
-
There are two forms of splices:
210
-
211
-
1._expression splice_ (`@@{: exp }`): simply renders a DSL expression,
212
-
2._definition splice_ (`@@{sort: id id ...}`): inserts the named definitions or rules of the indicated sort `sort` as defined in the DSL sources.
213
151
214
-
See the [documentation](doc/Latex.md) for more details.
215
152
153
+
### Example
216
154
217
-
## Running Sphinx Backend (WIP)
155
+
A smaller, self-contained example for a SpecTec specification, a small document with splices, and a suitable Makefile can be found in the [example](doc/example/) directory.
218
156
219
-
The full pdf/html document generation via Sphinx currently resides in the [`al`](https://github.com/Wasm-DSL/spectec/tree/al) branch.
220
-
221
-
To build both pdf and html specification document,
222
-
```
223
-
$ git checkout al
224
-
$ make
225
-
$ cd test-prose
226
-
$ make all
227
-
```
228
-
229
-
It splices Latex formulas and typesetted prose into the template `rst` document at `test-prose/doc`.
230
-
Then, Sphinx builds the `rst` files into desired formats such as pdf or html.
231
157
232
-
233
-
## Running Interpreter Backend (WIP)
158
+
### Running Interpreter Backend
234
159
235
160
The interpreter backend can be found in the [`al`](https://github.com/Wasm-DSL/spectec/tree/al) branch at the moment.
0 commit comments