GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
gd::ExpressionNodeLocationFinder Class Reference

Find the deepest node at the specified location in an expression. More...

#include <ExpressionNodeLocationFinder.h>

Inherits gd::ExpressionParser2NodeWorker.

Public Member Functions

 ExpressionNodeLocationFinder (size_t searchedPosition_)
 Initialize the finder to search at the specified position.
 
ExpressionNodeGetNode ()
 Return the deepest node found at the search position, if any.
 
ExpressionNodeGetParentNode ()
 Return the parent of deepest node found at the search position, if any.
 

Static Public Member Functions

static ExpressionNodeGetNodeAtPosition (gd::ExpressionNode &node, size_t searchedPosition)
 Helper function to find the deepest node at the search position, if any.
 
static ExpressionNodeGetParentNodeAtPosition (gd::ExpressionNode &node, size_t searchedPosition)
 Helper function to find the parent of the deepest node at the search position, if any. More...
 

Protected Member Functions

void OnVisitSubExpressionNode (SubExpressionNode &node) override
 
void OnVisitOperatorNode (OperatorNode &node) override
 
void OnVisitUnaryOperatorNode (UnaryOperatorNode &node) override
 
void OnVisitNumberNode (NumberNode &node) override
 
void OnVisitTextNode (TextNode &node) override
 
void OnVisitVariableNode (VariableNode &node) override
 
void OnVisitVariableAccessorNode (VariableAccessorNode &node) override
 
void OnVisitVariableBracketAccessorNode (VariableBracketAccessorNode &node) override
 
void OnVisitIdentifierNode (IdentifierNode &node) override
 
void OnVisitObjectFunctionNameNode (ObjectFunctionNameNode &node) override
 
void OnVisitFunctionCallNode (FunctionCallNode &node) override
 
void OnVisitEmptyNode (EmptyNode &node) override
 

Detailed Description

Find the deepest node at the specified location in an expression.

See also
gd::ExpressionParser2

Member Function Documentation

◆ GetParentNodeAtPosition()

static ExpressionNode* gd::ExpressionNodeLocationFinder::GetParentNodeAtPosition ( gd::ExpressionNode node,
size_t  searchedPosition 
)
inlinestatic

Helper function to find the parent of the deepest node at the search position, if any.

Warning
Useful for tests. In other cases, prefer using GetParentNode.

The documentation for this class was generated from the following file: