6 #if defined(GD_IDE_ONLY)
7 #ifndef GDCORE_ExpressionCodeGenerator_H
8 #define GDCORE_ExpressionCodeGenerator_H
12 #include "GDCore/Events/Parsers/ExpressionParser2Node.h"
13 #include "GDCore/Events/Parsers/ExpressionParser2NodeWorker.h"
14 #include "GDCore/String.h"
17 class ObjectsContainer;
19 class ParameterMetadata;
20 class ExpressionMetadata;
21 class EventsCodeGenerationContext;
22 class EventsCodeGenerator;
41 : rootType(rootType_), rootObjectName(rootObjectName_), codeGenerator(codeGenerator_), context(context_){};
65 const gd::String& GetOutput() {
return output; };
71 void OnVisitNumberNode(
NumberNode& node)
override;
72 void OnVisitTextNode(
TextNode& node)
override;
75 void OnVisitVariableBracketAccessorNode(
80 void OnVisitEmptyNode(
EmptyNode& node)
override;
84 const std::vector<std::unique_ptr<ExpressionNode>>& parameters,
89 const std::vector<std::unique_ptr<ExpressionNode>>& parameters,
95 const std::vector<std::unique_ptr<ExpressionNode>>& parameters,
98 const std::vector<std::unique_ptr<ExpressionNode>>& parameters,
100 size_t initialParameterIndex);
102 static std::vector<gd::Expression> PrintParameters(
103 const std::vector<std::unique_ptr<ExpressionNode>>& parameters);
106 gd::String objectNameToUseForVariableAccessor;
Used to manage the context when generating code for events.
Definition: EventsCodeGenerationContext.h:27
Internal class used to generate code from events.
Definition: EventsCodeGenerator.h:41
Generate code for a parsed expression.
Definition: ExpressionCodeGenerator.h:35
Class representing an expression used as a parameter of a gd::Instruction. This class is nothing more...
Definition: Expression.h:30
The interface for any worker class ("visitor" pattern) that want to interact with the nodes of a pars...
Definition: ExpressionParser2NodeWorker.h:36
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24
An empty node, used when parsing failed/a syntax error was encountered and any other node could not m...
Definition: ExpressionParser2Node.h:423
A function call node (either free function, object function or object behavior function)....
Definition: ExpressionParser2Node.h:371
An identifier node, usually representing an object or a variable with an optional function name or ch...
Definition: ExpressionParser2Node.h:204
A number node. For example: "123". Its type is always "number".
Definition: ExpressionParser2Node.h:161
The name of a function to call on an object or the behavior For example: "MyObject....
Definition: ExpressionParser2Node.h:321
An operator node. For example: "lhs + rhs".
Definition: ExpressionParser2Node.h:129
Definition: ExpressionParser2Node.h:115
A text node. For example: "Hello World". Its type is always "string".
Definition: ExpressionParser2Node.h:177
A unary operator node. For example: "-2".
Definition: ExpressionParser2Node.h:145
A direct accessor to a child variable. Example: MyChild in MyVariable.MyChild.
Definition: ExpressionParser2Node.h:282
A bracket accessor to a child variable. Example: ["MyChild"] (in MyVariable["MyChild"]).
Definition: ExpressionParser2Node.h:300
A variable, or object variable, with bracket accessor or at least 2 "dot" accessors.
Definition: ExpressionParser2Node.h:261