mago_syntax/walker/
mod.rs

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