Game Develop Core: gd::CallbacksForGeneratingExpressionCode Class Reference

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- Class List
- Class Index
- Class Hierarchy

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Public Member Functions | List of all members
gd::CallbacksForGeneratingExpressionCode Class Reference

Used to generate code from expressions. More...

`#include <ExpressionsCodeGeneration.h>`

Inheritance diagram for gd::CallbacksForGeneratingExpressionCode:
[legend]

## Public Member Functions

| CallbacksForGeneratingExpressionCode (std::string &output, EventsCodeGenerator &codeGenerator_, EventsCodeGenerationContext &context_)
void | OnConstantToken (std::string text)
void | OnNumber (std::string text)
void | OnOperator (std::string text)
void | OnStaticFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::ExpressionMetadata &expressionInfo)
void | OnStaticFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::StrExpressionMetadata &expressionInfo)
void | OnObjectFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::ExpressionMetadata &expressionInfo)
void | OnObjectFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::StrExpressionMetadata &expressionInfo)
void | OnObjectAutomatismFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::ExpressionMetadata &expressionInfo)
void | OnObjectAutomatismFunction (std::string functionName, const std::vector< gd::Expression > &parameters, const gd::StrExpressionMetadata &expressionInfo)
bool | OnSubMathExpression (const gd::Platform &platform, const gd::Project &project, const gd::Layout &layout, gd::Expression &expression)
bool | OnSubTextExpression (const gd::Platform &platform, const gd::Project &project, const gd::Layout &layout, gd::Expression &expression)

## Additional Inherited Members

Public Attributes inherited from gd::ParserCallbacks
std::string | firstErrorStr
size_t | firstErrorPos

## Detailed Description

Used to generate code from expressions.

Usage example :

std::string expressionOutputCppCode;
CallbacksForGeneratingExpressionCode callbacks(expressionOutputCppCode, codeGenerator, context);
gd::ExpressionParser parser(theOriginalGameDevelopExpression);
parser.ParseStringExpression(platform, project, scene, callbacks);
if (expressionOutputCppCode.empty()) expressionOutputCppCode = "\"\""; //If generation failed, we make sure output code is not empty.

See Also
  EventsCodeGenerator

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

- ExpressionsCodeGeneration.h
- ExpressionsCodeGeneration.cpp