LibreOffice Module basic (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
SbiExprNode Class Referencefinal

#include <expr.hxx>

Collaboration diagram for SbiExprNode:
[legend]

Public Member Functions

 SbiExprNode ()
 
 SbiExprNode (double, SbxDataType)
 
 SbiExprNode (OUString)
 
 SbiExprNode (const SbiSymDef &, SbxDataType, SbiExprListPtr=nullptr)
 
 SbiExprNode (std::unique_ptr< SbiExprNode >, SbiToken, std::unique_ptr< SbiExprNode >)
 
 SbiExprNode (std::unique_ptr< SbiExprNode >, sal_uInt16)
 
 SbiExprNode (sal_uInt16)
 
 ~SbiExprNode ()
 
bool IsValid () const
 
bool IsConstant () const
 
void ConvertToIntConstIfPossible ()
 
bool IsVariable () const
 
void SetWithParent (SbiExprNode *p)
 
SbxDataType GetType () const
 
void SetType (SbxDataType eTp)
 
SbiNodeType GetNodeType () const
 
SbiSymDefGetVar ()
 
SbiSymDefGetRealVar ()
 
SbiExprNodeGetRealNode ()
 
const OUString & GetString () const
 
short GetNumber () const
 
SbiExprListGetParameters ()
 
void Optimize (SbiParser *)
 
void Gen (SbiCodeGen &rGen, RecursiveMode eRecMode=UNDEFINED)
 

Private Member Functions

void FoldConstants (SbiParser *)
 
void FoldConstantsBinaryNode (SbiParser *)
 
void FoldConstantsUnaryNode (SbiParser *)
 
void CollectBits ()
 
bool IsOperand () const
 
bool IsNumber () const
 
bool IsLvalue () const
 
void GenElement (SbiCodeGen &, SbiOpcode)
 

Private Attributes

union {
   sal_uInt16   nTypeStrId
 
   double   nVal
 
   SbVar   aVar
 
}; 
 
OUString aStrVal
 
std::unique_ptr< SbiExprNodepLeft
 
std::unique_ptr< SbiExprNodepRight
 
SbiExprNodepWithParent
 
SbiNodeType eNodeType
 
SbxDataType eType
 
SbiToken eTok
 
bool bError
 

Friends

class SbiExpression
 
class SbiConstExpression
 

Detailed Description

Definition at line 107 of file expr.hxx.

Constructor & Destructor Documentation

◆ SbiExprNode() [1/7]

SbiExprNode::SbiExprNode ( )

Definition at line 100 of file exprnode.cxx.

References eType.

◆ SbiExprNode() [2/7]

SbiExprNode::SbiExprNode ( double  n,
SbxDataType  t 
)

Definition at line 44 of file exprnode.cxx.

References eType, n, and t.

◆ SbiExprNode() [3/7]

SbiExprNode::SbiExprNode ( OUString  aVal)

Definition at line 54 of file exprnode.cxx.

References eType.

◆ SbiExprNode() [4/7]

SbiExprNode::SbiExprNode ( const SbiSymDef r,
SbxDataType  t,
SbiExprListPtr  l = nullptr 
)

◆ SbiExprNode() [5/7]

SbiExprNode::SbiExprNode ( std::unique_ptr< SbiExprNode l,
SbiToken  t,
std::unique_ptr< SbiExprNode r 
)

Definition at line 33 of file exprnode.cxx.

References eType, and t.

◆ SbiExprNode() [6/7]

SbiExprNode::SbiExprNode ( std::unique_ptr< SbiExprNode l,
sal_uInt16  nId 
)

Definition at line 78 of file exprnode.cxx.

References eType, and nId.

◆ SbiExprNode() [7/7]

SbiExprNode::SbiExprNode ( sal_uInt16  nId)

Definition at line 90 of file exprnode.cxx.

References eType, and nId.

◆ ~SbiExprNode()

SbiExprNode::~SbiExprNode ( )

Definition at line 109 of file exprnode.cxx.

References aVar, IsVariable(), SbVar::pNext, SbVar::pPar, and SbVar::pvMorePar.

Member Function Documentation

◆ CollectBits()

void SbiExprNode::CollectBits ( )
private

Definition at line 195 of file exprnode.cxx.

References bError, pLeft, and pRight.

Referenced by FoldConstantsBinaryNode(), and Optimize().

◆ ConvertToIntConstIfPossible()

void SbiExprNode::ConvertToIntConstIfPossible ( )

Definition at line 152 of file exprnode.cxx.

References eNodeType, eType, nVal, SbxDOUBLE, SbxINTEGER, SbxMAXINT, SbxMININT, SbxNUMVAL, and o3tl::temporary().

◆ FoldConstants()

void SbiExprNode::FoldConstants ( SbiParser pParser)
private

◆ FoldConstantsBinaryNode()

void SbiExprNode::FoldConstantsBinaryNode ( SbiParser pParser)
private

◆ FoldConstantsUnaryNode()

void SbiExprNode::FoldConstantsUnaryNode ( SbiParser pParser)
private

◆ Gen()

void SbiExprNode::Gen ( SbiCodeGen rGen,
RecursiveMode  eRecMode = UNDEFINED 
)

◆ GenElement()

void SbiExprNode::GenElement ( SbiCodeGen rGen,
SbiOpcode  eOp 
)
private

◆ GetNodeType()

SbiNodeType SbiExprNode::GetNodeType ( ) const
inline

Definition at line 153 of file expr.hxx.

References eNodeType.

Referenced by SbiParser::Symbol().

◆ GetNumber()

short SbiExprNode::GetNumber ( ) const
inline

Definition at line 158 of file expr.hxx.

References nVal.

Referenced by SbiParser::DefType().

◆ GetParameters()

SbiExprList * SbiExprNode::GetParameters ( )
inline

Definition at line 159 of file expr.hxx.

References aVar, and SbVar::pPar.

Referenced by SbiParser::Symbol().

◆ GetRealNode()

SbiExprNode * SbiExprNode::GetRealNode ( )

Definition at line 137 of file exprnode.cxx.

References eNodeType, p, and SbxVARVAL.

Referenced by GetRealVar(), and SbiParser::With().

◆ GetRealVar()

SbiSymDef * SbiExprNode::GetRealVar ( )

Definition at line 127 of file exprnode.cxx.

References GetRealNode(), and p.

Referenced by SbiExpression::Term().

◆ GetString()

const OUString & SbiExprNode::GetString ( ) const
inline

Definition at line 157 of file expr.hxx.

References aStrVal.

◆ GetType()

SbxDataType SbiExprNode::GetType ( ) const
inline

Definition at line 151 of file expr.hxx.

References eType.

Referenced by Gen(), and GenElement().

◆ GetVar()

SbiSymDef * SbiExprNode::GetVar ( )

Definition at line 119 of file exprnode.cxx.

References aVar, eNodeType, SbVar::pDef, and SbxVARVAL.

Referenced by SbiParser::With().

◆ IsConstant()

bool SbiExprNode::IsConstant ( ) const
inline

Definition at line 144 of file expr.hxx.

References eNodeType, SbxNUMVAL, and SbxSTRVAL.

Referenced by Gen().

◆ IsLvalue()

bool SbiExprNode::IsLvalue ( ) const
private

Definition at line 176 of file exprnode.cxx.

References IsVariable().

◆ IsNumber()

bool SbiExprNode::IsNumber ( ) const
private

Definition at line 166 of file exprnode.cxx.

References eNodeType, and SbxNUMVAL.

◆ IsOperand()

bool SbiExprNode::IsOperand ( ) const
inlineprivate

Definition at line 127 of file expr.hxx.

References eNodeType, SbxNEW, SbxNODE, and SbxTYPEOF.

Referenced by FoldConstants(), and Gen().

◆ IsValid()

bool SbiExprNode::IsValid ( ) const
inline

Definition at line 143 of file expr.hxx.

References bError.

◆ IsVariable()

bool SbiExprNode::IsVariable ( ) const

Definition at line 171 of file exprnode.cxx.

References eNodeType, and SbxVARVAL.

Referenced by IsLvalue(), and ~SbiExprNode().

◆ Optimize()

void SbiExprNode::Optimize ( SbiParser pParser)

Definition at line 187 of file exprnode.cxx.

References CollectBits(), and FoldConstants().

◆ SetType()

void SbiExprNode::SetType ( SbxDataType  eTp)
inline

Definition at line 152 of file expr.hxx.

References eType.

Referenced by SbiParser::With().

◆ SetWithParent()

void SbiExprNode::SetWithParent ( SbiExprNode p)
inline

Definition at line 149 of file expr.hxx.

References p, and pWithParent.

Friends And Related Function Documentation

◆ SbiConstExpression

friend class SbiConstExpression
friend

Definition at line 109 of file expr.hxx.

◆ SbiExpression

friend class SbiExpression
friend

Definition at line 108 of file expr.hxx.

Member Data Documentation

◆ 

union { ... } SbiExprNode::@1

◆ aStrVal

OUString SbiExprNode::aStrVal
private

Definition at line 115 of file expr.hxx.

Referenced by FoldConstantsBinaryNode(), Gen(), and GetString().

◆ aVar

SbVar SbiExprNode::aVar

Definition at line 113 of file expr.hxx.

Referenced by Gen(), GenElement(), GetParameters(), GetVar(), SbiExprNode(), and ~SbiExprNode().

◆ bError

bool SbiExprNode::bError
private

Definition at line 122 of file expr.hxx.

Referenced by CollectBits(), FoldConstantsBinaryNode(), FoldConstantsUnaryNode(), and IsValid().

◆ eNodeType

SbiNodeType SbiExprNode::eNodeType
private

◆ eTok

SbiToken SbiExprNode::eTok
private

Definition at line 121 of file expr.hxx.

Referenced by FoldConstants(), FoldConstantsBinaryNode(), FoldConstantsUnaryNode(), and Gen().

◆ eType

SbxDataType SbiExprNode::eType
private

◆ nTypeStrId

sal_uInt16 SbiExprNode::nTypeStrId

Definition at line 111 of file expr.hxx.

Referenced by Gen().

◆ nVal

double SbiExprNode::nVal

◆ pLeft

std::unique_ptr<SbiExprNode> SbiExprNode::pLeft
private

◆ pRight

std::unique_ptr<SbiExprNode> SbiExprNode::pRight
private

Definition at line 117 of file expr.hxx.

Referenced by CollectBits(), FoldConstants(), FoldConstantsBinaryNode(), and Gen().

◆ pWithParent

SbiExprNode* SbiExprNode::pWithParent
private

Definition at line 118 of file expr.hxx.

Referenced by Gen(), and SetWithParent().


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