API Reference
@univerjs
@univerjs/engine-formula
classes
Lexertreebuilder

@univerjs/engine-formula v0.4.2Docs


Class: LexerTreeBuilder

Extends

Constructors

new LexerTreeBuilder()

new LexerTreeBuilder(): LexerTreeBuilder

Returns

LexerTreeBuilder

Inherited from

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)

Methods

checkIfAddBracket()

checkIfAddBracket(formulaString): number

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

Parameters

ParameterType
formulaStringstring

Returns

number

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:179 (opens in a new tab)


convertRefersToAbsolute()

convertRefersToAbsolute(
   formulaString, 
   startAbsoluteRefType, 
   endAbsoluteRefType): string

Parameters

ParameterType
formulaStringstring
startAbsoluteRefTypeAbsoluteRefType
endAbsoluteRefTypeAbsoluteRefType

Returns

string

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:266 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:84 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getCurrentLexerNode()

getCurrentLexerNode(): LexerNode

Returns

LexerNode

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:134 (opens in a new tab)


getFunctionAndParameter()

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

Parameters

ParameterType
formulaStringstring
strIndexnumber

Returns

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

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:138 (opens in a new tab)


getSequenceNode()

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

Parameters

ParameterType
sequenceArrayISequenceArray[]

Returns

(string | ISequenceNode)[]

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:410 (opens in a new tab)


getUpLevel()

getUpLevel(): number

Returns

number

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:94 (opens in a new tab)


isBracesClose()

isBracesClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:122 (opens in a new tab)


isBracketClose()

isBracketClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:126 (opens in a new tab)


isColonClose()

isColonClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:98 (opens in a new tab)


isColonOpen()

isColonOpen(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:102 (opens in a new tab)


isDoubleQuotationClose()

isDoubleQuotationClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:106 (opens in a new tab)


isLambdaClose()

isLambdaClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:114 (opens in a new tab)


isLambdaOpen()

isLambdaOpen(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:110 (opens in a new tab)


isSingleQuotationClose()

isSingleQuotationClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:118 (opens in a new tab)


isSquareBracketClose()

isSquareBracketClose(): boolean

Returns

boolean

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:130 (opens in a new tab)


moveFormulaRefOffset()

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

Parameters

ParameterTypeDefault value
formulaStringstringundefined
refOffsetXnumberundefined
refOffsetYnumberundefined
ignoreAbsolutebooleanfalse

Returns

string

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:330 (opens in a new tab)


nodeMakerTest()

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

Parameters

ParameterType
formulaStringstring

Returns

undefined | VALUE | (string | LexerNode)[]

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:615 (opens in a new tab)


sequenceNodesBuilder()

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

Parameters

ParameterType
formulaStringstring

Returns

undefined | (string | ISequenceNode)[]

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:238 (opens in a new tab)


treeBuilder()

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

Parameters

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

Returns

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

Defined in

packages/engine-formula/src/engine/analysis/lexer-tree-builder.ts:619 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.