spex-parser 0.1.5 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +312 -1
- package/dist/ast.d.ts +70 -2
- package/dist/ast.d.ts.map +1 -1
- package/dist/constants.d.ts +20 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +32 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lexer.d.ts +17 -1
- package/dist/lexer.d.ts.map +1 -1
- package/dist/lexer.js +159 -5
- package/dist/lexer.js.map +1 -1
- package/dist/parser.d.ts +9 -0
- package/dist/parser.d.ts.map +1 -1
- package/dist/parser.js +103 -7
- package/dist/parser.js.map +1 -1
- package/dist/visitor.d.ts +11 -2
- package/dist/visitor.d.ts.map +1 -1
- package/dist/visitor.js +181 -8
- package/dist/visitor.js.map +1 -1
- package/package.json +1 -1
- package/src/ast.ts +93 -0
- package/src/constants.ts +40 -0
- package/src/index.ts +20 -3
- package/src/lexer.ts +150 -6
- package/src/parser.ts +128 -7
- package/src/visitor.ts +195 -11
- package/tests/constants.test.ts +102 -0
- package/tests/e2e.test.ts +15 -3
- package/tests/lexer.test.ts +230 -9
- package/tests/parser.test.ts +438 -0
- package/tests/props/express_todo_web.spex +108 -0
- package/tests/props/express_web_env.spex +16 -0
- package/tests/props/flask_todo_web.spex +111 -0
- package/tests/props/flask_web_env.spex +16 -0
- package/tests/props/python_cli_env.spex +16 -0
- package/tests/props/python_todo_cli.spex +70 -0
- package/tests/props/todo.spex +99 -68
- package/tests/props/typescript_cli_env.spex +16 -0
- package/tests/props/typescript_todo_cli.spex +70 -0
- package/tests/visitor.test.ts +892 -0
package/README.md
CHANGED
|
@@ -76,10 +76,14 @@ string
|
|
|
76
76
|
number
|
|
77
77
|
bool
|
|
78
78
|
unit
|
|
79
|
+
concept
|
|
80
|
+
environment
|
|
79
81
|
```
|
|
80
82
|
|
|
81
83
|
`unit` is a special object that represent an empty type. It is useful in defining functions that take no input or do not return anything.
|
|
82
84
|
|
|
85
|
+
`concept` and `environment` are abstract base objects. A `concept` represents an abstract specification of something that needs to be realized, while an `environment` describes the context in which concepts are realized. They are covered in depth in [Concepts, Environments, and Realization](#concepts-environments-and-realization).
|
|
86
|
+
|
|
83
87
|
## Arrays
|
|
84
88
|
|
|
85
89
|
To represent an array:
|
|
@@ -114,9 +118,50 @@ Product objects are created by combining other objects:
|
|
|
114
118
|
|
|
115
119
|
Consequently, `()` and `unit` are the same object.
|
|
116
120
|
|
|
121
|
+
## Coproducts
|
|
122
|
+
|
|
123
|
+
Coproduct objects represent a choice between alternatives. Where a product means "both", a coproduct means "either". A value of a coproduct holds exactly one of the alternatives and records which one. Coproducts are also called sum types or tagged unions:
|
|
124
|
+
|
|
125
|
+
```spex
|
|
126
|
+
CREATE Shape AS
|
|
127
|
+
Point | Circle;
|
|
128
|
+
|
|
129
|
+
CREATE Command AS
|
|
130
|
+
AddTodo | ListTodos | CompleteTodo;
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Coproducts combine with any other object form:
|
|
134
|
+
|
|
135
|
+
```spex
|
|
136
|
+
CREATE Result AS
|
|
137
|
+
string | (error: string) | unit;
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Because the alternatives are disjoint, a coproduct needs no common universe: `A | B` simply says "an A or a B". This is what distinguishes a coproduct from a set union, which requires both sides to live in a common universe.
|
|
141
|
+
|
|
142
|
+
Operator precedence, from loosest to tightest, is: set operations, then `|`, then `->`:
|
|
143
|
+
|
|
144
|
+
```spex
|
|
145
|
+
CREATE X AS
|
|
146
|
+
A -> B | C; -- (A -> B) | C
|
|
147
|
+
|
|
148
|
+
CREATE Y AS
|
|
149
|
+
A UNION B | C; -- A UNION (B | C)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Use parentheses to group any expression and override the default precedence. A `(` opens a group unless it is followed by a field name and a colon, in which case it opens a product:
|
|
153
|
+
|
|
154
|
+
```spex
|
|
155
|
+
CREATE X AS
|
|
156
|
+
A -> (B | C);
|
|
157
|
+
|
|
158
|
+
CREATE Y AS
|
|
159
|
+
(A UNION B) EXCEPT C;
|
|
160
|
+
```
|
|
161
|
+
|
|
117
162
|
## Exponentials
|
|
118
163
|
|
|
119
|
-
Spex
|
|
164
|
+
Spex supports function types which are referred to as exponential objects. An exponential has a base (the result type) and an exponent (the parameter type), both of which must be objects:
|
|
120
165
|
|
|
121
166
|
```spex
|
|
122
167
|
string -> number
|
|
@@ -127,6 +172,33 @@ unit -> string
|
|
|
127
172
|
|
|
128
173
|
`string -> unit` represents all functions that take a string as input and do not return anything. `unit -> string` on the other hand, is a function that takes nothing as input, but returns a string.
|
|
129
174
|
|
|
175
|
+
## Lambda Expressions
|
|
176
|
+
|
|
177
|
+
A lambda expression defines an exponential pattern with an implementation body. It specifies the function type along with its implementation in a programming language:
|
|
178
|
+
|
|
179
|
+
````spex
|
|
180
|
+
CREATE double AS
|
|
181
|
+
lambda number -> number ```python
|
|
182
|
+
return @n * 2
|
|
183
|
+
```
|
|
184
|
+
````
|
|
185
|
+
|
|
186
|
+
The domain (left side of `->`) defines the parameter type, and the codomain (right side) defines the return type. The body is written in a fenced code block with a language identifier.
|
|
187
|
+
|
|
188
|
+
Lambda expressions support pattern blocks using `@{...}` syntax. Pattern blocks are extracted from the body and can contain references to the function's parameters:
|
|
189
|
+
|
|
190
|
+
````spex
|
|
191
|
+
CREATE transform AS
|
|
192
|
+
lambda (x: number) -> number ```python
|
|
193
|
+
if @x > 0:
|
|
194
|
+
@{return sin(@x)}
|
|
195
|
+
else:
|
|
196
|
+
@{return cos(@x)}
|
|
197
|
+
```
|
|
198
|
+
````
|
|
199
|
+
|
|
200
|
+
Pattern blocks are parsed into structured AST nodes with their positions tracked, making it easy to analyze and transform them programmatically. Multiple pattern blocks in a single body are distinguished by their start and end positions.
|
|
201
|
+
|
|
130
202
|
## Subobjects
|
|
131
203
|
|
|
132
204
|
Subobjects are analogous to subsets. Subobjects refine an object by selecting memebers that satisfy some constraints. Constraints are defined through natural language:
|
|
@@ -147,6 +219,202 @@ Subobjects are themselves objects so they could be subobjected as well. A good h
|
|
|
147
219
|
|
|
148
220
|
> "from `object` select those that `{constraint}`".
|
|
149
221
|
|
|
222
|
+
## Set Operations
|
|
223
|
+
|
|
224
|
+
Objects that live in a common universe can be combined with the set operations `UNION`, `INTERSECT`, and `EXCEPT`:
|
|
225
|
+
|
|
226
|
+
```spex
|
|
227
|
+
CREATE EvenInt AS
|
|
228
|
+
FROM int
|
|
229
|
+
SELECT { are even };
|
|
230
|
+
|
|
231
|
+
CREATE PositiveInt AS
|
|
232
|
+
FROM int
|
|
233
|
+
SELECT { are positive };
|
|
234
|
+
|
|
235
|
+
CREATE EvenPositiveInt AS
|
|
236
|
+
EvenInt INTERSECT PositiveInt;
|
|
237
|
+
CREATE EvenOrPositive AS EvenInt UNION PositiveInt;
|
|
238
|
+
CREATE EvenNotPositive AS EvenInt EXCEPT PositiveInt;
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
`UNION` keeps members that satisfy either side, `INTERSECT` keeps members that satisfy both sides, and `EXCEPT` removes the members of the right side from the left side.
|
|
242
|
+
|
|
243
|
+
Set operations bind loosest of all object operators and chain left-to-right:
|
|
244
|
+
|
|
245
|
+
```spex
|
|
246
|
+
CREATE X AS
|
|
247
|
+
A UNION B EXCEPT C; -- (A UNION B) EXCEPT C
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Literals
|
|
251
|
+
|
|
252
|
+
A literal object denotes a single value, and therefore represents the set containing exactly that value:
|
|
253
|
+
|
|
254
|
+
```spex
|
|
255
|
+
"root" -- the string root
|
|
256
|
+
42 -- the number 42
|
|
257
|
+
true -- the boolean true
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Literals can refine other objects or serve as alternatives in a coproduct:
|
|
261
|
+
|
|
262
|
+
```spex
|
|
263
|
+
CREATE UserName AS
|
|
264
|
+
string EXCEPT "root";
|
|
265
|
+
|
|
266
|
+
CREATE Handedness AS
|
|
267
|
+
"left" | "right";
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## Enums
|
|
271
|
+
|
|
272
|
+
An enum object declares a named set of allowed string values:
|
|
273
|
+
|
|
274
|
+
```spex
|
|
275
|
+
CREATE Color AS
|
|
276
|
+
ENUM ('red', 'green', 'blue');
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
An enum constrains a value to one of the listed strings.
|
|
280
|
+
|
|
281
|
+
## Patterns
|
|
282
|
+
|
|
283
|
+
A pattern literal denotes the subobject of `string` containing exactly the strings that match it:
|
|
284
|
+
|
|
285
|
+
```spex
|
|
286
|
+
/\d+/
|
|
287
|
+
/create\b/i
|
|
288
|
+
/'([^'\\]|\\.)*'|"([^"\\]|\\.)*"/
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
The source is kept verbatim and flags such as `i` (case-insensitive) follow the closing slash. Because a pattern is a subobject of the string base object, it participates in set operations and coproducts like any other object:
|
|
292
|
+
|
|
293
|
+
```spex
|
|
294
|
+
CREATE Digits AS /\d+/;
|
|
295
|
+
CREATE Word AS /\w+/;
|
|
296
|
+
|
|
297
|
+
CREATE DigitOrWord AS Digits UNION Word;
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
# Concepts, Environments, and Realization
|
|
301
|
+
|
|
302
|
+
Spex distinguishes between _what_ software should be and _where_ and _how_ it is realized. This separation is captured by three core ideas: concepts, environments, and realizations.
|
|
303
|
+
|
|
304
|
+
## Concept
|
|
305
|
+
|
|
306
|
+
A `concept` is a built-in base object that represents an abstract specification of something that needs to be realized. Concepts are ordinary Spex objects and can be subobjected just like any other object:
|
|
307
|
+
|
|
308
|
+
```spex
|
|
309
|
+
create HttpApi as
|
|
310
|
+
from concept
|
|
311
|
+
select {
|
|
312
|
+
serve HTTP requests and respond with JSON
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
create EchoApi as
|
|
316
|
+
from HttpApi
|
|
317
|
+
select {
|
|
318
|
+
return the request body unchanged
|
|
319
|
+
};
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
Because `EchoApi` is a subobject of `HttpApi`, it inherits everything `HttpApi` stands for and only adds constraints on top of it.
|
|
323
|
+
|
|
324
|
+
A concept can be abstract and can itself be composed of other abstract concepts. It does not need to directly correspond to executable code. The goal of concepts is to allow specifications to remain independent of implementation details: a concept describes _what_ the software should be, leaving _how_ it is built to be decided later.
|
|
325
|
+
|
|
326
|
+
## Environment
|
|
327
|
+
|
|
328
|
+
An `environment` is a second built-in base object. It describes the development and runtime context in which concepts are to be realized. An environment is independent from the application specification.
|
|
329
|
+
|
|
330
|
+
An environment may specify:
|
|
331
|
+
|
|
332
|
+
- the programming language
|
|
333
|
+
- the language or runtime version
|
|
334
|
+
- frameworks
|
|
335
|
+
- libraries and dependencies
|
|
336
|
+
- other tooling required to build or run the generated program
|
|
337
|
+
|
|
338
|
+
Environments are ordinary Spex objects and can be specialized through subobjects:
|
|
339
|
+
|
|
340
|
+
```spex
|
|
341
|
+
create Python as
|
|
342
|
+
from environment
|
|
343
|
+
select {
|
|
344
|
+
language: Python
|
|
345
|
+
};
|
|
346
|
+
|
|
347
|
+
create FastAPI as
|
|
348
|
+
from Python
|
|
349
|
+
select {
|
|
350
|
+
dependencies: fastapi, uvicorn
|
|
351
|
+
};
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
An environment is itself something that can be realized into an _environment artifact_: a reproducible description of the environment, such as a Dockerfile. Docker is not the only possible backend; any artifact that reproducibly describes the environment can serve this role.
|
|
355
|
+
|
|
356
|
+
Environment construction is separate from application-code generation. Preparing the context in which the software runs is a distinct concern from generating the software itself.
|
|
357
|
+
|
|
358
|
+
## Realization
|
|
359
|
+
|
|
360
|
+
Realization is the mechanism that connects an abstract concept to a more concrete representation. It is fundamentally different from subobjecting:
|
|
361
|
+
|
|
362
|
+
- a subobject preserves the object's base type
|
|
363
|
+
- a realization may cross abstraction or type boundaries
|
|
364
|
+
|
|
365
|
+
Therefore, realizing a `Concept` does not mean that the resulting object is a subobject of that concept.
|
|
366
|
+
|
|
367
|
+
A realization is associated with an environment because different environments may realize the same abstract concept differently. The same abstract `HttpApi`, for example, might be realized using Flask in a Python environment or Express in a TypeScript environment:
|
|
368
|
+
|
|
369
|
+
```text
|
|
370
|
+
HttpApi
|
|
371
|
+
/ \
|
|
372
|
+
Flask Express
|
|
373
|
+
| |
|
|
374
|
+
Python code TypeScript code
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
In Spex, this is declared with the `realize` statement:
|
|
378
|
+
|
|
379
|
+
```spex
|
|
380
|
+
realize HttpApi as FlaskHttpApi in Python;
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
Realization is recursive: an abstract concept can be realized into objects that are themselves still abstract and require further realization. Code generation is possible when the relevant abstract concepts have reached concrete realizations.
|
|
384
|
+
|
|
385
|
+
## Relationship Between the Three
|
|
386
|
+
|
|
387
|
+
The overall model connects the specification to concrete implementations:
|
|
388
|
+
|
|
389
|
+
```text
|
|
390
|
+
Concept
|
|
391
|
+
|
|
|
392
|
+
| realization in an Environment
|
|
393
|
+
v
|
|
394
|
+
Environment-specific representation
|
|
395
|
+
|
|
|
396
|
+
| generation
|
|
397
|
+
v
|
|
398
|
+
Concrete implementation/code
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Environments follow the same path towards a concrete artifact:
|
|
402
|
+
|
|
403
|
+
```text
|
|
404
|
+
Environment
|
|
405
|
+
|
|
|
406
|
+
| generation
|
|
407
|
+
v
|
|
408
|
+
Environment artifact
|
|
409
|
+
(e.g. Dockerfile)
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The important distinction is:
|
|
413
|
+
|
|
414
|
+
**Concepts describe what the software should be.
|
|
415
|
+
Environments describe where/how it is to be realized.
|
|
416
|
+
Realizations connect the abstract specification to concrete representations.**
|
|
417
|
+
|
|
150
418
|
# Named Objects
|
|
151
419
|
|
|
152
420
|
To name an object for reuse:
|
|
@@ -292,6 +560,49 @@ SELECT {
|
|
|
292
560
|
|
|
293
561
|
---
|
|
294
562
|
|
|
563
|
+
# Including Resources
|
|
564
|
+
|
|
565
|
+
A _resource_ is an external artifact that is not generated, such as an image, a JSON file, or a folder of assets. Use the `INCLUDE` declaration to bring a resource into scope:
|
|
566
|
+
|
|
567
|
+
```spex
|
|
568
|
+
INCLUDE "config.json" AS config;
|
|
569
|
+
INCLUDE "images/logo.png" AS logo;
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
The address is a string literal pointing to a file or folder. The name becomes a first-class object in the current scope and can be referenced in constraints with `@`:
|
|
573
|
+
|
|
574
|
+
```spex
|
|
575
|
+
INCLUDE "schema.sql" AS schema;
|
|
576
|
+
|
|
577
|
+
CREATE LoadSchema AS
|
|
578
|
+
FROM unit -> string
|
|
579
|
+
SELECT {
|
|
580
|
+
1. read the SQL file at @schema
|
|
581
|
+
2. return its contents as a string
|
|
582
|
+
};
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
## Folders
|
|
586
|
+
|
|
587
|
+
When the address points to a folder, the resource is treated as a product object whose fields correspond to the files inside it:
|
|
588
|
+
|
|
589
|
+
```spex
|
|
590
|
+
INCLUDE "assets/" AS assets;
|
|
591
|
+
|
|
592
|
+
CREATE LoadConfig AS
|
|
593
|
+
FROM unit -> Config
|
|
594
|
+
SELECT {
|
|
595
|
+
1. read @assets.config.json
|
|
596
|
+
2. return its content as a Config object
|
|
597
|
+
};
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
## Constraints
|
|
601
|
+
|
|
602
|
+
Resources cannot be subobjected. That is, `FROM <resource> SELECT { ... }` is not valid. This is because a resource represents a concrete external artifact, not a space of possible implementations.
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
295
606
|
# Generating Code
|
|
296
607
|
|
|
297
608
|
To specify what objects in an specification has to be generated as explicit code:
|
package/dist/ast.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export type SpexFile = {
|
|
|
2
2
|
kind: 'SpexFile';
|
|
3
3
|
declarations: Declaration[];
|
|
4
4
|
};
|
|
5
|
-
export type Declaration = ObjectDeclaration | ImportDeclaration | ExportDeclaration | GenerateDeclaration | PackageDeclaration;
|
|
5
|
+
export type Declaration = ObjectDeclaration | ImportDeclaration | ExportDeclaration | GenerateDeclaration | PackageDeclaration | RealizeDeclaration | IncludeDeclaration;
|
|
6
6
|
export type PackageKind = 'EXECUTABLE' | 'MODULE';
|
|
7
7
|
export type PackageDeclaration = {
|
|
8
8
|
kind: 'PackageDeclaration';
|
|
@@ -29,7 +29,18 @@ export type GenerateDeclaration = {
|
|
|
29
29
|
kind: 'GenerateDeclaration';
|
|
30
30
|
name: string;
|
|
31
31
|
};
|
|
32
|
-
export type
|
|
32
|
+
export type RealizeDeclaration = {
|
|
33
|
+
kind: 'RealizeDeclaration';
|
|
34
|
+
object: ObjectExpression;
|
|
35
|
+
target: ObjectExpression;
|
|
36
|
+
environment: ObjectExpression;
|
|
37
|
+
};
|
|
38
|
+
export type IncludeDeclaration = {
|
|
39
|
+
kind: 'IncludeDeclaration';
|
|
40
|
+
name: string;
|
|
41
|
+
address: string;
|
|
42
|
+
};
|
|
43
|
+
export type ObjectExpression = NamedObject | ProductObject | ExponentialObject | SubObject | ArrayObject | EnumObject | LiteralObject | SetObject | CoproductObject | PatternLiteralObject | ExponentialPattern;
|
|
33
44
|
export type NamedObject = {
|
|
34
45
|
kind: 'NamedObject';
|
|
35
46
|
name: string;
|
|
@@ -65,4 +76,61 @@ export type ArrayObject = {
|
|
|
65
76
|
kind: 'ArrayObject';
|
|
66
77
|
base: ObjectExpression;
|
|
67
78
|
};
|
|
79
|
+
export type EnumObject = {
|
|
80
|
+
kind: 'EnumObject';
|
|
81
|
+
values: string[];
|
|
82
|
+
};
|
|
83
|
+
export type LiteralObject = StringLiteralObject | NumberLiteralObject | BoolLiteralObject;
|
|
84
|
+
export type StringLiteralObject = {
|
|
85
|
+
kind: 'StringLiteralObject';
|
|
86
|
+
value: string;
|
|
87
|
+
};
|
|
88
|
+
export type NumberLiteralObject = {
|
|
89
|
+
kind: 'NumberLiteralObject';
|
|
90
|
+
value: string;
|
|
91
|
+
};
|
|
92
|
+
export type BoolLiteralObject = {
|
|
93
|
+
kind: 'BoolLiteralObject';
|
|
94
|
+
value: boolean;
|
|
95
|
+
};
|
|
96
|
+
export type SetObject = SetUnionObject | SetIntersectionObject | SetDifferenceObject;
|
|
97
|
+
export type SetUnionObject = {
|
|
98
|
+
kind: 'SetUnionObject';
|
|
99
|
+
left: ObjectExpression;
|
|
100
|
+
right: ObjectExpression;
|
|
101
|
+
};
|
|
102
|
+
export type SetIntersectionObject = {
|
|
103
|
+
kind: 'SetIntersectionObject';
|
|
104
|
+
left: ObjectExpression;
|
|
105
|
+
right: ObjectExpression;
|
|
106
|
+
};
|
|
107
|
+
export type SetDifferenceObject = {
|
|
108
|
+
kind: 'SetDifferenceObject';
|
|
109
|
+
left: ObjectExpression;
|
|
110
|
+
right: ObjectExpression;
|
|
111
|
+
};
|
|
112
|
+
export type CoproductObject = {
|
|
113
|
+
kind: 'CoproductObject';
|
|
114
|
+
left: ObjectExpression;
|
|
115
|
+
right: ObjectExpression;
|
|
116
|
+
};
|
|
117
|
+
export type PatternLiteralObject = {
|
|
118
|
+
kind: 'PatternLiteralObject';
|
|
119
|
+
source: string;
|
|
120
|
+
flags: string;
|
|
121
|
+
};
|
|
122
|
+
export type PatternBlock = {
|
|
123
|
+
raw: string;
|
|
124
|
+
parts: ConstraintPart[];
|
|
125
|
+
start: number;
|
|
126
|
+
end: number;
|
|
127
|
+
};
|
|
128
|
+
export type ExponentialPattern = {
|
|
129
|
+
kind: 'ExponentialPattern';
|
|
130
|
+
base: ObjectExpression;
|
|
131
|
+
exponent: ObjectExpression;
|
|
132
|
+
language: string;
|
|
133
|
+
body: string;
|
|
134
|
+
patterns: PatternBlock[];
|
|
135
|
+
};
|
|
68
136
|
//# sourceMappingURL=ast.d.ts.map
|
package/dist/ast.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../src/ast.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,WAAW,GACnB,iBAAiB,GACjB,iBAAiB,GACjB,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,CAAA;AAEtB,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,QAAQ,CAAA;AAEjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAA;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,gBAAgB,CAAA;CAC7B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,gBAAgB,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,qBAAqB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,gBAAgB,GACxB,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,SAAS,GACT,WAAW,C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AAID,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,sBAAsB,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,oBAAoB,CAAA;IAC1B,IAAI,EAAE,gBAAgB,CAAA;IACtB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAA;CACzB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ObjectExpression } from './ast.js';
|
|
2
|
+
export type Constant = {
|
|
3
|
+
kind: 'StringConstant';
|
|
4
|
+
value: string;
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'NumberConstant';
|
|
7
|
+
value: string;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'BoolConstant';
|
|
10
|
+
value: boolean;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'ProductConstant';
|
|
13
|
+
fields: Record<string, Constant>;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'ExponentialConstant';
|
|
16
|
+
base: Constant;
|
|
17
|
+
exponent: Constant;
|
|
18
|
+
};
|
|
19
|
+
export declare function constantOf(expr: ObjectExpression): Constant | null;
|
|
20
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAEhD,MAAM,MAAM,QAAQ,GAChB;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;CAAE,GAC7D;IAAE,IAAI,EAAE,qBAAqB,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAA;CAAE,CAAA;AAEvE,wBAAgB,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,QAAQ,GAAG,IAAI,CA8BlE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function constantOf(expr) {
|
|
2
|
+
switch (expr.kind) {
|
|
3
|
+
case 'StringLiteralObject':
|
|
4
|
+
return { kind: 'StringConstant', value: expr.value };
|
|
5
|
+
case 'NumberLiteralObject':
|
|
6
|
+
return { kind: 'NumberConstant', value: expr.value };
|
|
7
|
+
case 'BoolLiteralObject':
|
|
8
|
+
return { kind: 'BoolConstant', value: expr.value };
|
|
9
|
+
case 'ProductObject': {
|
|
10
|
+
const fields = {};
|
|
11
|
+
for (const [name, field] of Object.entries(expr.fields)) {
|
|
12
|
+
const constant = constantOf(field);
|
|
13
|
+
if (constant === null) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
fields[name] = constant;
|
|
17
|
+
}
|
|
18
|
+
return { kind: 'ProductConstant', fields };
|
|
19
|
+
}
|
|
20
|
+
case 'ExponentialObject': {
|
|
21
|
+
const base = constantOf(expr.base);
|
|
22
|
+
const exponent = constantOf(expr.exponent);
|
|
23
|
+
if (base === null || exponent === null) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return { kind: 'ExponentialConstant', base, exponent };
|
|
27
|
+
}
|
|
28
|
+
default:
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,UAAU,CAAC,IAAsB;IAC/C,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,qBAAqB;YACxB,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAA;QACtD,KAAK,qBAAqB;YACxB,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAA;QACtD,KAAK,mBAAmB;YACtB,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAA;QACpD,KAAK,eAAe,CAAC,CAAC,CAAC;YACrB,MAAM,MAAM,GAA6B,EAAE,CAAA;YAC3C,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxD,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;gBAClC,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;oBACtB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAA;YACzB,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAA;QAC5C,CAAC;QACD,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAClC,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAC1C,IAAI,IAAI,KAAK,IAAI,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACvC,OAAO,IAAI,CAAA;YACb,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAA;QACxD,CAAC;QACD;YACE,OAAO,IAAI,CAAA;IACf,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { SpexLexer } from './lexer.js';
|
|
2
2
|
export { SpexParser } from './parser.js';
|
|
3
|
-
export { SpexParserVisitor, parseToAst } from './visitor.js';
|
|
4
|
-
export
|
|
3
|
+
export { SpexParserVisitor, parseToAst, parseConstraint } from './visitor.js';
|
|
4
|
+
export { constantOf } from './constants.js';
|
|
5
|
+
export type { Constant } from './constants.js';
|
|
6
|
+
export type { SpexFile, Declaration, ObjectDeclaration, ImportDeclaration, ExportDeclaration, EnumObject, GenerateDeclaration, PackageDeclaration, RealizeDeclaration, IncludeDeclaration, ObjectExpression, NamedObject, ProductObject, ExponentialObject, ExponentialPattern, SubObject, ArrayObject, LiteralObject, StringLiteralObject, NumberLiteralObject, BoolLiteralObject, SetObject, SetUnionObject, SetIntersectionObject, SetDifferenceObject, CoproductObject, PatternLiteralObject, PatternBlock, PackageKind, Constraint, ConstraintPart, ConstraintReference, ConstraintText, } from './ast.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,YAAY,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAC9C,YAAY,EACV,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,cAAc,GACf,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { SpexLexer } from './lexer.js';
|
|
2
2
|
export { SpexParser } from './parser.js';
|
|
3
|
-
export { SpexParserVisitor, parseToAst } from './visitor.js';
|
|
3
|
+
export { SpexParserVisitor, parseToAst, parseConstraint } from './visitor.js';
|
|
4
|
+
export { constantOf } from './constants.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/lexer.d.ts
CHANGED
|
@@ -12,7 +12,16 @@ export declare const ExportTok: import("chevrotain").TokenType;
|
|
|
12
12
|
export declare const PackageTok: import("chevrotain").TokenType;
|
|
13
13
|
export declare const ExecutableTok: import("chevrotain").TokenType;
|
|
14
14
|
export declare const ModuleTok: import("chevrotain").TokenType;
|
|
15
|
+
export declare const EnumTok: import("chevrotain").TokenType;
|
|
16
|
+
export declare const UnionTok: import("chevrotain").TokenType;
|
|
17
|
+
export declare const IntersectTok: import("chevrotain").TokenType;
|
|
18
|
+
export declare const ExceptTok: import("chevrotain").TokenType;
|
|
19
|
+
export declare const RealizeTok: import("chevrotain").TokenType;
|
|
20
|
+
export declare const InTok: import("chevrotain").TokenType;
|
|
21
|
+
export declare const IncludeTok: import("chevrotain").TokenType;
|
|
22
|
+
export declare const LambdaTok: import("chevrotain").TokenType;
|
|
15
23
|
export declare const ArrowTok: import("chevrotain").TokenType;
|
|
24
|
+
export declare const PipeTok: import("chevrotain").TokenType;
|
|
16
25
|
export declare const LCurly: import("chevrotain").TokenType;
|
|
17
26
|
export declare const RCurly: import("chevrotain").TokenType;
|
|
18
27
|
export declare const LBracket: import("chevrotain").TokenType;
|
|
@@ -24,11 +33,18 @@ export declare const Comma: import("chevrotain").TokenType;
|
|
|
24
33
|
export declare const Semicolon: import("chevrotain").TokenType;
|
|
25
34
|
export declare const Dot: import("chevrotain").TokenType;
|
|
26
35
|
export declare const SelectBlock: import("chevrotain").TokenType;
|
|
27
|
-
export declare const
|
|
36
|
+
export declare const PatternLiteral: import("chevrotain").TokenType;
|
|
37
|
+
export declare const CodeBlock: import("chevrotain").TokenType;
|
|
38
|
+
export declare const StringLiteral: import("chevrotain").TokenType;
|
|
39
|
+
export declare const NumberLiteral: import("chevrotain").TokenType;
|
|
40
|
+
export declare const TrueTok: import("chevrotain").TokenType;
|
|
41
|
+
export declare const FalseTok: import("chevrotain").TokenType;
|
|
28
42
|
export declare const StringTok: import("chevrotain").TokenType;
|
|
29
43
|
export declare const NumberTok: import("chevrotain").TokenType;
|
|
30
44
|
export declare const BoolTok: import("chevrotain").TokenType;
|
|
31
45
|
export declare const UnitTok: import("chevrotain").TokenType;
|
|
46
|
+
export declare const ConceptTok: import("chevrotain").TokenType;
|
|
47
|
+
export declare const EnvironmentTok: import("chevrotain").TokenType;
|
|
32
48
|
export declare const Identifier: import("chevrotain").TokenType;
|
|
33
49
|
export declare const allTokens: import("chevrotain").TokenType[];
|
|
34
50
|
export declare const SpexLexer: Lexer;
|
package/dist/lexer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../src/lexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,
|
|
1
|
+
{"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../src/lexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,EAAmC,MAAM,YAAY,CAAA;AAEhF,eAAO,MAAM,UAAU,gCAIrB,CAAA;AAGF,eAAO,MAAM,WAAW,gCAItB,CAAA;AACF,eAAO,MAAM,YAAY,gCAIvB,CAAA;AAGF,eAAO,MAAM,SAAS,gCAGpB,CAAA;AACF,eAAO,MAAM,KAAK,gCAGhB,CAAA;AACF,eAAO,MAAM,OAAO,gCAGlB,CAAA;AACF,eAAO,MAAM,SA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