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::ExpressionValidator Class Reference

Validate that an expression is properly written by returning any error attached to the nodes during parsing. More...

#include <ExpressionValidator.h>

Inherits gd::ExpressionParser2NodeWorker.

Public Member Functions

 ExpressionValidator (const gd::Platform &platform_, const gd::ProjectScopedContainers &projectScopedContainers_, const gd::String &rootType_, const gd::String &extraInfo_="")
 
const std::vector< ExpressionParserError * > & GetFatalErrors ()
 Get only the fatal errors. More...
 
const std::vector< ExpressionParserError * > & GetAllErrors ()
 Get all the errors. More...
 

Static Public Member Functions

static bool HasNoErrors (const gd::Platform &platform, const gd::ProjectScopedContainers &projectScopedContainers, const gd::String &rootType, gd::ExpressionNode &node)
 Helper function to check if a given node does not contain any error including non-fatal ones.
 

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

Validate that an expression is properly written by returning any error attached to the nodes during parsing.

See also
gd::ExpressionParser2

Member Function Documentation

◆ GetAllErrors()

const std::vector<ExpressionParserError*>& gd::ExpressionValidator::GetAllErrors ( )
inline

Get all the errors.

No errors means that the expression is valid.

◆ GetFatalErrors()

const std::vector<ExpressionParserError*>& gd::ExpressionValidator::GetFatalErrors ( )
inline

Get only the fatal errors.

Expressions with fatal error can't be generated.


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