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