-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.js
28 lines (22 loc) · 881 Bytes
/
types.js
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
(function () {
const stringType = new Type.Primitive("string");
const booleanType = new Type.Primitive("boolean");
const Node = new Type.CustomObject("DFANode", null, new Map([
["label", stringType],
["isStartState", booleanType],
["isAcceptState", booleanType],
]));
const Edge = new Type.CustomObject("DFAEdge", null, new Map([
["label", stringType],
["destination", Node],
]));
Node.members.set("children", new Value.ArrayType(Edge));
const Graph = new Type.CustomObject("DFAGraph", null, new Map([
]));
const State = new Type.CustomObject("DFAState", null, new Map([
["active", Node],
["inputLeft", stringType],
["message", stringType]
]));
return {Graph: Graph, Nodes: [Node], Edges: [Edge], State: State, arguments: [stringType], result: booleanType};
})();