LibreOffice Module sc (master)  1
compiler.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <string.h>
23 
24 #include "scdllapi.h"
25 #include "global.hxx"
26 #include "refdata.hxx"
27 #include "token.hxx"
28 #include <formula/token.hxx>
29 #include <formula/grammar.hxx>
30 #include <rtl/ustrbuf.hxx>
31 #include <com/sun/star/sheet/ExternalLinkInfo.hpp>
32 #include <com/sun/star/i18n/ParseResult.hpp>
33 #include <queue>
34 #include <vector>
35 #include <memory>
36 #include <set>
37 #include <com/sun/star/uno/Sequence.hxx>
38 #include <o3tl/typed_flags_set.hxx>
39 
41 
42 struct ScSheetLimits;
43 
44 // constants and data types also for external modules (ScInterpreter et al)
45 
46 #define MAXSTRLEN 1024 /* maximum length of input string of one symbol */
47 
48 // flag values of CharTable
49 enum class ScCharFlags : sal_uInt32 {
50  NONE = 0x00000000,
51  Illegal = 0x00000000,
52  Char = 0x00000001,
53  CharBool = 0x00000002,
54  CharWord = 0x00000004,
55  CharValue = 0x00000008,
56  CharString = 0x00000010,
57  CharDontCare = 0x00000020,
58  Bool = 0x00000040,
59  Word = 0x00000080,
60  WordSep = 0x00000100,
61  Value = 0x00000200,
62  ValueSep = 0x00000400,
63  ValueExp = 0x00000800,
64  ValueSign = 0x00001000,
65  ValueValue = 0x00002000,
66  StringSep = 0x00004000,
67  NameSep = 0x00008000, // there can be only one! '\''
68  CharIdent = 0x00010000, // identifier (built-in function) or reference start
69  Ident = 0x00020000, // identifier or reference continuation
70  OdfLBracket = 0x00040000, // ODF '[' reference bracket
71  OdfRBracket = 0x00080000, // ODF ']' reference bracket
72  OdfLabelOp = 0x00100000, // ODF '!!' automatic intersection of labels
73  OdfNameMarker = 0x00200000, // ODF '$$' marker that starts a defined (range) name
74  CharName = 0x00400000, // start character of a defined name
75  Name = 0x00800000, // continuation character of a defined name
76  CharErrConst = 0x01000000, // start character of an error constant ('#')
77 };
78 namespace o3tl {
79  template<> struct typed_flags<ScCharFlags> : is_typed_flags<ScCharFlags, 0x01ffffff> {};
80 }
81 
82 #define SC_COMPILER_FILE_TAB_SEP '#' // 'Doc'#Tab
83 
84 class ScDocument;
85 class ScMatrix;
86 class ScRangeData;
87 class ScTokenArray;
89 class CharClass;
90 
91 namespace sc {
92 
93 class CompileFormulaContext;
94 
95 }
96 
97 // constants and data types internal to compiler
98 
99 struct ScRawToken final
100 {
101  friend class ScCompiler;
102  // Friends that use a temporary ScRawToken on the stack (and therefore need
103  // the private dtor) and know what they're doing...
104  friend class ScTokenArray;
106  formula::StackVar eType; // type of data; this determines how the unions are used
107 public:
108  union {
109  double nValue;
110  struct {
113  } sbyte;
115  struct {
116  sal_uInt16 nFileId;
118  } extref;
119  struct {
120  sal_uInt16 nFileId;
121  } extname;
122  struct {
123  sal_Int16 nSheet;
124  sal_uInt16 nIndex;
125  } name;
126  struct {
127  sal_uInt16 nIndex;
129  } table;
130  struct {
131  rtl_uString* mpData;
132  rtl_uString* mpDataIgnoreCase;
133  } sharedstring;
136  short nJump[ FORMULA_MAXJUMPCOUNT + 1 ]; // If/Chose token
137  };
138  OUString maExternalName; // depending on the opcode, this is either the external, or the external name, or the external table name
139 
140  // coverity[uninit_member] - members deliberately not initialized
142 private:
144 public:
145  formula::StackVar GetType() const { return eType; }
146  OpCode GetOpCode() const { return eOp; }
147  void NewOpCode( OpCode e ) { eOp = e; }
148 
149  // Use these methods only on tokens that are not part of a token array,
150  // since the reference count is cleared!
151  void SetOpCode( OpCode eCode );
152  void SetString( rtl_uString* pData, rtl_uString* pDataIgoreCase );
153  void SetSingleReference( const ScSingleRefData& rRef );
154  void SetDoubleReference( const ScComplexRefData& rRef );
155  void SetDouble( double fVal );
156  void SetErrorConstant( FormulaError nErr );
157 
158  // These methods are ok to use, reference count not cleared.
159  void SetName(sal_Int16 nSheet, sal_uInt16 nIndex);
160  void SetExternalSingleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef );
161  void SetExternalDoubleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef );
162  void SetExternalName( sal_uInt16 nFileId, const OUString& rName );
163  void SetExternal(const OUString& rStr);
164 
170  bool IsValidReference(const ScDocument& rDoc) const;
171 
172  formula::FormulaToken* CreateToken(ScSheetLimits& rLimits) const; // create typified token
173 };
174 
176 {
177 public:
178 
180  {
181  EXTENDED_ERROR_DETECTION_NONE = 0, // no error on unknown symbols, default (interpreter handles it)
182  EXTENDED_ERROR_DETECTION_NAME_BREAK, // name error on unknown symbols and break, pCode incomplete
183  EXTENDED_ERROR_DETECTION_NAME_NO_BREAK // name error on unknown symbols, don't break, continue
184  };
185 
186  struct SAL_DLLPRIVATE Convention
187  {
189 
191  virtual ~Convention();
192 
193  virtual void makeRefStr(
194  ScSheetLimits& rLimits,
195  OUStringBuffer& rBuffer,
197  const ScAddress& rPos,
198  const OUString& rErrRef, const std::vector<OUString>& rTabNames,
199  const ScComplexRefData& rRef, bool bSingleRef, bool bFromRangeName ) const = 0;
200 
201  virtual css::i18n::ParseResult
202  parseAnyToken( const OUString& rFormula,
203  sal_Int32 nSrcPos,
204  const CharClass* pCharClass,
205  bool bGroupSeparator) const = 0;
206 
213  virtual bool parseExternalName( const OUString& rSymbol, OUString& rFile, OUString& rName,
214  const ScDocument& rDoc,
215  const css::uno::Sequence< css::sheet::ExternalLinkInfo>* pExternalLinks ) const = 0;
216 
217  virtual OUString makeExternalNameStr( sal_uInt16 nFileId, const OUString& rFile,
218  const OUString& rName ) const = 0;
219 
220  virtual void makeExternalRefStr(
221  ScSheetLimits& rLimits,
222  OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rFileName,
223  const OUString& rTabName, const ScSingleRefData& rRef ) const = 0;
224 
225  virtual void makeExternalRefStr(
226  ScSheetLimits& rLimits,
227  OUStringBuffer& rBuffer, const ScAddress& rPos,
228  sal_uInt16 nFileId, const OUString& rFileName, const std::vector<OUString>& rTabNames,
229  const OUString& rTabName, const ScComplexRefData& rRef ) const = 0;
230 
232  {
238 
243  ABS_SHEET_PREFIX
244  };
245  virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
246 
247  virtual ScCharFlags getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const = 0;
248 
249  protected:
250  std::unique_ptr<ScCharFlags[]> mpCharTable;
251  };
252  friend struct Convention;
253 
254 private:
255 
256  static const CharClass *pCharClassEnglish; // character classification for en_US locale
257  static const CharClass *pCharClassLocalized; // character classification for UI locale
258  static const Convention *pConventions[ formula::FormulaGrammar::CONV_LAST ];
259 
260  static const struct AddInMap
261  {
262  const char* pODFF;
263  const char* pEnglish;
264  const char* pOriginal; // programmatical name
265  const char* pUpper; // upper case programmatical name
266  } g_aAddInMap[];
267  static size_t GetAddInMapCount();
268 
271 
274 
275  SCTAB mnCurrentSheetTab; // indicates current sheet number parsed so far
276  sal_Int32 mnCurrentSheetEndPos; // position after current sheet name if parsed
277 
278  // For CONV_XL_OOX, may be set via API by MOOXML filter.
279  css::uno::Sequence<css::sheet::ExternalLinkInfo> maExternalLinks;
280 
281  sal_Unicode cSymbol[MAXSTRLEN+1]; // current Symbol + 0
282  OUString aFormula; // formula source code
283  sal_Int32 nSrcPos; // tokenizer position (source code)
285 
286  std::queue<OpCode> maPendingOpCodes; // additional opcodes generated from a single symbol
287 
288  const CharClass* pCharClass; // which character classification is used for parseAnyToken and upper/lower
289  bool mbCharClassesDiffer; // whether pCharClass and current system locale's CharClass differ
290  sal_uInt16 mnPredetectedReference; // reference when reading ODF, 0 (none), 1 (single) or 2 (double)
291  sal_Int32 mnRangeOpPosInSymbol; // if and where a range operator is in symbol
294  bool mbCloseBrackets; // whether to close open brackets automatically, default TRUE
295  bool mbRewind; // whether symbol is to be rewound to some step during lexical analysis
296  std::vector<sal_uInt16> maExternalFiles;
297 
298  std::vector<OUString> maTabNames;
299  std::vector<OUString> &GetSetupTabNames() const;
300 
302  {
304  sal_uInt16 mnLevel;
305  TableRefEntry( formula::FormulaToken* p ) : mxToken(p), mnLevel(0) {}
306  };
307  std::vector<TableRefEntry> maTableRefs;
308 
309  // Optimizing implicit intersection is done only at the end of code generation, because the usage context may
310  // be important. Store candidate parameters and the operation they are the argument for.
312  {
314  : parameterLocation( p ), parameter( *p ), operation( o ) {}
318  };
319  std::vector< PendingImplicitIntersectionOptimization > mPendingImplicitIntersectionOptimizations;
320  std::set<formula::FormulaTokenRef> mUnhandledPossibleImplicitIntersections;
321 #ifdef DBG_UTIL
323 #endif
324 
325  bool NextNewToken(bool bInArray);
326  bool ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rOrg ) const;
327 
328  virtual void SetError(FormulaError nError) override;
329  sal_Int32 NextSymbol(bool bInArray);
330  bool IsValue( const OUString& );
331  bool IsOpCode( const OUString&, bool bInArray );
332  bool IsOpCode2( const OUString& );
333  bool IsString();
334  bool IsReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
335  bool IsSingleReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
336  bool IsDoubleReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
337  bool IsPredetectedReference( const OUString& rSymbol );
338  bool IsPredetectedErrRefReference( const OUString& rName, const OUString* pErrRef );
339  bool IsMacro( const OUString& );
340  bool IsNamedRange( const OUString& );
341  bool IsExternalNamedRange( const OUString& rSymbol, bool& rbInvalidExternalNameRange );
342  bool IsDBRange( const OUString& );
343  bool IsColRowName( const OUString& );
344  bool IsBoolean( const OUString& );
345  void AutoCorrectParsedSymbol();
346 
347  void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
348  void SetRelNameReference();
349 
355  ScRangeData* GetRangeData( const formula::FormulaToken& pToken ) const;
356 
357  static const CharClass* GetCharClassEnglish();
358  static const CharClass* GetCharClassLocalized();
359 
360 public:
361  ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos,
362  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
363 
366  ScCompiler( ScDocument& rDocument, const ScAddress&,
368  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
369 
370  ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, ScTokenArray& rArr,
371  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
372 
375  ScCompiler( ScDocument& rDocument, const ScAddress&, ScTokenArray& rArr,
377  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
378 
379  virtual ~ScCompiler() override;
380 
381 public:
382  static void DeInit();
383 
384  // for ScAddress::Format()
385  static void CheckTabQuotes( OUString& aTabName,
387 
392  static sal_Int32 GetDocTabPos( const OUString& rString );
393 
394  static bool EnQuote( OUString& rStr );
395 
396  // Check if it is a valid english function name
397  static bool IsEnglishSymbol( const OUString& rName );
398 
399  bool IsErrorConstant( const OUString& ) const;
400  bool IsTableRefItem( const OUString& ) const;
401  bool IsTableRefColumn( const OUString& ) const;
402 
404  bool GetTokenIfOpCode( OpCode eOp );
405 
409  void SetAutoCorrection( bool bVal );
410  void SetCloseBrackets( bool bVal ) { mbCloseBrackets = bVal; }
411  void SetRefConvention( const Convention *pConvP );
412  void SetRefConvention( const formula::FormulaGrammar::AddressConvention eConv );
413 
414  static const Convention* GetRefConvention( formula::FormulaGrammar::AddressConvention eConv );
415 
417  void SetFormulaLanguage( const OpCodeMapPtr & xMap );
418 
419  void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar );
420 
421  void SetNumberFormatter( SvNumberFormatter* pFormatter );
422 
423 private:
433  void SetGrammarAndRefConvention(
434  const formula::FormulaGrammar::Grammar eNewGrammar,
435  const formula::FormulaGrammar::Grammar eOldGrammar );
436 public:
437 
440  const css::uno::Sequence<
441  css::sheet::ExternalLinkInfo>& rLinks )
442  {
443  maExternalLinks = rLinks;
444  }
445 
446  void CreateStringFromXMLTokenArray( OUString& rFormula, OUString& rFormulaNmsp );
447 
448  void SetExtendedErrorDetection( ExtendedErrorDetection eVal ) { meExtendedErrorDetection = eVal; }
449 
450  bool IsCorrected() const { return bCorrected; }
451  const OUString& GetCorrectedFormula() const { return aCorrectedFormula; }
452 
461  std::unique_ptr<ScTokenArray> CompileString( const OUString& rFormula );
462  std::unique_ptr<ScTokenArray> CompileString( const OUString& rFormula, const OUString& rFormulaNmsp );
463  const ScAddress& GetPos() const { return aPos; }
464 
465  void MoveRelWrap();
466  static void MoveRelWrap( const ScTokenArray& rArr, const ScDocument& rDoc, const ScAddress& rPos,
467  SCCOL nMaxCol, SCROW nMaxRow );
468 
472  static bool IsCharFlagAllConventions(
473  OUString const & rStr, sal_Int32 nPos, ScCharFlags nFlags );
474 
476  static bool DoubleRefToPosSingleRefScalarCase(const ScRange& rRange, ScAddress& rAdr,
477  const ScAddress& rFormulaPos);
478 
479  bool HasUnhandledPossibleImplicitIntersections() const { return !mUnhandledPossibleImplicitIntersections.empty(); }
480 #ifdef DBG_UTIL
481  const std::set<OpCode>& UnhandledPossibleImplicitIntersectionsOpCodes() { return mUnhandledPossibleImplicitIntersectionsOpCodes; }
482 #endif
483 
484 private:
485  // FormulaCompiler
486  virtual OUString FindAddInFunction( const OUString& rUpperName, bool bLocalFirst ) const override;
487  virtual void fillFromAddInCollectionUpperName( const NonConstOpCodeMapPtr& xMap ) const override;
488  virtual void fillFromAddInCollectionEnglishName( const NonConstOpCodeMapPtr& xMap ) const override;
489  virtual void fillFromAddInMap( const NonConstOpCodeMapPtr& xMap, formula::FormulaGrammar::Grammar _eGrammar ) const override;
490  virtual void fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry >& _rVec,bool _bIsEnglish) const override;
491 
492  virtual bool HandleExternalReference(const formula::FormulaToken& _aToken) override;
493  virtual bool HandleRange() override;
494  virtual bool HandleColRowName() override;
495  virtual bool HandleDbData() override;
496  virtual bool HandleTableRef() override;
497 
499  virtual void CreateStringFromExternal( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
500  virtual void CreateStringFromSingleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
501  virtual void CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
502  virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
503  virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
504  virtual void LocalizeString( OUString& rName ) const override; // modify rName - input: exact name
505 
506  virtual formula::ParamClass GetForceArrayParameter( const formula::FormulaToken* pToken, sal_uInt16 nParam ) const override;
507 
510  { return c < 128 ? pConv->getCharTableFlags(c, cLast) : ScCharFlags::NONE; }
511 
512  virtual void HandleIIOpCode(formula::FormulaToken* token, formula::FormulaToken*** pppToken, sal_uInt8 nNumParams) override;
513  bool HandleIIOpCodeInternal(formula::FormulaToken* token, formula::FormulaToken*** pppToken, sal_uInt8 nNumParams);
514  bool SkipImplicitIntersectionOptimization(const formula::FormulaToken* token) const;
515  virtual void PostProcessCode() override;
516  virtual void AnnotateOperands() override;
517  static bool ParameterMayBeImplicitIntersection(const formula::FormulaToken* token, int parameter);
518  void ReplaceDoubleRefII(formula::FormulaToken** ppDoubleRefTok);
519  bool AdjustSumRangeShape(const ScComplexRefData& rBaseRange, ScComplexRefData& rSumRange);
520  void CorrectSumRange(const ScComplexRefData& rBaseRange, ScComplexRefData& rSumRange, formula::FormulaToken** ppSumRangeToken);
521  void AnnotateTrimOnDoubleRefs();
522 };
523 
524 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Matrix data type that can store values of mixed types.
Definition: scmatrix.hxx:112
virtual FormulaTokenRef ExtendRangeReference(FormulaToken &rTok1, FormulaToken &rTok2)
void SetErrorConstant(FormulaError nErr)
Definition: token.cxx:276
ScTableRefToken::Item eItem
Definition: compiler.hxx:128
formula::ParamClass eInForceArray
Definition: compiler.hxx:112
OUString maExternalName
Definition: compiler.hxx:138
FormulaError nError
Definition: compiler.hxx:135
formula::StackVar eType
Definition: compiler.hxx:106
SvNumberFormatter * mpFormatter
Definition: compiler.hxx:272
formula::FormulaToken * CreateToken(ScSheetLimits &rLimits) const
Definition: token.cxx:346
Single reference (one address) into the sheet.
Definition: refdata.hxx:29
virtual ScCharFlags getCharTableFlags(sal_Unicode c, sal_Unicode cLast) const =0
#define FORMULA_MAXJUMPCOUNT
const char * pEnglish
Definition: compiler.hxx:263
void SetDoubleReference(const ScComplexRefData &rRef)
Definition: token.cxx:262
static const CharClass * pCharClassEnglish
Definition: compiler.hxx:256
Character between sheet name and address.
Definition: compiler.hxx:237
const CharClass * pCharClass
Definition: compiler.hxx:288
ScMatrix * pMat
Definition: compiler.hxx:134
ExtendedErrorDetection
Definition: compiler.hxx:179
virtual void CreateStringFromExternal(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
formula::StackVar GetType() const
only delete via Delete()
Definition: compiler.hxx:145
sal_uInt16 mnPredetectedReference
Definition: compiler.hxx:290
void SetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &rRef)
Definition: token.cxx:303
const ScInterpreterContext * mpInterpreterContext
Definition: compiler.hxx:273
void SetExternalLinks(const css::uno::Sequence< css::sheet::ExternalLinkInfo > &rLinks)
Set external link info for ScAddress::CONV_XL_OOX.
Definition: compiler.hxx:439
rtl_uString * mpData
Definition: compiler.hxx:131
virtual void CreateStringFromIndex(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
std::vector< PendingImplicitIntersectionOptimization > mPendingImplicitIntersectionOptimizations
Definition: compiler.hxx:319
const OUString & GetCorrectedFormula() const
Definition: compiler.hxx:451
const char * pODFF
Definition: compiler.hxx:262
struct ScRawToken::@19::@23 extname
virtual void HandleIIOpCode(FormulaToken *, FormulaToken ***, sal_uInt8)
static const CharClass * pCharClassLocalized
Definition: compiler.hxx:257
virtual OUString FindAddInFunction(const OUString &rUpperName, bool bLocalFirst) const
virtual bool HandleColRowName()
short nJump[FORMULA_MAXJUMPCOUNT+1]
Definition: compiler.hxx:136
sal_uInt16 sal_Unicode
const std::set< OpCode > & UnhandledPossibleImplicitIntersectionsOpCodes()
Definition: compiler.hxx:481
struct ScRawToken::@19::@22 extref
virtual void PostProcessCode()
sal_uInt16 nIndex
Definition: compiler.hxx:124
OpCode
const char * pOriginal
Definition: compiler.hxx:264
void SetExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
Definition: token.cxx:292
void SetCloseBrackets(bool bVal)
Definition: compiler.hxx:410
bool IsCorrected() const
Definition: compiler.hxx:450
sal_uInt8 cByte
Definition: compiler.hxx:111
sal_Int32 mnCurrentSheetEndPos
Definition: compiler.hxx:276
void SetOpCode(OpCode eCode)
Definition: token.cxx:206
OUString aFormula
Definition: compiler.hxx:282
const formula::FormulaGrammar::AddressConvention meConv
Definition: compiler.hxx:188
std::unique_ptr< ScCharFlags[]> mpCharTable
Definition: compiler.hxx:250
ScCharFlags GetCharTableFlags(sal_Unicode c, sal_Unicode cLast)
Access the CharTable flags.
Definition: compiler.hxx:509
virtual void AnnotateOperands()
"stack" of currently active ocTableRef tokens
Definition: compiler.hxx:311
sal_uInt16 nFileId
Definition: compiler.hxx:116
const ScAddress & GetPos() const
Definition: compiler.hxx:463
sal_Int16 SCCOL
Definition: types.hxx:21
void NewOpCode(OpCode e)
Definition: compiler.hxx:147
sal_uInt16 & nParam
Definition: callform.cxx:57
std::queue< OpCode > maPendingOpCodes
Definition: compiler.hxx:286
OpCode GetOpCode() const
Definition: compiler.hxx:146
::boost::intrusive_ptr< FormulaToken > FormulaTokenRef
virtual void CreateStringFromDoubleRef(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
#define MAXSTRLEN
Definition: compiler.hxx:46
bool mbCloseBrackets
Definition: compiler.hxx:294
const Convention * pConv
Definition: compiler.hxx:292
void SetString(rtl_uString *pData, rtl_uString *pDataIgoreCase)
Definition: token.cxx:245
ExtendedErrorDetection meExtendedErrorDetection
Definition: compiler.hxx:293
double nValue
Definition: compiler.hxx:109
const char * pUpper
Definition: compiler.hxx:265
PendingImplicitIntersectionOptimization(formula::FormulaToken **p, formula::FormulaToken *o)
Definition: compiler.hxx:313
struct ScRawToken::@19::@25 table
bool mbRewind
Definition: compiler.hxx:295
FormulaError
virtual bool HandleDbData()
struct ScRawToken::@19::@24 name
virtual bool HandleExternalReference(const FormulaToken &_aToken)
void SetName(sal_Int16 nSheet, sal_uInt16 nIndex)
Definition: token.cxx:283
virtual void LocalizeString(OUString &rName) const
std::vector< sal_uInt16 > maExternalFiles
Definition: compiler.hxx:296
css::uno::Sequence< css::sheet::ExternalLinkInfo > maExternalLinks
Definition: compiler.hxx:279
virtual void fillFromAddInMap(const NonConstOpCodeMapPtr &xMap, FormulaGrammar::Grammar _eGrammar) const
sal_Int32 SCROW
Definition: types.hxx:17
sal_Int32 nSrcPos
Definition: compiler.hxx:283
ScComplexRefData aRef
Definition: compiler.hxx:114
sal_Int16 nSheet
Definition: compiler.hxx:123
bool IsValidReference(const ScDocument &rDoc) const
If the token is a non-external reference, determine if the reference is valid.
Definition: token.cxx:329
bool HasUnhandledPossibleImplicitIntersections() const
Definition: compiler.hxx:479
void SetSingleReference(const ScSingleRefData &rRef)
Definition: token.cxx:254
unsigned char sal_uInt8
struct ScRawToken::@19::@21 sbyte
void SetExternalName(sal_uInt16 nFileId, const OUString &rName)
Definition: token.cxx:313
virtual void CreateStringFromSingleRef(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
virtual void fillFromAddInCollectionEnglishName(const NonConstOpCodeMapPtr &xMap) const
std::vector< OUString > maTabNames
Definition: compiler.hxx:298
::boost::intrusive_ptr< formula::FormulaToken > ScTokenRef
Definition: types.hxx:29
SCTAB mnCurrentSheetTab
Definition: compiler.hxx:275
TableRefEntry(formula::FormulaToken *p)
Definition: compiler.hxx:305
virtual bool HandleTableRef()
virtual bool HandleRange()
void SetExtendedErrorDetection(ExtendedErrorDetection eVal)
Definition: compiler.hxx:448
OpCode eOp
Definition: compiler.hxx:105
void SetExternal(const OUString &rStr)
Definition: token.cxx:322
struct ScRawToken::@19::@26 sharedstring
Complex reference (a range) into the sheet.
Definition: refdata.hxx:122
virtual void SetError(FormulaError nError)
std::set< formula::FormulaTokenRef > mUnhandledPossibleImplicitIntersections
Definition: compiler.hxx:320
ScAddress aPos
Definition: compiler.hxx:270
void SetDouble(double fVal)
Definition: token.cxx:269
virtual void fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry > &_rVec, bool _bIsEnglish) const
virtual void fillFromAddInCollectionUpperName(const NonConstOpCodeMapPtr &xMap) const
bool mbCharClassesDiffer
Definition: compiler.hxx:289
std::set< OpCode > mUnhandledPossibleImplicitIntersectionsOpCodes
Definition: compiler.hxx:322
ScDocument & rDoc
Definition: compiler.hxx:269
rtl_uString * mpDataIgnoreCase
Definition: compiler.hxx:132
virtual formula::ParamClass GetForceArrayParameter(const FormulaToken *pToken, sal_uInt16 nParam) const
sal_Int32 mnRangeOpPosInSymbol
Definition: compiler.hxx:291
ScRawToken maRawToken
Definition: compiler.hxx:284
get or setup tab names for the current grammar
Definition: compiler.hxx:301
std::vector< TableRefEntry > maTableRefs
Definition: compiler.hxx:307
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
sal_Int16 SCTAB
Definition: types.hxx:22
ScCharFlags
Definition: compiler.hxx:49
virtual void CreateStringFromMatrix(OUStringBuffer &rBuffer, const FormulaToken *pToken) const