fastdo  0.5.12
eienexpr::ExprOperator类 参考

表达式操作符 更多...

#include <eienexpr.hpp>

类 eienexpr::ExprOperator 继承关系图:
eienexpr::ExprOperator 的协作图:

Public 类型

typedef bool(* OperatorFunction) (ExprOperand *arOperands[], short n, winux::SimplePointer< ExprOperand > *outRetValue, void *data)
 
- Public 类型 继承自 eienexpr::ExprAtom
enum  ExprAtomType { eatOperator, eatOperand }
 

Public 成员函数

 ExprOperator (winux::String const &oprStr="", bool isUnary=false, bool isRight=false, short level=0, OperatorFunction oprFn=NULL)
 
virtual ~ExprOperator ()
 
virtual ExprAtomclone () const
 克隆一个atom 更多...
 
virtual winux::String toString () const
 字符串形式输出 更多...
 
int nexus (ExprOperator const &opr) const
 操作符优先关系(低于:-1, 高于:1, 错误:-2) 更多...
 
bool isUnary () const
 
bool isRight () const
 
winux::String const & getStr () const
 
- Public 成员函数 继承自 eienexpr::ExprAtom
 ExprAtom ()
 
virtual ~ExprAtom ()
 
ExprAtomType getAtomType () const
 原子类型 更多...
 

静态 Public 成员函数

static bool Possibility (winux::String const &str)
 判断是否有解析为操作符的可能性,仅是文本上的 更多...
 
static void AddOpr (winux::String const &oprStr, bool isUnary, bool isRight, short level, OperatorFunction oprFn)
 动态添加一个操作符 更多...
 
static bool DelOpr (winux::String const &oprStr, bool isUnary, bool isRight)
 动态移除一个操作符 更多...
 
static bool ModifyOpr (int i, winux::String const &oprStr, bool isUnary, bool isRight, short level, OperatorFunction oprFn)
 动态修改一个操作符 更多...
 
static int FindOpr (ExprOperator *opr, winux::String const &oprStr, bool isUnary=false, bool isRight=false)
 查找预定义的字符 更多...
 
static int GetOpr (winux::String const &oprStr, ExprOperator *oprArr, int n)
 取得指定字符串的所有操作符,返回取得的个数,当n==0,则只返回个数 更多...
 
static int GetAllOprs (ExprOperator *oprArr, int n)
 取得所有操作符,返回取得的个数,当n==0,则只返回个数 更多...
 

Protected 属性

winux::String _oprStr
 
bool _isUnary
 
short _level
 
bool _isRight
 
OperatorFunction _oprFn
 
- Protected 属性 继承自 eienexpr::ExprAtom
ExprAtomType _atomType
 

静态 Protected 属性

static std::vector< ExprOperator_Operators
 

友元

class Expression
 
class ExprParser
 

详细描述

表达式操作符

在文件 eienexpr.hpp82 行定义.

成员类型定义说明

typedef bool(* eienexpr::ExprOperator::OperatorFunction) (ExprOperand *arOperands[], short n, winux::SimplePointer< ExprOperand > *outRetValue, void *data)

在文件 eienexpr.hpp86 行定义.

构造及析构函数说明

eienexpr::ExprOperator::ExprOperator ( winux::String const &  oprStr = "",
bool  isUnary = false,
bool  isRight = false,
short  level = 0,
OperatorFunction  oprFn = NULL 
)
virtual eienexpr::ExprOperator::~ExprOperator ( )
virtual

成员函数说明

static void eienexpr::ExprOperator::AddOpr ( winux::String const &  oprStr,
bool  isUnary,
bool  isRight,
short  level,
OperatorFunction  oprFn 
)
static

动态添加一个操作符

virtual ExprAtom* eienexpr::ExprOperator::clone ( ) const
virtual

克隆一个atom

实现了 eienexpr::ExprAtom.

static bool eienexpr::ExprOperator::DelOpr ( winux::String const &  oprStr,
bool  isUnary,
bool  isRight 
)
static

动态移除一个操作符

static int eienexpr::ExprOperator::FindOpr ( ExprOperator opr,
winux::String const &  oprStr,
bool  isUnary = false,
bool  isRight = false 
)
static

查找预定义的字符

static int eienexpr::ExprOperator::GetAllOprs ( ExprOperator oprArr,
int  n 
)
static

取得所有操作符,返回取得的个数,当n==0,则只返回个数

static int eienexpr::ExprOperator::GetOpr ( winux::String const &  oprStr,
ExprOperator oprArr,
int  n 
)
static

取得指定字符串的所有操作符,返回取得的个数,当n==0,则只返回个数

winux::String const& eienexpr::ExprOperator::getStr ( ) const
inline

在文件 eienexpr.hpp102 行定义.

bool eienexpr::ExprOperator::isRight ( ) const
inline

在文件 eienexpr.hpp101 行定义.

bool eienexpr::ExprOperator::isUnary ( ) const
inline

在文件 eienexpr.hpp100 行定义.

static bool eienexpr::ExprOperator::ModifyOpr ( int  i,
winux::String const &  oprStr,
bool  isUnary,
bool  isRight,
short  level,
OperatorFunction  oprFn 
)
static

动态修改一个操作符

int eienexpr::ExprOperator::nexus ( ExprOperator const &  opr) const

操作符优先关系(低于:-1, 高于:1, 错误:-2)

看优先级别,如果本算符级别大于opr算符级别,则返回1,小于则返回-1 (以opr算符在本算符左边为依据)若相同,则看opr的结合性,左结合返回-1,右结合返回1

static bool eienexpr::ExprOperator::Possibility ( winux::String const &  str)
static

判断是否有解析为操作符的可能性,仅是文本上的

virtual winux::String eienexpr::ExprOperator::toString ( ) const
virtual

字符串形式输出

实现了 eienexpr::ExprAtom.

友元及相关函数文档

friend class Expression
friend

在文件 eienexpr.hpp130 行定义.

friend class ExprParser
friend

在文件 eienexpr.hpp131 行定义.

类成员变量说明

bool eienexpr::ExprOperator::_isRight
protected

在文件 eienexpr.hpp107 行定义.

bool eienexpr::ExprOperator::_isUnary
protected

在文件 eienexpr.hpp105 行定义.

short eienexpr::ExprOperator::_level
protected

在文件 eienexpr.hpp106 行定义.

std::vector<ExprOperator> eienexpr::ExprOperator::_Operators
staticprotected

在文件 eienexpr.hpp110 行定义.

OperatorFunction eienexpr::ExprOperator::_oprFn
protected

在文件 eienexpr.hpp108 行定义.

winux::String eienexpr::ExprOperator::_oprStr
protected

在文件 eienexpr.hpp104 行定义.


该类的文档由以下文件生成: