not sure I fully understand what your trying to do but I think I would just make a walker like this:
```rs
pub const Walker = struct {
stack: Stack(*const AstNode),
pub fn init(root: *const AstNode) Walker {
// ...
}
pub fn next(self: *Walker) ?*const AstNode {
// ...
}
};
and then smt like: (would probably look quite different)
```rs
var ctx: ValidationContext = .{};
var walker: Walker = .init(&root);
while (walker.next()) |node| {
try CounterValidator.visit(&ctx, node);
try AnonValidator.visit(&ctx, node);
}
```