LibreOffice Module formula (master) 1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
formula::FormulaToken Class Reference

#include <token.hxx>

Inheritance diagram for formula::FormulaToken:
[legend]

Classes

struct  PrivateAccess
 This is dirty and only the compiler should use it! More...
 

Public Member Functions

 FormulaToken (StackVar eTypeP, OpCode e=ocPush)
 
 FormulaToken (const FormulaToken &r)
 
virtual ~FormulaToken ()
 
void Delete ()
 
void DeleteIfZeroRef ()
 
StackVar GetType () const
 
bool IsFunction () const
 
bool IsExternalRef () const
 
bool IsRef () const
 
sal_uInt8 GetParamCount () const
 
void IncRef () const
 
void DecRef () const
 
oslInterlockedCount GetRef () const
 
OpCode GetOpCode () const
 
bool IsInForceArray () const
 
virtual sal_uInt8 GetByte () const
 Dummy methods to avoid switches and casts where possible, the real token classes have to override the appropriate method[s]. More...
 
virtual void SetByte (sal_uInt8 n)
 
virtual ParamClass GetInForceArray () const
 
virtual void SetInForceArray (ParamClass c)
 
virtual double GetDouble () const
 
virtual double & GetDoubleAsReference ()
 
virtual sal_Int16 GetDoubleType () const
 
virtual void SetDoubleType (sal_Int16 nType)
 
virtual const svl::SharedString & GetString () const
 
virtual void SetString (const svl::SharedString &rStr)
 
virtual sal_uInt16 GetIndex () const
 
virtual void SetIndex (sal_uInt16 n)
 
virtual sal_Int16 GetSheet () const
 
virtual void SetSheet (sal_Int16 n)
 
virtual sal_Unicode GetChar () const
 
virtual short * GetJump () const
 
virtual const OUString & GetExternal () const
 
virtual FormulaToken * GetFAPOrigToken () const
 
virtual FormulaError GetError () const
 
virtual void SetError (FormulaError)
 
virtual const ScSingleRefData * GetSingleRef () const
 
virtual ScSingleRefData * GetSingleRef ()
 
virtual const ScComplexRefData * GetDoubleRef () const
 
virtual ScComplexRefData * GetDoubleRef ()
 
virtual const ScSingleRefData * GetSingleRef2 () const
 
virtual ScSingleRefData * GetSingleRef2 ()
 
virtual const ScMatrix * GetMatrix () const
 
virtual ScMatrix * GetMatrix ()
 
virtual ScJumpMatrix * GetJumpMatrix () const
 
virtual const std::vector< ScComplexRefData > * GetRefList () const
 
virtual std::vector< ScComplexRefData > * GetRefList ()
 
virtual FormulaToken * Clone () const
 
virtual bool TextEqual (const formula::FormulaToken &rToken) const
 
virtual bool operator== (const FormulaToken &rToken) const
 
void NewOpCode (OpCode e, const PrivateAccess &)
 

Private Member Functions

FormulaToken & operator= (const FormulaToken &)=delete
 

Private Attributes

OpCode eOp
 
const StackVar eType
 
oslInterlockedCount mnRefCnt
 

Detailed Description

Definition at line 123 of file token.hxx.

Constructor & Destructor Documentation

◆ FormulaToken() [1/2]

formula::FormulaToken::FormulaToken ( StackVar  eTypeP,
OpCode  e = ocPush 
)

Definition at line 57 of file token.cxx.

References eType.

◆ FormulaToken() [2/2]

formula::FormulaToken::FormulaToken ( const FormulaToken &  r)

Definition at line 62 of file token.cxx.

References eType.

◆ ~FormulaToken()

formula::FormulaToken::~FormulaToken ( )
virtual

Definition at line 67 of file token.cxx.

Member Function Documentation

◆ Clone()

virtual FormulaToken * formula::FormulaToken::Clone ( ) const
inlinevirtual

◆ DecRef()

void formula::FormulaToken::DecRef ( ) const
inline

Definition at line 151 of file token.hxx.

References Delete.

Referenced by formula::FormulaCompiler::MergeRangeReference().

◆ Delete()

void formula::FormulaToken::Delete ( )
inline

Definition at line 136 of file token.hxx.

Referenced by formula::FormulaTokenArray::HasMatrixDoubleRefOps().

◆ DeleteIfZeroRef()

void formula::FormulaToken::DeleteIfZeroRef ( )
inline

Definition at line 137 of file token.hxx.

◆ GetByte()

sal_uInt8 formula::FormulaToken::GetByte ( ) const
virtual

Dummy methods to avoid switches and casts where possible, the real token classes have to override the appropriate method[s].

The only methods valid anytime if not overridden are:

  • GetByte() since this represents the count of parameters to a function which of course is 0 on non-functions. FormulaByteToken and ScExternal do override it.
  • GetInForceArray() since also this is only used for operators and functions and is ParamClass::Unknown for other tokens.

Any other non-overridden method pops up an assertion.

Reimplemented in formula::FormulaSpaceToken, and formula::FormulaByteToken.

Definition at line 162 of file token.cxx.

Referenced by GetParamCount(), IsFunction(), formula::FormulaSpaceToken::operator==(), and formula::FormulaByteToken::operator==().

◆ GetChar()

sal_Unicode formula::FormulaToken::GetChar ( ) const
virtual

Reimplemented in formula::FormulaSpaceToken.

Definition at line 245 of file token.cxx.

Referenced by formula::FormulaSpaceToken::operator==().

◆ GetDouble()

double formula::FormulaToken::GetDouble ( ) const
virtual

◆ GetDoubleAsReference()

double & formula::FormulaToken::GetDoubleAsReference ( )
virtual

Reimplemented in formula::FormulaDoubleToken.

Definition at line 191 of file token.cxx.

◆ GetDoubleRef() [1/2]

ScComplexRefData * formula::FormulaToken::GetDoubleRef ( )
virtual

Definition at line 301 of file token.cxx.

◆ GetDoubleRef() [2/2]

const ScComplexRefData * formula::FormulaToken::GetDoubleRef ( ) const
virtual

Definition at line 295 of file token.cxx.

◆ GetDoubleType()

sal_Int16 formula::FormulaToken::GetDoubleType ( ) const
virtual

Reimplemented in formula::FormulaDoubleToken, and formula::FormulaTypedDoubleToken.

Definition at line 199 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaTypedDoubleToken::operator==().

◆ GetError()

FormulaError formula::FormulaToken::GetError ( ) const
virtual

Reimplemented in formula::FormulaErrorToken.

Definition at line 272 of file token.cxx.

References NONE, and SAL_WARN.

◆ GetExternal()

const OUString & formula::FormulaToken::GetExternal ( ) const
virtual

Reimplemented in formula::FormulaExternalToken.

Definition at line 259 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaExternalToken::operator==().

◆ GetFAPOrigToken()

FormulaToken * formula::FormulaToken::GetFAPOrigToken ( ) const
virtual

Reimplemented in formula::FormulaFAPToken.

Definition at line 266 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaDlg_Impl::MakeTree(), and formula::FormulaFAPToken::operator==().

◆ GetIndex()

sal_uInt16 formula::FormulaToken::GetIndex ( ) const
virtual

Reimplemented in formula::FormulaIndexToken.

Definition at line 223 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaIndexToken::operator==().

◆ GetInForceArray()

ParamClass formula::FormulaToken::GetInForceArray ( ) const
virtual

◆ GetJump()

short * formula::FormulaToken::GetJump ( ) const
virtual

Reimplemented in formula::FormulaJumpToken.

Definition at line 252 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaCompiler::Factor(), and formula::FormulaJumpToken::operator==().

◆ GetJumpMatrix()

ScJumpMatrix * formula::FormulaToken::GetJumpMatrix ( ) const
virtual

Definition at line 331 of file token.cxx.

◆ GetMatrix() [1/2]

ScMatrix * formula::FormulaToken::GetMatrix ( )
virtual

Definition at line 325 of file token.cxx.

◆ GetMatrix() [2/2]

const ScMatrix * formula::FormulaToken::GetMatrix ( ) const
virtual

Definition at line 319 of file token.cxx.

◆ GetOpCode()

OpCode formula::FormulaToken::GetOpCode ( ) const
inline

◆ GetParamCount()

sal_uInt8 formula::FormulaToken::GetParamCount ( ) const

◆ GetRef()

oslInterlockedCount formula::FormulaToken::GetRef ( ) const
inline

Definition at line 157 of file token.hxx.

◆ GetRefList() [1/2]

std::vector< ScComplexRefData > * formula::FormulaToken::GetRefList ( )
virtual

Definition at line 342 of file token.cxx.

◆ GetRefList() [2/2]

const std::vector< ScComplexRefData > * formula::FormulaToken::GetRefList ( ) const
virtual

Definition at line 336 of file token.cxx.

◆ GetSheet()

sal_Int16 formula::FormulaToken::GetSheet ( ) const
virtual

Reimplemented in formula::FormulaIndexToken.

Definition at line 234 of file token.cxx.

References SAL_WARN.

Referenced by formula::FormulaIndexToken::operator==().

◆ GetSingleRef() [1/2]

ScSingleRefData * formula::FormulaToken::GetSingleRef ( )
virtual

Definition at line 289 of file token.cxx.

◆ GetSingleRef() [2/2]

const ScSingleRefData * formula::FormulaToken::GetSingleRef ( ) const
virtual

Definition at line 283 of file token.cxx.

◆ GetSingleRef2() [1/2]

ScSingleRefData * formula::FormulaToken::GetSingleRef2 ( )
virtual

Definition at line 313 of file token.cxx.

◆ GetSingleRef2() [2/2]

const ScSingleRefData * formula::FormulaToken::GetSingleRef2 ( ) const
virtual

Definition at line 307 of file token.cxx.

◆ GetString()

const svl::SharedString & formula::FormulaToken::GetString ( ) const
virtual

◆ GetType()

StackVar formula::FormulaToken::GetType ( ) const
inline

◆ IncRef()

void formula::FormulaToken::IncRef ( ) const
inline

Definition at line 146 of file token.hxx.

◆ IsExternalRef()

bool formula::FormulaToken::IsExternalRef ( ) const

◆ IsFunction()

bool formula::FormulaToken::IsFunction ( ) const

◆ IsInForceArray()

bool formula::FormulaToken::IsInForceArray ( ) const

◆ IsRef()

bool formula::FormulaToken::IsRef ( ) const

◆ NewOpCode()

void formula::FormulaToken::NewOpCode ( OpCode  e,
const PrivateAccess &   
)
inline

Definition at line 217 of file token.hxx.

Referenced by formula::FormulaCompiler::Factor().

◆ operator=()

FormulaToken & formula::FormulaToken::operator= ( const FormulaToken &  )
privatedelete

◆ operator==()

bool formula::FormulaToken::operator== ( const FormulaToken &  rToken) const
virtual

◆ SetByte()

void formula::FormulaToken::SetByte ( sal_uInt8  n)
virtual

Reimplemented in formula::FormulaByteToken.

Definition at line 168 of file token.cxx.

Referenced by formula::FormulaCompiler::Factor().

◆ SetDoubleType()

void formula::FormulaToken::SetDoubleType ( sal_Int16  nType)
virtual

Reimplemented in formula::FormulaTypedDoubleToken.

Definition at line 205 of file token.cxx.

◆ SetError()

void formula::FormulaToken::SetError ( FormulaError  )
virtual

Reimplemented in formula::FormulaErrorToken.

Definition at line 278 of file token.cxx.

◆ SetIndex()

void formula::FormulaToken::SetIndex ( sal_uInt16  n)
virtual

Reimplemented in formula::FormulaIndexToken.

Definition at line 229 of file token.cxx.

◆ SetInForceArray()

void formula::FormulaToken::SetInForceArray ( ParamClass  c)
virtual

Reimplemented in formula::FormulaByteToken, and formula::FormulaJumpToken.

Definition at line 179 of file token.cxx.

◆ SetSheet()

void formula::FormulaToken::SetSheet ( sal_Int16  n)
virtual

Reimplemented in formula::FormulaIndexToken.

Definition at line 240 of file token.cxx.

◆ SetString()

void formula::FormulaToken::SetString ( const svl::SharedString &  rStr)
virtual

Reimplemented in formula::FormulaStringToken, and formula::FormulaStringOpToken.

Definition at line 218 of file token.cxx.

◆ TextEqual()

bool formula::FormulaToken::TextEqual ( const formula::FormulaToken &  rToken) const
virtual

Definition at line 348 of file token.cxx.

Member Data Documentation

◆ eOp

OpCode formula::FormulaToken::eOp
private

Definition at line 125 of file token.hxx.

Referenced by GetInForceArray(), GetParamCount(), IsFunction(), and IsRef().

◆ eType

const StackVar formula::FormulaToken::eType
private

Definition at line 126 of file token.hxx.

Referenced by GetInForceArray(), IsExternalRef(), IsRef(), and operator==().

◆ mnRefCnt

oslInterlockedCount formula::FormulaToken::mnRefCnt
mutableprivate

Definition at line 127 of file token.hxx.


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