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(pointer: TypeExpressions.POINTER) => throw_not_implemented("pointer", pointer)
81
82
visit(optional: TypeExpressions.OPTIONAL) => throw_not_implemented("optional", optional)
83
84
visit(reference: TypeExpressions.REFERENCE) => throw_not_implemented("reference", reference)
85
86
visit(member: TypeExpressions.MEMBER) => throw_not_implemented("member", member)
87
88
visit(named: TypeExpressions.NAMED) => throw_not_implemented("named", named)
89
90
visit(types: TypeExpressions.LIST) => throw_not_implemented("type_expression list", types)
91
92
visit(generic: TypeExpressions.GENERIC) => throw_not_implemented("generic", generic)
93
94
visit(function: TypeExpressions.FUNCTION) => throw_not_implemented("function", function)
95
96
visit(tuple: TypeExpressions.TUPLE) => throw_not_implemented("tuple", tuple)
97
98
visit(element: TypeExpressions.NAMED_TUPLE_ELEMENT) => throw_not_implemented("name tuple element", element)
99
100
visit(element: TypeExpressions.UNDEFINED) => throw_not_implemented("???", element)
101
102
visit(constraint: TypeExpressions.TYPE_PARAMETER_CONSTRAINT) => throw_not_implemented("type parameter constraint", constraint)
103
104
visit(expression: Expressions.Expression) => throw_not_implemented("expression", expression)
105
106
visit(identifier: Expressions.IDENTIFIER) => throw_not_implemented("identifier", identifier)
107
108
visit(literal: Expressions.Literals.Literal) => throw_not_implemented("literal", literal)
109
110
visit(`string: Expressions.Literals.STRING) => throw_not_implemented("string literal", `string)
111
112
visit(interpolation: Expressions.STRING_INTERPOLATION) => throw_not_implemented("string interpolation", interpolation)
113
114
visit(integer: Expressions.Literals.INTEGER) => throw_not_implemented("integer literal", integer)
115
116
visit(float: Expressions.Literals.FLOAT) => throw_not_implemented("float literal", float)
117
118
visit(character: Expressions.Literals.CHARACTER) => throw_not_implemented("character literal", character)
119
120
visit(boolean: Expressions.Literals.BOOLEAN) => throw_not_implemented("boolean literal", boolean)
121
122
visit(variable: Expressions.VARIABLE) => throw_not_implemented("variable", variable)
123
124
visit(variable: Expressions.TUPLE_ELEMENT) => throw_not_implemented("tuple element", variable)
125
126
visit(none: Expressions.Literals.NONE) => throw_not_implemented("none", none)
127
128
visit(`null: Expressions.NULL) => throw_not_implemented("null", `null)
129
130
visit(`self: Expressions.SELF) => throw_not_implemented("self", `self)
131
132
visit(`super: Expressions.SUPER) => throw_not_implemented("super", `super)
133
134
135
visit(construct: Expressions.CONSTRUCT) => throw_not_implemented("construct", construct)
136
visit(`cast: Expressions.CAST) => throw_not_implemented("cast", `cast)
137
138
visit(`await: Expressions.AWAIT) => throw_not_implemented("await", `await)
139
140
visit(spill: Expressions.SPILL) => throw_not_implemented("spill", spill)
141
142
visit(`isa: Expressions.ISA) => throw_not_implemented("isa", `isa)
143
144
visit(field_equals: Expressions.FIELD_EQUALS) => throw_not_implemented("field_equals", field_equals)
145
visit(hash_operand: Expressions.HASH_OPERAND) => throw_not_implemented("hash_operand", hash_operand)
146
visit(memberwise_equals: Expressions.MEMBERWISE_EQUALS) => throw_not_implemented("memberwise_equals", memberwise_equals)
147
visit(memberwise_hash: Expressions.MEMBERWISE_HASH) => throw_not_implemented("memberwise_hash", memberwise_hash)
148
149
visit(`isa: Expressions.TYPEOF) => throw_not_implemented("isa", `isa)
150
151
visit(`default: Expressions.DEFAULT) => throw_not_implemented("default", `default)
152
153
visit(function: Syntax.Trees.Expressions.FUNCTION) => throw_not_implemented("function", function)
154
155
visit(recurse: Expressions.RECURSE) => throw_not_implemented("rec", recurse)
156
157
visit(tuple: Expressions.TUPLE) => throw_not_implemented("tuple", tuple)
158
159
visit(sequence: Expressions.SEQUENCE) => throw_not_implemented("sequence", sequence)
160
161
visit(list: Expressions.LIST) => throw_not_implemented("list", list)
162
163
visit(call: Expressions.CALL) => throw_not_implemented("call", call)
164
165
visit(member: Expressions.MEMBER) => throw_not_implemented("member", member)
166
167
visit(ambiguous_expression: Expressions.AMBIGUOUS_EXPRESSION) => throw_not_implemented("type expression", ambiguous_expression)
168
169
visit(generic_application: Expressions.GENERIC_APPLICATION) => throw_not_implemented("type expression", generic_application)
170
171
visit(index: Expressions.INDEX) => throw_not_implemented("index", index)
172
173
visit(has_value: Expressions.HAS_VALUE) => throw_not_implemented("has value", has_value)
174
175
visit(unwrap: Expressions.UNWRAP) => throw_not_implemented("unwrap", unwrap)
176
177
visit(reference: Expressions.REFERENCE) => throw_not_implemented("reference", reference)
178
179
visit(unary: Expressions.UNARY) => throw_not_implemented("unary", unary)
180
181
visit(binary: Expressions.BINARY) => throw_not_implemented("binary", binary)
182
183
pre(statement: Expressions.STATEMENT) -> bool is
184
throw_not_implemented("statement expression", statement)
185
return false
186
si
187
188
visit(statement: Expressions.STATEMENT) => throw_not_implemented("statement expression", statement)
189
190
visit(left: Trees.Expressions.SIMPLE_LEFT_EXPRESSION) => throw_not_implemented("single expression left", left)
191
192
visit(destructure_left: Trees.Expressions.DESTRUCTURING_LEFT_EXPRESSION) => throw_not_implemented("destructure left", destructure_left)
193
194
visit(statement: Expressions.LET_IN) => throw_not_implemented("let in", statement)
195
196
pre(block: Expressions.VAL_BLOCK) -> bool is
197
throw_not_implemented("val block", block)
198
return false
199
si
200
201
visit(block: Expressions.VAL_BLOCK) => throw_not_implemented("val block", block)
202
203
visit(assert_in: Expressions.ASSERT_IN) => throw_not_implemented("assert in", assert_in)
204
205
visit(statement: Statements.Statement) => throw_not_implemented("statement", statement)
206
207
visit(statements: Statements.LIST) => throw_not_implemented("statement list", statements)
208
209
visit(f: Statements.FUNCTION) => throw_not_implemented("nested function", f)
210
visit(l: Statements.LET) => throw_not_implemented("let", l)
211
212
visit(assign: Statements.ASSIGNMENT) => throw_not_implemented("assignment", assign)
213
214
visit(expression: Statements.EXPRESSION) => throw_not_implemented("expression", expression)
215
216
visit(`return: Statements.RETURN) => throw_not_implemented("return", `return)
217
218
visit(`throw: Statements.THROW) => throw_not_implemented("throw", `throw)
219
220
visit(`yield: Statements.YIELD) => throw_not_implemented("yield", `yield)
221
222
visit(`yield: Statements.YIELD_ALL) => throw_not_implemented("yield in", `yield)
223
224
visit(`assert: Statements.ASSERT) => throw_not_implemented("assert", `assert)
225
226
visit(`if: Statements.IF) => throw_not_implemented("if", `if)
227
228
visit(rb: Statements.REFUTABLE_BINDING) => throw_not_implemented("refutable binding", rb)
229
230
visit(`case: Statements.CASE) => throw_not_implemented("case", `case)
231
232
visit(case_match: Statements.CASE_MATCH) => throw_not_implemented("case match", case_match)
233
234
visit(`try: Statements.TRY) => throw_not_implemented("try", `try)
235
236
visit(`catch: Statements.CATCH) => throw_not_implemented("catch", `catch)
237
238
visit(`do: Statements.DO) => throw_not_implemented("do", `do)
239
240
visit(`for: Statements.FOR) => throw_not_implemented("for", `for)
241
242
visit(labelled: Statements.LABELLED) => throw_not_implemented("labelled", labelled)
243
244
visit(`break: Statements.BREAK) => throw_not_implemented("break", `break)
245
246
visit(`continue: Statements.CONTINUE) => throw_not_implemented("continue", `continue)
247
248
visit(body: Bodies.Body) => throw_not_implemented("body", body)
249
250
visit(expression: Bodies.EXPRESSION) => throw_not_implemented("expression body", expression)
251
252
visit(block: Bodies.BLOCK) => throw_not_implemented("block body", block)
253
si
254
si