zeek/src/Traverse.h
Jon Siwek d4f3cad7d1 Merge remote-tracking branch 'origin/topic/timw/266-namespaces'
Merge adjustments:

- Preserved original `base_type_no_ref` argument type as ::TypeTag
- Removed superfluous #pragma guard around deprecated TableVal ctor
- Clarify NEWS regarding MetaHook{Pre,Post} deprecations
- Simplify some `::zeek::` qualifications to just `zeek::`
- Prefixed FORWARD_DECLARE_NAMESPACED macro with ZEEK_

* origin/topic/timw/266-namespaces:
  Disable some deprecation diagnostics for GCC
  Rename BroType to Type
  Update NEWS
  Review cleanup
  Move Type types to zeek namespace
  Move Flare/Pipe from the bro namespace to zeek::detail
  Move Attr to the zeek::detail namespace
  Move Trigger into the zeek::detail namespace
  Move ID to the zeek::detail namespace
  Move Anon.h into zeek::detail namespace
  Mark all of the aliased classes in plugin/Plugin.h deprecated, and fix all of the plugins that were using them
  Move all of the base plugin classes into the zeek::plugin namespace
  Expr: move all classes into zeek::detail
  Stmt: move Stmt classes into zeek::detail namespace
  Add utility macro for creating namespaced aliases for classes
2020-06-11 23:20:51 -07:00

40 lines
1.4 KiB
C++

// See the file "COPYING" in the main distribution directory for copyright.
#pragma once
#include "TraverseTypes.h"
class Func;
class Scope;
ZEEK_FORWARD_DECLARE_NAMESPACED(Stmt, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(Expr, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(ID, zeek::detail);
class TraversalCallback {
public:
TraversalCallback() { current_scope = nullptr; }
virtual ~TraversalCallback() {}
virtual TraversalCode PreFunction(const Func*) { return TC_CONTINUE; }
virtual TraversalCode PostFunction(const Func*) { return TC_CONTINUE; }
virtual TraversalCode PreStmt(const zeek::detail::Stmt*) { return TC_CONTINUE; }
virtual TraversalCode PostStmt(const zeek::detail::Stmt*) { return TC_CONTINUE; }
virtual TraversalCode PreExpr(const zeek::detail::Expr*) { return TC_CONTINUE; }
virtual TraversalCode PostExpr(const zeek::detail::Expr*) { return TC_CONTINUE; }
virtual TraversalCode PreID(const zeek::detail::ID*) { return TC_CONTINUE; }
virtual TraversalCode PostID(const zeek::detail::ID*) { return TC_CONTINUE; }
virtual TraversalCode PreTypedef(const zeek::detail::ID*) { return TC_CONTINUE; }
virtual TraversalCode PostTypedef(const zeek::detail::ID*) { return TC_CONTINUE; }
virtual TraversalCode PreDecl(const zeek::detail::ID*) { return TC_CONTINUE; }
virtual TraversalCode PostDecl(const zeek::detail::ID*) { return TC_CONTINUE; }
Scope* current_scope;
};
TraversalCode traverse_all(TraversalCallback* cb);