Skip to content
← Back

src/syntax/process/strictvisitor.ghul

1
namespace Syntax is
2
use System.NotImplementedException
3
4
use IO.Std
5
6
use Trees
7
8
class StrictVisitor: Visitor abstract is
9
init() is
10
super.init()
11
si
12
13
throw_not_implemented(name: string, node: Node) =>
14
throw NotImplementedException(
15
"Visitor {self} does not define a visit method for {name} {node.get_type()} and/or this node does not accept this visitor"
16
)
17
18
visit(node: Node) => throw NotImplementedException("Visitor itself is missing a matching method for {node.get_type()}")
19
20
visit(identifier: Identifiers.Identifier) => throw_not_implemented("identifier", identifier)
21
22
visit(identifier: Identifiers.QUALIFIED) => throw_not_implemented("qualified identifier", identifier)
23
24
visit(modifier: Modifiers.Modifier) => throw_not_implemented("modifier", modifier)
25
26
visit(modifiers: Modifiers.LIST) => throw_not_implemented("modifiers", modifiers)
27
28
visit(definition: Definitions.Definition) => throw_not_implemented("definition", definition)
29
30
visit(definitions: Definitions.LIST) => throw_not_implemented("definition list", definitions)
31
32
visit(`namespace: Definitions.NAMESPACE) => throw_not_implemented("namespace", `namespace)
33
34
visit(`use: Definitions.USE) => throw_not_implemented("use", `use)
35
36
visit(super_call: Definitions.SUPER_CALL) => throw_not_implemented("super call", super_call)
37
38
visit(`class: Definitions.CLASS) => throw_not_implemented("class", `class)
39
40
visit(`trait: Definitions.TRAIT) => throw_not_implemented("trait", `trait)
41
42
visit(`struct: Definitions.STRUCT) => throw_not_implemented("struct", `struct)
43
44
visit(`partial: Definitions.PARTIAL) => throw_not_implemented("partial", `partial)
45
46
visit(`impl: Definitions.IMPL) => throw_not_implemented("impl", `impl)
47
48
visit(`union: Definitions.UNION) => throw_not_implemented("union", `union)
49
50
visit(variant: Definitions.VARIANT) => throw_not_implemented("variant", variant)
51
52
visit(`enum: Definitions.ENUM) => throw_not_implemented("enum", `enum)
53
54
visit(enum_member: Definitions.ENUM_MEMBER) => throw_not_implemented("enum member", enum_member)
55
56
visit(function: Definitions.FUNCTION) => throw_not_implemented("function", function)
57
58
visit(property: Definitions.PROPERTY) => throw_not_implemented("property", property)
59
60
visit(indexer: Definitions.INDEXER) => throw_not_implemented("indexer", indexer)
61
62
visit(variable: Variables.VARIABLE) => throw_not_implemented("variable", variable)
63
64
visit(variables: Variables.LIST) => throw_not_implemented("variable list", variables)
65
66
visit(destructure_element: Trees.Variables.SIMPLE_VARIABLE_LEFT) => throw_not_implemented("simple variable name", destructure_element)
67
68
visit(destructure_element_list: Trees.Variables.DESTRUCTURING_VARIABLE_LEFT) => throw_not_implemented("destructure variable names", destructure_element_list)
69
70
visit(literal_leaf: Trees.Variables.LITERAL_VARIABLE_LEFT) => throw_not_implemented("literal leaf in destructure", literal_leaf)
71
72
visit(type_expression: TypeExpressions.TypeExpression) => throw_not_implemented("type_expression", type_expression)
73
74
visit(type_expression: TypeExpressions.INFER) => throw_not_implemented("infer", type_expression)
75
76
visit(structured: TypeExpressions.Structured) => throw_not_implemented("structured", structured)
77
78
visit(array: TypeExpressions.ARRAY_) => throw_not_implemented("array", array)
79
80
visit(iterable: TypeExpressions.ITERABLE) => throw_not_implemented("iterable", iterable)
81
82
visit(pointer: TypeExpressions.POINTER) => throw_not_implemented("pointer", pointer)
83
84
visit(optional: TypeExpressions.OPTIONAL) => throw_not_implemented("optional", optional)
85
86
visit(reference: TypeExpressions.REFERENCE) => throw_not_implemented("reference", reference)
87
88
visit(member: TypeExpressions.MEMBER) => throw_not_implemented("member", member)
89
90
visit(named: TypeExpressions.NAMED) => throw_not_implemented("named", named)
91
92
visit(types: TypeExpressions.LIST) => throw_not_implemented("type_expression list", types)
93
94
visit(generic: TypeExpressions.GENERIC) => throw_not_implemented("generic", generic)
95
96
visit(function: TypeExpressions.FUNCTION) => throw_not_implemented("function", function)
97
98
visit(tuple: TypeExpressions.TUPLE) => throw_not_implemented("tuple", tuple)
99
100
visit(element: TypeExpressions.NAMED_TUPLE_ELEMENT) => throw_not_implemented("name tuple element", element)
101
102
visit(element: TypeExpressions.UNDEFINED) => throw_not_implemented("???", element)
103
104
visit(constraint: TypeExpressions.TYPE_PARAMETER_CONSTRAINT) => throw_not_implemented("type parameter constraint", constraint)
105
106
visit(expression: Expressions.Expression) => throw_not_implemented("expression", expression)
107
108
visit(identifier: Expressions.IDENTIFIER) => throw_not_implemented("identifier", identifier)
109
110
visit(literal: Expressions.Literals.Literal) => throw_not_implemented("literal", literal)
111
112
visit(`string: Expressions.Literals.STRING) => throw_not_implemented("string literal", `string)
113
114
visit(interpolation: Expressions.STRING_INTERPOLATION) => throw_not_implemented("string interpolation", interpolation)
115
116
visit(integer: Expressions.Literals.INTEGER) => throw_not_implemented("integer literal", integer)
117
118
visit(float: Expressions.Literals.FLOAT) => throw_not_implemented("float literal", float)
119
120
visit(character: Expressions.Literals.CHARACTER) => throw_not_implemented("character literal", character)
121
122
visit(boolean: Expressions.Literals.BOOLEAN) => throw_not_implemented("boolean literal", boolean)
123
124
visit(variable: Expressions.VARIABLE) => throw_not_implemented("variable", variable)
125
126
visit(variable: Expressions.TUPLE_ELEMENT) => throw_not_implemented("tuple element", variable)
127
128
visit(none: Expressions.Literals.NONE) => throw_not_implemented("none", none)
129
130
visit(`null: Expressions.NULL) => throw_not_implemented("null", `null)
131
132
visit(`self: Expressions.SELF) => throw_not_implemented("self", `self)
133
134
visit(`super: Expressions.SUPER) => throw_not_implemented("super", `super)
135
136
137
visit(construct: Expressions.CONSTRUCT) => throw_not_implemented("construct", construct)
138
visit(`cast: Expressions.CAST) => throw_not_implemented("cast", `cast)
139
140
visit(`await: Expressions.AWAIT) => throw_not_implemented("await", `await)
141
visit(`use: Expressions.USE) => throw_not_implemented("use", `use)
142
143
visit(spill: Expressions.SPILL) => throw_not_implemented("spill", spill)
144
145
visit(`isa: Expressions.ISA) => throw_not_implemented("isa", `isa)
146
147
visit(field_equals: Expressions.FIELD_EQUALS) => throw_not_implemented("field_equals", field_equals)
148
visit(hash_operand: Expressions.HASH_OPERAND) => throw_not_implemented("hash_operand", hash_operand)
149
visit(memberwise_equals: Expressions.MEMBERWISE_EQUALS) => throw_not_implemented("memberwise_equals", memberwise_equals)
150
visit(memberwise_hash: Expressions.MEMBERWISE_HASH) => throw_not_implemented("memberwise_hash", memberwise_hash)
151
152
visit(`isa: Expressions.TYPEOF) => throw_not_implemented("isa", `isa)
153
154
visit(`default: Expressions.DEFAULT) => throw_not_implemented("default", `default)
155
156
visit(function: Syntax.Trees.Expressions.FUNCTION) => throw_not_implemented("function", function)
157
158
visit(recurse: Expressions.RECURSE) => throw_not_implemented("rec", recurse)
159
160
visit(tuple: Expressions.TUPLE) => throw_not_implemented("tuple", tuple)
161
162
visit(sequence: Expressions.SEQUENCE) => throw_not_implemented("sequence", sequence)
163
164
visit(list: Expressions.LIST) => throw_not_implemented("list", list)
165
166
visit(call: Expressions.CALL) => throw_not_implemented("call", call)
167
168
visit(member: Expressions.MEMBER) => throw_not_implemented("member", member)
169
170
visit(ambiguous_expression: Expressions.AMBIGUOUS_EXPRESSION) => throw_not_implemented("type expression", ambiguous_expression)
171
172
visit(generic_application: Expressions.GENERIC_APPLICATION) => throw_not_implemented("type expression", generic_application)
173
174
visit(index: Expressions.INDEX) => throw_not_implemented("index", index)
175
176
visit(has_value: Expressions.HAS_VALUE) => throw_not_implemented("has value", has_value)
177
178
visit(unwrap: Expressions.UNWRAP) => throw_not_implemented("unwrap", unwrap)
179
180
visit(reference: Expressions.REFERENCE) => throw_not_implemented("reference", reference)
181
182
visit(unary: Expressions.UNARY) => throw_not_implemented("unary", unary)
183
184
visit(binary: Expressions.BINARY) => throw_not_implemented("binary", binary)
185
186
pre(statement: Expressions.STATEMENT) -> bool is
187
throw_not_implemented("statement expression", statement)
188
return false
189
si
190
191
visit(statement: Expressions.STATEMENT) => throw_not_implemented("statement expression", statement)
192
193
visit(left: Trees.Expressions.SIMPLE_LEFT_EXPRESSION) => throw_not_implemented("single expression left", left)
194
195
visit(destructure_left: Trees.Expressions.DESTRUCTURING_LEFT_EXPRESSION) => throw_not_implemented("destructure left", destructure_left)
196
197
visit(statement: Expressions.LET_IN) => throw_not_implemented("let in", statement)
198
199
visit(comprehension: Expressions.COMPREHENSION) => throw_not_implemented("list comprehension", comprehension)
200
201
visit(clause: Expressions.COMPREHENSION_FOR) => throw_not_implemented("comprehension for clause", clause)
202
203
visit(clause: Expressions.COMPREHENSION_IF) => throw_not_implemented("comprehension if clause", clause)
204
205
pre(block: Expressions.VAL_BLOCK) -> bool is
206
throw_not_implemented("val block", block)
207
return false
208
si
209
210
visit(block: Expressions.VAL_BLOCK) => throw_not_implemented("val block", block)
211
212
visit(assert_in: Expressions.ASSERT_IN) => throw_not_implemented("assert in", assert_in)
213
214
visit(statement: Statements.Statement) => throw_not_implemented("statement", statement)
215
216
visit(statements: Statements.LIST) => throw_not_implemented("statement list", statements)
217
218
visit(f: Statements.FUNCTION) => throw_not_implemented("nested function", f)
219
visit(l: Statements.LET) => throw_not_implemented("let", l)
220
221
visit(assign: Statements.ASSIGNMENT) => throw_not_implemented("assignment", assign)
222
223
visit(expression: Statements.EXPRESSION) => throw_not_implemented("expression", expression)
224
225
visit(`return: Statements.RETURN) => throw_not_implemented("return", `return)
226
227
visit(`throw: Statements.THROW) => throw_not_implemented("throw", `throw)
228
229
visit(`yield: Statements.YIELD) => throw_not_implemented("yield", `yield)
230
231
visit(`yield: Statements.YIELD_ALL) => throw_not_implemented("yield in", `yield)
232
233
visit(`assert: Statements.ASSERT) => throw_not_implemented("assert", `assert)
234
235
visit(`if: Statements.IF) => throw_not_implemented("if", `if)
236
237
visit(rb: Statements.REFUTABLE_BINDING) => throw_not_implemented("refutable binding", rb)
238
239
visit(`case: Statements.CASE) => throw_not_implemented("case", `case)
240
241
visit(case_match: Statements.CASE_MATCH) => throw_not_implemented("case match", case_match)
242
243
visit(`try: Statements.TRY) => throw_not_implemented("try", `try)
244
245
visit(`catch: Statements.CATCH) => throw_not_implemented("catch", `catch)
246
247
visit(`do: Statements.DO) => throw_not_implemented("do", `do)
248
249
visit(`for: Statements.FOR) => throw_not_implemented("for", `for)
250
251
visit(labelled: Statements.LABELLED) => throw_not_implemented("labelled", labelled)
252
253
visit(`break: Statements.BREAK) => throw_not_implemented("break", `break)
254
255
visit(`continue: Statements.CONTINUE) => throw_not_implemented("continue", `continue)
256
257
visit(body: Bodies.Body) => throw_not_implemented("body", body)
258
259
visit(expression: Bodies.EXPRESSION) => throw_not_implemented("expression body", expression)
260
261
visit(block: Bodies.BLOCK) => throw_not_implemented("block body", block)
262
si
263
si