GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Find the type of the expression or sub-expression that a given node represents. More...
#include <ExpressionTypeFinder.h>
Inherits gd::ExpressionParser2NodeWorker.
Static Public Member Functions | |
static const gd::String | GetType (const gd::Platform &platform, const gd::ProjectScopedContainers &projectScopedContainers, const gd::String &rootType, gd::ExpressionNode &node) |
Helper function to find the type of the expression or sub-expression that a given node represents. | |
Protected Member Functions | |
ExpressionTypeFinder (const gd::Platform &platform_, const gd::ProjectScopedContainers &projectScopedContainers_, const gd::String &rootType_) | |
const gd::String & | GetType () |
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 | OnVisitIdentifierNode (IdentifierNode &node) override |
void | OnVisitEmptyNode (EmptyNode &node) override |
void | OnVisitObjectFunctionNameNode (ObjectFunctionNameNode &node) override |
void | OnVisitVariableBracketAccessorNode (VariableBracketAccessorNode &node) override |
void | OnVisitFunctionCallNode (FunctionCallNode &node) override |
Find the type of the expression or sub-expression that a given node represents.
The type returned by this worker is a mix of:
This logic was built with the constraint of following a parser that can't know the right side. Now that it is extracted, it could be enhanced if needed.