template<typename T>
slang::SeparatedSyntaxList class

A syntax node that represents a token-separated list of child syntax nodes. The stored children are assumed to alternate between delimiters (such as a comma) and nodes.

Base classes

class SyntaxListBase
A base class for syntax nodes that represent a list of items.

Public types

template<typename U>
class iterator_base

Public functions

auto empty() const -> bool
auto size() const -> size_t noexcept

Private functions

auto getChild(size_t index) -> TokenOrSyntax final
Gets the child (token or node) at the given index.
auto getChild(size_t index) const -> ConstTokenOrSyntax final
Gets the child (token or node) at the given index.
void setChild(size_t index, TokenOrSyntax child) final
Sets the child (token or node) at the given index.
auto clone(BumpAllocator& alloc) const -> SyntaxListBase* final
Clones the list into a new node using the provided allocator.
void resetAll(BumpAllocator& alloc, span<const TokenOrSyntax> children) final

Function documentation

template<typename T>
bool slang::SeparatedSyntaxList<T>::empty() const

Returns true if the list is empty, and false if it has elements.

template<typename T>
size_t slang::SeparatedSyntaxList<T>::size() const noexcept

Returns the number of nodes in the list (doesn't include delimiter tokens in the count).

template<typename T>
void slang::SeparatedSyntaxList<T>::resetAll(BumpAllocator& alloc, span<const TokenOrSyntax> children) final private

Overwrites all children with the new set of provided children (and making a copy with the provided allocator).