mago_syntax/walker/
mod.rs

1#![allow(unused_variables)]
2
3use crate::ast::Program;
4use crate::ast::ast::*;
5
6/// Helper macro to generate the core walk logic.
7macro_rules! define_walk_body {
8    ($walker:ident, $context:ident, $var_name:ident, $code:block) => {
9        paste::paste! {
10            $walker.[<walk_in_ $var_name>]($var_name, $context);
11            $code
12            $walker.[<walk_out_ $var_name>]($var_name, $context);
13        }
14    };
15}
16
17/// Helper macro to generate trait methods for the mutable walker.
18macro_rules! gen_mut_trait_methods {
19    // This arm matches nodes that have an arena lifetime.
20    ('arena, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
21        paste::paste! {
22            #[inline]
23            fn [<walk_in_ $var_name>](&mut self, $var_name: & $ast $node_type<$arena>, context: &mut C) {}
24            #[inline]
25            fn [<walk_ $var_name>](&mut self, $var_name: & $ast $node_type<$arena>, $context: &mut C) {
26                let $walker = self;
27                define_walk_body!($walker, $context, $var_name, $code);
28            }
29            #[inline]
30            fn [<walk_out_ $var_name>](&mut self, $var_name: & $ast $node_type<$arena>, context: &mut C) {}
31        }
32    };
33    // This arm matches simple/copy nodes that DO NOT have an arena lifetime.
34    (_, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
35        paste::paste! {
36            #[inline]
37            fn [<walk_in_ $var_name>](&mut self, $var_name: & $ast $node_type, context: &mut C) {}
38            #[inline]
39            fn [<walk_ $var_name>](&mut self, $var_name: & $ast $node_type, $context: &mut C) {
40                let $walker = self;
41                define_walk_body!($walker, $context, $var_name, $code);
42            }
43            #[inline]
44            fn [<walk_out_ $var_name>](&mut self, $var_name: & $ast $node_type, context: &mut C) {}
45        }
46    };
47}
48
49/// Helper macro to generate trait methods for the immutable walker.
50macro_rules! gen_const_trait_methods {
51    // This arm matches nodes that have an arena lifetime.
52    ('arena, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
53        paste::paste! {
54            #[inline]
55            fn [<walk_in_ $var_name>](&self, $var_name: & $ast $node_type<$arena>, context: &mut C) {}
56            #[inline]
57            fn [<walk_ $var_name>](&self, $var_name: & $ast $node_type<$arena>, $context: &mut C) {
58                let $walker = self;
59                define_walk_body!($walker, $context, $var_name, $code);
60            }
61            #[inline]
62            fn [<walk_out_ $var_name>](&self, $var_name: & $ast $node_type<$arena>, context: &mut C) {}
63        }
64    };
65    // This arm matches simple/copy nodes that DO NOT have an arena lifetime.
66    (_, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
67        paste::paste! {
68            #[inline]
69            fn [<walk_in_ $var_name>](&self, $var_name: & $ast $node_type, context: &mut C) {}
70            #[inline]
71            fn [<walk_ $var_name>](&self, $var_name: & $ast $node_type, $context: &mut C) {
72                let $walker = self;
73                define_walk_body!($walker, $context, $var_name, $code);
74            }
75            #[inline]
76            fn [<walk_out_ $var_name>](&self, $var_name: & $ast $node_type, context: &mut C) {}
77        }
78    };
79}
80
81/// Helper macro to generate standalone walk functions.
82macro_rules! gen_standalone_funcs {
83    // This arm matches nodes that have an arena lifetime.
84    ('arena, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
85        paste::paste! {
86            #[inline]
87            pub fn [<walk_ $var_name _mut>]<$ast, $arena, W, C>($walker: &mut W, $var_name: & $ast $node_type<$arena>, $context: &mut C)
88                where W: ?Sized + MutWalker<$ast, $arena, C>
89            {
90                define_walk_body!($walker, $context, $var_name, $code);
91            }
92
93            #[inline]
94            pub fn [<walk_ $var_name>]<$ast, $arena, W, C>($walker: &W, $var_name: & $ast $node_type<$arena>, $context: &mut C)
95                where W: ?Sized + Walker<$ast, $arena, C>
96            {
97                define_walk_body!($walker, $context, $var_name, $code);
98            }
99        }
100    };
101    // This arm matches simple/copy nodes that DO NOT have an arena lifetime.
102    (_, $node_type:ty, $var_name:ident, $walker:ident, $context:ident, $ast:lifetime, $arena:lifetime, $code:block) => {
103        paste::paste! {
104            #[inline]
105            pub fn [<walk_ $var_name _mut>]<$ast, $arena, W, C>($walker: &mut W, $var_name: & $ast $node_type, $context: &mut C)
106                where W: ?Sized + MutWalker<$ast, $arena, C>
107            {
108                define_walk_body!($walker, $context, $var_name, $code);
109            }
110
111            #[inline]
112            pub fn [<walk_ $var_name>]<$ast, $arena, W, C>($walker: &W, $var_name: & $ast $node_type, $context: &mut C)
113                where W: ?Sized + Walker<$ast, $arena, C>
114            {
115                define_walk_body!($walker, $context, $var_name, $code);
116            }
117        }
118    };
119}
120
121/// Macro for generating a walker trait and associated functions for traversing an AST.
122macro_rules! generate_ast_walker {
123    (
124        using($walker:ident, $context:ident, $ast:lifetime, $arena:lifetime):
125        $(
126            $prefix:tt $node_type:ty as $var_name:ident => $code:block
127        )*
128    ) => {
129        /// A trait that defines a mutable walker to traverse AST nodes.
130        pub trait MutWalker<$ast, $arena, C>: Sync + Send {
131            $(
132                gen_mut_trait_methods!($prefix, $node_type, $var_name, $walker, $context, $ast, $arena, $code);
133            )*
134        }
135
136        /// A trait that defines an immutable walker to traverse AST nodes.
137        pub trait Walker<$ast, $arena, C>: Sync + Send {
138            $(
139                gen_const_trait_methods!($prefix, $node_type, $var_name, $walker, $context, $ast, $arena, $code);
140            )*
141        }
142
143        $(
144            gen_standalone_funcs!($prefix, $node_type, $var_name, $walker, $context, $ast, $arena, $code);
145        )*
146    }
147}
148
149generate_ast_walker! {
150    using(walker, context, 'ast, 'arena):
151
152    'arena Program as program => {
153        for statement in program.statements.iter() {
154            walker.walk_statement(statement, context);
155        }
156    }
157
158    'arena Statement as statement => {
159        match &statement {
160            Statement::OpeningTag(opening_tag) => walker.walk_opening_tag(opening_tag, context),
161            Statement::ClosingTag(closing_tag) => walker.walk_closing_tag(closing_tag, context),
162            Statement::Inline(inline) => walker.walk_inline(inline, context),
163            Statement::Namespace(namespace) => walker.walk_namespace(namespace, context),
164            Statement::Use(r#use) => walker.walk_use(r#use, context),
165            Statement::Class(class) => walker.walk_class(class, context),
166            Statement::Interface(interface) => walker.walk_interface(interface, context),
167            Statement::Trait(r#trait) => walker.walk_trait(r#trait, context),
168            Statement::Enum(r#enum) => walker.walk_enum(r#enum, context),
169            Statement::Block(block) => walker.walk_block(block, context),
170            Statement::Constant(constant) => walker.walk_constant(constant, context),
171            Statement::Function(function) => walker.walk_function(function, context),
172            Statement::Declare(declare) => walker.walk_declare(declare, context),
173            Statement::Goto(goto) => walker.walk_goto(goto, context),
174            Statement::Label(label) => walker.walk_label(label, context),
175            Statement::Try(r#try) => walker.walk_try(r#try, context),
176            Statement::Foreach(foreach) => walker.walk_foreach(foreach, context),
177            Statement::For(r#for) => walker.walk_for(r#for, context),
178            Statement::While(r#while) => walker.walk_while(r#while, context),
179            Statement::DoWhile(do_while) => walker.walk_do_while(do_while, context),
180            Statement::Continue(r#continue) => walker.walk_continue(r#continue, context),
181            Statement::Break(r#break) => walker.walk_break(r#break, context),
182            Statement::Switch(switch) => walker.walk_switch(switch, context),
183            Statement::If(r#if) => walker.walk_if(r#if, context),
184            Statement::Return(r#return) => walker.walk_return(r#return, context),
185            Statement::Expression(expression) => walker.walk_statement_expression(expression, context),
186            Statement::Echo(echo) => walker.walk_echo(echo, context),
187            Statement::Global(global) => walker.walk_global(global, context),
188            Statement::Static(r#static) => walker.walk_static(r#static, context),
189            Statement::HaltCompiler(halt_compiler) => walker.walk_halt_compiler(halt_compiler, context),
190            Statement::Unset(unset) => walker.walk_unset(unset, context),
191            Statement::Noop(_) => {
192                // Do nothing by default
193            },
194        }
195    }
196
197    'arena OpeningTag as opening_tag => {
198        match opening_tag {
199            OpeningTag::Full(full_opening_tag) => walker.walk_full_opening_tag(full_opening_tag, context),
200            OpeningTag::Short(short_opening_tag) => walker.walk_short_opening_tag(short_opening_tag, context),
201            OpeningTag::Echo(echo_opening_tag) => walker.walk_echo_opening_tag(echo_opening_tag, context),
202        }
203    }
204
205    'arena FullOpeningTag as full_opening_tag => {
206        // Do nothing by default
207    }
208
209    _ ShortOpeningTag as short_opening_tag => {
210        // Do nothing by default
211    }
212
213    _ EchoOpeningTag as echo_opening_tag => {
214        // Do nothing by default
215    }
216
217    _ ClosingTag as closing_tag => {
218        // Do nothing by default
219    }
220
221    'arena Inline as inline => {
222        // Do nothing by default
223    }
224
225    'arena Namespace as namespace => {
226        walker.walk_keyword(&namespace.namespace, context);
227        if let Some(name) = &namespace.name {
228            walker.walk_identifier(name, context);
229        }
230
231        walker.walk_namespace_body(&namespace.body, context);
232    }
233
234    'arena NamespaceBody as namespace_body => {
235        match namespace_body {
236            NamespaceBody::Implicit(namespace_implicit_body) => walker.walk_namespace_implicit_body(namespace_implicit_body, context),
237            NamespaceBody::BraceDelimited(block) => walker.walk_block(block, context),
238        }
239    }
240
241    'arena NamespaceImplicitBody as namespace_implicit_body => {
242        walker.walk_terminator(&namespace_implicit_body.terminator, context);
243
244        for statement in namespace_implicit_body.statements.iter() {
245            walker.walk_statement(statement, context);
246        }
247    }
248
249    'arena Terminator as terminator => {
250        match terminator {
251            Terminator::Semicolon(_) => {
252                // Do nothing by default
253            }
254            Terminator::ClosingTag(closing_tag) => {
255                walker.walk_closing_tag(closing_tag, context);
256            }
257            Terminator::TagPair(closing_tag, opening_tag) => {
258                walker.walk_closing_tag(closing_tag, context);
259                walker.walk_opening_tag(opening_tag, context);
260            }
261        }
262    }
263
264    'arena Use as r#use => {
265        walker.walk_keyword(&r#use.r#use, context);
266
267        walker.walk_use_items(&r#use.items, context);
268
269        walker.walk_terminator(&r#use.terminator, context);
270    }
271
272    'arena UseItems as use_items => {
273        match use_items {
274            UseItems::Sequence(use_item_sequence) => {
275                walker.walk_use_item_sequence(use_item_sequence, context);
276            }
277            UseItems::TypedSequence(typed_use_item_sequence) => {
278                walker.walk_typed_use_item_sequence(typed_use_item_sequence, context);
279            }
280            UseItems::TypedList(typed_use_item_list) => {
281                walker.walk_typed_use_item_list(typed_use_item_list, context);
282            }
283            UseItems::MixedList(mixed_use_item_list) => {
284                walker.walk_mixed_use_item_list(mixed_use_item_list, context);
285            }
286        }
287    }
288
289    'arena UseItemSequence as use_item_sequence => {
290        for use_item in use_item_sequence.items.iter() {
291            walker.walk_use_item(use_item, context);
292        }
293    }
294
295    'arena UseItem as use_item => {
296        walker.walk_identifier(&use_item.name, context);
297
298        if let Some(alias) = &use_item.alias {
299            walker.walk_use_item_alias(alias, context);
300        }
301    }
302
303    'arena UseItemAlias as use_item_alias => {
304        walker.walk_keyword(&use_item_alias.r#as, context);
305        walker.walk_local_identifier(&use_item_alias.identifier, context);
306    }
307
308    'arena TypedUseItemSequence as typed_use_item_sequence => {
309        walker.walk_use_type(&typed_use_item_sequence.r#type, context);
310
311        for use_item in typed_use_item_sequence.items.iter() {
312            walker.walk_use_item(use_item, context);
313        }
314    }
315
316    'arena UseType as use_type => {
317        match &use_type {
318            UseType::Function(keyword) => walker.walk_keyword(keyword, context),
319            UseType::Const(keyword) => walker.walk_keyword(keyword, context),
320        }
321    }
322
323    'arena TypedUseItemList as typed_use_item_list => {
324        walker.walk_use_type(&typed_use_item_list.r#type, context);
325        walker.walk_identifier(&typed_use_item_list.namespace, context);
326
327        for use_item in typed_use_item_list.items.iter() {
328            walker.walk_use_item(use_item, context);
329        }
330    }
331
332    'arena MixedUseItemList as mixed_use_item_list => {
333        walker.walk_identifier(&mixed_use_item_list.namespace, context);
334
335        for maybe_typed_use_item in mixed_use_item_list.items.iter() {
336            walker.walk_maybe_typed_use_item(maybe_typed_use_item, context);
337        }
338    }
339
340    'arena MaybeTypedUseItem as maybe_typed_use_item => {
341        if let Some(use_type) = &maybe_typed_use_item.r#type {
342            walker.walk_use_type(use_type, context);
343        }
344
345        walker.walk_use_item(&maybe_typed_use_item.item, context);
346    }
347
348    'arena AttributeList as attribute_list => {
349        for attribute in attribute_list.attributes.iter() {
350            walker.walk_attribute(attribute, context);
351        }
352    }
353
354    'arena Attribute as attribute => {
355        walker.walk_identifier(&attribute.name, context);
356
357        if let Some(argument_list) = &attribute.argument_list {
358            walker.walk_argument_list(argument_list, context);
359        }
360    }
361
362    'arena ArgumentList as argument_list => {
363        for argument in argument_list.arguments.iter() {
364            walker.walk_argument(argument, context);
365        }
366    }
367
368    'arena Argument as argument => {
369        match &argument {
370            Argument::Positional(positional_argument) => {
371                walker.walk_positional_argument(positional_argument, context);
372            }
373            Argument::Named(named_argument) => {
374                walker.walk_named_argument(named_argument, context);
375            }
376        }
377    }
378
379    'arena PositionalArgument as positional_argument => {
380        walker.walk_expression(&positional_argument.value, context);
381    }
382
383    'arena NamedArgument as named_argument => {
384        walker.walk_local_identifier(&named_argument.name, context);
385        walker.walk_expression(&named_argument.value, context);
386    }
387
388    'arena Modifier as modifier => {
389        walker.walk_keyword(modifier.get_keyword(), context);
390    }
391
392    'arena Extends as extends => {
393        walker.walk_keyword(&extends.extends, context);
394
395        for ty in extends.types.iter() {
396            walker.walk_identifier(ty, context);
397        }
398    }
399
400    'arena Implements as implements => {
401        walker.walk_keyword(&implements.implements, context);
402
403        for ty in implements.types.iter() {
404            walker.walk_identifier(ty, context);
405        }
406    }
407
408    'arena Class as class => {
409        for attribute_list in class.attribute_lists.iter() {
410            walker.walk_attribute_list(attribute_list, context);
411        }
412
413        for modifier in class.modifiers.iter() {
414            walker.walk_modifier(modifier, context);
415        }
416
417        walker.walk_keyword(&class.class, context);
418        walker.walk_local_identifier(&class.name, context);
419        if let Some(extends) = &class.extends {
420            walker.walk_extends(extends, context);
421        }
422
423        if let Some(implements) = &class.implements {
424            walker.walk_implements(implements, context);
425        }
426
427        for class_member in class.members.iter() {
428            walker.walk_class_like_member(class_member, context);
429        }
430    }
431
432    'arena Interface as interface => {
433        for attribute_list in interface.attribute_lists.iter() {
434            walker.walk_attribute_list(attribute_list, context);
435        }
436
437        walker.walk_keyword(&interface.interface, context);
438        walker.walk_local_identifier(&interface.name, context);
439
440        if let Some(extends) = &interface.extends {
441            walker.walk_extends(extends, context);
442        }
443
444        for class_member in interface.members.iter() {
445            walker.walk_class_like_member(class_member, context);
446        }
447    }
448
449    'arena Trait as r#trait => {
450        for attribute_list in r#trait.attribute_lists.iter() {
451            walker.walk_attribute_list(attribute_list, context);
452        }
453
454        walker.walk_keyword(&r#trait.r#trait, context);
455        walker.walk_local_identifier(&r#trait.name, context);
456
457        for class_member in r#trait.members.iter() {
458            walker.walk_class_like_member(class_member, context);
459        }
460    }
461
462    'arena Enum as r#enum => {
463        for attribute_list in r#enum.attribute_lists.iter() {
464            walker.walk_attribute_list(attribute_list, context);
465        }
466
467        walker.walk_keyword(&r#enum.r#enum, context);
468        walker.walk_local_identifier(&r#enum.name, context);
469
470        if let Some(backing_type_hint) = &r#enum.backing_type_hint {
471            walker.walk_enum_backing_type_hint(backing_type_hint, context);
472        }
473
474        if let Some(implements) = &r#enum.implements {
475            walker.walk_implements(implements, context);
476        }
477
478        for class_member in r#enum.members.iter() {
479            walker.walk_class_like_member(class_member, context);
480        }
481    }
482
483    'arena EnumBackingTypeHint as enum_backing_type_hint => {
484        walker.walk_hint(&enum_backing_type_hint.hint, context);
485    }
486
487    'arena ClassLikeMember as class_like_member => {
488        match class_like_member {
489            ClassLikeMember::TraitUse(trait_use) => {
490                walker.walk_trait_use(trait_use, context);
491            }
492            ClassLikeMember::Constant(class_like_constant) => {
493                walker.walk_class_like_constant(class_like_constant, context);
494            }
495            ClassLikeMember::Property(property) => {
496                walker.walk_property(property, context);
497            }
498            ClassLikeMember::EnumCase(enum_case) => {
499                walker.walk_enum_case(enum_case, context);
500            }
501            ClassLikeMember::Method(method) => {
502                walker.walk_method(method, context);
503            }
504        }
505    }
506
507    'arena TraitUse as trait_use => {
508        walker.walk_keyword(&trait_use.r#use, context);
509
510        for trait_name in trait_use.trait_names.iter() {
511            walker.walk_identifier(trait_name, context);
512        }
513
514        walker.walk_trait_use_specification(&trait_use.specification, context);
515    }
516
517    'arena TraitUseSpecification as trait_use_specification => {
518        match trait_use_specification {
519            TraitUseSpecification::Abstract(trait_use_abstract_specification) => {
520                walker.walk_trait_use_abstract_specification(trait_use_abstract_specification, context);
521            }
522            TraitUseSpecification::Concrete(trait_use_concrete_specification) => {
523                walker.walk_trait_use_concrete_specification(trait_use_concrete_specification, context);
524            }
525        }
526    }
527
528    'arena TraitUseAbstractSpecification as trait_use_abstract_specification => {
529        walker.walk_terminator(&trait_use_abstract_specification.0, context);
530    }
531
532    'arena TraitUseConcreteSpecification as trait_use_concrete_specification => {
533        for adaptation in trait_use_concrete_specification.adaptations.iter() {
534            walker.walk_trait_use_adaptation(
535                adaptation,
536
537                context,
538            );
539        }
540    }
541
542    'arena TraitUseAdaptation as trait_use_adaptation => {
543        match trait_use_adaptation {
544            TraitUseAdaptation::Precedence(trait_use_precedence_adaptation) => {
545                walker.walk_trait_use_precedence_adaptation(trait_use_precedence_adaptation, context);
546            },
547            TraitUseAdaptation::Alias(trait_use_alias_adaptation) => {
548                walker.walk_trait_use_alias_adaptation(trait_use_alias_adaptation, context);
549            },
550        }
551    }
552
553    'arena TraitUsePrecedenceAdaptation as trait_use_precedence_adaptation => {
554        walker.walk_trait_use_absolute_method_reference(
555            &trait_use_precedence_adaptation.method_reference,
556
557            context,
558        );
559
560        walker.walk_keyword(&trait_use_precedence_adaptation.insteadof, context);
561
562        for trait_name in trait_use_precedence_adaptation.trait_names.iter() {
563            walker.walk_identifier(trait_name, context);
564        }
565
566        walker.walk_terminator(&trait_use_precedence_adaptation.terminator, context);
567    }
568
569    'arena TraitUseAbsoluteMethodReference as trait_use_absolute_method_reference => {
570        walker.walk_identifier(&trait_use_absolute_method_reference.trait_name, context);
571        walker.walk_local_identifier(&trait_use_absolute_method_reference.method_name, context);
572    }
573
574    'arena TraitUseAliasAdaptation as trait_use_alias_adaptation => {
575        walker.walk_trait_use_method_reference(
576            &trait_use_alias_adaptation.method_reference,
577
578            context,
579        );
580
581        walker.walk_keyword(&trait_use_alias_adaptation.r#as, context);
582
583        if let Some(modifier) = &trait_use_alias_adaptation.visibility {
584            walker.walk_modifier(modifier, context);
585        }
586
587        if let Some(alias) = &trait_use_alias_adaptation.alias {
588            walker.walk_local_identifier(alias, context);
589        }
590
591        walker.walk_terminator(&trait_use_alias_adaptation.terminator, context);
592    }
593
594    'arena TraitUseMethodReference as trait_use_method_reference => {
595        match trait_use_method_reference {
596            TraitUseMethodReference::Identifier(local_identifier) => {
597                walker.walk_local_identifier(local_identifier, context);
598            },
599            TraitUseMethodReference::Absolute(absolute) => {
600                walker.walk_trait_use_absolute_method_reference(absolute, context);
601            },
602        }
603    }
604
605    'arena ClassLikeConstant as class_like_constant => {
606        for attribute_list in class_like_constant.attribute_lists.iter() {
607            walker.walk_attribute_list(attribute_list, context);
608        }
609
610        for modifier in class_like_constant.modifiers.iter() {
611            walker.walk_modifier(modifier, context);
612        }
613
614        walker.walk_keyword(&class_like_constant.r#const, context);
615
616        if let Some(hint) = &class_like_constant.hint {
617            walker.walk_hint(hint, context);
618        }
619
620        for item in class_like_constant.items.iter() {
621            walker.walk_class_like_constant_item(item, context);
622        }
623
624        walker.walk_terminator(&class_like_constant.terminator, context);
625    }
626
627    'arena ClassLikeConstantItem as class_like_constant_item => {
628        walker.walk_local_identifier(&class_like_constant_item.name, context);
629        walker.walk_expression(&class_like_constant_item.value, context);
630    }
631
632    'arena Property as property => {
633        match property {
634            Property::Plain(plain_property) => {
635                walker.walk_plain_property(plain_property, context);
636            }
637            Property::Hooked(hooked_property) => {
638                walker.walk_hooked_property(hooked_property, context);
639            }
640        }
641    }
642
643    'arena PlainProperty as plain_property => {
644        for attribute_list in plain_property.attribute_lists.iter() {
645            walker.walk_attribute_list(attribute_list, context);
646        }
647
648        for modifier in plain_property.modifiers.iter() {
649            walker.walk_modifier(modifier, context);
650        }
651
652        if let Some(var) = &plain_property.var {
653            walker.walk_keyword(var, context);
654        }
655
656        if let Some(hint) = &plain_property.hint {
657            walker.walk_hint(hint, context);
658        }
659
660        for item in plain_property.items.iter() {
661            walker.walk_property_item(item, context);
662        }
663
664        walker.walk_terminator(&plain_property.terminator, context);
665    }
666
667    'arena PropertyItem as property_item => {
668        match property_item {
669            PropertyItem::Abstract(property_abstract_item) => {
670                walker.walk_property_abstract_item(property_abstract_item, context);
671            }
672            PropertyItem::Concrete(property_concrete_item) => {
673                walker.walk_property_concrete_item(property_concrete_item, context);
674            }
675        }
676    }
677
678    'arena PropertyAbstractItem as property_abstract_item => {
679        walker.walk_direct_variable(&property_abstract_item.variable, context);
680    }
681
682    'arena PropertyConcreteItem as property_concrete_item => {
683        walker.walk_direct_variable(&property_concrete_item.variable, context);
684        walker.walk_expression(&property_concrete_item.value, context);
685    }
686
687    'arena HookedProperty as hooked_property => {
688        for attribute_list in hooked_property.attribute_lists.iter() {
689            walker.walk_attribute_list(attribute_list, context);
690        }
691
692        for modifier in hooked_property.modifiers.iter() {
693            walker.walk_modifier(modifier, context);
694        }
695
696        if let Some(var) = &hooked_property.var {
697            walker.walk_keyword(var, context);
698        }
699
700        if let Some(hint) = &hooked_property.hint {
701            walker.walk_hint(hint, context);
702        }
703
704        walker.walk_property_item(&hooked_property.item, context);
705        walker.walk_property_hook_list(&hooked_property.hook_list, context);
706    }
707
708    'arena PropertyHookList as property_hook_list => {
709        for hook in property_hook_list.hooks.iter() {
710            walker.walk_property_hook(hook, context);
711        }
712    }
713
714    'arena PropertyHook as property_hook => {
715        for attribute_list in property_hook.attribute_lists.iter() {
716            walker.walk_attribute_list(attribute_list, context);
717        }
718
719        for modifier in property_hook.modifiers.iter() {
720            walker.walk_modifier(modifier, context);
721        }
722
723        walker.walk_local_identifier(&property_hook.name, context);
724        if let Some(parameters) = &property_hook.parameters {
725            walker.walk_function_like_parameter_list(parameters, context);
726        }
727
728        walker.walk_property_hook_body(&property_hook.body, context);
729    }
730
731    'arena PropertyHookBody as property_hook_body => {
732        match property_hook_body {
733            PropertyHookBody::Abstract(property_hook_abstract_body) => {
734                walker.walk_property_hook_abstract_body(property_hook_abstract_body, context);
735            }
736            PropertyHookBody::Concrete(property_hook_concrete_body) => {
737                walker.walk_property_hook_concrete_body(property_hook_concrete_body, context);
738            }
739        }
740    }
741
742    _ PropertyHookAbstractBody as property_hook_abstract_body => {
743        // Do nothing by default
744    }
745
746    'arena PropertyHookConcreteBody as property_hook_concrete_body => {
747        match property_hook_concrete_body {
748            PropertyHookConcreteBody::Block(block) => {
749                walker.walk_block(block, context);
750            }
751            PropertyHookConcreteBody::Expression(property_hook_concrete_expression_body) => {
752                walker.walk_property_hook_concrete_expression_body(property_hook_concrete_expression_body, context);
753            }
754        }
755    }
756
757    'arena PropertyHookConcreteExpressionBody as property_hook_concrete_expression_body => {
758        walker.walk_expression(&property_hook_concrete_expression_body.expression, context);
759    }
760
761    'arena FunctionLikeParameterList as function_like_parameter_list => {
762        for parameter in function_like_parameter_list.parameters.iter() {
763            walker.walk_function_like_parameter(parameter, context);
764        }
765    }
766
767    'arena FunctionLikeParameter as function_like_parameter => {
768        for attribute_list in function_like_parameter.attribute_lists.iter() {
769            walker.walk_attribute_list(attribute_list, context);
770        }
771
772        for modifier in function_like_parameter.modifiers.iter() {
773            walker.walk_modifier(modifier, context);
774        }
775
776        if let Some(hint) = &function_like_parameter.hint {
777            walker.walk_hint(hint, context);
778        }
779
780        walker.walk_direct_variable(&function_like_parameter.variable, context);
781        if let Some(default_value) = &function_like_parameter.default_value {
782            walker.walk_function_like_parameter_default_value(default_value, context);
783        }
784
785        if let Some(hooks) = &function_like_parameter.hooks {
786            walker.walk_property_hook_list(hooks, context);
787        }
788    }
789
790    'arena FunctionLikeParameterDefaultValue as function_like_parameter_default_value => {
791        walker.walk_expression(&function_like_parameter_default_value.value, context);
792    }
793
794    'arena EnumCase as enum_case => {
795        for attribute_list in enum_case.attribute_lists.iter() {
796            walker.walk_attribute_list(attribute_list, context);
797        }
798
799        walker.walk_keyword(&enum_case.case, context);
800        walker.walk_enum_case_item(&enum_case.item, context);
801        walker.walk_terminator(&enum_case.terminator, context);
802    }
803
804    'arena EnumCaseItem as enum_case_item => {
805        match enum_case_item {
806            EnumCaseItem::Unit(enum_case_unit_item) => {
807                walker.walk_enum_case_unit_item(enum_case_unit_item, context);
808            }
809            EnumCaseItem::Backed(enum_case_backed_item) => {
810                walker.walk_enum_case_backed_item(enum_case_backed_item, context);
811            }
812        }
813    }
814
815    'arena EnumCaseUnitItem as enum_case_unit_item => {
816        walker.walk_local_identifier(&enum_case_unit_item.name, context);
817    }
818
819    'arena EnumCaseBackedItem as enum_case_backed_item => {
820        walker.walk_local_identifier(&enum_case_backed_item.name, context);
821        walker.walk_expression(&enum_case_backed_item.value, context);
822    }
823
824    'arena Method as method => {
825        for attribute_list in method.attribute_lists.iter() {
826            walker.walk_attribute_list(attribute_list, context);
827        }
828
829        for modifier in method.modifiers.iter() {
830            walker.walk_modifier(modifier, context);
831        }
832
833        walker.walk_keyword(&method.function, context);
834        walker.walk_local_identifier(&method.name, context);
835        walker.walk_function_like_parameter_list(&method.parameter_list, context);
836        if let Some(hint) = &method.return_type_hint {
837            walker.walk_function_like_return_type_hint(hint, context);
838        }
839
840        walker.walk_method_body(&method.body, context);
841    }
842
843    'arena MethodBody as method_body => {
844        match method_body {
845            MethodBody::Abstract(method_abstract_body) => {
846                walker.walk_method_abstract_body(method_abstract_body, context);
847            }
848            MethodBody::Concrete(method_concrete_body) => {
849                walker.walk_block(method_concrete_body, context);
850            }
851        }
852    }
853
854    _ MethodAbstractBody as method_abstract_body => {
855        // Do nothing by default
856    }
857
858    'arena FunctionLikeReturnTypeHint as function_like_return_type_hint => {
859        walker.walk_hint(&function_like_return_type_hint.hint, context);
860    }
861
862    'arena Block as block => {
863        for statement in block.statements.iter() {
864            walker.walk_statement(statement, context);
865        }
866    }
867
868    'arena Constant as constant => {
869        for attribute_list in constant.attribute_lists.iter() {
870            walker.walk_attribute_list(attribute_list, context);
871        }
872
873        walker.walk_keyword(&constant.r#const, context);
874        for item in constant.items.iter() {
875            walker.walk_constant_item(item, context);
876        }
877
878        walker.walk_terminator(&constant.terminator, context);
879    }
880
881    'arena ConstantItem as constant_item => {
882        walker.walk_local_identifier(&constant_item.name, context);
883        walker.walk_expression(&constant_item.value, context);
884    }
885
886    'arena Function as function => {
887        for attribute_list in function.attribute_lists.iter() {
888            walker.walk_attribute_list(attribute_list, context);
889        }
890
891        walker.walk_keyword(&function.function, context);
892        walker.walk_local_identifier(&function.name, context);
893        walker.walk_function_like_parameter_list(&function.parameter_list, context);
894        if let Some(hint) = &function.return_type_hint {
895            walker.walk_function_like_return_type_hint(hint, context);
896        }
897
898        walker.walk_block(&function.body, context);
899    }
900
901    'arena Declare as declare => {
902        walker.walk_keyword(&declare.declare, context);
903        for item in declare.items.iter() {
904            walker.walk_declare_item(item, context);
905        }
906
907        walker.walk_declare_body(&declare.body, context);
908    }
909
910    'arena DeclareItem as declare_item => {
911        walker.walk_local_identifier(&declare_item.name, context);
912        walker.walk_expression(&declare_item.value, context);
913    }
914
915    'arena DeclareBody as declare_body => {
916        match declare_body {
917            DeclareBody::Statement(statement) => {
918                walker.walk_statement(statement, context);
919            }
920            DeclareBody::ColonDelimited(declare_colon_delimited_body) => {
921                walker.walk_declare_colon_delimited_body(declare_colon_delimited_body, context);
922            }
923        }
924    }
925
926    'arena DeclareColonDelimitedBody as declare_colon_delimited_body => {
927        for statement in declare_colon_delimited_body.statements.iter() {
928            walker.walk_statement(statement, context);
929        }
930
931        walker.walk_terminator(&declare_colon_delimited_body.terminator, context);
932    }
933
934    'arena Goto as goto => {
935        walker.walk_keyword(&goto.goto, context);
936        walker.walk_local_identifier(&goto.label, context);
937        walker.walk_terminator(&goto.terminator, context);
938    }
939
940    'arena Label as label => {
941        walker.walk_local_identifier(&label.name, context);
942    }
943
944    'arena Try as r#try => {
945        walker.walk_keyword(&r#try.r#try, context);
946        walker.walk_block(&r#try.block, context);
947        for catch in r#try.catch_clauses.iter() {
948            walker.walk_try_catch_clause(catch, context);
949        }
950
951        if let Some(finally) = &r#try.finally_clause {
952            walker.walk_try_finally_clause(finally, context);
953        }
954    }
955
956    'arena TryCatchClause as try_catch_clause => {
957        walker.walk_keyword(&try_catch_clause.catch, context);
958        walker.walk_hint(&try_catch_clause.hint, context);
959        if let Some(variable) = &try_catch_clause.variable {
960            walker.walk_direct_variable(variable, context);
961        }
962
963        walker.walk_block(&try_catch_clause.block, context);
964    }
965
966    'arena TryFinallyClause as try_finally_clause => {
967        walker.walk_keyword(&try_finally_clause.finally, context);
968        walker.walk_block(&try_finally_clause.block, context);
969    }
970
971    'arena Foreach as foreach => {
972        walker.walk_keyword(&foreach.foreach, context);
973        walker.walk_expression(foreach.expression, context);
974        walker.walk_keyword(&foreach.r#as, context);
975        walker.walk_foreach_target(&foreach.target, context);
976        walker.walk_foreach_body(&foreach.body, context);
977    }
978
979    'arena ForeachTarget as foreach_target => {
980        match foreach_target {
981            ForeachTarget::Value(foreach_value_target) => {
982                walker.walk_foreach_value_target(foreach_value_target, context);
983            }
984            ForeachTarget::KeyValue(foreach_key_value_target) => {
985                walker.walk_foreach_key_value_target(foreach_key_value_target, context);
986            }
987        }
988    }
989
990    'arena ForeachValueTarget as foreach_value_target => {
991        walker.walk_expression(foreach_value_target.value, context);
992    }
993
994    'arena ForeachKeyValueTarget as foreach_key_value_target => {
995        walker.walk_expression(foreach_key_value_target.key, context);
996        walker.walk_expression(foreach_key_value_target.value, context);
997    }
998
999    'arena ForeachBody as foreach_body => {
1000        match foreach_body {
1001            ForeachBody::Statement(statement) => {
1002                walker.walk_statement(statement, context);
1003            }
1004            ForeachBody::ColonDelimited(foreach_colon_delimited_body) => {
1005                walker.walk_foreach_colon_delimited_body(foreach_colon_delimited_body, context);
1006            }
1007        }
1008    }
1009
1010    'arena ForeachColonDelimitedBody as foreach_colon_delimited_body => {
1011        for statement in foreach_colon_delimited_body.statements.iter() {
1012            walker.walk_statement(statement, context);
1013        }
1014
1015        walker.walk_keyword(&foreach_colon_delimited_body.end_foreach, context);
1016        walker.walk_terminator(&foreach_colon_delimited_body.terminator, context);
1017    }
1018
1019    'arena For as r#for => {
1020        walker.walk_keyword(&r#for.r#for, context);
1021
1022        for initialization in r#for.initializations.iter() {
1023            walker.walk_expression(initialization, context);
1024        }
1025
1026        for condition in r#for.conditions.iter() {
1027            walker.walk_expression(condition, context);
1028        }
1029
1030        for increment in r#for.increments.iter() {
1031            walker.walk_expression(increment, context);
1032        }
1033
1034        walker.walk_for_body(&r#for.body, context);
1035    }
1036
1037    'arena ForBody as for_body => {
1038        match for_body {
1039            ForBody::Statement(statement) => {
1040                walker.walk_statement(statement, context);
1041            }
1042            ForBody::ColonDelimited(for_colon_delimited_body) => {
1043                walker.walk_for_colon_delimited_body(for_colon_delimited_body, context);
1044            }
1045        }
1046    }
1047
1048    'arena ForColonDelimitedBody as for_colon_delimited_body => {
1049        for statement in for_colon_delimited_body.statements.iter() {
1050            walker.walk_statement(statement, context);
1051        }
1052
1053        walker.walk_keyword(&for_colon_delimited_body.end_for, context);
1054        walker.walk_terminator(&for_colon_delimited_body.terminator, context);
1055    }
1056
1057    'arena While as r#while => {
1058        walker.walk_keyword(&r#while.r#while, context);
1059        walker.walk_expression(r#while.condition, context);
1060        walker.walk_while_body(&r#while.body, context);
1061    }
1062
1063    'arena WhileBody as while_body => {
1064        match while_body {
1065            WhileBody::Statement(statement) => {
1066                walker.walk_statement(statement, context);
1067            }
1068            WhileBody::ColonDelimited(while_colon_delimited_body) => {
1069                walker.walk_while_colon_delimited_body(while_colon_delimited_body, context);
1070            }
1071        }
1072    }
1073
1074    'arena WhileColonDelimitedBody as while_colon_delimited_body => {
1075        for statement in while_colon_delimited_body.statements.iter() {
1076            walker.walk_statement(statement, context);
1077        }
1078
1079        walker.walk_keyword(&while_colon_delimited_body.end_while, context);
1080        walker.walk_terminator(&while_colon_delimited_body.terminator, context);
1081    }
1082
1083    'arena DoWhile as do_while => {
1084        walker.walk_keyword(&do_while.r#do, context);
1085        walker.walk_statement(do_while.statement, context);
1086        walker.walk_keyword(&do_while.r#while, context);
1087        walker.walk_expression(do_while.condition, context);
1088        walker.walk_terminator(&do_while.terminator, context);
1089    }
1090
1091    'arena Continue as r#continue => {
1092        walker.walk_keyword(&r#continue.r#continue, context);
1093        if let Some(level) = &r#continue.level {
1094            walker.walk_expression(level, context);
1095        }
1096
1097        walker.walk_terminator(&r#continue.terminator, context);
1098    }
1099
1100    'arena Break as r#break => {
1101        walker.walk_keyword(&r#break.r#break, context);
1102        if let Some(level) = &r#break.level {
1103            walker.walk_expression(level, context);
1104        }
1105
1106        walker.walk_terminator(&r#break.terminator, context);
1107    }
1108
1109    'arena Switch as switch => {
1110        walker.walk_keyword(&switch.r#switch, context);
1111        walker.walk_expression(switch.expression, context);
1112        walker.walk_switch_body(&switch.body, context);
1113    }
1114
1115    'arena SwitchBody as switch_body => {
1116        match switch_body {
1117            SwitchBody::BraceDelimited(switch_brace_delimited_body) => {
1118                walker.walk_switch_brace_delimited_body(switch_brace_delimited_body, context);
1119            }
1120            SwitchBody::ColonDelimited(switch_colon_delimited_body) => {
1121                walker.walk_switch_colon_delimited_body(switch_colon_delimited_body, context);
1122            }
1123        }
1124    }
1125
1126    'arena SwitchBraceDelimitedBody as switch_brace_delimited_body => {
1127        if let Some(terminator) = &switch_brace_delimited_body.optional_terminator {
1128            walker.walk_terminator(terminator, context);
1129        }
1130
1131        for case in switch_brace_delimited_body.cases.iter() {
1132            walker.walk_switch_case(case, context);
1133        }
1134    }
1135
1136    'arena SwitchColonDelimitedBody as switch_colon_delimited_body => {
1137        if let Some(terminator) = &switch_colon_delimited_body.optional_terminator {
1138            walker.walk_terminator(terminator, context);
1139        }
1140
1141        for case in switch_colon_delimited_body.cases.iter() {
1142            walker.walk_switch_case(case, context);
1143        }
1144
1145        walker.walk_keyword(&switch_colon_delimited_body.end_switch, context);
1146        walker.walk_terminator(&switch_colon_delimited_body.terminator, context);
1147    }
1148
1149    'arena SwitchCase as switch_case => {
1150        match switch_case {
1151            SwitchCase::Expression(switch_expression_case) => {
1152                walker.walk_switch_expression_case(switch_expression_case, context);
1153            }
1154            SwitchCase::Default(switch_default_case) => {
1155                walker.walk_switch_default_case(switch_default_case, context);
1156            }
1157        }
1158    }
1159
1160    'arena SwitchExpressionCase as switch_expression_case => {
1161        walker.walk_keyword(&switch_expression_case.r#case, context);
1162        walker.walk_expression(switch_expression_case.expression, context);
1163        walker.walk_switch_case_separator(&switch_expression_case.separator, context);
1164        for statement in switch_expression_case.statements.iter() {
1165            walker.walk_statement(statement, context);
1166        }
1167    }
1168
1169    'arena SwitchDefaultCase as switch_default_case => {
1170        walker.walk_keyword(&switch_default_case.r#default, context);
1171        walker.walk_switch_case_separator(&switch_default_case.separator, context);
1172        for statement in switch_default_case.statements.iter() {
1173            walker.walk_statement(statement, context);
1174        }
1175    }
1176
1177    _ SwitchCaseSeparator as switch_case_separator => {
1178        // Do nothing by default
1179    }
1180
1181    'arena If as r#if => {
1182        walker.walk_keyword(&r#if.r#if, context);
1183        walker.walk_expression(r#if.condition, context);
1184        walker.walk_if_body(&r#if.body, context);
1185    }
1186
1187    'arena IfBody as if_body => {
1188        match if_body {
1189            IfBody::Statement(statement) => {
1190                walker.walk_if_statement_body(statement, context);
1191            }
1192            IfBody::ColonDelimited(if_colon_delimited_body) => {
1193                walker.walk_if_colon_delimited_body(if_colon_delimited_body, context);
1194            }
1195        }
1196    }
1197
1198    'arena IfStatementBody as if_statement_body => {
1199        walker.walk_statement(if_statement_body.statement, context);
1200
1201        for else_if_clause in if_statement_body.else_if_clauses.iter() {
1202            walker.walk_if_statement_body_else_if_clause(else_if_clause, context);
1203        }
1204
1205        if let Some(else_clause) = &if_statement_body.else_clause {
1206            walker.walk_if_statement_body_else_clause(else_clause, context);
1207        }
1208    }
1209
1210    'arena IfStatementBodyElseIfClause as if_statement_body_else_if_clause => {
1211        walker.walk_keyword(&if_statement_body_else_if_clause.r#elseif, context);
1212        walker.walk_expression(if_statement_body_else_if_clause.condition, context);
1213        walker.walk_statement(if_statement_body_else_if_clause.statement, context);
1214    }
1215
1216    'arena IfStatementBodyElseClause as if_statement_body_else_clause => {
1217        walker.walk_keyword(&if_statement_body_else_clause.r#else, context);
1218        walker.walk_statement(if_statement_body_else_clause.statement, context);
1219    }
1220
1221    'arena IfColonDelimitedBody as if_colon_delimited_body => {
1222        for statement in if_colon_delimited_body.statements.iter() {
1223            walker.walk_statement(statement, context);
1224        }
1225
1226        for else_if_clause in if_colon_delimited_body.else_if_clauses.iter() {
1227            walker.walk_if_colon_delimited_body_else_if_clause(else_if_clause, context);
1228        }
1229
1230        if let Some(else_clause) = &if_colon_delimited_body.else_clause {
1231            walker.walk_if_colon_delimited_body_else_clause(else_clause, context);
1232        }
1233
1234        walker.walk_keyword(&if_colon_delimited_body.endif, context);
1235        walker.walk_terminator(&if_colon_delimited_body.terminator, context);
1236    }
1237
1238    'arena IfColonDelimitedBodyElseIfClause as if_colon_delimited_body_else_if_clause => {
1239        walker.walk_keyword(&if_colon_delimited_body_else_if_clause.r#elseif, context);
1240        walker.walk_expression(if_colon_delimited_body_else_if_clause.condition, context);
1241        for statement in if_colon_delimited_body_else_if_clause.statements.iter() {
1242            walker.walk_statement(statement, context);
1243        }
1244    }
1245
1246    'arena IfColonDelimitedBodyElseClause as if_colon_delimited_body_else_clause => {
1247        walker.walk_keyword(&if_colon_delimited_body_else_clause.r#else, context);
1248        for statement in if_colon_delimited_body_else_clause.statements.iter() {
1249            walker.walk_statement(statement, context);
1250        }
1251    }
1252
1253    'arena Return as r#return => {
1254        walker.walk_keyword(&r#return.r#return, context);
1255        if let Some(expression) = &r#return.value {
1256            walker.walk_expression(expression, context);
1257        }
1258
1259        walker.walk_terminator(&r#return.terminator, context);
1260    }
1261
1262    'arena ExpressionStatement as statement_expression => {
1263        walker.walk_expression(statement_expression.expression, context);
1264        walker.walk_terminator(&statement_expression.terminator, context);
1265    }
1266
1267    'arena Echo as echo => {
1268        walker.walk_keyword(&echo.echo, context);
1269        for expression in echo.values.iter() {
1270            walker.walk_expression(expression, context);
1271        }
1272
1273        walker.walk_terminator(&echo.terminator, context);
1274    }
1275
1276    'arena Global as global => {
1277        walker.walk_keyword(&global.global, context);
1278        for variable in global.variables.iter() {
1279            walker.walk_variable(variable, context);
1280        }
1281
1282        walker.walk_terminator(&global.terminator, context);
1283    }
1284
1285    'arena Static as r#static => {
1286        walker.walk_keyword(&r#static.r#static, context);
1287        for item in r#static.items.iter() {
1288            walker.walk_static_item(item, context);
1289        }
1290
1291        walker.walk_terminator(&r#static.terminator, context);
1292    }
1293
1294    'arena StaticItem as static_item => {
1295        match static_item {
1296            StaticItem::Abstract(static_abstract_item) => {
1297                walker.walk_static_abstract_item(static_abstract_item, context);
1298            }
1299            StaticItem::Concrete(static_concrete_item) => {
1300                walker.walk_static_concrete_item(static_concrete_item, context);
1301            }
1302        }
1303    }
1304
1305    'arena StaticAbstractItem as static_abstract_item => {
1306        walker.walk_direct_variable(&static_abstract_item.variable, context);
1307    }
1308
1309    'arena StaticConcreteItem as static_concrete_item => {
1310        walker.walk_direct_variable(&static_concrete_item.variable, context);
1311        walker.walk_expression(&static_concrete_item.value, context);
1312    }
1313
1314    'arena HaltCompiler as halt_compiler => {
1315        walker.walk_keyword(&halt_compiler.halt_compiler, context);
1316    }
1317
1318    'arena Unset as unset => {
1319        walker.walk_keyword(&unset.unset, context);
1320        for value in unset.values.iter() {
1321            walker.walk_expression(value, context);
1322        }
1323
1324        walker.walk_terminator(&unset.terminator, context);
1325    }
1326
1327    'arena Expression as expression => {
1328        match &expression {
1329            Expression::Parenthesized(parenthesized) => walker.walk_parenthesized(parenthesized, context),
1330            Expression::Binary(expr) => walker.walk_binary(expr, context),
1331            Expression::UnaryPrefix(operation) => walker.walk_unary_prefix(operation, context),
1332            Expression::UnaryPostfix(operation) => walker.walk_unary_postfix(operation, context),
1333            Expression::Literal(literal) => walker.walk_literal_expression(literal, context),
1334            Expression::CompositeString(string) => walker.walk_composite_string(string, context),
1335            Expression::Assignment(assignment) => {
1336                walker.walk_assignment(assignment, context)
1337            }
1338            Expression::Conditional(conditional) => {
1339                walker.walk_conditional(conditional, context)
1340            }
1341            Expression::Array(array) => walker.walk_array(array, context),
1342            Expression::LegacyArray(legacy_array) => walker.walk_legacy_array(legacy_array, context),
1343            Expression::List(list) => walker.walk_list(list, context),
1344            Expression::ArrayAccess(array_access) => walker.walk_array_access(array_access, context),
1345            Expression::ArrayAppend(array_append) => walker.walk_array_append(array_append, context),
1346            Expression::AnonymousClass(anonymous_class) => {
1347                walker.walk_anonymous_class(anonymous_class, context)
1348            }
1349            Expression::Closure(closure) => walker.walk_closure(closure, context),
1350            Expression::ArrowFunction(arrow_function) => walker.walk_arrow_function(arrow_function, context),
1351            Expression::Variable(variable) => walker.walk_variable(variable, context),
1352            Expression::Identifier(identifier) => walker.walk_identifier(identifier, context),
1353            Expression::Match(r#match) => walker.walk_match(r#match, context),
1354            Expression::Yield(r#yield) => walker.walk_yield(r#yield, context),
1355            Expression::Construct(construct) => walker.walk_construct(construct, context),
1356            Expression::Throw(throw) => walker.walk_throw(throw, context),
1357            Expression::Clone(clone) => walker.walk_clone(clone, context),
1358            Expression::Call(call) => walker.walk_call(call, context),
1359            Expression::Access(access) => walker.walk_access(access, context),
1360            Expression::ConstantAccess(expr) => walker.walk_constant_access(expr, context),
1361            Expression::ClosureCreation(closure_creation) => {
1362                walker.walk_closure_creation(closure_creation, context)
1363            }
1364            Expression::Parent(keyword) => walker.walk_parent_keyword(keyword, context),
1365            Expression::Static(keyword) => walker.walk_static_keyword(keyword, context),
1366            Expression::Self_(keyword) => walker.walk_self_keyword(keyword, context),
1367            Expression::Instantiation(instantiation) => walker.walk_instantiation(instantiation, context),
1368            Expression::MagicConstant(magic_constant) => walker.walk_magic_constant(magic_constant, context),
1369            Expression::Pipe(pipe) => walker.walk_pipe(pipe, context),
1370        }
1371    }
1372
1373    'arena Binary as binary => {
1374        walker.walk_expression(binary.lhs, context);
1375        walker.walk_binary_operator(&binary.operator, context);
1376        walker.walk_expression(binary.rhs, context);
1377    }
1378
1379    'arena BinaryOperator as binary_operator => {
1380        match binary_operator {
1381            BinaryOperator::Instanceof(keyword)
1382            | BinaryOperator::LowAnd(keyword)
1383            | BinaryOperator::LowOr(keyword)
1384            | BinaryOperator::LowXor(keyword) => {
1385                walker.walk_keyword(keyword, context);
1386            }
1387            _ => {}
1388        }
1389    }
1390
1391    'arena UnaryPrefix as unary_prefix => {
1392        walker.walk_unary_prefix_operator(&unary_prefix.operator, context);
1393        walker.walk_expression(unary_prefix.operand, context);
1394    }
1395
1396    'arena UnaryPrefixOperator as unary_prefix_operator => {
1397        // Do nothing
1398    }
1399
1400    'arena UnaryPostfix as unary_postfix => {
1401        walker.walk_expression(unary_postfix.operand, context);
1402        walker.walk_unary_postfix_operator(&unary_postfix.operator, context);
1403    }
1404
1405    _ UnaryPostfixOperator as unary_postfix_operator => {
1406        // Do nothing
1407    }
1408
1409    'arena Parenthesized as parenthesized => {
1410        walker.walk_expression(parenthesized.expression, context)
1411    }
1412
1413    'arena Literal as literal_expression => {
1414        match literal_expression {
1415            Literal::String(string) => walker.walk_literal_string(string, context),
1416            Literal::Integer(integer) => walker.walk_literal_integer(integer, context),
1417            Literal::Float(float) => walker.walk_literal_float(float, context),
1418            Literal::True(keyword) => walker.walk_true_keyword(keyword, context),
1419            Literal::False(keyword) => walker.walk_false_keyword(keyword, context),
1420            Literal::Null(keyword) => walker.walk_null_keyword(keyword, context),
1421        }
1422    }
1423
1424    'arena LiteralString as literal_string => {
1425        // Do nothing by default
1426    }
1427
1428    'arena LiteralInteger as literal_integer => {
1429        // Do nothing by default
1430    }
1431
1432    'arena LiteralFloat as literal_float => {
1433        // Do nothing by default
1434    }
1435
1436    'arena Keyword as true_keyword => {
1437        // Do nothing by default
1438    }
1439
1440    'arena Keyword as false_keyword => {
1441        // Do nothing by default
1442    }
1443
1444    'arena Keyword as null_keyword => {
1445        // Do nothing by default
1446    }
1447
1448    'arena CompositeString as composite_string => {
1449        match composite_string {
1450            CompositeString::ShellExecute(str) => walker.walk_shell_execute_string(str, context),
1451            CompositeString::Interpolated(str) => walker.walk_interpolated_string(str, context),
1452            CompositeString::Document(str) => walker.walk_document_string(str, context),
1453        }
1454    }
1455
1456    'arena ShellExecuteString as shell_execute_string => {
1457        for part in shell_execute_string.parts.iter() {
1458            walker.walk_string_part(part, context);
1459        }
1460    }
1461
1462    'arena InterpolatedString as interpolated_string => {
1463        for part in interpolated_string.parts.iter() {
1464            walker.walk_string_part(part, context);
1465        }
1466    }
1467
1468    'arena DocumentString as document_string => {
1469        for part in document_string.parts.iter() {
1470            walker.walk_string_part(part, context);
1471        }
1472    }
1473
1474    'arena StringPart as string_part => {
1475        match string_part {
1476            StringPart::Literal(literal) => walker.walk_literal_string_part(literal, context),
1477            StringPart::Expression(expression) => walker.walk_expression(expression, context),
1478            StringPart::BracedExpression(braced_expression_string_part) => {
1479                walker.walk_braced_expression_string_part(braced_expression_string_part, context)
1480            }
1481        };
1482    }
1483
1484    'arena LiteralStringPart as literal_string_part => {
1485        // Do nothing
1486    }
1487
1488    'arena BracedExpressionStringPart as braced_expression_string_part => {
1489        walker.walk_expression(braced_expression_string_part.expression, context);
1490    }
1491
1492    'arena Assignment as assignment => {
1493        walker.walk_expression(assignment.lhs, context);
1494        walker.walk_assignment_operator(&assignment.operator, context);
1495        walker.walk_expression(assignment.rhs, context);
1496    }
1497
1498    _ AssignmentOperator as assignment_operator => {
1499        // Do nothing
1500    }
1501
1502    'arena Conditional as conditional => {
1503        walker.walk_expression(conditional.condition, context);
1504        if let Some(then) = &conditional.then {
1505            walker.walk_expression(then, context);
1506        }
1507
1508        walker.walk_expression(conditional.r#else, context);
1509    }
1510
1511    'arena Array as array => {
1512        for element in array.elements.iter() {
1513            walker.walk_array_element(element, context);
1514        }
1515    }
1516
1517    'arena ArrayElement as array_element => {
1518        match array_element {
1519            ArrayElement::KeyValue(key_value_array_element) => {
1520                walker.walk_key_value_array_element(key_value_array_element, context);
1521            }
1522            ArrayElement::Value(value_array_element) => {
1523                walker.walk_value_array_element(value_array_element, context);
1524            }
1525            ArrayElement::Variadic(variadic_array_element) => {
1526                walker.walk_variadic_array_element(variadic_array_element, context);
1527            }
1528            ArrayElement::Missing(missing_array_element) => {
1529                walker.walk_missing_array_element(missing_array_element, context);
1530            }
1531        }
1532    }
1533
1534    'arena KeyValueArrayElement as key_value_array_element => {
1535        walker.walk_expression(key_value_array_element.key, context);
1536        walker.walk_expression(key_value_array_element.value, context);
1537    }
1538
1539    'arena ValueArrayElement as value_array_element => {
1540        walker.walk_expression(value_array_element.value, context);
1541    }
1542
1543    'arena VariadicArrayElement as variadic_array_element => {
1544        walker.walk_expression(variadic_array_element.value, context);
1545    }
1546
1547    _ MissingArrayElement as missing_array_element => {
1548        // Do nothing
1549    }
1550
1551    'arena LegacyArray as legacy_array => {
1552        walker.walk_keyword(&legacy_array.array, context);
1553        for element in legacy_array.elements.iter() {
1554            walker.walk_array_element(element, context);
1555        }
1556    }
1557
1558    'arena List as list => {
1559        walker.walk_keyword(&list.list, context);
1560
1561        for element in list.elements.iter() {
1562            walker.walk_array_element(element, context);
1563        }
1564    }
1565
1566    'arena ArrayAccess as array_access => {
1567        walker.walk_expression(array_access.array, context);
1568        walker.walk_expression(array_access.index, context);
1569    }
1570
1571    'arena ArrayAppend as array_append => {
1572        walker.walk_expression(array_append.array, context);
1573    }
1574
1575    'arena AnonymousClass as anonymous_class => {
1576        for attribute_list in anonymous_class.attribute_lists.iter() {
1577            walker.walk_attribute_list(attribute_list, context);
1578        }
1579
1580        for modifier in anonymous_class.modifiers.iter() {
1581            walker.walk_modifier(modifier, context);
1582        }
1583
1584        walker.walk_keyword(&anonymous_class.new, context);
1585        walker.walk_keyword(&anonymous_class.class, context);
1586        if let Some(argument_list) = &anonymous_class.argument_list {
1587            walker.walk_argument_list(argument_list, context);
1588        }
1589
1590        if let Some(extends) = &anonymous_class.extends {
1591            walker.walk_extends(extends, context);
1592        }
1593
1594        if let Some(implements) = &anonymous_class.implements {
1595            walker.walk_implements(implements, context);
1596        }
1597
1598        for class_member in anonymous_class.members.iter() {
1599            walker.walk_class_like_member(class_member, context);
1600        }
1601    }
1602
1603    'arena Closure as closure => {
1604        for attribute_list in closure.attribute_lists.iter() {
1605                walker.walk_attribute_list(attribute_list, context);
1606            }
1607
1608        if let Some(keyword) = &closure.r#static {
1609            walker.walk_keyword(keyword, context);
1610        }
1611
1612        walker.walk_keyword(&closure.function, context);
1613        walker.walk_function_like_parameter_list(&closure.parameter_list, context);
1614        if let Some(use_clause) = &closure.use_clause {
1615            walker.walk_closure_use_clause(use_clause, context);
1616        }
1617
1618        if let Some(return_type_hint) = &closure.return_type_hint {
1619            walker.walk_function_like_return_type_hint(return_type_hint, context);
1620        }
1621
1622        walker.walk_block(&closure.body, context);
1623    }
1624
1625    'arena ClosureUseClause as closure_use_clause => {
1626        for variable in closure_use_clause.variables.iter() {
1627            walker.walk_closure_use_clause_variable(variable, context);
1628        }
1629    }
1630
1631    'arena ClosureUseClauseVariable as closure_use_clause_variable => {
1632        walker.walk_direct_variable(&closure_use_clause_variable.variable, context);
1633    }
1634
1635    'arena ArrowFunction as arrow_function => {
1636        for attribute_list in arrow_function.attribute_lists.iter() {
1637            walker.walk_attribute_list(attribute_list, context);
1638        }
1639
1640        if let Some(keyword) = &arrow_function.r#static {
1641            walker.walk_keyword(keyword, context);
1642        }
1643
1644        walker.walk_keyword(&arrow_function.r#fn, context);
1645        walker.walk_function_like_parameter_list(&arrow_function.parameter_list, context);
1646
1647        if let Some(return_type_hint) = &arrow_function.return_type_hint {
1648            walker.walk_function_like_return_type_hint(return_type_hint, context);
1649        }
1650
1651        walker.walk_expression(arrow_function.expression, context);
1652    }
1653
1654    'arena Variable as variable => {
1655        match variable {
1656            Variable::Direct(direct_variable) => {
1657                walker.walk_direct_variable(direct_variable, context);
1658            }
1659            Variable::Indirect(indirect_variable) => {
1660                walker.walk_indirect_variable(indirect_variable, context);
1661            }
1662            Variable::Nested(nested_variable) => {
1663                walker.walk_nested_variable(nested_variable, context);
1664            }
1665        }
1666    }
1667
1668    'arena DirectVariable as direct_variable => {
1669        // Do nothing by default
1670    }
1671
1672    'arena IndirectVariable as indirect_variable => {
1673        walker.walk_expression(indirect_variable.expression, context);
1674    }
1675
1676    'arena NestedVariable as nested_variable => {
1677        walker.walk_variable(nested_variable.variable, context);
1678    }
1679
1680    'arena Identifier as identifier => {
1681        match identifier {
1682            Identifier::Local(local_identifier) => walker.walk_local_identifier(local_identifier, context),
1683            Identifier::Qualified(qualified_identifier) => walker.walk_qualified_identifier(qualified_identifier, context),
1684            Identifier::FullyQualified(fully_qualified_identifier) => walker.walk_fully_qualified_identifier(fully_qualified_identifier, context),
1685        };
1686    }
1687
1688    'arena LocalIdentifier as local_identifier => {
1689        // Do nothing by default
1690    }
1691
1692    'arena QualifiedIdentifier as qualified_identifier => {
1693        // Do nothing by default
1694    }
1695
1696    'arena FullyQualifiedIdentifier as fully_qualified_identifier => {
1697        // Do nothing by default
1698    }
1699
1700    'arena Match as r#match => {
1701        walker.walk_keyword(&r#match.r#match, context);
1702        walker.walk_expression(r#match.expression, context);
1703        for arm in r#match.arms.iter() {
1704            walker.walk_match_arm(arm, context);
1705        }
1706    }
1707
1708    'arena MatchArm as match_arm => {
1709        match match_arm {
1710            MatchArm::Expression(expression_match_arm) => {
1711                walker.walk_match_expression_arm(expression_match_arm, context);
1712            }
1713            MatchArm::Default(default_match_arm) => {
1714                walker.walk_match_default_arm(default_match_arm, context);
1715            }
1716        }
1717    }
1718
1719    'arena MatchExpressionArm as match_expression_arm => {
1720        for condition in match_expression_arm.conditions.iter() {
1721            walker.walk_expression(condition, context);
1722        }
1723
1724        walker.walk_expression(match_expression_arm.expression, context);
1725    }
1726
1727    'arena MatchDefaultArm as match_default_arm => {
1728        walker.walk_keyword(&match_default_arm.r#default, context);
1729        walker.walk_expression(match_default_arm.expression, context);
1730    }
1731
1732    'arena Yield as r#yield => {
1733        match r#yield {
1734            Yield::Value(yield_value) => {
1735                walker.walk_yield_value(yield_value, context);
1736            }
1737            Yield::Pair(yield_pair) => {
1738                walker.walk_yield_pair(yield_pair, context);
1739            }
1740            Yield::From(yield_from) => {
1741                walker.walk_yield_from(yield_from, context);
1742            }
1743        }
1744    }
1745
1746    'arena YieldValue as yield_value => {
1747        walker.walk_keyword(&yield_value.r#yield, context);
1748
1749        if let Some(value) = &yield_value.value {
1750            walker.walk_expression(value, context);
1751        }
1752    }
1753
1754    'arena YieldPair as yield_pair => {
1755        walker.walk_keyword(&yield_pair.r#yield, context);
1756        walker.walk_expression(yield_pair.key, context);
1757        walker.walk_expression(yield_pair.value, context);
1758    }
1759
1760    'arena YieldFrom as yield_from => {
1761        walker.walk_keyword(&yield_from.r#yield, context);
1762        walker.walk_keyword(&yield_from.from, context);
1763        walker.walk_expression(yield_from.iterator, context);
1764    }
1765
1766    'arena Construct as construct => {
1767        match construct {
1768            Construct::Isset(isset_construct) => {
1769                walker.walk_isset_construct(isset_construct, context);
1770            }
1771            Construct::Empty(empty_construct) => {
1772                walker.walk_empty_construct(empty_construct, context);
1773            }
1774            Construct::Eval(eval_construct) => {
1775                walker.walk_eval_construct(eval_construct, context);
1776            }
1777            Construct::Include(include_construct) => {
1778                walker.walk_include_construct(include_construct, context);
1779            }
1780            Construct::IncludeOnce(include_once_construct) => {
1781                walker.walk_include_once_construct(include_once_construct, context);
1782            }
1783            Construct::Require(require_construct) => {
1784                walker.walk_require_construct(require_construct, context);
1785            }
1786            Construct::RequireOnce(require_once_construct) => {
1787                walker.walk_require_once_construct(require_once_construct, context);
1788            }
1789            Construct::Print(print_construct) => {
1790                walker.walk_print_construct(print_construct, context);
1791            }
1792            Construct::Exit(exit_construct) => {
1793                walker.walk_exit_construct(exit_construct, context);
1794            }
1795            Construct::Die(die_construct) => {
1796                walker.walk_die_construct(die_construct, context);
1797            }
1798        }
1799    }
1800
1801    'arena IssetConstruct as isset_construct => {
1802        walker.walk_keyword(&isset_construct.isset, context);
1803        for value in isset_construct.values.iter() {
1804            walker.walk_expression(value, context);
1805        }
1806    }
1807
1808    'arena EmptyConstruct as empty_construct => {
1809        walker.walk_keyword(&empty_construct.empty, context);
1810        walker.walk_expression(empty_construct.value, context);
1811    }
1812
1813    'arena EvalConstruct as eval_construct => {
1814        walker.walk_keyword(&eval_construct.eval, context);
1815        walker.walk_expression(eval_construct.value, context);
1816    }
1817
1818    'arena IncludeConstruct as include_construct => {
1819        walker.walk_keyword(&include_construct.include, context);
1820        walker.walk_expression(include_construct.value, context);
1821    }
1822
1823    'arena IncludeOnceConstruct as include_once_construct => {
1824        walker.walk_keyword(&include_once_construct.include_once, context);
1825        walker.walk_expression(include_once_construct.value, context);
1826    }
1827
1828    'arena RequireConstruct as require_construct => {
1829        walker.walk_keyword(&require_construct.require, context);
1830        walker.walk_expression(require_construct.value, context);
1831    }
1832
1833    'arena RequireOnceConstruct as require_once_construct => {
1834        walker.walk_keyword(&require_once_construct.require_once, context);
1835        walker.walk_expression(require_once_construct.value, context);
1836    }
1837
1838    'arena PrintConstruct as print_construct => {
1839        walker.walk_keyword(&print_construct.print, context);
1840        walker.walk_expression(print_construct.value, context);
1841    }
1842
1843    'arena ExitConstruct as exit_construct => {
1844        walker.walk_keyword(&exit_construct.exit, context);
1845        if let Some(arguments) = &exit_construct.arguments {
1846            walker.walk_argument_list(arguments, context);
1847        }
1848    }
1849
1850    'arena DieConstruct as die_construct => {
1851        walker.walk_keyword(&die_construct.die, context);
1852        if let Some(arguments) = &die_construct.arguments {
1853            walker.walk_argument_list(arguments, context);
1854        }
1855    }
1856
1857    'arena Throw as r#throw => {
1858        walker.walk_keyword(&r#throw.r#throw, context);
1859        walker.walk_expression(r#throw.exception, context);
1860    }
1861
1862    'arena Clone as clone => {
1863        walker.walk_keyword(&clone.clone, context);
1864        walker.walk_expression(clone.object, context);
1865    }
1866
1867    'arena Call as call => {
1868        match call {
1869            Call::Function(function_call) => {
1870                walker.walk_function_call(function_call, context);
1871            }
1872            Call::Method(method_call) => {
1873                walker.walk_method_call(method_call, context);
1874            }
1875            Call::NullSafeMethod(null_safe_method_call) => {
1876                walker.walk_null_safe_method_call(null_safe_method_call, context);
1877            }
1878            Call::StaticMethod(static_method_call) => {
1879                walker.walk_static_method_call(static_method_call, context);
1880            }
1881        }
1882    }
1883
1884    'arena FunctionCall as function_call => {
1885        walker.walk_expression(function_call.function, context);
1886        walker.walk_argument_list(&function_call.argument_list, context);
1887    }
1888
1889    'arena MethodCall as method_call => {
1890        walker.walk_expression(method_call.object, context);
1891        walker.walk_class_like_member_selector(&method_call.method, context);
1892        walker.walk_argument_list(&method_call.argument_list, context);
1893    }
1894
1895    'arena NullSafeMethodCall as null_safe_method_call => {
1896        walker.walk_expression(null_safe_method_call.object, context);
1897        walker.walk_class_like_member_selector(&null_safe_method_call.method, context);
1898        walker.walk_argument_list(&null_safe_method_call.argument_list, context);
1899    }
1900
1901    'arena StaticMethodCall as static_method_call => {
1902        walker.walk_expression(static_method_call.class, context);
1903        walker.walk_class_like_member_selector(&static_method_call.method, context);
1904        walker.walk_argument_list(&static_method_call.argument_list, context);
1905    }
1906
1907    'arena ClassLikeMemberSelector as class_like_member_selector => {
1908        match class_like_member_selector {
1909            ClassLikeMemberSelector::Identifier(local_identifier) => {
1910                walker.walk_local_identifier(local_identifier, context);
1911            }
1912            ClassLikeMemberSelector::Variable(variable) => {
1913                walker.walk_variable(variable, context);
1914            }
1915            ClassLikeMemberSelector::Expression(class_like_member_expression_selector) => {
1916                walker.walk_class_like_member_expression_selector(
1917                    class_like_member_expression_selector,
1918
1919                    context,
1920                );
1921            }
1922        }
1923    }
1924
1925    'arena ClassLikeMemberExpressionSelector as class_like_member_expression_selector => {
1926        walker.walk_expression(class_like_member_expression_selector.expression, context);
1927    }
1928
1929    'arena ConstantAccess as constant_access => {
1930        walker.walk_identifier(&constant_access.name, context);
1931    }
1932
1933    'arena Access as access => {
1934        match access {
1935            Access::Property(property_access) => {
1936                walker.walk_property_access(property_access, context);
1937            }
1938            Access::NullSafeProperty(null_safe_property_access) => {
1939                walker.walk_null_safe_property_access(null_safe_property_access, context);
1940            }
1941            Access::StaticProperty(static_property_access) => {
1942                walker.walk_static_property_access(static_property_access, context);
1943            }
1944            Access::ClassConstant(class_constant_access) => {
1945                walker.walk_class_constant_access(class_constant_access, context);
1946            }
1947        }
1948    }
1949
1950    'arena PropertyAccess as property_access => {
1951        walker.walk_expression(property_access.object, context);
1952        walker.walk_class_like_member_selector(&property_access.property, context);
1953    }
1954
1955    'arena NullSafePropertyAccess as null_safe_property_access => {
1956        walker.walk_expression(null_safe_property_access.object, context);
1957        walker.walk_class_like_member_selector(&null_safe_property_access.property, context);
1958    }
1959
1960    'arena StaticPropertyAccess as static_property_access => {
1961        walker.walk_expression(static_property_access.class, context);
1962        walker.walk_variable(&static_property_access.property, context);
1963    }
1964
1965    'arena ClassConstantAccess as class_constant_access => {
1966        walker.walk_expression(class_constant_access.class, context);
1967        walker.walk_class_like_constant_selector(&class_constant_access.constant, context);
1968    }
1969
1970    'arena ClassLikeConstantSelector as class_like_constant_selector => {
1971        match class_like_constant_selector {
1972            ClassLikeConstantSelector::Identifier(local_identifier) => {
1973                walker.walk_local_identifier(local_identifier, context);
1974            }
1975            ClassLikeConstantSelector::Expression(class_like_constant_expression_selector) => {
1976                walker.walk_class_like_member_expression_selector(
1977                    class_like_constant_expression_selector,
1978
1979                    context,
1980                );
1981            }
1982        }
1983    }
1984
1985    'arena ClosureCreation as closure_creation => {
1986        match closure_creation {
1987            ClosureCreation::Function(function_closure_creation) => {
1988                walker.walk_function_closure_creation(function_closure_creation, context);
1989            }
1990            ClosureCreation::Method(method_closure_creation) => {
1991                walker.walk_method_closure_creation(method_closure_creation, context);
1992            }
1993            ClosureCreation::StaticMethod(static_method_closure_creation) => {
1994                walker.walk_static_method_closure_creation(static_method_closure_creation, context);
1995            }
1996        }
1997    }
1998
1999    'arena FunctionClosureCreation as function_closure_creation => {
2000        walker.walk_expression(function_closure_creation.function, context);
2001    }
2002
2003    'arena MethodClosureCreation as method_closure_creation => {
2004        walker.walk_expression(method_closure_creation.object, context);
2005        walker.walk_class_like_member_selector(&method_closure_creation.method, context);
2006    }
2007
2008    'arena StaticMethodClosureCreation as static_method_closure_creation => {
2009        walker.walk_expression(static_method_closure_creation.class, context);
2010        walker.walk_class_like_member_selector(&static_method_closure_creation.method, context);
2011    }
2012
2013    'arena Keyword as parent_keyword => {
2014        // Do nothing by default
2015    }
2016
2017    'arena Keyword as static_keyword => {
2018        // Do nothing by default
2019    }
2020
2021    'arena Keyword as self_keyword => {
2022        // Do nothing by default
2023    }
2024
2025    'arena Instantiation as instantiation => {
2026        walker.walk_keyword(&instantiation.new, context);
2027        walker.walk_expression(instantiation.class, context);
2028        if let Some(argument_list) = &instantiation.argument_list {
2029            walker.walk_argument_list(argument_list, context);
2030        }
2031    }
2032
2033    'arena MagicConstant as magic_constant => {
2034        walker.walk_local_identifier(magic_constant.value(), context);
2035    }
2036
2037    'arena Pipe as pipe => {
2038        walker.walk_expression(pipe.input, context);
2039        walker.walk_expression(pipe.callable, context);
2040    }
2041
2042    'arena Hint as hint => {
2043        match hint {
2044            Hint::Identifier(identifier) => {
2045                walker.walk_identifier(identifier, context);
2046            }
2047            Hint::Parenthesized(parenthesized_hint) => {
2048                walker.walk_parenthesized_hint(parenthesized_hint, context);
2049            }
2050            Hint::Nullable(nullable_hint) => {
2051                walker.walk_nullable_hint(nullable_hint, context);
2052            }
2053            Hint::Union(union_hint) => {
2054                walker.walk_union_hint(union_hint, context);
2055            }
2056            Hint::Intersection(intersection_hint) => {
2057                walker.walk_intersection_hint(intersection_hint, context);
2058            }
2059            Hint::Null(keyword) |
2060            Hint::True(keyword) |
2061            Hint::False(keyword) |
2062            Hint::Array(keyword) |
2063            Hint::Callable(keyword) |
2064            Hint::Static(keyword) |
2065            Hint::Self_(keyword) |
2066            Hint::Parent(keyword) => {
2067                walker.walk_keyword(keyword, context);
2068            }
2069            Hint::Void(local_identifier) |
2070            Hint::Never(local_identifier) |
2071            Hint::Float(local_identifier) |
2072            Hint::Bool(local_identifier) |
2073            Hint::Integer(local_identifier) |
2074            Hint::String(local_identifier) |
2075            Hint::Object(local_identifier) |
2076            Hint::Mixed(local_identifier) |
2077            Hint::Iterable(local_identifier) => {
2078                walker.walk_local_identifier(local_identifier, context);
2079            }
2080        }
2081    }
2082
2083    'arena ParenthesizedHint as parenthesized_hint => {
2084        walker.walk_hint(parenthesized_hint.hint, context);
2085    }
2086
2087    'arena NullableHint as nullable_hint => {
2088        walker.walk_hint(nullable_hint.hint, context);
2089    }
2090
2091    'arena UnionHint as union_hint => {
2092        walker.walk_hint(union_hint.left, context);
2093        walker.walk_hint(union_hint.right, context);
2094    }
2095
2096    'arena IntersectionHint as intersection_hint => {
2097        walker.walk_hint(intersection_hint.left, context);
2098        walker.walk_hint(intersection_hint.right, context);
2099    }
2100
2101    'arena Keyword as keyword => {
2102        // Do nothing by default
2103    }
2104}