|
| EventsCodeGenerator (const gd::Project &project_, const gd::Layout &layout, const gd::Platform &platform_) |
| Construct a code generator for the specified platform/project/layout.
|
|
| EventsCodeGenerator (const gd::Platform &platform, const gd::ProjectScopedContainers &projectScopedContainers_) |
| Construct a code generator for the specified objects/groups and platform.
|
|
void | PreprocessEventList (gd::EventsList &listEvent) |
| Preprocess an events list (replacing for example links with the linked events). More...
|
|
virtual gd::String | GenerateEventsListCode (gd::EventsList &events, EventsCodeGenerationContext &context) |
| Generate code for executing an event list. More...
|
|
virtual gd::String | GenerateConditionsListCode (gd::InstructionsList &conditions, EventsCodeGenerationContext &context) |
| Generate code for executing a condition list. More...
|
|
virtual gd::String | GenerateActionsListCode (gd::InstructionsList &actions, EventsCodeGenerationContext &context) |
| Generate code for executing an action list. More...
|
|
std::vector< gd::String > | GenerateParametersCodes (const std::vector< gd::Expression > ¶meters, const ParameterMetadataContainer ¶metersInfo, EventsCodeGenerationContext &context, std::vector< std::pair< gd::String, gd::String > > *supplementaryParametersTypes=0) |
| Generate the code for a parameter of an action/condition/expression. More...
|
|
gd::String | GenerateConditionCode (gd::Instruction &condition, gd::String returnBoolean, EventsCodeGenerationContext &context) |
| Generate code for a single condition. More...
|
|
gd::String | GenerateActionCode (gd::Instruction &action, EventsCodeGenerationContext &context, const gd::String &optionalAsyncCallbackName="") |
| Generate code for a single action. More...
|
|
virtual const CallbackDescriptor | GenerateCallback (const gd::String &callbackFunctionName, gd::EventsCodeGenerationContext &parentContext, gd::InstructionsList &actions, gd::EventsList *subEvents=nullptr) |
| Generates actions and events as a callback. More...
|
|
const gd::String | GenerateEventsParameters (const gd::EventsCodeGenerationContext &context) |
| Generates the parameters list of an event's generated function.
|
|
virtual gd::String | GenerateObjectsDeclarationCode (EventsCodeGenerationContext &context) |
| Generate code for declaring objects lists. More...
|
|
void | AddIncludeFile (gd::String file) |
| Declare an include file to be added. More...
|
|
void | AddIncludeFiles (std::vector< gd::String > files) |
| Declare a list of include files to be added. More...
|
|
void | AddGlobalDeclaration (gd::String declaration) |
| Add a declaration which will be inserted after includes.
|
|
void | AddCustomCodeOutsideMain (gd::String code) |
| Add some code before events outside the main function.
|
|
const std::set< gd::String > & | GetIncludeFiles () const |
| Get the set containing the include files.
|
|
const gd::String & | GetCustomCodeOutsideMain () const |
| Get the custom code to be inserted outside main.
|
|
const std::set< gd::String > & | GetCustomGlobalDeclaration () const |
| Get the custom declaration to be inserted after includes.
|
|
bool | GenerateCodeForRuntime () |
| Return true if code generation is made for runtime only.
|
|
void | SetGenerateCodeForRuntime (bool compilationForRuntime_) |
| Set if the code generated is meant to be used for runtime only and not in the IDE.
|
|
void | ReportError () |
| Report that an error occurred during code generation ( Event code won't be generated )
|
|
bool | ErrorOccurred () const |
| Return true if an error has occurred during code generation (in this case, generated code is not usable). More...
|
|
const gd::ObjectsContainersList & | GetObjectsContainersList () const |
|
const gd::ProjectScopedContainers & | GetProjectScopedContainers () const |
|
gd::ProjectScopedContainers & | GetProjectScopedContainers () |
| Give access to the project scoped containers as code generation might push and pop variable containers (for local variables). This could be passed as a parameter recursively in code generation, but this requires heavy refactoring. Instead, we use this single instance.
|
|
bool | HasProjectAndLayout () const |
| Return true if the code generation is done for a given project and layout. If not, this means that the code is generated for a function.
|
|
const gd::Project & | GetProject () const |
| Get the project the code is being generated for. More...
|
|
const gd::Layout & | GetLayout () const |
| Get the layout the code is being generated for. More...
|
|
const gd::Platform & | GetPlatform () const |
| Get the platform the code is being generated for.
|
|
size_t | GetMaxCustomConditionsDepth () const |
| Get the maximum depth of custom conditions reached during code generation.
|
|
size_t | GetMaxConditionsListsSize () const |
| Get the maximum size of a list of conditions.
|
|
void | SetDiagnosticReport (gd::DiagnosticReport *diagnosticReport_) |
|
gd::DiagnosticReport * | GetDiagnosticReport () |
|
virtual gd::String | GenerateBooleanFullName (const gd::String &boolName, const gd::EventsCodeGenerationContext &context) |
| Generate the full name for accessing to a boolean variable used for conditions. More...
|
|
virtual gd::String | GenerateUpperScopeBooleanFullName (const gd::String &boolName, const gd::EventsCodeGenerationContext &context) |
| Generate the full name for accessing to a boolean variable used for conditions. More...
|
|
virtual gd::String | GenerateBooleanInitializationToFalse (const gd::String &boolName, const gd::EventsCodeGenerationContext &context) |
| Must create a boolean. Its value must be false. More...
|
|
virtual gd::String | GetObjectListName (const gd::String &name, const gd::EventsCodeGenerationContext &context) |
| Get the full name for accessing to a list of objects. More...
|
|
virtual gd::String | GenerateProfilerSectionBegin (const gd::String §ion) |
| Generate the code to notify the profiler of the beginning of a section.
|
|
virtual gd::String | GenerateProfilerSectionEnd (const gd::String §ion) |
| Generate the code to notify the profiler of the end of a section.
|
|
virtual gd::String | GetCodeNamespaceAccessor () |
| Get the namespace to be used to store code generated objects/values/functions, with the extra "dot" at the end to be used to access to a property/member. More...
|
|
virtual gd::String | GetCodeNamespace () |
| Get the namespace to be used to store code generated objects/values/functions. More...
|
|
size_t | GenerateSingleUsageUniqueIdFor (const gd::Instruction *instruction) |
|
size_t | GenerateSingleUsageUniqueIdForEventsList () |
|
virtual gd::String | GenerateRelationalOperation (const gd::String &relationalOperator, const gd::String &lhs, const gd::String &rhs) |
| Generate a relational operation. More...
|
|
virtual gd::String | GenerateLocalVariablesStackAccessor () |
| Generate the code to access the local variables stack.
|
|
gd::String | GenerateAnyOrSceneVariableGetter (const gd::Expression &variableExpression, EventsCodeGenerationContext &context) |
| Generate an any variable getter that fallbacks on scene variable for compatibility reason.
|
|
|
virtual const gd::String | GenerateRelationalOperatorCodes (const gd::String &operatorString) |
|
virtual gd::String | GenerateParameterCodes (const gd::Expression ¶meter, const gd::ParameterMetadata &metadata, gd::EventsCodeGenerationContext &context, const gd::String &lastObjectName, std::vector< std::pair< gd::String, gd::String > > *supplementaryParametersTypes) |
| Generate the code for a single parameter. More...
|
|
virtual gd::String | GenerateGetVariable (const gd::String &variableName, const VariableScope &scope, gd::EventsCodeGenerationContext &context, const gd::String &objectName) |
| Generate the code to get a variable.
|
|
virtual gd::String | GenerateVariableAccessor (gd::String childName) |
| Generate the code to get the child of a variable.
|
|
virtual gd::String | GenerateVariableValueAs (const gd::String &type) |
|
virtual gd::String | GenerateVariableBracketAccessor (gd::String expressionCode) |
| Generate the code to get the child of a variable, using generated the expression.
|
|
virtual gd::String | GenerateBadVariable () |
| Generate the code to reference a variable which is in an empty/null state.
|
|
virtual gd::String | GenerateObject (const gd::String &objectName, const gd::String &type, gd::EventsCodeGenerationContext &context) |
| Generate the code to reference an object. More...
|
|
virtual gd::String | GeneratePropertyGetter (const gd::PropertiesContainer &propertiesContainer, const gd::NamedPropertyDescriptor &property, const gd::String &type, gd::EventsCodeGenerationContext &context) |
|
virtual gd::String | GenerateParameterGetter (const gd::ParameterMetadata ¶meter, const gd::String &type, gd::EventsCodeGenerationContext &context) |
|
virtual gd::String | GenerateBadObject () |
| Generate the code to reference an object which is in an empty/null state.
|
|
virtual gd::String | GenerateObjectFunctionCall (gd::String objectListName, const ObjectMetadata &objMetadata, const gd::ExpressionCodeGenerationInformation &codeInfo, gd::String parametersStr, gd::String defaultOutput, gd::EventsCodeGenerationContext &context) |
| Call a function of the current object. More...
|
|
virtual gd::String | GenerateObjectBehaviorFunctionCall (gd::String objectListName, gd::String behaviorName, const gd::BehaviorMetadata &autoInfo, const gd::ExpressionCodeGenerationInformation &codeInfo, gd::String parametersStr, gd::String defaultOutput, gd::EventsCodeGenerationContext &context) |
| Call a function of a behavior of the current object. More...
|
|
virtual gd::String | GenerateScopeBegin (gd::EventsCodeGenerationContext &context, const gd::String &extraVariable="") |
| Called when a new scope must be entered. More...
|
|
virtual gd::String | GenerateScopeEnd (gd::EventsCodeGenerationContext &context, const gd::String &extraVariable="") |
| Called when a new must be ended. More...
|
|
virtual gd::String | GenerateNegatedPredicate (const gd::String &predicate) const |
| Must negate a predicate. More...
|
|
virtual gd::String | GenerateFreeCondition (const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, const gd::String &returnBoolean, bool conditionInverted, gd::EventsCodeGenerationContext &context) |
|
virtual gd::String | GenerateObjectCondition (const gd::String &objectName, const gd::ObjectMetadata &objInfo, const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, const gd::String &returnBoolean, bool conditionInverted, gd::EventsCodeGenerationContext &context) |
|
virtual gd::String | GenerateBehaviorCondition (const gd::String &objectName, const gd::String &behaviorName, const gd::BehaviorMetadata &autoInfo, const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, const gd::String &returnBoolean, bool conditionInverted, gd::EventsCodeGenerationContext &context) |
|
virtual gd::String | GenerateFreeAction (const gd::String &functionCallName, const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, gd::EventsCodeGenerationContext &context, const gd::String &optionalAsyncCallbackName="") |
|
virtual gd::String | GenerateObjectAction (const gd::String &objectName, const gd::ObjectMetadata &objInfo, const gd::String &functionCallName, const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, gd::EventsCodeGenerationContext &context, const gd::String &optionalAsyncCallbackName="") |
|
virtual gd::String | GenerateBehaviorAction (const gd::String &objectName, const gd::String &behaviorName, const gd::BehaviorMetadata &autoInfo, const gd::String &functionCallName, const std::vector< gd::String > &arguments, const gd::InstructionMetadata &instrInfos, gd::EventsCodeGenerationContext &context, const gd::String &optionalAsyncCallbackName="") |
|
gd::String | GenerateRelationalOperatorCall (const gd::InstructionMetadata &instrInfos, const std::vector< gd::String > &arguments, const gd::String &callStartString, std::size_t startFromArgument=0) |
|
gd::String | GenerateOperatorCall (const gd::InstructionMetadata &instrInfos, const std::vector< gd::String > &arguments, const gd::String &callStartString, const gd::String &getterStartString, std::size_t startFromArgument=0) |
|
gd::String | GenerateCompoundOperatorCall (const gd::InstructionMetadata &instrInfos, const std::vector< gd::String > &arguments, const gd::String &callStartString, std::size_t startFromArgument=0) |
|
gd::String | GenerateMutatorCall (const gd::InstructionMetadata &instrInfos, const std::vector< gd::String > &arguments, const gd::String &callStartString, std::size_t startFromArgument=0) |
|
gd::String | GenerateTrue () const |
| Return the "true" keyword in the target language.
|
|
gd::String | GenerateFalse () const |
| Return the "false" keyword in the target language.
|
|
virtual gd::String | GenerateArgumentsList (const std::vector< gd::String > &arguments, size_t startFrom=0) |
| Generate the list of comma-separated arguments to be used to call a function. More...
|
|
virtual gd::String | GenerateGetBehaviorNameCode (const gd::String &behaviorName) |
|
void | CheckBehaviorParameters (const gd::Instruction &instruction, const gd::InstructionMetadata &instrInfos) |
|
Internal class used to generate code from events.