-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstuff.js
More file actions
54 lines (46 loc) · 931 Bytes
/
stuff.js
File metadata and controls
54 lines (46 loc) · 931 Bytes
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
export class Stmt {}
export class PrintStmt extends Stmt {
/**
*
* @param {string} string
* @param {string[] | undefined} args
*/
constructor(string, args) {
super();
this.string = string;
this.args = args ?? [];
}
}
export class ReturnStmt extends Stmt {
/**
*
* @param {NumberExpr} value
*/
constructor(value) {
super();
this.value = value;
}
}
// TODO
export class IfStmt extends Stmt {}
export class ElseStmt extends Stmt {}
export class AST {}
export class Block extends AST {
constructor(stmts) {
super();
this.stmts = stmts;
}
}
export class NumberNode extends AST {
constructor(value) {
super();
this.value = value;
}
}
export class BinaryExpr extends AST {
constructor(left, right) {
super();
this.left = left;
this.right = right;
}
}