@univerjs/engine-formula v0.5.4


Class: LexerTreeBuilder

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:59

Extends

Constructors

new LexerTreeBuilder()

new LexerTreeBuilder(): LexerTreeBuilder

Returns

LexerTreeBuilder

Inherited from

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96

Methods

checkIfAddBracket()

checkIfAddBracket(formulaString): number

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:179

Estimate the number of right brackets that need to be automatically added to the end of the formula.

Parameters

ParameterType
formulaStringstring

Returns

number


convertRefersToAbsolute()

convertRefersToAbsolute(
   formulaString, 
   startAbsoluteRefType, 
   endAbsoluteRefType, 
   currentSheetName): string

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:266

Parameters

ParameterTypeDefault value
formulaStringstringundefined
startAbsoluteRefTypeAbsoluteRefTypeundefined
endAbsoluteRefTypeAbsoluteRefTypeundefined
currentSheetNamestring''

Returns

string


dispose()

dispose(): void

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:84

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getCurrentLexerNode()

getCurrentLexerNode(): LexerNode

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:134

Returns

LexerNode


getFunctionAndParameter()

getFunctionAndParameter(formulaString, strIndex): 
  | undefined
  | {
  functionName: string;
  paramIndex: number;
}

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:138

Parameters

ParameterType
formulaStringstring
strIndexnumber

Returns

| undefined | { functionName: string; paramIndex: number; }


getSequenceNode()

getSequenceNode(sequenceArray): (string | ISequenceNode)[]

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:410

Parameters

ParameterType
sequenceArrayISequenceArray[]

Returns

(string | ISequenceNode)[]


getUpLevel()

getUpLevel(): number

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:94

Returns

number


isBracesClose()

isBracesClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:122

Returns

boolean


isBracketClose()

isBracketClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:126

Returns

boolean


isColonClose()

isColonClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:98

Returns

boolean


isColonOpen()

isColonOpen(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:102

Returns

boolean


isDoubleQuotationClose()

isDoubleQuotationClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:106

Returns

boolean


isLambdaClose()

isLambdaClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:114

Returns

boolean


isLambdaOpen()

isLambdaOpen(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:110

Returns

boolean


isSingleQuotationClose()

isSingleQuotationClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:118

Returns

boolean


isSquareBracketClose()

isSquareBracketClose(): boolean

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:130

Returns

boolean


moveFormulaRefOffset()

moveFormulaRefOffset(
   formulaString, 
   refOffsetX, 
   refOffsetY, 
   ignoreAbsolute): string

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:330

Parameters

ParameterTypeDefault value
formulaStringstringundefined
refOffsetXnumberundefined
refOffsetYnumberundefined
ignoreAbsolutebooleanfalse

Returns

string


nodeMakerTest()

nodeMakerTest(formulaString): 
  | undefined
  | VALUE
  | (string | LexerNode)[]

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:615

Parameters

ParameterType
formulaStringstring

Returns

| undefined | VALUE | (string | LexerNode)[]


sequenceNodesBuilder()

sequenceNodesBuilder(formulaString): 
  | undefined
  | (string | ISequenceNode)[]

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:238

Parameters

ParameterType
formulaStringstring

Returns

| undefined | (string | ISequenceNode)[]


treeBuilder()

treeBuilder(
   formulaString, 
   transformSuffix, 
   injectDefinedName?, 
   simpleCheckDefinedName?): 
  | undefined
  | VALUE
  | LexerNode
  | (string | LexerNode)[]

Defined in: submodules/univer/packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:619

Parameters

ParameterTypeDefault value
formulaStringstringundefined
transformSuffixbooleantrue
injectDefinedName?(sequenceArray) => { definedNames: string[]; hasDefinedName: boolean; sequenceString: string; }undefined
simpleCheckDefinedName?(formulaString) => booleanundefined

Returns

| undefined | VALUE | LexerNode | (string | LexerNode)[]