ScummVM API documentation
Bagel::CBagExpression Class Reference
Inheritance diagram for Bagel::CBagExpression:
Bagel::CBagParseObject Bagel::CBofObject

Public Types

enum  OPERATION {
  OP_NONE, OP_ASSIGN, OP_EQUAL, OP_NOT_EQUAL,
  OP_LESS_THAN, OP_LESS_THAN_EQUAL, OP_GREATER_THAN, OP_GREATER_THAN_EQUAL,
  OP_PLUS_ASSIGN, OP_MINUS_ASSIGN, OP_CONTAINS, OP_HAS,
  OP_CURR_SDEV, OP_PLUS, OP_MINUS, OP_MULTIPLY,
  OP_DIVIDE, OP_AND, OP_OR, OP_MOD,
  OP_STATUS
}
 
- Public Types inherited from Bagel::CBagParseObject
enum  KEYWORDS {
  UNKNOWN = 0, STORAGEDEV, START_WLD, VARIABLE,
  REMARK, DISKID, CURSOR, SHAREDPAL,
  DISKAUDIO, PDASTATE, SYSSCREEN, WIELDCURSOR
}
 

Public Member Functions

 CBagExpression (CBagExpression *prevExpr=nullptr, bool prevNegFl=false)
 
bool evaluate (bool negFl=false, CBagVar &result= *_tempVar)
 
bool evalLeftToRight (bool negFl=false, CBagVar &result= *_tempVar)
 
bool negEvaluate (CBagVar &result= *_tempVar)
 
void setNegative (bool b=true)
 
bool isNegative () const
 
CBagVargetVariable (int itemPos)
 
OPERATION getOperation (int itemPos)
 
ParseCodes setInfo (CBagIfstream &istr) override
 
ErrorCode getOperatorFromStream (CBagIfstream &istr, OPERATION &oper)
 
CBagExpressiongetPrevExpression () const
 
void setPrevExpression (CBagExpression *expr)
 
virtual bool onAssign (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onEqual (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onNotEqual (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onLessThan (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onGreaterThan (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onLessThanEqual (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onGreaterThanEqual (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onPlusAssign (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onMinusAssign (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onContains (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onHas (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onCurrSDev (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onPlus (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onMinus (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onMultiply (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onDivide (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onMod (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onAnd (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onOr (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
virtual bool onStatus (CBagVar *leftHandOper, CBagVar *rightHandOper, CBagVar &resultOper)
 
- Public Member Functions inherited from Bagel::CBagParseObject
virtual ErrorCode attach ()
 
virtual ErrorCode detach ()
 
virtual bool isAttached ()
 
int getStringFromStream (CBagIfstream &istr, CBofString &sStr, const CBofString &sEndChars, bool bPutBack=false)
 
int getAlphaNumFromStream (CBagIfstream &istr, CBofString &sStr)
 
int getOperStrFromStream (CBagIfstream &istr, CBofString &sStr)
 
int getIntFromStream (CBagIfstream &istr, int &nNum)
 
int getRectFromStream (CBagIfstream &istr, CBofRect &rect)
 
int getKeywordFromStream (CBagIfstream &istr, KEYWORDS &keyword)
 
int putbackStringOnStream (CBagIfstream &istr, const CBofString &sStr)
 
int parseAlertBox (CBagIfstream &istr, const char *sTitle, const char *sFile, int nLine)
 

Static Public Member Functions

static void initialize ()
 
static void shutdown ()
 
- Static Public Member Functions inherited from Bagel::CBagParseObject
static void initialize ()
 
- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 

Static Public Attributes

static CBagVar_tempVar
 

Member Function Documentation

◆ evalLeftToRight()

bool Bagel::CBagExpression::evalLeftToRight ( bool  negFl = false,
CBagVar result = *_tempVar 
)

Same as evaluate above except it evaluates left to right and preserves the value of the previous evaluation in the loop. Provides partial evaluation hierarchy support.


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