UFO: Alien Invasion
ui_expression.cpp File Reference
#include "ui_expression.h"
#include "ui_main.h"
#include "ui_node.h"
#include "ui_internal.h"
#include "ui_parse.h"
#include "ui_actions.h"
#include "node/ui_node_abstractnode.h"
#include "../../shared/parse.h"
#include "../../shared/shared.h"
Include dependency graph for ui_expression.cpp:

Go to the source code of this file.

Macros

#define VALUE1   UI_GetBooleanFromExpression(expression->d.nonTerminal.left, context)
 
#define VALUE2   UI_GetBooleanFromExpression(expression->d.nonTerminal.right, context)
 

Functions

uiNode_tUI_GetNodeFromExpression (uiAction_t *expression, const uiCallContext_t *context, const value_t **property)
 Get a node and a property from an expression. More...
 
float UI_GetFloatFromExpression (uiAction_t *expression, const uiCallContext_t *context)
 
const char * UI_GetStringFromExpression (uiAction_t *expression, const uiCallContext_t *context)
 
bool UI_GetBooleanFromExpression (uiAction_t *expression, const uiCallContext_t *context)
 Check if an expression is true. More...
 
uiAction_tUI_AllocStaticStringCondition (const char *description)
 Allocate and initialize an expression according to a string. More...
 
static uiAction_tUI_ParseValueExpression (const char **text)
 Read a value from the stream and init an action with it. More...
 
uiAction_tUI_ParseExpression (const char **text)
 

Macro Definition Documentation

◆ VALUE1

#define VALUE1   UI_GetBooleanFromExpression(expression->d.nonTerminal.left, context)

◆ VALUE2

#define VALUE2   UI_GetBooleanFromExpression(expression->d.nonTerminal.right, context)

Function Documentation

◆ UI_AllocStaticStringCondition()

uiAction_t* UI_AllocStaticStringCondition ( const char *  description)

Allocate and initialize an expression according to a string.

Parameters
[in]descriptionString describing a condition
Returns
The condition if everything is ok, nullptr otherwise

Definition at line 540 of file ui_expression.cpp.

References Com_Printf(), uiNode_t::text, UI_ParseExpression(), and va().

Referenced by UI_ParseProperty().

◆ UI_GetBooleanFromExpression()

◆ UI_GetFloatFromExpression()

◆ UI_GetNodeFromExpression()

uiNode_t* UI_GetNodeFromExpression ( uiAction_t expression,
const uiCallContext_t context,
const value_t **  property 
)

◆ UI_GetStringFromExpression()

◆ UI_ParseExpression()

◆ UI_ParseValueExpression()

static uiAction_t* UI_ParseValueExpression ( const char **  text)
static

Read a value from the stream and init an action with it.

Returns
An initialized action else nullptr
Todo:
when it is possible, we must check range of param id
Todo:
We MUST remove the OLD code as fast as possible
Todo:
use a better check - e.g. Com_ParseValue with V_INT or V_FLOAT

Definition at line 560 of file ui_expression.cpp.

References Com_Error(), Com_GetType(), Com_Parse(), Com_Printf(), uiAction_t::d, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, EA_VALUE_FLOAT, EA_VALUE_PARAM, EA_VALUE_PARAMCOUNT, EA_VALUE_PATHNODE, EA_VALUE_PATHNODE_WITHINJECTION, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_STRING, EA_VALUE_STRING_WITHINJECTION, ERR_FATAL, f, i, Q_strcasecmp, Q_streq, Q_strncasecmp, Q_strstart(), uiAction_t::terminal, uiNode_t::text, TT_QUOTED_WORD, uiAction_t::type, UI_AllocStaticAction(), UI_AllocStaticString(), UI_IsInjectedString(), and va().

Referenced by UI_ParseExpression().