KSeExpr 6.0.0.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
12namespace KSeExpr {
13
14template <bool constnode>
16 _examiner->reset();
17 internalWalk(examinee);
18}
19
20template <bool constnode>
23 if (_examiner->examine(examinee)) walkChildren(examinee);
24 _examiner->post(examinee);
25}
26
27template <bool constnode>
29 for (int i = 0; i < parent->numChildren(); i++) internalWalk(parent->child(i));
30}
31
32template class Walker<false>;
33template class Walker<true>;
34} // namespace KSeExpr
typename T_EXAMINER::T_NODE T_NODE
Definition ExprWalker.h:31
void walk(T_NODE *examinee)
Preorder walk.
void internalWalk(T_NODE *examinee)
void walkChildren(T_NODE *parent)