-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexpr.py
More file actions
132 lines (88 loc) · 2.87 KB
/
Copy pathexpr.py
File metadata and controls
132 lines (88 loc) · 2.87 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
from expression import Expr, Stmt
class Assign(Expr):
def __init__(self, name, value):
self.name = name
self.value = value
def accept(self, visitor):
return visitor.visit_assign_expr(self)
class Binary(Expr):
def __init__(self, left, operator, right):
self.left = left
self.operator = operator
self.right = right
def accept(self, visitor):
return visitor.visit_binary_expr(self)
class Call(Expr):
def __init__(self, callee, paren, arguments):
self.callee = callee
self.paren = paren
self.arguments = arguments
def accept(self, visitor):
return visitor.visit_call_expr(self)
class Index(Expr):
def __init__(self, collection, paren, indicies):
self.collection = collection
self.paren = paren
self.indicies = indicies
def accept(self, visitor):
return visitor.visit_index_expr(self)
class Lambda(Expr):
def __init__(self, parameters, body):
self.parameters = parameters
self.body = body
def accept(self, visitor):
return visitor.visit_lambda_expr(self)
class Get(Expr):
def __init__(self, object, name):
self.object = object
self.name = name
def accept(self, visitor):
return visitor.visit_get_expr(self)
class Grouping(Expr):
def __init__(self, expression):
self.expression = expression
def accept(self, visitor):
return visitor.visit_grouping_expr(self)
class List(Expr):
def __init__(self, expression):
self.expression = expression
def accept(self, visitor):
return visitor.visit_list_expr(self)
class Literal(Expr):
def __init__(self, value):
self.value = value
def accept(self, visitor):
return visitor.visit_literal_expr(self)
class Logical(Expr):
def __init__(self, left, operator, right):
self.left = left
self.operator = operator
self.right = right
def accept(self, visitor):
return visitor.visit_logical_expr(self)
class Set(Expr):
def __init__(self, object, name, value):
self.object = object
self.name = name
self.value = value
def accept(self, visitor):
return visitor.visit_set_expr(self)
class Unary(Expr):
def __init__(self, operator, right):
self.operator = operator
self.right = right
def accept(self, visitor):
return visitor.visit_unary_expr(self)
class ListConstructor(Expr):
def __init__(self, start, next, stop, token):
self.start = start
self.next = next
self.stop = stop
self.token = token
def accept(self, visitor):
return visitor.visit_listconstructor_expr(self)
class Variable(Expr):
def __init__(self, name):
self.name = name
def accept(self, visitor):
return visitor.visit_variable_expr(self)