kexi

#include <expression.h>

Inheritance diagram for KexiDB::BaseExpr:
KexiDB::BinaryExpr KexiDB::ConstExpr KexiDB::FunctionExpr KexiDB::NArgExpr KexiDB::UnaryExpr KexiDB::VariableExpr KexiDB::QueryParameterExpr

Public Types

typedef TQPtrList< BaseExpr > List
typedef TQPtrListIterator< BaseExpr > ListIterator

Public Member Functions

 BaseExpr (int token)
virtual BaseExpr * copy () const =0
int token () const
virtual Field::Type type ()
BaseExpr * parent () const
virtual void setParent (BaseExpr *p)
virtual bool validate (ParseInfo &parseInfo)
virtual TQString toString (QuerySchemaParameterValueListIterator *params=0)=0
virtual void getQueryParameters (QuerySchemaParameterList &params)=0
void debug ()
virtual TQString debugString ()
TQString tokenToDebugString ()
virtual TQString tokenToString ()
int exprClass () const
NArgExpr * toNArg ()
UnaryExpr * toUnary ()
BinaryExpr * toBinary ()
ConstExpr * toConst ()
VariableExpr * toVariable ()
FunctionExpr * toFunction ()
QueryParameterExpr * toQueryParameter ()

Static Public Member Functions

static TQString tokenToDebugString (int token)

Protected Attributes

int m_cl
BaseExpr * m_par
int m_token

Detailed Description

A base class for all expressions.

Definition at line 66 of file expression.h.

Member Typedef Documentation

◆ List

typedef TQPtrList<BaseExpr> KexiDB::BaseExpr::List

Definition at line 69 of file expression.h.

◆ ListIterator

typedef TQPtrListIterator<BaseExpr> KexiDB::BaseExpr::ListIterator

Definition at line 70 of file expression.h.

Constructor & Destructor Documentation

◆ BaseExpr()

BaseExpr::BaseExpr ( int token)

Definition at line 67 of file expression.cpp.

◆ ~BaseExpr()

BaseExpr::~BaseExpr ( )
virtual

Definition at line 74 of file expression.cpp.

Member Function Documentation

◆ copy()

virtual BaseExpr * KexiDB::BaseExpr::copy ( ) const
pure virtual
Returns
a deep copy of this object.
Todo
a nonpointer will be returned here when we move to implicit data sharing

Implemented in KexiDB::BinaryExpr, KexiDB::ConstExpr, KexiDB::FunctionExpr, KexiDB::NArgExpr, KexiDB::QueryParameterExpr, KexiDB::UnaryExpr, and KexiDB::VariableExpr.

◆ debug()

void KexiDB::BaseExpr::debug ( )
inline

Definition at line 98 of file expression.h.

◆ debugString()

TQString BaseExpr::debugString ( )
virtual

Definition at line 83 of file expression.cpp.

◆ exprClass()

int KexiDB::BaseExpr::exprClass ( ) const
inline

Definition at line 111 of file expression.h.

◆ getQueryParameters()

virtual void KexiDB::BaseExpr::getQueryParameters ( QuerySchemaParameterList & params)
pure virtual

Collects query parameters (messages and types) reculsively and saves them to params. The leaf nodes are objects of QueryParameterExpr class.

Implemented in KexiDB::BinaryExpr, KexiDB::ConstExpr, KexiDB::FunctionExpr, KexiDB::NArgExpr, KexiDB::QueryParameterExpr, KexiDB::UnaryExpr, and KexiDB::VariableExpr.

◆ parent()

BaseExpr * KexiDB::BaseExpr::parent ( ) const
inline

Definition at line 83 of file expression.h.

◆ setParent()

virtual void KexiDB::BaseExpr::setParent ( BaseExpr * p)
inlinevirtual

Definition at line 85 of file expression.h.

◆ toBinary()

BinaryExpr * BaseExpr::toBinary ( )

Definition at line 116 of file expression.cpp.

◆ toConst()

ConstExpr * BaseExpr::toConst ( )

Definition at line 117 of file expression.cpp.

◆ toFunction()

FunctionExpr * BaseExpr::toFunction ( )

Definition at line 119 of file expression.cpp.

◆ token()

int KexiDB::BaseExpr::token ( ) const
inline

Definition at line 79 of file expression.h.

◆ tokenToDebugString() [1/2]

TQString KexiDB::BaseExpr::tokenToDebugString ( )
inline
Returns
single character if the token is < 256 or token name, e.g. LESS_OR_EQUAL (for debugging).

Definition at line 104 of file expression.h.

◆ tokenToDebugString() [2/2]

TQString BaseExpr::tokenToDebugString ( int token)
static

Definition at line 96 of file expression.cpp.

◆ tokenToString()

TQString BaseExpr::tokenToString ( )
virtual
Returns
string for token, like "<=" or ">"

Reimplemented in KexiDB::BinaryExpr.

Definition at line 107 of file expression.cpp.

◆ toNArg()

NArgExpr * BaseExpr::toNArg ( )

Convenience type casts.

Definition at line 114 of file expression.cpp.

◆ toQueryParameter()

QueryParameterExpr * BaseExpr::toQueryParameter ( )

Definition at line 120 of file expression.cpp.

◆ toString()

virtual TQString KexiDB::BaseExpr::toString ( QuerySchemaParameterValueListIterator * params = 0)
pure virtual
Returns
string as a representation of this expression element by running recursive calls. param, if not 0, points to a list item containing value of a query parameter (used in QueryParameterExpr).

Implemented in KexiDB::BinaryExpr, KexiDB::ConstExpr, KexiDB::FunctionExpr, KexiDB::NArgExpr, KexiDB::QueryParameterExpr, KexiDB::UnaryExpr, and KexiDB::VariableExpr.

◆ toUnary()

UnaryExpr * BaseExpr::toUnary ( )

Definition at line 115 of file expression.cpp.

◆ toVariable()

VariableExpr * BaseExpr::toVariable ( )

Definition at line 118 of file expression.cpp.

◆ type()

Field::Type BaseExpr::type ( )
virtual

Reimplemented in KexiDB::VariableExpr.

Definition at line 78 of file expression.cpp.

◆ validate()

bool BaseExpr::validate ( ParseInfo & parseInfo)
virtual

Reimplemented in KexiDB::BinaryExpr, KexiDB::UnaryExpr, and KexiDB::VariableExpr.

Definition at line 88 of file expression.cpp.

Member Data Documentation

◆ m_cl

int KexiDB::BaseExpr::m_cl
protected

class

Definition at line 123 of file expression.h.

◆ m_par

BaseExpr* KexiDB::BaseExpr::m_par
protected

parent expression

Definition at line 124 of file expression.h.

◆ m_token

int KexiDB::BaseExpr::m_token
protected

Definition at line 125 of file expression.h.


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