[]
Spread.CalcEngine.Expression
• 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"
| Name | Type |
|---|---|
type |
ExpressionType |
• 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);