slang/syntax/SyntaxNode.h file

Base class and utilities for syntax nodes.

Namespaces

namespace slang
Root namespace.
namespace slang::syntax
Syntax tree manipulation.

Classes

struct slang::syntax::PtrTokenOrSyntax
A token pointer or a syntax node pointer.
struct slang::syntax::ConstTokenOrSyntax
A token or a constant syntax node.
struct slang::syntax::TokenOrSyntax
A token or a syntax node.
class slang::syntax::SyntaxNode
Base class for all syntax nodes.
class slang::syntax::SyntaxNode::ParentRef
A small proxy that behaves like a SyntaxNode* but stores its pointer in a tagged form so that the low bit can be used to indicate the rare presence of a "preview node" attached to this node (see previewNode() below).
class slang::syntax::SyntaxNode::token_iterator
An iterator that walks through all tokens in a syntax node in order.
class slang::syntax::DeferredSourceRange
Represents a source range or a way to get one by materializing it from a syntax node.
template<typename Derived, typename Element>
class slang::syntax::SyntaxListBase
Common base for the three syntax-list container types.
template<typename T>
class slang::syntax::SyntaxList
A container of syntax nodes.
class slang::syntax::TokenList
A container of tokens.
template<typename T>
class slang::syntax::SeparatedSyntaxList
A container of token-separated syntax nodes.
template<typename U>
class slang::syntax::SeparatedSyntaxList::iterator_base
An iterator that will iterate over just the nodes (and skip the delimiters) in the parent SeparatedSyntaxList.
template<typename T>
struct slang::syntax::is_syntax_list
Type trait that is true for the three syntax-list container types (SyntaxList<T>, TokenList, SeparatedSyntaxList<T>).

Functions

SyntaxNode* clone(const SyntaxNode& node, BumpAllocator& alloc)
Performs a shallow clone of the given syntax node.
SyntaxNode* deepClone(const SyntaxNode& node, BumpAllocator& alloc)
Performs a deep clone of the given syntax node.
template<std::derived_from<SyntaxNode> T>
T* clone(const T& node, BumpAllocator& alloc)
Performs a shallow clone of the given syntax node.
template<std::derived_from<SyntaxNode> T>
T* deepClone(const T& node, BumpAllocator& alloc)
Performs a deep clone of the given syntax node.