-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathast_nodes.py
More file actions
40 lines (28 loc) · 721 Bytes
/
Copy pathast_nodes.py
File metadata and controls
40 lines (28 loc) · 721 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
class Node:
pass
class Condition(Node):
def __init__(self, left, op, right):
self.left = left
self.op = op
self.right = right
class Not(Node):
def __init__(self, value):
self.value = value
class And(Node):
def __init__(self, left, right):
self.left = left
self.right = right
class Or(Node):
def __init__(self, left, right):
self.left = left
self.right = right
class Action(Node):
def __init__(self, name):
self.name = name
class If(Node):
def __init__(self, condition, body):
self.condition = condition
self.body = body
class Else(Node):
def __init__(self, body):
self.body = body