GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
|
Parse an expression, returning a tree of node corresponding to the parsed expression. More...
#include <ExpressionParser2.h>
Public Member Functions | |
std::unique_ptr< ExpressionNode > | ParseExpression (const gd::String &expression_) |
Static Public Member Functions | |
static size_t | WrittenParametersFirstIndex (const gd::String &objectName, const gd::String &behaviorName) |
Parse an expression, returning a tree of node corresponding to the parsed expression.
This is a LL(1) parser. This could be extracted to a generic/reusable parser by refactoring out the dependency on gd::MetadataProvider (injecting instead functions to be called to query supported functions).
|
inline |
Parse the given expression into a tree of nodes.
expression | The expression to parse. |
|
inlinestatic |
Given an object name (or empty if none) and a behavior name (or empty if none), return the index of the first parameter that is inside the parenthesis: 0, 1 or 2.
For example, in an expression like Object.MyBehavior::Method("hello")
, the parameter "hello" is the second parameter (the first being by convention Object, and the second MyBehavior, also by convention).