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
|
class ASTNode(object):
def __init__(self, token):
self.token = token
Primitive = ASTNode
class BinOp(ASTNode):
def __init__(self, token, left, right):
ASTNode.__init__(self, token)
self.left = left
self.right = right
class UnaryOp(ASTNode):
def __init__(self, token, expr):
ASTNode.__init__(self, token)
self.expr = expr
class FunctionCall(ASTNode):
def __init__(self, token, name, args):
ASTNode.__init__(self, token)
self.name = name
self.args = args
class ContextValue(ASTNode):
def __init__(self, token):
ASTNode.__init__(self, token)
class List(ASTNode):
def __init__(self, token, list):
ASTNode.__init__(self, token)
self.list = list
class ValueAccess(ASTNode):
def __init__(self, token, arr, isInterval, left, right):
ASTNode.__init__(self, token)
self.arr = arr
self.isInterval = isInterval
self.left = left
self.right = right
class Object(ASTNode):
def __init__(self, token, obj):
ASTNode.__init__(self, token)
self.obj = obj
|