Skip to content

Commit 6d6a228

Browse files
committed
refactor(AST): introduce AstVisitor trait
The AST-Visitor trait allows generic visiting of AST-nodes. A default Walking behavior is implemented for each AstStatement but it can be altered by any implementor. When overriding a visit_XXX method, the implementation can decide to continue with the default walking behavior (by calling the walk function on the passed AstStatement-Struct, to skip it, or to continue with an alternative walking bahavior.
1 parent 38b5b3c commit 6d6a228

File tree

4 files changed

+735
-0
lines changed

4 files changed

+735
-0
lines changed

compiler/plc_ast/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ pub mod control_statements;
77
pub mod literals;
88
mod pre_processor;
99
pub mod provider;
10+
pub mod visitor;

0 commit comments

Comments
 (0)