Lines Matching refs:traverser
4 The most common way to work with the AST is by using a node traverser and one or more node visitors.
11 $traverser = new NodeTraverser;
12 $traverser->addVisitor(new class extends NodeVisitorAbstract {
21 $modifiedStmts = $traverser->traverse($stmts);
27 $traverser = new NodeTraverser($visitor1, $visitor2, $visitor3);
30 $traverser = new NodeTraverser();
31 $traverser->addVisitor($visitor1);
32 $traverser->addVisitor($visitor2);
33 $traverser->addVisitor($visitor3);
139 Now `$a && $b` will be replaced by `!($a && $b)`. Then the traverser will go into the first (and
218 instruct the traverser to not recurse into the class node:
256 A single traverser can be used with multiple visitors:
259 $traverser = new NodeTraverser;
260 $traverser->addVisitor($visitorA);
261 $traverser->addVisitor($visitorB);
262 $stmts = $traverser->traverse($stmts);
265 It is important to understand that if a traverser is run with multiple visitors, the visitors will
300 $stmts = $traverserA->traverser($stmts);
301 $stmts = $traverserB->traverser($stmts);
351 Internally, the `NodeFinder` also uses a node traverser. It only simplifies the interface for a