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

#include <FormulaCompiler.hxx>

Collaboration diagram for formula::FormulaCompiler:
[legend]

Classes

class  CurrentFactor
 
class  OpCodeMap
 Mappings from strings to OpCodes and vice versa. More...
 

Public Types

enum class  SeparatorType {
  RESOURCE_BASE ,
  SEMICOLON_BASE
}
 Separators mapped when loading opcodes from the resource, values other than RESOURCE_BASE may override the resource strings. More...
 
enum  InitSymbols {
  ASK = 0 ,
  INIT ,
  DESTROY
}
 
typedef std::shared_ptr< const OpCodeMapOpCodeMapPtr
 
typedef std::shared_ptr< OpCodeMapNonConstOpCodeMapPtr
 

Public Member Functions

 FormulaCompiler (bool bComputeII=false, bool bMatrixFlag=false)
 
 FormulaCompiler (FormulaTokenArray &_rArr, bool bComputeII=false, bool bMatrixFlag=false)
 
virtual ~FormulaCompiler ()
 
OpCodeMapPtr GetOpCodeMap (const sal_Int32 nLanguage) const
 Get OpCodeMap for formula language. More...
 
void DestroyOpCodeMap (const sal_Int32 nLanguage)
 Destroy the singleton OpCodeMap for formula language. More...
 
bool HasOpCodeMap (const sal_Int32 nLanguage) const
 Whether the singleton OpCodeMap for formula language exists already. More...
 
const OpCodeMapPtrGetCurrentOpCodeMap () const
 Get current OpCodeMap in effect. More...
 
OpCode GetEnglishOpCode (const OUString &rName) const
 Get OpCode for English symbol. More...
 
FormulaError GetErrorConstant (const OUString &rName) const
 
void AppendErrorConstant (OUStringBuffer &rBuffer, FormulaError nError) const
 
void EnableJumpCommandReorder (bool bEnable)
 
void EnableStopOnError (bool bEnable)
 
SvNumFormatType GetNumFormatType () const
 
bool CompileTokenArray ()
 
void CreateStringFromTokenArray (OUString &rFormula)
 
void CreateStringFromTokenArray (OUStringBuffer &rBuffer)
 
const FormulaTokenCreateStringFromToken (OUString &rFormula, const FormulaToken *pToken)
 
const FormulaTokenCreateStringFromToken (OUStringBuffer &rBuffer, const FormulaToken *pToken, bool bAllowArrAdvance=false)
 
void AppendBoolean (OUStringBuffer &rBuffer, bool bVal) const
 
void AppendDouble (OUStringBuffer &rBuffer, double fVal) const
 
FormulaGrammar::Grammar GetGrammar () const
 Set symbol map corresponding to one of predefined formula::FormulaGrammar::Grammar, including an address reference convention. More...
 
bool NeedsTableRefTransformation () const
 Whether current symbol set and grammar need transformation of Table structured references to A1 style references when writing / exporting (creating strings). More...
 
virtual formula::ParamClass GetForceArrayParameter (const FormulaToken *pToken, sal_uInt16 nParam) const
 If a parameter nParam (0-based) is to be forced to array for OpCode eOp, i.e. More...
 
void SetComputeIIFlag (bool bSet)
 Sets the implicit intersection compute flag. More...
 
void SetMatrixFlag (bool bSet)
 Sets the matrix flag for the formula. More...
 

Static Public Member Functions

static OpCodeMapPtr CreateOpCodeMap (const css::uno::Sequence< const css::sheet::FormulaOpCodeMapEntry > &rMapping, bool bEnglish)
 Create an internal symbol map from API mapping. More...
 
static bool IsOpCodeVolatile (OpCode eOp)
 
static bool IsOpCodeJumpCommand (OpCode eOp)
 
static bool DeQuote (OUString &rStr)
 
static const OUString & GetNativeSymbol (OpCode eOp)
 
static sal_Unicode GetNativeSymbolChar (OpCode eOp)
 
static bool IsMatrixFunction (OpCode _eOpCode)
 
static void AppendString (OUStringBuffer &rBuffer, const OUString &rStr)
 
static void UpdateSeparatorsNative (const OUString &rSep, const OUString &rArrayColSep, const OUString &rArrayRowSep)
 
static void ResetNativeSymbols ()
 
static void SetNativeSymbols (const OpCodeMapPtr &xMap)
 

Protected Member Functions

OpCodeMapPtr GetFinalOpCodeMap (const sal_Int32 nLanguage) const
 Get finalized OpCodeMap for formula language. More...
 
virtual OUString FindAddInFunction (const OUString &rUpperName, bool bLocalFirst) const
 
virtual void fillFromAddInCollectionUpperName (const NonConstOpCodeMapPtr &xMap) const
 
virtual void fillFromAddInMap (const NonConstOpCodeMapPtr &xMap, FormulaGrammar::Grammar _eGrammar) const
 
virtual void fillFromAddInCollectionEnglishName (const NonConstOpCodeMapPtr &xMap) const
 
virtual void fillAddInToken (::std::vector< css::sheet::FormulaOpCodeMapEntry > &_rVec, bool _bIsEnglish) const
 
virtual void SetError (FormulaError nError)
 
virtual FormulaTokenRef ExtendRangeReference (FormulaToken &rTok1, FormulaToken &rTok2)
 
virtual bool HandleExternalReference (const FormulaToken &_aToken)
 
virtual bool HandleRange ()
 
virtual bool HandleColRowName ()
 
virtual bool HandleDbData ()
 
virtual bool HandleTableRef ()
 
virtual void CreateStringFromExternal (OUStringBuffer &rBuffer, const FormulaToken *pToken) const
 
virtual void CreateStringFromSingleRef (OUStringBuffer &rBuffer, const FormulaToken *pToken) const
 
virtual void CreateStringFromDoubleRef (OUStringBuffer &rBuffer, const FormulaToken *pToken) const
 
virtual void CreateStringFromMatrix (OUStringBuffer &rBuffer, const FormulaToken *pToken) const
 
virtual void CreateStringFromIndex (OUStringBuffer &rBuffer, const FormulaToken *pToken) const
 
virtual void LocalizeString (OUString &rName) const
 
bool GetToken ()
 
OpCode NextToken ()
 
void PutCode (FormulaTokenRef &)
 
void Factor ()
 
void RangeLine ()
 
void UnionLine ()
 
void IntersectionLine ()
 
void UnaryLine ()
 
void PostOpLine ()
 
void PowLine ()
 
void MulDivLine ()
 
void AddSubLine ()
 
void ConcatLine ()
 
void CompareLine ()
 
OpCode Expression ()
 
void PopTokenArray ()
 
void PushTokenArray (FormulaTokenArray *, bool)
 
bool MergeRangeReference (FormulaToken **const pCode1, FormulaToken *const *const pCode2)
 
virtual void HandleIIOpCode (FormulaToken *, FormulaToken ***, sal_uInt8)
 
virtual void PostProcessCode ()
 
virtual void AnnotateOperands ()
 

Protected Attributes

OUString aCorrectedFormula
 
OUString aCorrectedSymbol
 
OpCodeMapPtr mxSymbols
 
FormulaTokenRef mpToken
 
FormulaTokenRef pCurrentFactorToken
 
sal_uInt16 nCurrentFactorParam
 
FormulaTokenArraypArr
 
FormulaTokenArrayPlainIterator maArrIterator
 
FormulaTokenRef mpLastToken
 
FormulaToken ** pCode
 
FormulaArrayStackpStack
 
OpCode eLastOp
 
short nRecursion
 
SvNumFormatType nNumFmt
 
sal_uInt16 pc
 
FormulaGrammar::Grammar meGrammar
 
bool bAutoCorrect
 
bool bCorrected
 
bool glSubTotal
 
bool needsRPNTokenCheck
 
bool mbJumpCommandReorder
 
bool mbStopOnError
 Whether or not to reorder RPN for jump commands. More...
 
bool mbComputeII
 Whether to stop compilation on first encountered error. More...
 
bool mbMatrixFlag
 

Private Member Functions

 FormulaCompiler (const FormulaCompiler &)=delete
 
FormulaCompileroperator= (const FormulaCompiler &)=delete
 
bool InitSymbolsNative (InitSymbols) const
 
bool InitSymbolsEnglish (InitSymbols) const
 only SymbolsNative, on first document creation More...
 
bool InitSymbolsPODF (InitSymbols) const
 only SymbolsEnglish, maybe later More...
 
bool InitSymbolsAPI (InitSymbols) const
 only SymbolsPODF, on demand More...
 
bool InitSymbolsODFF (InitSymbols) const
 only SymbolsAPI, on demand More...
 
bool InitSymbolsEnglishXL (InitSymbols) const
 only SymbolsODFF, on demand More...
 
bool InitSymbolsOOXML (InitSymbols) const
 only SymbolsEnglishXL, on demand More...
 
void loadSymbols (const std::pair< const char *, int > *pSymbols, FormulaGrammar::Grammar eGrammar, NonConstOpCodeMapPtr &rxMap, SeparatorType eSepType=SeparatorType::SEMICOLON_BASE) const
 only SymbolsOOXML, on demand More...
 
void CheckSetForceArrayParameter (FormulaTokenRef const &rCurr, sal_uInt8 nParam)
 Check pCurrentFactorToken for nParam's (0-based) ForceArray types and set ForceArray at rCurr if so. More...
 
void ForceArrayOperator (FormulaTokenRef const &rCurr)
 

Private Attributes

NonConstOpCodeMapPtr mxSymbolsODFF
 
NonConstOpCodeMapPtr mxSymbolsPODF
 
NonConstOpCodeMapPtr mxSymbolsAPI
 
NonConstOpCodeMapPtr mxSymbolsNative
 
NonConstOpCodeMapPtr mxSymbolsEnglish
 
NonConstOpCodeMapPtr mxSymbolsEnglishXL
 
NonConstOpCodeMapPtr mxSymbolsOOXML
 

Static Private Attributes

static FormulaTokenArray smDummyTokenArray
 

Detailed Description

Definition at line 71 of file FormulaCompiler.hxx.

Member Typedef Documentation

◆ NonConstOpCodeMapPtr

Definition at line 203 of file FormulaCompiler.hxx.

◆ OpCodeMapPtr

typedef std::shared_ptr< const OpCodeMap > formula::FormulaCompiler::OpCodeMapPtr

Definition at line 202 of file FormulaCompiler.hxx.

Member Enumeration Documentation

◆ InitSymbols

Enumerator
ASK 
INIT 
DESTROY 

Definition at line 423 of file FormulaCompiler.hxx.

◆ SeparatorType

Separators mapped when loading opcodes from the resource, values other than RESOURCE_BASE may override the resource strings.

Used by OpCodeList implementation via loadSymbols().

Enumerator
RESOURCE_BASE 
SEMICOLON_BASE 

Definition at line 331 of file FormulaCompiler.hxx.

Constructor & Destructor Documentation

◆ FormulaCompiler() [1/3]

formula::FormulaCompiler::FormulaCompiler ( const FormulaCompiler )
privatedelete

◆ FormulaCompiler() [2/3]

formula::FormulaCompiler::FormulaCompiler ( bool  bComputeII = false,
bool  bMatrixFlag = false 
)

Definition at line 790 of file FormulaCompiler.cxx.

References pc, and UNDEFINED.

◆ FormulaCompiler() [3/3]

formula::FormulaCompiler::FormulaCompiler ( FormulaTokenArray _rArr,
bool  bComputeII = false,
bool  bMatrixFlag = false 
)

Definition at line 765 of file FormulaCompiler.cxx.

References pc, and UNDEFINED.

◆ ~FormulaCompiler()

formula::FormulaCompiler::~FormulaCompiler ( )
virtual

Definition at line 813 of file FormulaCompiler.cxx.

Member Function Documentation

◆ AddSubLine()

void formula::FormulaCompiler::AddSubLine ( )
protected

Definition at line 2187 of file FormulaCompiler.cxx.

References HandleIIOpCode(), mbComputeII, mpToken, MulDivLine(), NextToken(), ocAdd, ocSub, p, pCode, and PutCode().

Referenced by ConcatLine().

◆ AnnotateOperands()

virtual void formula::FormulaCompiler::AnnotateOperands ( )
inlineprotectedvirtual

Definition at line 387 of file FormulaCompiler.hxx.

Referenced by Factor().

◆ AppendBoolean()

void formula::FormulaCompiler::AppendBoolean ( OUStringBuffer &  rBuffer,
bool  bVal 
) const

Definition at line 2687 of file FormulaCompiler.cxx.

References mxSymbols, ocFalse, and ocTrue.

◆ AppendDouble()

void formula::FormulaCompiler::AppendDouble ( OUStringBuffer &  rBuffer,
double  fVal 
) const

◆ AppendErrorConstant()

void formula::FormulaCompiler::AppendErrorConstant ( OUStringBuffer &  rBuffer,
FormulaError  nError 
) const

◆ AppendString()

void formula::FormulaCompiler::AppendString ( OUStringBuffer &  rBuffer,
const OUString &  rStr 
)
static

Definition at line 2692 of file FormulaCompiler.cxx.

References aStr.

Referenced by CreateStringFromToken().

◆ CheckSetForceArrayParameter()

void formula::FormulaCompiler::CheckSetForceArrayParameter ( FormulaTokenRef const &  rCurr,
sal_uInt8  nParam 
)
private

Check pCurrentFactorToken for nParam's (0-based) ForceArray types and set ForceArray at rCurr if so.

Set nParam+1 as 1-based nCurrentFactorParam for subsequent ForceArrayOperator() calls.

Definition at line 3089 of file FormulaCompiler.cxx.

References ForceArrayOperator(), nCurrentFactorParam, and pCurrentFactorToken.

Referenced by Factor().

◆ CompareLine()

void formula::FormulaCompiler::CompareLine ( )
protected

◆ CompileTokenArray()

bool formula::FormulaCompiler::CompileTokenArray ( )

◆ ConcatLine()

void formula::FormulaCompiler::ConcatLine ( )
protected

Definition at line 2207 of file FormulaCompiler.cxx.

References AddSubLine(), HandleIIOpCode(), mbComputeII, mpToken, NextToken(), ocAmpersand, p, pCode, and PutCode().

Referenced by CompareLine().

◆ CreateOpCodeMap()

FormulaCompiler::OpCodeMapPtr formula::FormulaCompiler::CreateOpCodeMap ( const css::uno::Sequence< const css::sheet::FormulaOpCodeMapEntry > &  rMapping,
bool  bEnglish 
)
static

Create an internal symbol map from API mapping.

Parameters
bEnglishUse English number parser / formatter instead of native.

Definition at line 934 of file FormulaCompiler.cxx.

References formula::FormulaGrammar::CONV_UNSPECIFIED, formula::FormulaGrammar::GRAM_EXTERNAL, formula::FormulaGrammar::mergeToGrammar(), ocExternal, SAL_WARN, SC_OPCODE_LAST_OPCODE_ID, and formula::FormulaGrammar::setEnglishBit().

◆ CreateStringFromDoubleRef()

void formula::FormulaCompiler::CreateStringFromDoubleRef ( OUStringBuffer &  rBuffer,
const FormulaToken pToken 
) const
protectedvirtual

Definition at line 2908 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ CreateStringFromExternal()

void formula::FormulaCompiler::CreateStringFromExternal ( OUStringBuffer &  rBuffer,
const FormulaToken pToken 
) const
protectedvirtual

Definition at line 2920 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ CreateStringFromIndex()

void formula::FormulaCompiler::CreateStringFromIndex ( OUStringBuffer &  rBuffer,
const FormulaToken pToken 
) const
protectedvirtual

Definition at line 2912 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ CreateStringFromMatrix()

void formula::FormulaCompiler::CreateStringFromMatrix ( OUStringBuffer &  rBuffer,
const FormulaToken pToken 
) const
protectedvirtual

Definition at line 2916 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ CreateStringFromSingleRef()

void formula::FormulaCompiler::CreateStringFromSingleRef ( OUStringBuffer &  rBuffer,
const FormulaToken pToken 
) const
protectedvirtual

Definition at line 2904 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ CreateStringFromToken() [1/2]

const FormulaToken * formula::FormulaCompiler::CreateStringFromToken ( OUString &  rFormula,
const FormulaToken pToken 
)

◆ CreateStringFromToken() [2/2]

const FormulaToken * formula::FormulaCompiler::CreateStringFromToken ( OUStringBuffer &  rBuffer,
const FormulaToken pToken,
bool  bAllowArrAdvance = false 
)

◆ CreateStringFromTokenArray() [1/2]

void formula::FormulaCompiler::CreateStringFromTokenArray ( OUString &  rFormula)

◆ CreateStringFromTokenArray() [2/2]

void formula::FormulaCompiler::CreateStringFromTokenArray ( OUStringBuffer &  rBuffer)

◆ DeQuote()

bool formula::FormulaCompiler::DeQuote ( OUString &  rStr)
static

Definition at line 1199 of file FormulaCompiler.cxx.

◆ DestroyOpCodeMap()

void formula::FormulaCompiler::DestroyOpCodeMap ( const sal_Int32  nLanguage)

Destroy the singleton OpCodeMap for formula language.

This unconditionally destroys the underlying singleton instance of the map to be reinitialized again later on the next GetOpCodeMap() call. Use if the base class FormulaCompiler::GetOpCodeMap() was called and created the map (i.e. HasOpCodeMap() before returned false) and later a derived class like ScCompiler shall initialize it including AddIns.

Parameters
nLanguageOne of css::sheet::FormulaLanguage constants.

Definition at line 873 of file FormulaCompiler.cxx.

References InitSymbolsAPI(), InitSymbolsEnglish(), InitSymbolsEnglishXL(), InitSymbolsNative(), InitSymbolsODFF(), InitSymbolsOOXML(), and InitSymbolsPODF().

Referenced by GetOpCodeMap().

◆ EnableJumpCommandReorder()

void formula::FormulaCompiler::EnableJumpCommandReorder ( bool  bEnable)

Definition at line 1380 of file FormulaCompiler.cxx.

References mbJumpCommandReorder.

◆ EnableStopOnError()

void formula::FormulaCompiler::EnableStopOnError ( bool  bEnable)

Definition at line 1385 of file FormulaCompiler.cxx.

References mbStopOnError.

◆ Expression()

OpCode formula::FormulaCompiler::Expression ( )
protected

◆ ExtendRangeReference()

FormulaTokenRef formula::FormulaCompiler::ExtendRangeReference ( FormulaToken rTok1,
FormulaToken rTok2 
)
protectedvirtual

Definition at line 2280 of file FormulaCompiler.cxx.

Referenced by MergeRangeReference().

◆ Factor()

void formula::FormulaCompiler::Factor ( )
protected

Definition at line 1557 of file FormulaCompiler.cxx.

References aCorrectedFormula, aCorrectedSymbol, formula::FormulaTokenArray::AddRecalcMode(), formula::FormulaTokenArrayPlainIterator::AfterRemoveToken(), AnnotateOperands(), bAutoCorrect, bCorrected, CheckSetForceArrayParameter(), CodeOverflow, Expression(), FORMULA_MAXJUMPCOUNT, FORMULA_MAXPARAMS, FORMULA_MAXPARAMSII, FORMULA_MAXTOKENS, formula::FormulaTokenArray::GetCodeError(), formula::FormulaToken::GetDouble(), formula::FormulaTokenArrayPlainIterator::GetIndex(), formula::FormulaToken::GetJump(), formula::FormulaToken::GetOpCode(), formula::FormulaToken::GetType(), HandleIIOpCode(), IllegalParameter, formula::FormulaGrammar::isODFF(), IsOpCodeJumpCommand(), IsOpCodeVolatile(), maArrIterator, mbComputeII, mbJumpCommandReorder, mbStopOnError, meGrammar, mpToken, mxSymbols, formula::FormulaToken::NewOpCode(), NextToken(), nNumFmt, NoName, NONE, ocAnd, ocBad, ocCell, ocChoose, ocClose, ocColRowName, ocColRowNameAuto, ocColumn, ocConvertOOo, ocDBArea, ocDde, ocExternal, ocHyperLink, ocIf, ocIfError, ocIfNA, ocInternalBegin, ocInternalEnd, ocIsoWeeknum, ocMacro, ocMatRef, ocMissing, ocMul, ocName, ocNot, ocOpen, ocOr, ocPush, ocRow, ocSep, ocStop, ocTableRef, ocUnion, ocWebservice, ocWeeknumOOo, ONLOAD_LENIENT, ONLOAD_MUST, OperatorExpected, p, PairExpected, ParameterExpected, pArr, pc, pCode, pStack, PutCode(), formula::FormulaTokenArray::RemoveToken(), SAL_WARN, SC_OPCODE_START_1_PAR, SC_OPCODE_START_2_PAR, SC_OPCODE_START_NO_PAR, SC_OPCODE_STOP_1_PAR, SC_OPCODE_STOP_2_PAR, SC_OPCODE_STOP_NO_PAR, formula::FormulaToken::SetByte(), SetError(), formula::FormulaTokenArray::SetExclusiveRecalcModeAlways(), formula::FormulaTokenArray::SetHyperLink(), formula::FormulaTokenArray::SetRecalcModeOnRefMove(), formula::svDouble, formula::svJump, formula::svSingleRef, formula::svString, formula::FormulaTokenArray::TokenAt(), and UnknownToken.

Referenced by RangeLine().

◆ fillAddInToken()

void formula::FormulaCompiler::fillAddInToken ( ::std::vector< css::sheet::FormulaOpCodeMapEntry > &  _rVec,
bool  _bIsEnglish 
) const
protectedvirtual

◆ fillFromAddInCollectionEnglishName()

void formula::FormulaCompiler::fillFromAddInCollectionEnglishName ( const NonConstOpCodeMapPtr xMap) const
protectedvirtual

Definition at line 1136 of file FormulaCompiler.cxx.

Referenced by loadSymbols().

◆ fillFromAddInCollectionUpperName()

void formula::FormulaCompiler::fillFromAddInCollectionUpperName ( const NonConstOpCodeMapPtr xMap) const
protectedvirtual

Definition at line 1132 of file FormulaCompiler.cxx.

Referenced by loadSymbols().

◆ fillFromAddInMap()

void formula::FormulaCompiler::fillFromAddInMap ( const NonConstOpCodeMapPtr xMap,
FormulaGrammar::Grammar  _eGrammar 
) const
protectedvirtual

Definition at line 1140 of file FormulaCompiler.cxx.

Referenced by loadSymbols().

◆ FindAddInFunction()

OUString formula::FormulaCompiler::FindAddInFunction ( const OUString &  rUpperName,
bool  bLocalFirst 
) const
protectedvirtual

◆ ForceArrayOperator()

void formula::FormulaCompiler::ForceArrayOperator ( FormulaTokenRef const &  rCurr)
private

◆ GetCurrentOpCodeMap()

const OpCodeMapPtr & formula::FormulaCompiler::GetCurrentOpCodeMap ( ) const
inline

Get current OpCodeMap in effect.

Definition at line 264 of file FormulaCompiler.hxx.

◆ GetEnglishOpCode()

OpCode formula::FormulaCompiler::GetEnglishOpCode ( const OUString &  rName) const

Get OpCode for English symbol.

Used in XFunctionAccess to create token array.

Parameters
rNameSymbol to lookup. MUST be upper case.

Definition at line 1144 of file FormulaCompiler.cxx.

References GetOpCodeMap(), and ocNone.

◆ GetErrorConstant()

FormulaError formula::FormulaCompiler::GetErrorConstant ( const OUString &  rName) const

◆ GetFinalOpCodeMap()

FormulaCompiler::OpCodeMapPtr formula::FormulaCompiler::GetFinalOpCodeMap ( const sal_Int32  nLanguage) const
protected

Get finalized OpCodeMap for formula language.

Creates/returns a singleton instance of an OpCodeMap that contains external AddIn mappings if the derived class supports them. Do not call at this base class as it results in a permanent mapping without AddIns even for derived classes (unless it is for the implementation of the temporary GetOpCodeMap()).

Parameters
nLanguageOne of css::sheet::FormulaLanguage constants.
Returns
Map for nLanguage. If nLanguage is unknown, a NULL map is returned.

Definition at line 826 of file FormulaCompiler.cxx.

References InitSymbolsAPI(), InitSymbolsEnglish(), InitSymbolsEnglishXL(), InitSymbolsNative(), InitSymbolsODFF(), InitSymbolsOOXML(), InitSymbolsPODF(), mxSymbolsAPI, mxSymbolsEnglish, mxSymbolsEnglishXL, mxSymbolsNative, mxSymbolsODFF, mxSymbolsOOXML, and mxSymbolsPODF.

Referenced by GetOpCodeMap().

◆ GetForceArrayParameter()

formula::ParamClass formula::FormulaCompiler::GetForceArrayParameter ( const FormulaToken pToken,
sal_uInt16  nParam 
) const
virtual

If a parameter nParam (0-based) is to be forced to array for OpCode eOp, i.e.

classified as ParamClass::ForceArray or ParamClass::ReferenceOrForceArray type.

Definition at line 2928 of file FormulaCompiler.cxx.

References formula::Unknown.

Referenced by ForceArrayOperator().

◆ GetGrammar()

FormulaGrammar::Grammar formula::FormulaCompiler::GetGrammar ( ) const
inline

Set symbol map corresponding to one of predefined formula::FormulaGrammar::Grammar, including an address reference convention.

Definition at line 304 of file FormulaCompiler.hxx.

◆ GetNativeSymbol()

const OUString & formula::FormulaCompiler::GetNativeSymbol ( OpCode  eOp)
static

Definition at line 994 of file FormulaCompiler.cxx.

References formula::lcl_fillNativeSymbols().

Referenced by CreateStringFromToken(), and GetNativeSymbolChar().

◆ GetNativeSymbolChar()

sal_Unicode formula::FormulaCompiler::GetNativeSymbolChar ( OpCode  eOp)
static

Definition at line 1001 of file FormulaCompiler.cxx.

References GetNativeSymbol().

◆ GetNumFormatType()

SvNumFormatType formula::FormulaCompiler::GetNumFormatType ( ) const
inline

Definition at line 289 of file FormulaCompiler.hxx.

◆ GetOpCodeMap()

FormulaCompiler::OpCodeMapPtr formula::FormulaCompiler::GetOpCodeMap ( const sal_Int32  nLanguage) const

Get OpCodeMap for formula language.

Returns either the finalized OpCodeMap (created by GetFinalOpCodeMap() of a derived class) for nLanguage if there is such, or if not then a temporary map of which its singleton is reset immediately and the temporary will get destroyed by the caller's scope. A temporary map created at this base class does not contain AddIn mappings.

Parameters
nLanguageOne of css::sheet::FormulaLanguage constants.
Returns
Map for nLanguage. If nLanguage is unknown, a NULL map is returned.

Definition at line 817 of file FormulaCompiler.cxx.

References DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

Referenced by GetEnglishOpCode().

◆ GetToken()

bool formula::FormulaCompiler::GetToken ( )
protected

◆ HandleColRowName()

bool formula::FormulaCompiler::HandleColRowName ( )
protectedvirtual

Definition at line 2889 of file FormulaCompiler.cxx.

Referenced by GetToken().

◆ HandleDbData()

bool formula::FormulaCompiler::HandleDbData ( )
protectedvirtual

Definition at line 2894 of file FormulaCompiler.cxx.

Referenced by GetToken().

◆ HandleExternalReference()

bool formula::FormulaCompiler::HandleExternalReference ( const FormulaToken _aToken)
protectedvirtual

Definition at line 2879 of file FormulaCompiler.cxx.

Referenced by GetToken().

◆ HandleIIOpCode()

virtual void formula::FormulaCompiler::HandleIIOpCode ( FormulaToken ,
FormulaToken ***  ,
sal_uInt8   
)
inlineprotectedvirtual

◆ HandleRange()

bool formula::FormulaCompiler::HandleRange ( )
protectedvirtual

Definition at line 2884 of file FormulaCompiler.cxx.

Referenced by GetToken().

◆ HandleTableRef()

bool formula::FormulaCompiler::HandleTableRef ( )
protectedvirtual

Definition at line 2899 of file FormulaCompiler.cxx.

Referenced by GetToken().

◆ HasOpCodeMap()

bool formula::FormulaCompiler::HasOpCodeMap ( const sal_Int32  nLanguage) const

Whether the singleton OpCodeMap for formula language exists already.

Parameters
nLanguageOne of css::sheet::FormulaLanguage constants.

Definition at line 904 of file FormulaCompiler.cxx.

References InitSymbolsAPI(), InitSymbolsEnglish(), InitSymbolsEnglishXL(), InitSymbolsNative(), InitSymbolsODFF(), InitSymbolsOOXML(), and InitSymbolsPODF().

Referenced by GetOpCodeMap().

◆ InitSymbolsAPI()

bool formula::FormulaCompiler::InitSymbolsAPI ( FormulaCompiler::InitSymbols  eWhat) const
private

only SymbolsPODF, on demand

Definition at line 1039 of file FormulaCompiler.cxx.

References aMap, formula::FormulaGrammar::GRAM_API, loadSymbols(), mxSymbolsAPI, and RESOURCE_BASE.

Referenced by DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

◆ InitSymbolsEnglish()

bool formula::FormulaCompiler::InitSymbolsEnglish ( FormulaCompiler::InitSymbols  eWhat) const
private

only SymbolsNative, on first document creation

Definition at line 1011 of file FormulaCompiler.cxx.

References aMap, formula::FormulaGrammar::GRAM_ENGLISH, loadSymbols(), and mxSymbolsEnglish.

Referenced by DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

◆ InitSymbolsEnglishXL()

bool formula::FormulaCompiler::InitSymbolsEnglishXL ( FormulaCompiler::InitSymbols  eWhat) const
private

◆ InitSymbolsNative()

bool formula::FormulaCompiler::InitSymbolsNative ( FormulaCompiler::InitSymbols  eWhat) const
private

◆ InitSymbolsODFF()

bool formula::FormulaCompiler::InitSymbolsODFF ( FormulaCompiler::InitSymbols  eWhat) const
private

only SymbolsAPI, on demand

Definition at line 1053 of file FormulaCompiler.cxx.

References aMap, formula::FormulaGrammar::GRAM_ODFF, loadSymbols(), mxSymbolsODFF, and RESOURCE_BASE.

Referenced by DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

◆ InitSymbolsOOXML()

bool formula::FormulaCompiler::InitSymbolsOOXML ( FormulaCompiler::InitSymbols  eWhat) const
private

only SymbolsEnglishXL, on demand

Definition at line 1091 of file FormulaCompiler.cxx.

References aMap, formula::FormulaGrammar::GRAM_OOXML, loadSymbols(), mxSymbolsOOXML, and RESOURCE_BASE.

Referenced by DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

◆ InitSymbolsPODF()

bool formula::FormulaCompiler::InitSymbolsPODF ( FormulaCompiler::InitSymbols  eWhat) const
private

only SymbolsEnglish, maybe later

Definition at line 1025 of file FormulaCompiler.cxx.

References aMap, formula::FormulaGrammar::GRAM_PODF, loadSymbols(), mxSymbolsPODF, and RESOURCE_BASE.

Referenced by DestroyOpCodeMap(), GetFinalOpCodeMap(), and HasOpCodeMap().

◆ IntersectionLine()

void formula::FormulaCompiler::IntersectionLine ( )
protected

◆ IsMatrixFunction()

bool formula::FormulaCompiler::IsMatrixFunction ( OpCode  _eOpCode)
static

◆ IsOpCodeJumpCommand()

bool formula::FormulaCompiler::IsOpCodeJumpCommand ( OpCode  eOp)
static

◆ IsOpCodeVolatile()

bool formula::FormulaCompiler::IsOpCodeVolatile ( OpCode  eOp)
static

Definition at line 1153 of file FormulaCompiler.cxx.

References ocDebugVar, ocFormula, ocGetActDate, ocGetActTime, ocIndirect, ocInfo, ocOffset, and ocRandom.

Referenced by Factor().

◆ loadSymbols()

void formula::FormulaCompiler::loadSymbols ( const std::pair< const char *, int > *  pSymbols,
FormulaGrammar::Grammar  eGrammar,
NonConstOpCodeMapPtr rxMap,
SeparatorType  eSepType = SeparatorType::SEMICOLON_BASE 
) const
private

◆ LocalizeString()

void formula::FormulaCompiler::LocalizeString ( OUString &  rName) const
protectedvirtual

Definition at line 2924 of file FormulaCompiler.cxx.

Referenced by CreateStringFromToken().

◆ MergeRangeReference()

bool formula::FormulaCompiler::MergeRangeReference ( FormulaToken **const  pCode1,
FormulaToken *const *const  pCode2 
)
protected

Definition at line 2285 of file FormulaCompiler.cxx.

References formula::FormulaToken::DecRef(), ExtendRangeReference(), p, pc, and pCode.

Referenced by RangeLine().

◆ MulDivLine()

void formula::FormulaCompiler::MulDivLine ( )
protected

Definition at line 2167 of file FormulaCompiler.cxx.

References HandleIIOpCode(), mbComputeII, mpToken, NextToken(), ocDiv, ocMul, p, pCode, PowLine(), and PutCode().

Referenced by AddSubLine().

◆ NeedsTableRefTransformation()

bool formula::FormulaCompiler::NeedsTableRefTransformation ( ) const

Whether current symbol set and grammar need transformation of Table structured references to A1 style references when writing / exporting (creating strings).

Definition at line 2705 of file FormulaCompiler.cxx.

References formula::FormulaGrammar::isPODF(), meGrammar, mxSymbols, and ocTableRefOpen.

Referenced by CreateStringFromToken().

◆ NextToken()

OpCode formula::FormulaCompiler::NextToken ( )
protected

◆ operator=()

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

◆ PopTokenArray()

void formula::FormulaCompiler::PopTokenArray ( )
protected

◆ PostOpLine()

void formula::FormulaCompiler::PostOpLine ( )
protected

Definition at line 2132 of file FormulaCompiler.cxx.

References HandleIIOpCode(), mbComputeII, mpToken, NextToken(), ocPercentSign, pCode, PutCode(), and UnaryLine().

Referenced by PowLine().

◆ PostProcessCode()

virtual void formula::FormulaCompiler::PostProcessCode ( )
inlineprotectedvirtual

Definition at line 385 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray().

◆ PowLine()

void formula::FormulaCompiler::PowLine ( )
protected

Definition at line 2147 of file FormulaCompiler.cxx.

References HandleIIOpCode(), mbComputeII, mpToken, NextToken(), ocPow, p, pCode, PostOpLine(), and PutCode().

Referenced by MulDivLine().

◆ PushTokenArray()

void formula::FormulaCompiler::PushTokenArray ( FormulaTokenArray pa,
bool  bTemp 
)
protected

◆ PutCode()

void formula::FormulaCompiler::PutCode ( FormulaTokenRef p)
protected

◆ RangeLine()

void formula::FormulaCompiler::RangeLine ( )
protected

Definition at line 2050 of file FormulaCompiler.cxx.

References Factor(), MergeRangeReference(), mpToken, NextToken(), ocRange, p, pCode, and PutCode().

Referenced by IntersectionLine().

◆ ResetNativeSymbols()

void formula::FormulaCompiler::ResetNativeSymbols ( )
static

Definition at line 2724 of file FormulaCompiler.cxx.

References formula::lcl_fillNativeSymbols().

◆ SetComputeIIFlag()

void formula::FormulaCompiler::SetComputeIIFlag ( bool  bSet)
inline

Sets the implicit intersection compute flag.

Definition at line 322 of file FormulaCompiler.hxx.

◆ SetError()

void formula::FormulaCompiler::SetError ( FormulaError  nError)
protectedvirtual

◆ SetMatrixFlag()

void formula::FormulaCompiler::SetMatrixFlag ( bool  bSet)
inline

Sets the matrix flag for the formula.

Definition at line 325 of file FormulaCompiler.hxx.

◆ SetNativeSymbols()

void formula::FormulaCompiler::SetNativeSymbols ( const OpCodeMapPtr xMap)
static

Definition at line 2731 of file FormulaCompiler.cxx.

References formula::lcl_fillNativeSymbols().

◆ UnaryLine()

void formula::FormulaCompiler::UnaryLine ( )
protected

◆ UnionLine()

void formula::FormulaCompiler::UnionLine ( )
protected

Definition at line 2099 of file FormulaCompiler.cxx.

References IntersectionLine(), mpToken, NextToken(), ocUnion, p, and PutCode().

Referenced by UnaryLine().

◆ UpdateSeparatorsNative()

void formula::FormulaCompiler::UpdateSeparatorsNative ( const OUString &  rSep,
const OUString &  rArrayColSep,
const OUString &  rArrayRowSep 
)
static

Member Data Documentation

◆ aCorrectedFormula

OUString formula::FormulaCompiler::aCorrectedFormula
protected

Definition at line 389 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), Factor(), GetToken(), NextToken(), and PushTokenArray().

◆ aCorrectedSymbol

OUString formula::FormulaCompiler::aCorrectedSymbol
protected

Definition at line 390 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), Factor(), GetToken(), NextToken(), and PushTokenArray().

◆ bAutoCorrect

bool formula::FormulaCompiler::bAutoCorrect
protected

Definition at line 411 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), Factor(), GetToken(), NextToken(), and PushTokenArray().

◆ bCorrected

bool formula::FormulaCompiler::bCorrected
protected

Definition at line 412 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), Factor(), and NextToken().

◆ eLastOp

OpCode formula::FormulaCompiler::eLastOp
protected

Definition at line 404 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), and NextToken().

◆ glSubTotal

bool formula::FormulaCompiler::glSubTotal
protected

Definition at line 413 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), and GetToken().

◆ maArrIterator

FormulaTokenArrayPlainIterator formula::FormulaCompiler::maArrIterator
protected

◆ mbComputeII

bool formula::FormulaCompiler::mbComputeII
protected

Whether to stop compilation on first encountered error.

Definition at line 419 of file FormulaCompiler.hxx.

Referenced by AddSubLine(), CompareLine(), ConcatLine(), Expression(), Factor(), GetToken(), MulDivLine(), PostOpLine(), PowLine(), and UnaryLine().

◆ mbJumpCommandReorder

bool formula::FormulaCompiler::mbJumpCommandReorder
protected

Definition at line 416 of file FormulaCompiler.hxx.

Referenced by EnableJumpCommandReorder(), Factor(), and PutCode().

◆ mbMatrixFlag

bool formula::FormulaCompiler::mbMatrixFlag
protected

Definition at line 420 of file FormulaCompiler.hxx.

Referenced by ForceArrayOperator().

◆ mbStopOnError

bool formula::FormulaCompiler::mbStopOnError
protected

Whether or not to reorder RPN for jump commands.

Definition at line 417 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), EnableStopOnError(), Factor(), and GetToken().

◆ meGrammar

FormulaGrammar::Grammar formula::FormulaCompiler::meGrammar
protected

◆ mpLastToken

FormulaTokenRef formula::FormulaCompiler::mpLastToken
protected

Definition at line 399 of file FormulaCompiler.hxx.

Referenced by GetToken(), PopTokenArray(), and PushTokenArray().

◆ mpToken

FormulaTokenRef formula::FormulaCompiler::mpToken
protected

◆ mxSymbols

OpCodeMapPtr formula::FormulaCompiler::mxSymbols
protected

◆ mxSymbolsAPI

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsAPI
mutableprivate

Definition at line 491 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsAPI().

◆ mxSymbolsEnglish

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsEnglish
mutableprivate

Definition at line 493 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsEnglish().

◆ mxSymbolsEnglishXL

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsEnglishXL
mutableprivate

Definition at line 494 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsEnglishXL().

◆ mxSymbolsNative

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsNative
mutableprivate

Definition at line 492 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsNative().

◆ mxSymbolsODFF

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsODFF
mutableprivate

Definition at line 489 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsODFF().

◆ mxSymbolsOOXML

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsOOXML
mutableprivate

Definition at line 495 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsOOXML().

◆ mxSymbolsPODF

NonConstOpCodeMapPtr formula::FormulaCompiler::mxSymbolsPODF
mutableprivate

Definition at line 490 of file FormulaCompiler.hxx.

Referenced by GetFinalOpCodeMap(), and InitSymbolsPODF().

◆ nCurrentFactorParam

sal_uInt16 formula::FormulaCompiler::nCurrentFactorParam
protected

◆ needsRPNTokenCheck

bool formula::FormulaCompiler::needsRPNTokenCheck
protected

Definition at line 414 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), and GetToken().

◆ nNumFmt

SvNumFormatType formula::FormulaCompiler::nNumFmt
protected

Definition at line 406 of file FormulaCompiler.hxx.

Referenced by CompileTokenArray(), and Factor().

◆ nRecursion

short formula::FormulaCompiler::nRecursion
protected

Definition at line 405 of file FormulaCompiler.hxx.

Referenced by Expression(), GetToken(), and NextToken().

◆ pArr

FormulaTokenArray* formula::FormulaCompiler::pArr
protected

◆ pc

sal_uInt16 formula::FormulaCompiler::pc
protected

◆ pCode

FormulaToken** formula::FormulaCompiler::pCode
protected

◆ pCurrentFactorToken

FormulaTokenRef formula::FormulaCompiler::pCurrentFactorToken
protected

◆ pStack

FormulaArrayStack* formula::FormulaCompiler::pStack
protected

◆ smDummyTokenArray

FormulaTokenArray formula::FormulaCompiler::smDummyTokenArray
staticprivate

Definition at line 497 of file FormulaCompiler.hxx.


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