[]
        
(Showing Draft Content)

GC.Spread.CalcEngine.Expression

Class: Expression

Spread.CalcEngine.Expression

Table of contents

Constructors

Properties

Constructors

constructor

new Expression(type)

Provides the base class from which the classes that represent expression tree nodes are derived. This is an abstract class.

example

// the below code will return a Expression
GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, "=1");
// Convert a formula string to an expression tree
const expression = GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, "=SUM(A1:B2)");
console.log(expression.type); // Returns ExpressionType.function
console.log(expression.functionName); // Returns "SUM"

Parameters

Name Type
type ExpressionType

Properties

type

type: ExpressionType

Indicates the type of expression node in the formula parse tree. Each expression node represents a specific element in a formula, such as a number, string, reference, function, or operator.

example

console.log(GC.Spread.Sheets.CalcEngine.formulaToExpression(sheet, "=1").type === GC.Spread.CalcEngine.ExpressionType.number);