LibreOffice Module formula (master) 1
|
Mappings from strings to OpCodes and vice versa. More...
#include <FormulaCompiler.hxx>
Public Member Functions | |
OpCodeMap (sal_uInt16 nSymbols, bool bCore, FormulaGrammar::Grammar eGrammar) | |
void | copyFrom (const OpCodeMap &r) |
Copy mappings from r into this map, effectively replacing this map. More... | |
const OpCodeHashMap & | getHashMap () const |
Get the symbol String -> OpCode hash map for finds. More... | |
const ExternalHashMap & | getExternalHashMap () const |
Get the symbol String -> AddIn String hash map for finds. More... | |
const ExternalHashMap & | getReverseExternalHashMap () const |
Get the AddIn String -> symbol String hash map for finds. More... | |
const OUString & | getSymbol (const OpCode eOp) const |
Get the symbol string matching an OpCode. More... | |
sal_Unicode | getSymbolChar (const OpCode eOp) const |
Get the first character of the symbol string matching an OpCode. More... | |
FormulaGrammar::Grammar | getGrammar () const |
Get the grammar. More... | |
sal_uInt16 | getSymbolCount () const |
Get the symbol count. More... | |
bool | isEnglish () const |
Are these English symbols, as opposed to native language (which may be English as well)? More... | |
bool | isEnglishLocale () const |
Are inline numbers parsed/formatted in en-US locale, as opposed to default locale? More... | |
bool | isPODF () const |
Is it an ODF 1.1 compatibility mapping? More... | |
bool | isODFF () const |
Is it an ODFF / ODF 1.2 mapping? More... | |
bool | isOOXML () const |
Is it an OOXML mapping? More... | |
bool | hasExternals () const |
Does it have external symbol/name mappings? More... | |
void | putOpCode (const OUString &rStr, const OpCode eOp, const CharClass *pCharClass) |
Put entry of symbol String and OpCode pair. More... | |
void | putExternal (const OUString &rSymbol, const OUString &rAddIn) |
Put entry of symbol String and AddIn international String pair. More... | |
void | putExternalSoftly (const OUString &rSymbol, const OUString &rAddIn) |
Put entry of symbol String and AddIn international String pair, not warning just info as used for AddIn collection and setting up alias names. More... | |
css::uno::Sequence< css::sheet::FormulaToken > | createSequenceOfFormulaTokens (const FormulaCompiler &_rCompiler, const css::uno::Sequence< OUString > &rNames) const |
Core implementation of XFormulaOpCodeMapper::getMappings() More... | |
css::uno::Sequence< css::sheet::FormulaOpCodeMapEntry > | createSequenceOfAvailableMappings (const FormulaCompiler &_rCompiler, const sal_Int32 nGroup) const |
Core implementation of XFormulaOpCodeMapper::getAvailableMappings() More... | |
Static Public Member Functions | |
static sal_Int32 | getOpCodeUnknown () |
The value used in createSequenceOfAvailableMappings() and thus in XFormulaOpCodeMapper::getMappings() for an unknown symbol. More... | |
Private Member Functions | |
OpCodeMap (const OpCodeMap &)=delete | |
If English locale for numbers. More... | |
OpCodeMap & | operator= (const OpCodeMap &)=delete |
void | putCopyOpCode (const OUString &rSymbol, OpCode eOp) |
Conditionally put a mapping in copyFrom() context. More... | |
Private Attributes | |
OpCodeHashMap | maHashMap |
std::unique_ptr< OUString[]> | mpTable |
Hash map of symbols, OUString -> OpCode. More... | |
ExternalHashMap | maExternalHashMap |
Array of symbols, OpCode -> OUString, offset==OpCode. More... | |
ExternalHashMap | maReverseExternalHashMap |
Hash map of ocExternal, Filter String -> AddIn String. More... | |
FormulaGrammar::Grammar | meGrammar |
Hash map of ocExternal, AddIn String -> Filter String. More... | |
sal_uInt16 | mnSymbols |
Grammar, language and reference convention. More... | |
bool | mbCore: 1 |
Count of OpCode symbols. More... | |
bool | mbEnglish: 1 |
If mapping was setup by core, not filters. More... | |
bool | mbEnglishLocale: 1 |
If English symbols and external names. More... | |
Mappings from strings to OpCodes and vice versa.
Definition at line 82 of file FormulaCompiler.hxx.
|
privatedelete |
If English locale for numbers.
|
inline |
Definition at line 99 of file FormulaCompiler.hxx.
void formula::FormulaCompiler::OpCodeMap::copyFrom | ( | const OpCodeMap & | r | ) |
Copy mappings from r into this map, effectively replacing this map.
Override known legacy bad function names with correct ones if the conditions can be derived from the current maps.
Definition at line 1257 of file FormulaCompiler.cxx.
References formula::FormulaGrammar::extractFormulaLanguage(), getSymbolCount(), i, maExternalHashMap, maReverseExternalHashMap, mbCore, mbEnglish, meGrammar, formula::FormulaCompiler::meGrammar, mpTable, n, ocRRI, ocTableOp, and SAL_WARN_IF.
uno::Sequence< sheet::FormulaOpCodeMapEntry > formula::FormulaCompiler::OpCodeMap::createSequenceOfAvailableMappings | ( | const FormulaCompiler & | _rCompiler, |
const sal_Int32 | nGroup | ||
) | const |
Core implementation of XFormulaOpCodeMapper::getAvailableMappings()
Definition at line 501 of file FormulaCompiler.cxx.
References aMap, formula::FormulaCompiler::fillAddInToken(), i, nCount, nIndex, ocAdd, ocBad, ocCall, ocColRowName, ocDBArea, ocExternal, ocMacro, ocMatRef, ocMissing, ocName, ocNoName, ocPercentSign, ocPush, ocSpaces, ocStop, ocWhitespace, SAL_N_ELEMENTS, SC_OPCODE_AND, SC_OPCODE_ARRAY_CLOSE, SC_OPCODE_ARRAY_COL_SEP, SC_OPCODE_ARRAY_OPEN, SC_OPCODE_ARRAY_ROW_SEP, SC_OPCODE_CHOOSE, SC_OPCODE_CLOSE, SC_OPCODE_IF, SC_OPCODE_IF_ERROR, SC_OPCODE_IF_NA, SC_OPCODE_NO_NAME, SC_OPCODE_OPEN, SC_OPCODE_OR, SC_OPCODE_SEP, SC_OPCODE_START_1_PAR, SC_OPCODE_START_2_PAR, SC_OPCODE_START_BIN_OP, SC_OPCODE_START_NO_PAR, SC_OPCODE_START_UN_OP, SC_OPCODE_STOP_1_PAR, SC_OPCODE_STOP_2_PAR, SC_OPCODE_STOP_BIN_OP, SC_OPCODE_STOP_NO_PAR, and SC_OPCODE_STOP_UN_OP.
uno::Sequence< sheet::FormulaToken > formula::FormulaCompiler::OpCodeMap::createSequenceOfFormulaTokens | ( | const FormulaCompiler & | _rCompiler, |
const css::uno::Sequence< OUString > & | rNames | ||
) | const |
Core implementation of XFormulaOpCodeMapper::getMappings()
Definition at line 463 of file FormulaCompiler.cxx.
References formula::FormulaCompiler::FindAddInFunction(), ocExternal, and pName.
|
inline |
Get the symbol String -> AddIn String hash map for finds.
Definition at line 122 of file FormulaCompiler.hxx.
|
inline |
Get the grammar.
Definition at line 141 of file FormulaCompiler.hxx.
|
inline |
Get the symbol String -> OpCode hash map for finds.
Definition at line 119 of file FormulaCompiler.hxx.
|
inlinestatic |
The value used in createSequenceOfAvailableMappings() and thus in XFormulaOpCodeMapper::getMappings() for an unknown symbol.
Definition at line 190 of file FormulaCompiler.hxx.
Referenced by formula::FormulaOpCodeMapperObj::getOpCodeUnknown().
|
inline |
Get the AddIn String -> symbol String hash map for finds.
Definition at line 125 of file FormulaCompiler.hxx.
|
inline |
Get the symbol string matching an OpCode.
Definition at line 128 of file FormulaCompiler.hxx.
References DBG_ASSERT.
|
inline |
Get the first character of the symbol string matching an OpCode.
Definition at line 138 of file FormulaCompiler.hxx.
|
inline |
|
inline |
Does it have external symbol/name mappings?
Definition at line 166 of file FormulaCompiler.hxx.
|
inline |
Are these English symbols, as opposed to native language (which may be English as well)?
Definition at line 148 of file FormulaCompiler.hxx.
|
inline |
Are inline numbers parsed/formatted in en-US locale, as opposed to default locale?
Definition at line 152 of file FormulaCompiler.hxx.
|
inline |
Is it an ODFF / ODF 1.2 mapping?
Definition at line 160 of file FormulaCompiler.hxx.
References formula::FormulaGrammar::isODFF().
|
inline |
Is it an OOXML mapping?
Definition at line 163 of file FormulaCompiler.hxx.
References formula::FormulaGrammar::isOOXML().
|
inline |
Is it an ODF 1.1 compatibility mapping?
Definition at line 155 of file FormulaCompiler.hxx.
References formula::FormulaGrammar::isPODF().
|
private |
Conditionally put a mapping in copyFrom() context.
Does NOT check eOp range!
Definition at line 1243 of file FormulaCompiler.cxx.
References maHashMap, mpTable, and SAL_WARN_IF.
void formula::FormulaCompiler::OpCodeMap::putExternal | ( | const OUString & | rSymbol, |
const OUString & | rAddIn | ||
) |
Put entry of symbol String and AddIn international String pair.
Definition at line 434 of file FormulaCompiler.cxx.
References SAL_INFO_IF, and SAL_WARN_IF.
void formula::FormulaCompiler::OpCodeMap::putExternalSoftly | ( | const OUString & | rSymbol, |
const OUString & | rAddIn | ||
) |
Put entry of symbol String and AddIn international String pair, not warning just info as used for AddIn collection and setting up alias names.
Definition at line 451 of file FormulaCompiler.cxx.
References SAL_INFO, and SAL_INFO_IF.
void formula::FormulaCompiler::OpCodeMap::putOpCode | ( | const OUString & | rStr, |
const OpCode | eOp, | ||
const CharClass * | pCharClass | ||
) |
Put entry of symbol String and OpCode pair.
Definition at line 666 of file FormulaCompiler.cxx.
References ocArrayColSep, ocArrayRowSep, ocBackSolver, ocCurrency, ocCurrent, ocEasterSunday, ocErrorType, ocFixed, ocGetDayOfWeek, ocGetDiffDate360, ocGrowth, ocHLookup, ocLinest, ocLogest, ocMultiArea, ocSep, ocStyle, ocTrend, ocTrunc, ocVLookup, SAL_WARN, and CharClass::uppercase().
|
private |
Array of symbols, OpCode -> OUString, offset==OpCode.
Definition at line 86 of file FormulaCompiler.hxx.
Referenced by copyFrom().
|
private |
Definition at line 84 of file FormulaCompiler.hxx.
Referenced by putCopyOpCode().
|
private |
Hash map of ocExternal, Filter String -> AddIn String.
Definition at line 87 of file FormulaCompiler.hxx.
Referenced by copyFrom().
|
private |
Count of OpCode symbols.
Definition at line 90 of file FormulaCompiler.hxx.
Referenced by copyFrom().
|
private |
If mapping was setup by core, not filters.
Definition at line 91 of file FormulaCompiler.hxx.
Referenced by copyFrom().
|
private |
If English symbols and external names.
Definition at line 92 of file FormulaCompiler.hxx.
|
private |
Hash map of ocExternal, AddIn String -> Filter String.
Definition at line 88 of file FormulaCompiler.hxx.
Referenced by copyFrom().
|
private |
Grammar, language and reference convention.
Definition at line 89 of file FormulaCompiler.hxx.
|
private |
Hash map of symbols, OUString -> OpCode.
Definition at line 85 of file FormulaCompiler.hxx.
Referenced by copyFrom(), and putCopyOpCode().