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  } whitespace;
114  struct {
117  } sbyte;
119  struct {
120  sal_uInt16 nFileId;
122  } extref;
123  struct {
124  sal_uInt16 nFileId;
125  } extname;
126  struct {
127  sal_Int16 nSheet;
128  sal_uInt16 nIndex;
129  } name;
130  struct {
131  sal_uInt16 nIndex;
133  } table;
134  struct {
135  rtl_uString* mpData;
136  rtl_uString* mpDataIgnoreCase;
137  } sharedstring;
140  short nJump[ FORMULA_MAXJUMPCOUNT + 1 ]; // If/Chose token
141  };
142  OUString maExternalName; // depending on the opcode, this is either the external, or the external name, or the external table name
143 
144  // coverity[uninit_member] - members deliberately not initialized
146 private:
148 public:
149  formula::StackVar GetType() const { return eType; }
150  OpCode GetOpCode() const { return eOp; }
151  void NewOpCode( OpCode e ) { eOp = e; }
152 
153  // Use these methods only on tokens that are not part of a token array,
154  // since the reference count is cleared!
155  void SetOpCode( OpCode eCode );
156  void SetString( rtl_uString* pData, rtl_uString* pDataIgoreCase );
157  void SetSingleReference( const ScSingleRefData& rRef );
158  void SetDoubleReference( const ScComplexRefData& rRef );
159  void SetDouble( double fVal );
160  void SetErrorConstant( FormulaError nErr );
161 
162  // These methods are ok to use, reference count not cleared.
163  void SetName(sal_Int16 nSheet, sal_uInt16 nIndex);
164  void SetExternalSingleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScSingleRefData& rRef );
165  void SetExternalDoubleRef( sal_uInt16 nFileId, const OUString& rTabName, const ScComplexRefData& rRef );
166  void SetExternalName( sal_uInt16 nFileId, const OUString& rName );
167  void SetExternal(const OUString& rStr);
168 
174  bool IsValidReference(const ScDocument& rDoc) const;
175 
176  formula::FormulaToken* CreateToken(ScSheetLimits& rLimits) const; // create typified token
177 };
178 
180 {
181 public:
182 
184  {
185  EXTENDED_ERROR_DETECTION_NONE = 0, // no error on unknown symbols, default (interpreter handles it)
186  EXTENDED_ERROR_DETECTION_NAME_BREAK, // name error on unknown symbols and break, pCode incomplete
187  EXTENDED_ERROR_DETECTION_NAME_NO_BREAK // name error on unknown symbols, don't break, continue
188  };
189 
190  struct SAL_DLLPRIVATE Convention
191  {
193 
195  virtual ~Convention();
196 
197  virtual void makeRefStr(
198  ScSheetLimits& rLimits,
199  OUStringBuffer& rBuffer,
201  const ScAddress& rPos,
202  const OUString& rErrRef, const std::vector<OUString>& rTabNames,
203  const ScComplexRefData& rRef, bool bSingleRef, bool bFromRangeName ) const = 0;
204 
205  virtual css::i18n::ParseResult
206  parseAnyToken( const OUString& rFormula,
207  sal_Int32 nSrcPos,
208  const CharClass* pCharClass,
209  bool bGroupSeparator) const = 0;
210 
217  virtual bool parseExternalName( const OUString& rSymbol, OUString& rFile, OUString& rName,
218  const ScDocument& rDoc,
219  const css::uno::Sequence< css::sheet::ExternalLinkInfo>* pExternalLinks ) const = 0;
220 
221  virtual OUString makeExternalNameStr( sal_uInt16 nFileId, const OUString& rFile,
222  const OUString& rName ) const = 0;
223 
224  virtual void makeExternalRefStr(
225  ScSheetLimits& rLimits,
226  OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& rFileName,
227  const OUString& rTabName, const ScSingleRefData& rRef ) const = 0;
228 
229  virtual void makeExternalRefStr(
230  ScSheetLimits& rLimits,
231  OUStringBuffer& rBuffer, const ScAddress& rPos,
232  sal_uInt16 nFileId, const OUString& rFileName, const std::vector<OUString>& rTabNames,
233  const OUString& rTabName, const ScComplexRefData& rRef ) const = 0;
234 
236  {
242 
247  ABS_SHEET_PREFIX
248  };
249  virtual sal_Unicode getSpecialSymbol( SpecialSymbolType eSymType ) const = 0;
250 
251  virtual ScCharFlags getCharTableFlags( sal_Unicode c, sal_Unicode cLast ) const = 0;
252 
253  protected:
254  std::unique_ptr<ScCharFlags[]> mpCharTable;
255  };
256  friend struct Convention;
257 
258 private:
259 
260  static const CharClass *pCharClassEnglish; // character classification for en_US locale
261  static const CharClass *pCharClassLocalized; // character classification for UI locale
262  static const Convention *pConventions[ formula::FormulaGrammar::CONV_LAST ];
263 
264  static const struct AddInMap
265  {
266  const char* pODFF;
267  const char* pEnglish;
268  const char* pOriginal; // programmatical name
269  const char* pUpper; // upper case programmatical name
270  } g_aAddInMap[];
271  static size_t GetAddInMapCount();
272 
275 
278 
279  SCTAB mnCurrentSheetTab; // indicates current sheet number parsed so far
280  sal_Int32 mnCurrentSheetEndPos; // position after current sheet name if parsed
281 
282  // For CONV_XL_OOX, may be set via API by MOOXML filter.
283  css::uno::Sequence<css::sheet::ExternalLinkInfo> maExternalLinks;
284 
285  sal_Unicode cSymbol[MAXSTRLEN+1]; // current Symbol + 0
286  OUString aFormula; // formula source code
287  sal_Int32 nSrcPos; // tokenizer position (source code)
289 
290  std::queue<OpCode> maPendingOpCodes; // additional opcodes generated from a single symbol
291 
292  const CharClass* pCharClass; // which character classification is used for parseAnyToken and upper/lower
293  bool mbCharClassesDiffer; // whether pCharClass and current system locale's CharClass differ
294  sal_uInt16 mnPredetectedReference; // reference when reading ODF, 0 (none), 1 (single) or 2 (double)
295  sal_Int32 mnRangeOpPosInSymbol; // if and where a range operator is in symbol
298  bool mbCloseBrackets; // whether to close open brackets automatically, default TRUE
299  bool mbRewind; // whether symbol is to be rewound to some step during lexical analysis
300  bool mbRefConventionChartOOXML; // whether to use special ooxml chart syntax in case of OOXML reference convention,
301  // when parsing a formula string. [0]!GlobalNamedRange, LocalSheet!LocalNamedRange
302  std::vector<sal_uInt16> maExternalFiles;
303 
304  std::vector<OUString> maTabNames;
305  std::vector<OUString> &GetSetupTabNames() const;
306 
308  {
310  sal_uInt16 mnLevel;
311  TableRefEntry( formula::FormulaToken* p ) : mxToken(p), mnLevel(0) {}
312  };
313  std::vector<TableRefEntry> maTableRefs;
314 
315  // Optimizing implicit intersection is done only at the end of code generation, because the usage context may
316  // be important. Store candidate parameters and the operation they are the argument for.
318  {
320  : parameterLocation( p ), parameter( *p ), operation( o ) {}
324  };
325  std::vector< PendingImplicitIntersectionOptimization > mPendingImplicitIntersectionOptimizations;
326  std::set<formula::FormulaTokenRef> mUnhandledPossibleImplicitIntersections;
327 #ifdef DBG_UTIL
329 #endif
330 
331  bool NextNewToken(bool bInArray);
332  bool ToUpperAsciiOrI18nIsAscii( OUString& rUpper, const OUString& rOrg ) const;
333 
334  virtual void SetError(FormulaError nError) override;
335 
336  struct Whitespace final
337  {
338  sal_Int32 nCount;
340 
341  Whitespace() : nCount(0), cChar(0x20) {}
342  void reset( sal_Unicode c ) { nCount = 0; cChar = c; }
343  };
344 
345  static void addWhitespace( std::vector<ScCompiler::Whitespace> & rvSpaces,
346  ScCompiler::Whitespace & rSpace, sal_Unicode c, sal_Int32 n = 1 );
347 
348  std::vector<Whitespace> NextSymbol(bool bInArray);
349 
350  bool IsValue( const OUString& );
351  bool IsOpCode( const OUString&, bool bInArray );
352  bool IsOpCode2( const OUString& );
353  bool IsString();
354  bool IsReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
355  bool IsSingleReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
356  bool IsDoubleReference( const OUString& rSymbol, const OUString* pErrRef = nullptr );
357  bool IsPredetectedReference( const OUString& rSymbol );
358  bool IsPredetectedErrRefReference( const OUString& rName, const OUString* pErrRef );
359  bool IsMacro( const OUString& );
360  bool IsNamedRange( const OUString& );
361  bool IsExternalNamedRange( const OUString& rSymbol, bool& rbInvalidExternalNameRange );
362  bool IsDBRange( const OUString& );
363  bool IsColRowName( const OUString& );
364  bool IsBoolean( const OUString& );
365  void AutoCorrectParsedSymbol();
366  const ScRangeData* GetRangeData( SCTAB& rSheet, const OUString& rUpperName ) const;
367 
368  void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
369  void SetRelNameReference();
370 
376  ScRangeData* GetRangeData( const formula::FormulaToken& pToken ) const;
377 
378  static const CharClass* GetCharClassEnglish();
379  static const CharClass* GetCharClassLocalized();
380 
381 public:
382  ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos,
383  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
384 
387  ScCompiler( ScDocument& rDocument, const ScAddress&,
389  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
390 
391  ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos, ScTokenArray& rArr,
392  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
393 
396  ScCompiler( ScDocument& rDocument, const ScAddress&, ScTokenArray& rArr,
398  bool bComputeII = false, bool bMatrixFlag = false, const ScInterpreterContext* pContext = nullptr );
399 
400  virtual ~ScCompiler() override;
401 
402 public:
403  static void DeInit();
404 
405  // for ScAddress::Format()
406  static void CheckTabQuotes( OUString& aTabName,
408 
413  static sal_Int32 GetDocTabPos( const OUString& rString );
414 
415  static bool EnQuote( OUString& rStr );
416 
417  // Check if it is a valid english function name
418  static bool IsEnglishSymbol( const OUString& rName );
419 
420  bool IsErrorConstant( const OUString& ) const;
421  bool IsTableRefItem( const OUString& ) const;
422  bool IsTableRefColumn( const OUString& ) const;
423 
425  bool GetTokenIfOpCode( OpCode eOp );
426 
430  void SetAutoCorrection( bool bVal );
431  void SetCloseBrackets( bool bVal ) { mbCloseBrackets = bVal; }
432  void SetRefConventionChartOOXML( bool bVal ) { mbRefConventionChartOOXML = bVal; }
433  void SetRefConvention( const Convention *pConvP );
434  void SetRefConvention( const formula::FormulaGrammar::AddressConvention eConv );
435 
436  static const Convention* GetRefConvention( formula::FormulaGrammar::AddressConvention eConv );
437 
439  void SetFormulaLanguage( const OpCodeMapPtr & xMap );
440 
441  void SetGrammar( const formula::FormulaGrammar::Grammar eGrammar );
442 
443  void SetNumberFormatter( SvNumberFormatter* pFormatter );
444 
445 private:
455  void SetGrammarAndRefConvention(
456  const formula::FormulaGrammar::Grammar eNewGrammar,
457  const formula::FormulaGrammar::Grammar eOldGrammar );
458 public:
459 
462  const css::uno::Sequence<
463  css::sheet::ExternalLinkInfo>& rLinks )
464  {
465  maExternalLinks = rLinks;
466  }
467 
468  void CreateStringFromXMLTokenArray( OUString& rFormula, OUString& rFormulaNmsp );
469 
470  void SetExtendedErrorDetection( ExtendedErrorDetection eVal ) { meExtendedErrorDetection = eVal; }
471 
472  bool IsCorrected() const { return bCorrected; }
473  const OUString& GetCorrectedFormula() const { return aCorrectedFormula; }
474 
483  std::unique_ptr<ScTokenArray> CompileString( const OUString& rFormula );
484  std::unique_ptr<ScTokenArray> CompileString( const OUString& rFormula, const OUString& rFormulaNmsp );
485  const ScAddress& GetPos() const { return aPos; }
486 
487  void MoveRelWrap();
488  static void MoveRelWrap( const ScTokenArray& rArr, const ScDocument& rDoc, const ScAddress& rPos,
489  SCCOL nMaxCol, SCROW nMaxRow );
490 
494  static bool IsCharFlagAllConventions(
495  OUString const & rStr, sal_Int32 nPos, ScCharFlags nFlags );
496 
498  static bool DoubleRefToPosSingleRefScalarCase(const ScRange& rRange, ScAddress& rAdr,
499  const ScAddress& rFormulaPos);
500 
501  bool HasUnhandledPossibleImplicitIntersections() const { return !mUnhandledPossibleImplicitIntersections.empty(); }
502 #ifdef DBG_UTIL
503  const std::set<OpCode>& UnhandledPossibleImplicitIntersectionsOpCodes() { return mUnhandledPossibleImplicitIntersectionsOpCodes; }
504 #endif
505 
506 private:
507  // FormulaCompiler
508  virtual OUString FindAddInFunction( const OUString& rUpperName, bool bLocalFirst ) const override;
509  virtual void fillFromAddInCollectionUpperName( const NonConstOpCodeMapPtr& xMap ) const override;
510  virtual void fillFromAddInCollectionEnglishName( const NonConstOpCodeMapPtr& xMap ) const override;
511  virtual void fillFromAddInMap( const NonConstOpCodeMapPtr& xMap, formula::FormulaGrammar::Grammar _eGrammar ) const override;
512  virtual void fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry >& _rVec,bool _bIsEnglish) const override;
513 
514  virtual bool HandleExternalReference(const formula::FormulaToken& _aToken) override;
515  virtual bool HandleRange() override;
516  virtual bool HandleColRowName() override;
517  virtual bool HandleDbData() override;
518  virtual bool HandleTableRef() override;
519 
521  virtual void CreateStringFromExternal( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
522  virtual void CreateStringFromSingleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
523  virtual void CreateStringFromDoubleRef( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
524  virtual void CreateStringFromMatrix( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
525  virtual void CreateStringFromIndex( OUStringBuffer& rBuffer, const formula::FormulaToken* pToken ) const override;
526  virtual void LocalizeString( OUString& rName ) const override; // modify rName - input: exact name
527 
528  virtual formula::ParamClass GetForceArrayParameter( const formula::FormulaToken* pToken, sal_uInt16 nParam ) const override;
529 
532  { return c < 128 ? pConv->getCharTableFlags(c, cLast) : ScCharFlags::NONE; }
533 
534  virtual void HandleIIOpCode(formula::FormulaToken* token, formula::FormulaToken*** pppToken, sal_uInt8 nNumParams) override;
535  bool HandleIIOpCodeInternal(formula::FormulaToken* token, formula::FormulaToken*** pppToken, sal_uInt8 nNumParams);
536  bool SkipImplicitIntersectionOptimization(const formula::FormulaToken* token) const;
537  virtual void PostProcessCode() override;
538  virtual void AnnotateOperands() override;
539  static bool ParameterMayBeImplicitIntersection(const formula::FormulaToken* token, int parameter);
540  void ReplaceDoubleRefII(formula::FormulaToken** ppDoubleRefTok);
541  bool AdjustSumRangeShape(const ScComplexRefData& rBaseRange, ScComplexRefData& rSumRange);
542  void CorrectSumRange(const ScComplexRefData& rBaseRange, ScComplexRefData& rSumRange, formula::FormulaToken** ppSumRangeToken);
543  void AnnotateTrimOnDoubleRefs();
544 };
545 
546 /* 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:281
void reset(sal_Unicode c)
Definition: compiler.hxx:342
ScTableRefToken::Item eItem
Definition: compiler.hxx:132
formula::ParamClass eInForceArray
Definition: compiler.hxx:116
OUString maExternalName
Definition: compiler.hxx:142
FormulaError nError
Definition: compiler.hxx:139
formula::StackVar eType
Definition: compiler.hxx:106
SvNumberFormatter * mpFormatter
Definition: compiler.hxx:276
formula::FormulaToken * CreateToken(ScSheetLimits &rLimits) const
Definition: token.cxx:351
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:267
void SetDoubleReference(const ScComplexRefData &rRef)
Definition: token.cxx:267
static const CharClass * pCharClassEnglish
Definition: compiler.hxx:260
Character between sheet name and address.
Definition: compiler.hxx:241
const CharClass * pCharClass
Definition: compiler.hxx:292
struct ScRawToken::@19::@27 sharedstring
ScMatrix * pMat
Definition: compiler.hxx:138
ExtendedErrorDetection
Definition: compiler.hxx:183
virtual void CreateStringFromExternal(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
formula::StackVar GetType() const
only delete via Delete()
Definition: compiler.hxx:149
sal_uInt16 mnPredetectedReference
Definition: compiler.hxx:294
void SetExternalDoubleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScComplexRefData &rRef)
Definition: token.cxx:308
const ScInterpreterContext * mpInterpreterContext
Definition: compiler.hxx:277
void SetExternalLinks(const css::uno::Sequence< css::sheet::ExternalLinkInfo > &rLinks)
Set external link info for ScAddress::CONV_XL_OOX.
Definition: compiler.hxx:461
rtl_uString * mpData
Definition: compiler.hxx:135
virtual void CreateStringFromIndex(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
std::vector< PendingImplicitIntersectionOptimization > mPendingImplicitIntersectionOptimizations
Definition: compiler.hxx:325
const OUString & GetCorrectedFormula() const
Definition: compiler.hxx:473
const char * pODFF
Definition: compiler.hxx:266
virtual void HandleIIOpCode(FormulaToken *, FormulaToken ***, sal_uInt8)
static const CharClass * pCharClassLocalized
Definition: compiler.hxx:261
virtual OUString FindAddInFunction(const OUString &rUpperName, bool bLocalFirst) const
virtual bool HandleColRowName()
short nJump[FORMULA_MAXJUMPCOUNT+1]
Definition: compiler.hxx:140
sal_uInt16 sal_Unicode
const std::set< OpCode > & UnhandledPossibleImplicitIntersectionsOpCodes()
Definition: compiler.hxx:503
virtual void PostProcessCode()
sal_uInt16 nIndex
Definition: compiler.hxx:128
OpCode
struct ScRawToken::@19::@26 table
const char * pOriginal
Definition: compiler.hxx:268
struct ScRawToken::@19::@22 sbyte
void SetExternalSingleRef(sal_uInt16 nFileId, const OUString &rTabName, const ScSingleRefData &rRef)
Definition: token.cxx:297
void SetCloseBrackets(bool bVal)
Definition: compiler.hxx:431
bool IsCorrected() const
Definition: compiler.hxx:472
sal_uInt8 cByte
Definition: compiler.hxx:115
sal_Int32 mnCurrentSheetEndPos
Definition: compiler.hxx:280
void SetOpCode(OpCode eCode)
Definition: token.cxx:206
OUString aFormula
Definition: compiler.hxx:286
const formula::FormulaGrammar::AddressConvention meConv
Definition: compiler.hxx:192
std::unique_ptr< ScCharFlags[]> mpCharTable
Definition: compiler.hxx:254
ScCharFlags GetCharTableFlags(sal_Unicode c, sal_Unicode cLast)
Access the CharTable flags.
Definition: compiler.hxx:531
virtual void AnnotateOperands()
"stack" of currently active ocTableRef tokens
Definition: compiler.hxx:317
sal_uInt16 nFileId
Definition: compiler.hxx:120
const ScAddress & GetPos() const
Definition: compiler.hxx:485
sal_Int16 SCCOL
Definition: types.hxx:21
struct ScRawToken::@19::@23 extref
void NewOpCode(OpCode e)
Definition: compiler.hxx:151
sal_uInt16 & nParam
Definition: callform.cxx:57
std::queue< OpCode > maPendingOpCodes
Definition: compiler.hxx:290
OpCode GetOpCode() const
Definition: compiler.hxx:150
::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:298
const Convention * pConv
Definition: compiler.hxx:296
void SetString(rtl_uString *pData, rtl_uString *pDataIgoreCase)
Definition: token.cxx:250
ExtendedErrorDetection meExtendedErrorDetection
Definition: compiler.hxx:297
double nValue
Definition: compiler.hxx:109
struct ScRawToken::@19::@25 name
const char * pUpper
Definition: compiler.hxx:269
bool mbRefConventionChartOOXML
Definition: compiler.hxx:300
PendingImplicitIntersectionOptimization(formula::FormulaToken **p, formula::FormulaToken *o)
Definition: compiler.hxx:319
bool mbRewind
Definition: compiler.hxx:299
FormulaError
virtual bool HandleDbData()
virtual bool HandleExternalReference(const FormulaToken &_aToken)
void SetName(sal_Int16 nSheet, sal_uInt16 nIndex)
Definition: token.cxx:288
virtual void LocalizeString(OUString &rName) const
std::vector< sal_uInt16 > maExternalFiles
Definition: compiler.hxx:302
css::uno::Sequence< css::sheet::ExternalLinkInfo > maExternalLinks
Definition: compiler.hxx:283
virtual void fillFromAddInMap(const NonConstOpCodeMapPtr &xMap, FormulaGrammar::Grammar _eGrammar) const
sal_Int32 SCROW
Definition: types.hxx:17
sal_Int32 nSrcPos
Definition: compiler.hxx:287
ScComplexRefData aRef
Definition: compiler.hxx:118
sal_Int16 nSheet
Definition: compiler.hxx:127
bool IsValidReference(const ScDocument &rDoc) const
If the token is a non-external reference, determine if the reference is valid.
Definition: token.cxx:334
struct ScRawToken::@19::@24 extname
bool HasUnhandledPossibleImplicitIntersections() const
Definition: compiler.hxx:501
void SetSingleReference(const ScSingleRefData &rRef)
Definition: token.cxx:259
unsigned char sal_uInt8
void SetExternalName(sal_uInt16 nFileId, const OUString &rName)
Definition: token.cxx:318
virtual void CreateStringFromSingleRef(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
virtual void fillFromAddInCollectionEnglishName(const NonConstOpCodeMapPtr &xMap) const
std::vector< OUString > maTabNames
Definition: compiler.hxx:304
::boost::intrusive_ptr< formula::FormulaToken > ScTokenRef
Definition: types.hxx:29
SCTAB mnCurrentSheetTab
Definition: compiler.hxx:279
TableRefEntry(formula::FormulaToken *p)
Definition: compiler.hxx:311
virtual bool HandleTableRef()
sal_Unicode cChar
Definition: compiler.hxx:112
virtual bool HandleRange()
void SetExtendedErrorDetection(ExtendedErrorDetection eVal)
Definition: compiler.hxx:470
void SetRefConventionChartOOXML(bool bVal)
Definition: compiler.hxx:432
OpCode eOp
Definition: compiler.hxx:105
void SetExternal(const OUString &rStr)
Definition: token.cxx:327
Complex reference (a range) into the sheet.
Definition: refdata.hxx:122
virtual void SetError(FormulaError nError)
std::set< formula::FormulaTokenRef > mUnhandledPossibleImplicitIntersections
Definition: compiler.hxx:326
ScAddress aPos
Definition: compiler.hxx:274
void SetDouble(double fVal)
Definition: token.cxx:274
virtual void fillAddInToken(::std::vector< css::sheet::FormulaOpCodeMapEntry > &_rVec, bool _bIsEnglish) const
virtual void fillFromAddInCollectionUpperName(const NonConstOpCodeMapPtr &xMap) const
bool mbCharClassesDiffer
Definition: compiler.hxx:293
std::set< OpCode > mUnhandledPossibleImplicitIntersectionsOpCodes
Definition: compiler.hxx:328
ScDocument & rDoc
Definition: compiler.hxx:273
rtl_uString * mpDataIgnoreCase
Definition: compiler.hxx:136
virtual formula::ParamClass GetForceArrayParameter(const FormulaToken *pToken, sal_uInt16 nParam) const
sal_Int32 mnRangeOpPosInSymbol
Definition: compiler.hxx:295
ScRawToken maRawToken
Definition: compiler.hxx:288
get or setup tab names for the current grammar
Definition: compiler.hxx:307
std::vector< TableRefEntry > maTableRefs
Definition: compiler.hxx:313
#define SC_DLLPUBLIC
Definition: scdllapi.h:27
sal_Int16 SCTAB
Definition: types.hxx:22
ScCharFlags
Definition: compiler.hxx:49
sal_uInt8 nCount
Definition: compiler.hxx:111
virtual void CreateStringFromMatrix(OUStringBuffer &rBuffer, const FormulaToken *pToken) const
struct ScRawToken::@19::@21 whitespace