KSeExpr  4.0.4.0
ExprWalker.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2011-2019 Disney Enterprises, Inc.
2 // SPDX-License-Identifier: LicenseRef-Apache-2.0
3 // SPDX-FileCopyrightText: 2020 L. E. Segovia <amy@amyspark.me>
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 
6 #include <cstring>
7 #include <vector>
8 
9 #include "ExprPatterns.h"
10 #include "ExprWalker.h"
11 
12 namespace KSeExpr {
13 
14 template <bool constnode>
16  _examiner->reset();
17  internalWalk(examinee);
18 }
19 
20 template <bool constnode>
23  if (_examiner->examine(examinee)) walkChildren(examinee);
24  _examiner->post(examinee);
25 }
26 
27 template <bool constnode>
29  for (int i = 0; i < parent->numChildren(); i++) internalWalk(parent->child(i));
30 }
31 
32 template class Walker<false>;
33 template class Walker<true>;
34 } // namespace KSeExpr
typename T_EXAMINER::T_NODE T_NODE
Definition: ExprWalker.h:31
void walk(T_NODE *examinee)
Preorder walk.
Definition: ExprWalker.cpp:15
void internalWalk(T_NODE *examinee)
Definition: ExprWalker.cpp:21
void walkChildren(T_NODE *parent)
Definition: ExprWalker.cpp:28