UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Verse::Vst::Node Struct Reference

#include <VstNode.h>

+ Inheritance diagram for Verse::Vst::Node:

Public Types

using NodeArray = LArray< TSRef< Node > >
 

Public Member Functions

 Node ()
 
 Node (NodeType in_type)
 
 Node (NodeType in_type, const SLocus &whence)
 
virtual UE_API ~Node ()
 
TSRef< NodeAsShared ()
 
template<typename TNodeType >
TNodeTypeAs ()
 
template<typename TNodeType >
const TNodeTypeAs () const
 
template<typename TNodeType >
TNodeTypeAsNullable ()
 
template<typename TNodeType >
const TNodeTypeAsNullable () const
 
template<typename TNodeType >
bool IsA () const
 
int GetChildCount () const
 
NodeType GetElementType () const
 
int32_t GetElementTypeInt () const
 
template<typename OpType >
OpType GetTag () const
 
template<typename OpType = uint8_t>
void SetTag (OpType in_op)
 
UE_API bool HasAttributes () const
 
UE_API const IdentifierGetAttributeIdentifier (const CUTF8StringView &AttributeName) const
 
UE_API bool IsAttributePresent (const CUTF8StringView &AttributeName) const
 
UE_API const NodeTryGetFirstAttributeOfType (NodeType Type) const
 
template<typename TNodeType >
const TNodeTypeTryGetFirstAttributeOfType () const
 
UE_API void PrependAux (const TSRef< Node > &AuxChild)
 
UE_API void PrependAux (const NodeArray &AuxChildren)
 
UE_API void AppendAux (const TSRef< Node > &AuxChild)
 
UE_API void AppendAux (const NodeArray &AuxChildren)
 
UE_API void AppendAuxAt (const TSRef< Node > &AuxChild, int32_t Idx)
 
const TSPtr< Clause > & GetAux () const
 
UE_API void SetAux (const TSRef< Clause > &Aux)
 
void RemoveAux ()
 
UE_API void AppendPrefixComment (const TSRef< Node > &CommentNode)
 
UE_API void AppendPrefixComment (TSRef< Node > &&CommentNode)
 
UE_API void AppendPrefixComments (const NodeArray &CommentNodes)
 
UE_API void AppendPostfixComment (const TSRef< Node > &CommentNode)
 
UE_API void AppendPostfixComment (TSRef< Node > &&CommentNode)
 
UE_API void AppendPostfixComments (const NodeArray &CommentNodes)
 
const NodeArrayGetPrefixComments () const
 
const NodeArrayGetPostfixComments () const
 
NodeArrayAccessPrefixComments ()
 
NodeArrayAccessPostfixComments ()
 
void SetWhence (const SLocus &Whence)
 
void CombineWhenceWith (const SLocus &Whence)
 
const SLocusWhence () const
 
UE_API const CUTF8StringGetSnippetPath () const
 
UE_API const SnippetFindSnippetByFilePath (const CUTF8StringView &FilePath) const
 
UE_API const NodeFindChildByPosition (const SPosition &TextPosition) const
 
UE_API const TSRef< NodeFindChildClosestToPosition (const SPosition &TextPosition, const SIndexedSourceText &SourceText) const
 
const NodeInfoGetElementInfo () const
 
const ChTypeGetElementName () const
 
int32_t GetPrecedence () const
 
int32_t NumRequiredChildren () const
 
ESupportsManyChildren IsManyChildrenSupported () const
 
int32_t NumNewLinesBefore () const
 
void SetNumNewLinesBefore (const int32_t Num)
 
int32_t NumNewLinesAfter () const
 
void SetNumNewLinesAfter (const int32_t Num)
 
void SetNewLineAfter (const bool bNewLineAfter)
 
bool HasNewLineAfter () const
 
bool HasNewLinesBefore () const
 
bool IsEmpty () const
 
const NodeArrayGetChildren () const
 
NodeArrayAccessChildren ()
 
NodeArray TakeChildren ()
 
TSPtr< NodeGetRightmostChild () const
 
NodeAccessParent ()
 
TSRef< NodeGetSharedSelf ()
 
TSRef< NodeGetSharedSelf () const
 
const NodeGetParent () const
 
void SetParentInternal (TSRef< Node > InParent)
 
bool HasParent () const
 
template<class Type >
const TypeGetParentOfType () const
 
bool IsElementType (NodeType InType) const
 
UE_API const CAtomAsAtomNullable () const
 
bool IsChildElementType (int32_t idx, NodeType InType) const
 
bool IsError () const
 
void DebugOrphanCheck ()
 
bool Contains (const Node &Target, const bool bRecursive=true) const
 
int32_t FindPreviousSibling ()
 
const TSRef< Node > & AppendChild (const TSRef< Node > &child)
 
const TSRef< Node > & AppendChild (const TSRef< Node > &&child)
 
const TSRef< Node > & AppendChildAt (const TSRef< Node > &child, int32_t idx)
 
void SetChildAt (int32_t Index, TSRef< Node > Child)
 
TSRef< NodeTakeChildAt (int32_t idx, const TSPtr< Node > Replacement=TSPtr< Node >())
 
void AppendChildren (const uLang::TArray< TSRef< Node > > &Children, int32_t NumToAppend=-1)
 
void AppendChildren (const uLang::TSRefArray< Node > &Children, int32_t NumToAppend=-1)
 
void PrependChildren (const uLang::TArray< TSRef< Node > > &Children, int32_t NumToAppend=-1)
 
UE_API void ReplaceSelfWith (const TSRef< Node > &replacement)
 
UE_API bool RemoveFromParent (int32_t idx=uLang::IndexNone)
 
void Empty ()
 
const SnippetFindSnippet () const
 
NodeFindRoot ()
 
const uLang::CAstNodeGetMappedAstNode () const
 
UE_API void AddMapping (uLang::CAstNode *AstNode) const
 
UE_API void EnsureAuxAllocated ()
 
void SetTile (FTile *Tile)
 
FTileGetTile ()
 
virtual VERSECOMPILER_API TSRef< NodeCloneNode () const
 
void CloneNodeFields (Node *DestOther) const
 
- Public Member Functions inherited from uLang::CSharedMix
 CSharedMix ()
 
virtual UE_API ~CSharedMix ()
 
 CSharedMix (const CSharedMix &Other)=delete
 
CSharedMixoperator= (const CSharedMix &Other)=delete
 
uint32_t GetRefCount () const
 

Static Public Member Functions

static SLocus CombineLocii (const NodeArray &Nodes)
 
template<class VisitPolicy , typename ReturnType = void>
static void VisitWith (const TSRef< Vst::Node > &node, VisitPolicy &visit_policy)
 
static void TransferChildren (const TSRef< Node > &From, const TSRef< Node > &To, int32_t First, int32_t Last)
 
static void TransferChildren (const TSRef< Node > &From, const TSRef< Node > &To)
 
static void TransferPrefixComments (const TSRef< Node > &From, const TSRef< Node > &To)
 
static void TransferPostfixComments (const TSRef< Node > &From, const TSRef< Node > &To)
 
static UE_API void RemoveMapping (uLang::CAstNode *AstNode)
 

Protected Member Functions

void DropParent (const TSRef< Node > &Child)
 
void AppendChildInternal (const TSRef< Node > &child)
 
void AppendChildInternal (TSRef< Node > &&child)
 

Static Protected Member Functions

static const NodeFindOrphanedNode (const Node &InNode)
 
- Static Protected Member Functions inherited from uLang::CSharedMix
template<class ObjectType >
static TSPtrG< ObjectType, false, CHeapRawAllocatorSharedThis (ObjectType *This)
 
template<class ObjectType >
static TSPtrG< const ObjectType, false, CHeapRawAllocatorSharedThis (const ObjectType *This)
 

Protected Attributes

NodeArray _Children
 
Node_Parent
 
TSPtr< Clause_Aux
 
NodeArray _PreComments
 
NodeArray _PostComments
 
SLocus _Whence
 
int32_t _NumNewLinesBefore
 The number of trailing newlines that should follow this node.
 
int32_t _NumNewLinesAfter
 
uint8_t _Tag
 
NodeType _Type
 
const uLang::CAstNode_MappedAstNode
 
FTile_Tile
 

Friends

class uLang::CAstNode
 

Member Typedef Documentation

◆ NodeArray

Constructor & Destructor Documentation

◆ Node() [1/3]

Verse::Vst::Node::Node ( )
inline

◆ Node() [2/3]

Verse::Vst::Node::Node ( NodeType  in_type)
inline

◆ Node() [3/3]

Verse::Vst::Node::Node ( NodeType  in_type,
const SLocus whence 
)
inline

◆ ~Node()

Verse::Vst::Node::~Node ( )
virtual

Member Function Documentation

◆ AccessChildren()

NodeArray & Verse::Vst::Node::AccessChildren ( )
inline

◆ AccessParent()

Node * Verse::Vst::Node::AccessParent ( )
inline

◆ AccessPostfixComments()

NodeArray & Verse::Vst::Node::AccessPostfixComments ( )
inline

◆ AccessPrefixComments()

NodeArray & Verse::Vst::Node::AccessPrefixComments ( )
inline

◆ AddMapping()

void Verse::Vst::Node::AddMapping ( uLang::CAstNode AstNode) const

◆ AppendAux() [1/2]

void Verse::Vst::Node::AppendAux ( const NodeArray AuxChildren)

◆ AppendAux() [2/2]

void Verse::Vst::Node::AppendAux ( const TSRef< Node > &  AuxChild)

◆ AppendAuxAt()

void Verse::Vst::Node::AppendAuxAt ( const TSRef< Node > &  AuxChild,
int32_t  Idx 
)

◆ AppendChild() [1/2]

const TSRef< Node > & Verse::Vst::Node::AppendChild ( const TSRef< Node > &&  child)
inline

◆ AppendChild() [2/2]

const TSRef< Node > & Verse::Vst::Node::AppendChild ( const TSRef< Node > &  child)
inline

◆ AppendChildAt()

const TSRef< Node > & Verse::Vst::Node::AppendChildAt ( const TSRef< Node > &  child,
int32_t  idx 
)
inline

◆ AppendChildInternal() [1/2]

void Verse::Vst::Node::AppendChildInternal ( const TSRef< Node > &  child)
inlineprotected

◆ AppendChildInternal() [2/2]

void Verse::Vst::Node::AppendChildInternal ( TSRef< Node > &&  child)
inlineprotected

◆ AppendChildren() [1/2]

void Verse::Vst::Node::AppendChildren ( const uLang::TArray< TSRef< Node > > &  Children,
int32_t  NumToAppend = -1 
)
inline

◆ AppendChildren() [2/2]

void Verse::Vst::Node::AppendChildren ( const uLang::TSRefArray< Node > &  Children,
int32_t  NumToAppend = -1 
)
inline

◆ AppendPostfixComment() [1/2]

void Verse::Vst::Node::AppendPostfixComment ( const TSRef< Node > &  CommentNode)

◆ AppendPostfixComment() [2/2]

void Verse::Vst::Node::AppendPostfixComment ( TSRef< Node > &&  CommentNode)

◆ AppendPostfixComments()

void Verse::Vst::Node::AppendPostfixComments ( const NodeArray CommentNodes)

◆ AppendPrefixComment() [1/2]

void Verse::Vst::Node::AppendPrefixComment ( const TSRef< Node > &  CommentNode)

◆ AppendPrefixComment() [2/2]

void Verse::Vst::Node::AppendPrefixComment ( TSRef< Node > &&  CommentNode)

◆ AppendPrefixComments()

void Verse::Vst::Node::AppendPrefixComments ( const NodeArray CommentNodes)

◆ As() [1/2]

template<typename TNodeType >
TNodeType & Verse::Vst::Node::As ( )
inline

◆ As() [2/2]

template<typename TNodeType >
const TNodeType & Verse::Vst::Node::As ( ) const
inline

◆ AsAtomNullable()

const CAtom * Verse::Vst::Node::AsAtomNullable ( ) const

◆ AsNullable() [1/2]

template<typename TNodeType >
TNodeType * Verse::Vst::Node::AsNullable ( )
inline

◆ AsNullable() [2/2]

template<typename TNodeType >
const TNodeType * Verse::Vst::Node::AsNullable ( ) const
inline

◆ AsShared()

TSRef< Node > Verse::Vst::Node::AsShared ( )
inline

◆ CloneNode()

◆ CloneNodeFields()

void Verse::Vst::Node::CloneNodeFields ( Node DestOther) const

◆ CombineLocii()

static SLocus Verse::Vst::Node::CombineLocii ( const NodeArray Nodes)
inlinestatic

◆ CombineWhenceWith()

void Verse::Vst::Node::CombineWhenceWith ( const SLocus Whence)
inline

◆ Contains()

bool Verse::Vst::Node::Contains ( const Node Target,
const bool  bRecursive = true 
) const
inline

◆ DebugOrphanCheck()

void Verse::Vst::Node::DebugOrphanCheck ( )
inline

◆ DropParent()

void Verse::Vst::Node::DropParent ( const TSRef< Node > &  Child)
inlineprotected

Validates that the child being added to this node is currently orphaned. If the child has a parent, then two nodes would own the same child, which is impossible.

◆ Empty()

void Verse::Vst::Node::Empty ( )
inline

◆ EnsureAuxAllocated()

void Verse::Vst::Node::EnsureAuxAllocated ( )

◆ FindChildByPosition()

const Node * Verse::Vst::Node::FindChildByPosition ( const SPosition TextPosition) const

◆ FindChildClosestToPosition()

const TSRef< Node > Verse::Vst::Node::FindChildClosestToPosition ( const SPosition TextPosition,
const SIndexedSourceText SourceText 
) const

◆ FindOrphanedNode()

static const Node * Verse::Vst::Node::FindOrphanedNode ( const Node InNode)
inlinestaticprotected

Checks for any nodes that have their parent set incorrectly within the hierarchy.

Parameters
RootA pointer to the root of the tree to inspect for any orphaned nodes.
Returns
A pointer to the first node that was found to have an incorrect parent set. If no such node was found, returns nullptr.

◆ FindPreviousSibling()

int32_t Verse::Vst::Node::FindPreviousSibling ( )
inline

◆ FindRoot()

Node * Verse::Vst::Node::FindRoot ( )
inline

◆ FindSnippet()

const Snippet * Verse::Vst::Node::FindSnippet ( ) const
inline

◆ FindSnippetByFilePath()

const Snippet * Verse::Vst::Node::FindSnippetByFilePath ( const CUTF8StringView FilePath) const

◆ GetAttributeIdentifier()

const Identifier * Verse::Vst::Node::GetAttributeIdentifier ( const CUTF8StringView AttributeName) const

◆ GetAux()

const TSPtr< Clause > & Verse::Vst::Node::GetAux ( ) const
inline

◆ GetChildCount()

int Verse::Vst::Node::GetChildCount ( ) const
inline

◆ GetChildren()

const NodeArray & Verse::Vst::Node::GetChildren ( ) const
inline

◆ GetElementInfo()

const NodeInfo & Verse::Vst::Node::GetElementInfo ( ) const
inline

◆ GetElementName()

const ChType * Verse::Vst::Node::GetElementName ( ) const
inline

◆ GetElementType()

NodeType Verse::Vst::Node::GetElementType ( ) const
inline

◆ GetElementTypeInt()

int32_t Verse::Vst::Node::GetElementTypeInt ( ) const
inline

◆ GetMappedAstNode()

const uLang::CAstNode * Verse::Vst::Node::GetMappedAstNode ( ) const
inline

◆ GetParent()

const Node * Verse::Vst::Node::GetParent ( ) const
inline

◆ GetParentOfType()

template<class Type >
const Type * Verse::Vst::Node::GetParentOfType ( ) const
inline

◆ GetPostfixComments()

const NodeArray & Verse::Vst::Node::GetPostfixComments ( ) const
inline

◆ GetPrecedence()

int32_t Verse::Vst::Node::GetPrecedence ( ) const
inline

◆ GetPrefixComments()

const NodeArray & Verse::Vst::Node::GetPrefixComments ( ) const
inline

◆ GetRightmostChild()

TSPtr< Node > Verse::Vst::Node::GetRightmostChild ( ) const
inline

◆ GetSharedSelf() [1/2]

TSRef< Node > Verse::Vst::Node::GetSharedSelf ( )
inline

◆ GetSharedSelf() [2/2]

TSRef< Node > Verse::Vst::Node::GetSharedSelf ( ) const
inline

◆ GetSnippetPath()

const CUTF8String & Verse::Vst::Node::GetSnippetPath ( ) const

◆ GetTag()

template<typename OpType >
OpType Verse::Vst::Node::GetTag ( ) const
inline

◆ GetTile()

FTile * Verse::Vst::Node::GetTile ( )
inline

◆ HasAttributes()

bool Verse::Vst::Node::HasAttributes ( ) const

◆ HasNewLineAfter()

bool Verse::Vst::Node::HasNewLineAfter ( ) const
inline

◆ HasNewLinesBefore()

bool Verse::Vst::Node::HasNewLinesBefore ( ) const
inline

◆ HasParent()

bool Verse::Vst::Node::HasParent ( ) const
inline

◆ IsA()

template<typename TNodeType >
bool Verse::Vst::Node::IsA ( ) const
inline

◆ IsAttributePresent()

bool Verse::Vst::Node::IsAttributePresent ( const CUTF8StringView AttributeName) const

◆ IsChildElementType()

bool Verse::Vst::Node::IsChildElementType ( int32_t  idx,
NodeType  InType 
) const
inline

◆ IsElementType()

bool Verse::Vst::Node::IsElementType ( NodeType  InType) const
inline

◆ IsEmpty()

bool Verse::Vst::Node::IsEmpty ( ) const
inline

◆ IsError()

bool Verse::Vst::Node::IsError ( ) const
inline

◆ IsManyChildrenSupported()

ESupportsManyChildren Verse::Vst::Node::IsManyChildrenSupported ( ) const
inline

◆ NumNewLinesAfter()

int32_t Verse::Vst::Node::NumNewLinesAfter ( ) const
inline

◆ NumNewLinesBefore()

int32_t Verse::Vst::Node::NumNewLinesBefore ( ) const
inline

◆ NumRequiredChildren()

int32_t Verse::Vst::Node::NumRequiredChildren ( ) const
inline

◆ PrependAux() [1/2]

void Verse::Vst::Node::PrependAux ( const NodeArray AuxChildren)

◆ PrependAux() [2/2]

void Verse::Vst::Node::PrependAux ( const TSRef< Node > &  AuxChild)

◆ PrependChildren()

void Verse::Vst::Node::PrependChildren ( const uLang::TArray< TSRef< Node > > &  Children,
int32_t  NumToAppend = -1 
)
inline

◆ RemoveAux()

void Verse::Vst::Node::RemoveAux ( )
inline

◆ RemoveFromParent()

bool Verse::Vst::Node::RemoveFromParent ( int32_t  idx = uLang::IndexNone)

◆ RemoveMapping()

void Verse::Vst::Node::RemoveMapping ( uLang::CAstNode AstNode)
static

◆ ReplaceSelfWith()

void Verse::Vst::Node::ReplaceSelfWith ( const TSRef< Node > &  replacement)

◆ SetAux()

void Verse::Vst::Node::SetAux ( const TSRef< Clause > &  Aux)

◆ SetChildAt()

void Verse::Vst::Node::SetChildAt ( int32_t  Index,
TSRef< Node Child 
)
inline

◆ SetNewLineAfter()

void Verse::Vst::Node::SetNewLineAfter ( const bool  bNewLineAfter)
inline

◆ SetNumNewLinesAfter()

void Verse::Vst::Node::SetNumNewLinesAfter ( const int32_t  Num)
inline

◆ SetNumNewLinesBefore()

void Verse::Vst::Node::SetNumNewLinesBefore ( const int32_t  Num)
inline

◆ SetParentInternal()

void Verse::Vst::Node::SetParentInternal ( TSRef< Node InParent)
inline

◆ SetTag()

template<typename OpType = uint8_t>
void Verse::Vst::Node::SetTag ( OpType  in_op)
inline

◆ SetTile()

void Verse::Vst::Node::SetTile ( FTile Tile)
inline

◆ SetWhence()

void Verse::Vst::Node::SetWhence ( const SLocus Whence)
inline

◆ TakeChildAt()

TSRef< Node > Verse::Vst::Node::TakeChildAt ( int32_t  idx,
const TSPtr< Node Replacement = TSPtr<Node>() 
)
inline

◆ TakeChildren()

NodeArray Verse::Vst::Node::TakeChildren ( )
inline

◆ TransferChildren() [1/2]

static void Verse::Vst::Node::TransferChildren ( const TSRef< Node > &  From,
const TSRef< Node > &  To 
)
inlinestatic

◆ TransferChildren() [2/2]

static void Verse::Vst::Node::TransferChildren ( const TSRef< Node > &  From,
const TSRef< Node > &  To,
int32_t  First,
int32_t  Last 
)
inlinestatic

◆ TransferPostfixComments()

static void Verse::Vst::Node::TransferPostfixComments ( const TSRef< Node > &  From,
const TSRef< Node > &  To 
)
inlinestatic

◆ TransferPrefixComments()

static void Verse::Vst::Node::TransferPrefixComments ( const TSRef< Node > &  From,
const TSRef< Node > &  To 
)
inlinestatic

◆ TryGetFirstAttributeOfType() [1/2]

template<typename TNodeType >
const TNodeType * Verse::Vst::Node::TryGetFirstAttributeOfType ( ) const
inline

◆ TryGetFirstAttributeOfType() [2/2]

const Node * Verse::Vst::Node::TryGetFirstAttributeOfType ( NodeType  Type) const

◆ VisitWith()

template<class VisitPolicy , typename ReturnType >
void Verse::Vst::Node::VisitWith ( const TSRef< Vst::Node > &  node,
VisitPolicy visit_policy 
)
static

WHY THIS DESIGN ?

(1) Readability. All the pretty printing code is co-located. It is easier to work on and to understand. (2) Design flexibility: Policy Pattern lets pipeline stages live outside of the node class.

e.g. The PrettyPrinter is easier to understand because you can read and step through the code without leaving a single file. The implementation can live in a Toolchain module. You can easily swap out to a different pretty printer implementation without touching the Vst nodes.

If changing this design (perhaps to improve performance), make sure to preserve both properties.

NEEDS IMPROVEMENT

When implementing a VisitPolicy, a programmer must implement every method for every type. This is not necessarily desirable. Especially true for certain semantic compiler passes.

◆ Whence()

const SLocus & Verse::Vst::Node::Whence ( ) const
inline

Friends And Related Symbol Documentation

◆ uLang::CAstNode

friend class uLang::CAstNode
friend

Member Data Documentation

◆ _Aux

TSPtr<Clause> Verse::Vst::Node::_Aux
protected

Auxiliary data such as attributes associated with this VstNode. The transaction system addresses this via child index -1.

◆ _Children

NodeArray Verse::Vst::Node::_Children
protected

◆ _MappedAstNode

const uLang::CAstNode* Verse::Vst::Node::_MappedAstNode
mutableprotected

◆ _NumNewLinesAfter

int32_t Verse::Vst::Node::_NumNewLinesAfter
protected

◆ _NumNewLinesBefore

int32_t Verse::Vst::Node::_NumNewLinesBefore
protected

The number of trailing newlines that should follow this node.

◆ _Parent

Node* Verse::Vst::Node::_Parent
protected

VstNodes point at their parent. We guarantee that a VstNode can only exist in one place in the Vst tree at a time, so the Parent<->Child relationship is unique.

◆ _PostComments

NodeArray Verse::Vst::Node::_PostComments
protected

◆ _PreComments

NodeArray Verse::Vst::Node::_PreComments
protected

◆ _Tag

uint8_t Verse::Vst::Node::_Tag
protected

Describes the role of this node in the context of its parent. e.g. Children of BinaryOpAddSub are tagged as Operator or Operand

◆ _Tile

FTile* Verse::Vst::Node::_Tile
protected

◆ _Type

NodeType Verse::Vst::Node::_Type
protected

Runtime type information about this node

◆ _Whence

SLocus Verse::Vst::Node::_Whence
protected

Text location from whence this node was parsed. (1) must be contained in (= not be partially outside of) parent's _Whence; (2) must not overlap any sibling's _Whence; (3) snippets (text files), programs, and some modules will not have a valid locus


The documentation for this struct was generated from the following files: