Skip to content

Commit a4d7255

Browse files
committed
Exp and BlockStmt
1 parent 181a58c commit a4d7255

File tree

4 files changed

+60
-12
lines changed

4 files changed

+60
-12
lines changed

TODO.md

+28-12
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
1+
# stmt
2+
3+
Stmt
4+
5+
Run
6+
7+
```
8+
run {
9+
(input) -> [register] -> (c1, c2)
10+
(c1) -> [sendQuestionnaire] -> (c3)
11+
(c3) -> [processQuestionnaire] -> (c5)
12+
(c3) -> [timeout] -> (c5)
13+
14+
(c5, c6) -> [archive] -> (output)
15+
16+
(c2) -> <evaluate> -> (c6, c7)
17+
(c5, c7) -> [processComplaint] -> (c5, c8)
18+
(c8) -> <checkProcessing> -> (c6, c7)
19+
}
20+
```
21+
122
# net
223

3-
[connect] connectTransitionToPlaces(net: Net, transition: Transition, place: Place)
24+
[connect] connectTransitionToInputPlaces(net: Net, transition: Transition, places: Array<Place>)
25+
[connect] connectTransitionToOutputPlaces(net: Net, transition: Transition, places: Array<Place>)
426

527
[run] run
628

729
- everytime a marking changes,
830
loop through and try to execute every transitions.
931

10-
# command-line
11-
12-
fix run command
13-
add repl command
14-
1532
# syntax
1633

1734
parser
@@ -20,15 +37,14 @@ parser
2037

2138
fix `Loader` -- parse and execute
2239

23-
# choice
24-
25-
[maybe] as one kind of `Transition`
40+
# command-line
2641

27-
# lang
42+
fix run command
43+
add repl command
2844

29-
env
30-
Stmt
45+
# choice
3146

47+
[maybe] as one kind of `Transition`
3248

3349
# type system
3450

src/lang/exp/BlockStmt.ts

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Span } from "../span"
2+
import { Exp } from "./Exp"
3+
4+
export type BlockStmt = Change
5+
6+
export type Change = {
7+
"@type": "BlockStmt"
8+
"@kind": "Change"
9+
transition: Exp
10+
inputArgs: Array<Exp>
11+
outputArgs: Array<Exp>
12+
span: Span
13+
}

src/lang/exp/Exp.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Span } from "../span"
2+
import { BlockStmt } from "./BlockStmt"
3+
4+
export type Exp = Var | Block
5+
6+
export type Var = {
7+
"@type": "Exp"
8+
"@kind": "Var"
9+
name: string
10+
span: Span
11+
}
12+
13+
export type Block = {
14+
"@type": "Exp"
15+
"@kind": "Block"
16+
body: Array<BlockStmt>
17+
span: Span
18+
}

src/lang/exp/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./Exp"

0 commit comments

Comments
 (0)