mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
broader support for AST traversal, including Attr and Attributes objects
This commit is contained in:
parent
9a2200e60a
commit
a0fc8ca5e4
10 changed files with 280 additions and 23 deletions
17
src/Type.h
17
src/Type.h
|
@ -13,6 +13,7 @@
|
|||
#include "zeek/ID.h"
|
||||
#include "zeek/IntrusivePtr.h"
|
||||
#include "zeek/Obj.h"
|
||||
#include "zeek/Traverse.h"
|
||||
#include "zeek/ZeekList.h"
|
||||
|
||||
namespace zeek
|
||||
|
@ -258,6 +259,8 @@ public:
|
|||
void SetName(const std::string& arg_name) { name = arg_name; }
|
||||
const std::string& GetName() const { return name; }
|
||||
|
||||
virtual detail::TraversalCode Traverse(detail::TraversalCallback* cb) const;
|
||||
|
||||
struct TypePtrComparer
|
||||
{
|
||||
bool operator()(const TypePtr& a, const TypePtr& b) const { return a.get() < b.get(); }
|
||||
|
@ -353,6 +356,8 @@ public:
|
|||
"GHI-572.")]] unsigned int
|
||||
MemoryAllocation() const override;
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
|
@ -376,6 +381,8 @@ public:
|
|||
// Returns true if this table is solely indexed by subnet.
|
||||
bool IsSubNetIndex() const;
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
IndexType(TypeTag t, TypeListPtr arg_indices, TypePtr arg_yield_type)
|
||||
: Type(t), indices(std::move(arg_indices)), yield_type(std::move(arg_yield_type))
|
||||
|
@ -533,6 +540,8 @@ public:
|
|||
*/
|
||||
void SetExpressionlessReturnOkay(bool is_ok) { expressionless_return_okay = is_ok; }
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
friend FuncTypePtr make_intrusive<FuncType>();
|
||||
|
||||
|
@ -564,6 +573,8 @@ public:
|
|||
|
||||
template <class T> IntrusivePtr<T> GetType() const { return cast_intrusive<T>(type); }
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
TypePtr type;
|
||||
};
|
||||
|
@ -698,6 +709,8 @@ public:
|
|||
|
||||
std::string GetFieldDeprecationWarning(int field, bool has_check) const;
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
RecordType() { types = nullptr; }
|
||||
|
||||
|
@ -731,6 +744,8 @@ public:
|
|||
|
||||
const TypePtr& Yield() const override { return yield; }
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
|
@ -844,6 +859,8 @@ public:
|
|||
|
||||
void DescribeReST(ODesc* d, bool roles_only = false) const override;
|
||||
|
||||
detail::TraversalCode Traverse(detail::TraversalCallback* cb) const override;
|
||||
|
||||
protected:
|
||||
void DoDescribe(ODesc* d) const override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue