LibreOffice Module formula (master) 1
|
Grammars digested by ScCompiler. More...
#include <grammar.hxx>
Public Types | |
enum | AddressConvention { CONV_UNSPECIFIED = -1 , CONV_OOO = 0 , CONV_ODF , CONV_XL_A1 , CONV_XL_R1C1 , CONV_XL_OOX , CONV_LOTUS_A1 , CONV_LAST , CONV_A1_XL_A1 } |
enum | Grammar { GRAM_UNSPECIFIED = -1 , GRAM_ODFF , GRAM_PODF , GRAM_ENGLISH , GRAM_NATIVE , GRAM_ODFF_UI , GRAM_ODFF_A1 , GRAM_PODF_UI , GRAM_PODF_A1 , GRAM_NATIVE_UI , GRAM_NATIVE_ODF , GRAM_NATIVE_XL_A1 , GRAM_NATIVE_XL_R1C1 , GRAM_ENGLISH_XL_A1 , GRAM_ENGLISH_XL_R1C1 , GRAM_ENGLISH_XL_OOX , GRAM_OOXML , GRAM_API , GRAM_DEFAULT = GRAM_NATIVE_UI , GRAM_STORAGE_DEFAULT = GRAM_ODFF , GRAM_EXTERNAL = (1 << (kConventionShift - 1)) } |
Values encoding the formula language plus address reference convention plus English parsing/formatting. More... | |
Static Public Member Functions | |
static bool | isEnglish (const Grammar eGrammar) |
If English parsing/formatting is associated with a grammar. More... | |
static Grammar | mapAPItoGrammar (const bool bEnglish, const bool bXML) |
Compatibility helper for old "bCompileEnglish, bCompileXML" API calls to obtain the new grammar. More... | |
static bool | isSupported (const Grammar eGrammar) |
static sal_Int32 | extractFormulaLanguage (const Grammar eGrammar) |
static AddressConvention | extractRefConvention (const Grammar eGrammar) |
static Grammar | setEnglishBit (const Grammar eGrammar, const bool bEnglish) |
static Grammar | mergeToGrammar (const Grammar eGrammar, const AddressConvention eConv) |
static bool | isPODF (const Grammar eGrammar) |
If grammar is of ODF 1.1. More... | |
static bool | isODFF (const Grammar eGrammar) |
If grammar is of ODFF. More... | |
static bool | isOOXML (const Grammar eGrammar) |
If grammar is of OOXML. More... | |
static bool | isRefConventionOOXML (const Grammar eGrammar) |
If reference convention is OOXML. More... | |
static bool | isExcelSyntax (const Grammar eGrammar) |
If grammar has an Excel syntax, determined by address convention. More... | |
Static Public Attributes | |
static const int | kConventionOffset = - CONV_UNSPECIFIED + 1 |
CONV_UNSPECIFIED is a negative value! More... | |
static const int | kConventionShift = 16 |
static const int | kEnglishBit = (1 << (kConventionShift + 8)) |
static const int | kFlagMask = ~((~unsigned(0)) << kConventionShift) |
Grammars digested by ScCompiler.
Definition at line 32 of file grammar.hxx.
Enumerator | |
---|---|
CONV_UNSPECIFIED | |
CONV_OOO | |
CONV_ODF | |
CONV_XL_A1 | |
CONV_XL_R1C1 | |
CONV_XL_OOX | |
CONV_LOTUS_A1 | |
CONV_LAST | |
CONV_A1_XL_A1 |
Definition at line 35 of file grammar.hxx.
Values encoding the formula language plus address reference convention plus English parsing/formatting.
When adding new values adapt isSupported() below as well.
Enumerator | |
---|---|
GRAM_UNSPECIFIED | Used only in ScCompiler ctor and in some XML import API context. |
GRAM_ODFF | ODFF with default ODF A1 bracketed references. |
GRAM_PODF | ODF 1.1 with default ODF A1 bracketed references. |
GRAM_ENGLISH | English with default A1 reference style. |
GRAM_NATIVE | Native with default A1 reference style. |
GRAM_ODFF_UI | ODFF with reference style as set in UI, may be A1 or R1C1. |
GRAM_ODFF_A1 | ODFF with A1 reference style, unbracketed. |
GRAM_PODF_UI | ODF 1.1 with reference style as set in UI, may be A1 or R1C1. |
GRAM_PODF_A1 | ODF 1.1 with A1 reference style, unbracketed. |
GRAM_NATIVE_UI | Native with reference style as set in UI, may be A1 or R1C1. |
GRAM_NATIVE_ODF | Native with ODF A1 bracketed references. Not very useful but supported. |
GRAM_NATIVE_XL_A1 | Native with Excel A1 reference style. |
GRAM_NATIVE_XL_R1C1 | Native with Excel R1C1 reference style. |
GRAM_ENGLISH_XL_A1 | English with Excel A1 reference style. |
GRAM_ENGLISH_XL_R1C1 | English with Excel R1C1 reference style. |
GRAM_ENGLISH_XL_OOX | English with Excel OOXML reference style. |
GRAM_OOXML | Excel OOXML with Excel OOXML reference style. |
GRAM_API | API English with A1 reference style, unbracketed. |
GRAM_DEFAULT | Central definition of the default grammar to be used. |
GRAM_STORAGE_DEFAULT | Central definition of the default storage grammar to be used. |
GRAM_EXTERNAL | OpCodeMap set by external filter and merged with reference convention plus English bit on top. Plain value acts as FormulaLanguage. |
Definition at line 67 of file grammar.hxx.
|
inlinestatic |
Definition at line 175 of file grammar.hxx.
Referenced by formula::FormulaCompiler::OpCodeMap::copyFrom(), isSupported(), and mergeToGrammar().
|
inlinestatic |
Definition at line 180 of file grammar.hxx.
|
inlinestatic |
If English parsing/formatting is associated with a grammar.
Definition at line 164 of file grammar.hxx.
Referenced by mergeToGrammar().
|
inlinestatic |
If grammar has an Excel syntax, determined by address convention.
Definition at line 226 of file grammar.hxx.
Referenced by formula::FormulaCompiler::CreateStringFromToken(), formula::FormulaCompiler::GetToken(), and formula::FormulaCompiler::NextToken().
|
inlinestatic |
If grammar is of ODFF.
Definition at line 199 of file grammar.hxx.
Referenced by formula::FormulaCompiler::CreateStringFromTokenArray(), formula::FormulaCompiler::Factor(), and formula::FormulaCompiler::OpCodeMap::isODFF().
|
inlinestatic |
If grammar is of OOXML.
Definition at line 206 of file grammar.hxx.
Referenced by formula::FormulaCompiler::CreateStringFromTokenArray(), and formula::FormulaCompiler::OpCodeMap::isOOXML().
|
inlinestatic |
If grammar is of ODF 1.1.
Definition at line 192 of file grammar.hxx.
Referenced by formula::FormulaCompiler::CreateStringFromTokenArray(), formula::FormulaCompiler::OpCodeMap::isPODF(), and formula::FormulaCompiler::NeedsTableRefTransformation().
|
inlinestatic |
If reference convention is OOXML.
Note this is not equivalent to isOOXML() as it does not have to be FormulaLanguage::OOXML but can be Grammar::GRAM_EXTERNAL merged with AddressConvention::CONV_XL_OOX, which is used by various parts of OOXML import through the API FormulaParser.
Definition at line 219 of file grammar.hxx.
|
static |
Definition at line 39 of file grammar.cxx.
References extractFormulaLanguage(), GRAM_API, GRAM_ENGLISH, GRAM_ENGLISH_XL_A1, GRAM_ENGLISH_XL_OOX, GRAM_ENGLISH_XL_R1C1, GRAM_EXTERNAL, GRAM_NATIVE, GRAM_NATIVE_ODF, GRAM_NATIVE_UI, GRAM_NATIVE_XL_A1, GRAM_NATIVE_XL_R1C1, GRAM_ODFF, GRAM_ODFF_A1, GRAM_ODFF_UI, GRAM_OOXML, GRAM_PODF, GRAM_PODF_A1, and GRAM_PODF_UI.
Referenced by mergeToGrammar().
|
static |
Compatibility helper for old "bCompileEnglish, bCompileXML" API calls to obtain the new grammar.
Definition at line 25 of file grammar.cxx.
References GRAM_API, GRAM_NATIVE, GRAM_NATIVE_ODF, and GRAM_PODF.
|
static |
Definition at line 74 of file grammar.cxx.
References extractFormulaLanguage(), isEnglish(), isSupported(), kConventionOffset, kConventionShift, and setEnglishBit().
Referenced by formula::FormulaCompiler::CreateOpCodeMap().
|
static |
Definition at line 66 of file grammar.cxx.
References kEnglishBit.
Referenced by formula::FormulaCompiler::CreateOpCodeMap(), and mergeToGrammar().
|
static |
CONV_UNSPECIFIED is a negative value!
Definition at line 55 of file grammar.hxx.
Referenced by mergeToGrammar().
|
static |
Definition at line 57 of file grammar.hxx.
Referenced by mergeToGrammar().
|
static |
Definition at line 59 of file grammar.hxx.
Referenced by setEnglishBit().
|
static |
Definition at line 61 of file grammar.hxx.