Yate
Public Member Functions | Static Public Member Functions | Friends
ExpOperation Class Reference

A single operation in an expression. More...

#include <yatescript.h>

Inheritance diagram for ExpOperation:
NamedString String GenObject ExpFunction ExpWrapper

List of all members.

Public Member Functions

 ExpOperation (const ExpOperation &original)
 ExpOperation (const ExpOperation &original, const char *name)
 ExpOperation (const String &value, const char *name=0, bool autoNum=false)
 ExpOperation (const char *value, const char *name=0)
 ExpOperation (long int value, const char *name=0)
 ExpOperation (bool value, const char *name=0)
 ExpOperation (ExpEvaluator::Opcode oper, const char *name=0, long int value=nonInteger(), bool barrier=false)
 ExpOperation (ExpEvaluator::Opcode oper, const char *name, const char *value, bool barrier=false)
ExpEvaluator::Opcode opcode () const
bool isInteger () const
long int number () const
bool barrier () const
long int operator= (long int num)
virtual ExpOperationclone (const char *name) const
ExpOperationclone () const

Static Public Member Functions

static long int nonInteger ()

Friends

class ExpEvaluator

Detailed Description

A single operation in an expression.

This class describes a single operation in an expression evaluator


Constructor & Destructor Documentation

ExpOperation ( const ExpOperation original) [inline]

Copy constructor

Parameters:
originalOperation to copy
ExpOperation ( const ExpOperation original,
const char *  name 
) [inline]

Copy constructor with renaming, to be used for named results

Parameters:
originalOperation to copy
nameName of the newly created operation
ExpOperation ( const String value,
const char *  name = 0,
bool  autoNum = false 
) [inline, explicit]

Push String constructor

Parameters:
valueString constant to push on stack on execution
nameOptional of the newly created constant
autoNumAutomatically convert to number if possible

References String::isBoolean(), and String::toBoolean().

ExpOperation ( const char *  value,
const char *  name = 0 
) [inline, explicit]

Push literal string constructor

Parameters:
valueString constant to push on stack on execution
nameOptional of the newly created constant
ExpOperation ( long int  value,
const char *  name = 0 
) [inline, explicit]

Push Number constructor

Parameters:
valueInteger constant to push on stack on execution
nameOptional of the newly created constant

References String::operator=().

ExpOperation ( bool  value,
const char *  name = 0 
) [inline, explicit]

Push Boolean constructor

Parameters:
valueBoolean constant to push on stack on execution
nameOptional of the newly created constant
ExpOperation ( ExpEvaluator::Opcode  oper,
const char *  name = 0,
long int  value = nonInteger(),
bool  barrier = false 
) [inline]

Constructor from components

Parameters:
operOperation code
nameOptional name of the operation or result
valueOptional integer constant used as function parameter count
barrierTrue if the operation is an expression barrier on the stack
ExpOperation ( ExpEvaluator::Opcode  oper,
const char *  name,
const char *  value,
bool  barrier = false 
) [inline]

Constructor of non-integer operation from components

Parameters:
operOperation code
nameName of the operation or result
valueString value of operation
barrierTrue if the operation is an expression barrier on the stack

Member Function Documentation

bool barrier ( ) const [inline]

Check if this operation acts as an evaluator barrier on the stack

Returns:
True if an expression should not pop this operation off the stack
virtual ExpOperation* clone ( const char *  name) const [inline, virtual]

Clone and rename method

Parameters:
nameName of the cloned operation
Returns:
New operation instance

Reimplemented in ExpWrapper, and ExpFunction.

ExpOperation* clone ( ) const [inline]

Clone method

Returns:
New operation instance

References ExpOperation::clone().

Referenced by ExpOperation::clone().

bool isInteger ( ) const [inline]

Check if an integer value is stored

Returns:
True if an integer value is stored
static long int nonInteger ( ) [inline, static]

Special value that is not recognized as an integer value

Returns:
A value that indicates a non-integer value
long int number ( ) const [inline]

Retrieve the number stored in this operation

Returns:
Stored number
ExpEvaluator::Opcode opcode ( ) const [inline]

Retrieve the code of this operation

Returns:
Operation code as declared in the expression evaluator
long int operator= ( long int  num) [inline]

Number assignment operator

Parameters:
numNumeric value to assign to the operation
Returns:
Assigned number

References String::operator=().


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