[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Expressions

GrapeCity.Documents.Excel.Expressions Namespace

Classes

ArrayNode

Represents an array literal node in a formula syntax tree.

An ArrayNode stores a two-dimensional array of constant values that can be used as a literal expression in the syntax tree. Array and element values cannot be null. Supported element types are double, string, bool, and CalcError. Primitive numeric values such as byte, short, int, long, and float are accepted, but they are normalized to double if the node is converted to text and then parsed again. Floating-point values cannot be NaN or infinity.

The array must contain at least one element, and each nested array must use a zero-based lower bound.

ConstNode

Represents a constant node in the syntax tree.

This abstract base class represents literal values that appear as terminal nodes in an expression tree, such as numbers, text, logical values, errors, and array constants.

As a subclass of TerminalNode, a constant node does not contain child nodes and is used as a leaf node during parsing and evaluation.

EmptyNode

Represents an empty node in a formula syntax tree.

This node is used when an argument is omitted. EmptyNode is immutable, and the shared instance returned by Instance is the only valid instance for public use.

ErrorNode

Represents an error literal node in a formula syntax tree.

An ErrorNode stores a CalcError value that identifies a formula error.

FormulaSyntaxTree

Represents a formula as a syntax tree.

This class is the entry point for the formula expression API. A FormulaSyntaxTree can be created as an empty tree and then populated by assigning a root SyntaxNode, or it can be created from formula text by using Parse(string). After the tree is built, you can inspect its structure with Root or convert it back to formula text with ToString().

FunctionNode

Represents a function call expression in a syntax tree.

A FunctionNode stores the function name and inherits child-node support from NonTerminalNode so the function arguments can be represented as nested syntax nodes.

LogicalNode

Represents a boolean literal node in a formula syntax tree.

A LogicalNode stores a bool value that can be read or updated after creation.

NameNode

Represents a name node in the syntax tree.

A NameNode stores the short name together with optional worksheet scope information and an optional WorkbookReference for external workbook references. Use this class to represent parsed names such as a workbook-scoped or worksheet-scoped name in a formula expression tree.

NonTerminalNode

Represents a non-terminal node in a formula syntax tree.

A NonTerminalNode is a SyntaxNode that can contain one or more child nodes. It serves as the base type for composite syntax elements, such as function calls, operators, and parenthesized expressions, where the expression structure is represented by nested SyntaxNode instances.

The child collection returned by Children contains the immediate descendants of this node and is used to build and traverse the syntax tree.

NumberNode

Represents a numeric literal node in a formula syntax tree.

This node stores a single double value and can be read or updated after creation.

See ConstNode for other constant node types.

OperatorNode

Represents an operator call expression in a formula syntax tree.

An OperatorNode is a non-terminal syntax node whose operator type is defined by an OperatorKind. Use this class to inspect or modify the operator associated with an expression node.

ParenthesisNode

Represents a parenthesized expression in a formula syntax tree.

The node contains the expression inside the parentheses through the inherited child node collection.

ParseContext

Represents options used when converting formula text to a FormulaSyntaxTree.

Use this class to supply parsing context for Parse(string, ParseContext), such as the formula location and whether references are interpreted in R1C1 style. The base row and base column are zero-based indexes.

Reference

Represents a reference in a formula.

A Reference describes a cell, a range, a worksheet-qualified reference, a 3D worksheet reference, or a reference to an external workbook. Use its row, column, range, worksheet, and workbook properties to build or inspect formula references programmatically.

If a row or column index is relative, use the base row or base column in the parse or unparse context when converting the reference to text.

ReferenceNode

Represents a reference node in the formula syntax tree.

A ReferenceNode is a TerminalNode that wraps a Reference object so a cell, range, worksheet, or workbook reference can be represented as a terminal expression node.

SyntaxNode

Represents a node in a formula syntax tree.

SyntaxNode is the abstract base class for all nodes in a parsed formula expression. A node can be terminal or non-terminal, depending on whether it represents a leaf value or a composite expression that contains nested nodes.

Use this type when working with formula syntax trees returned by parsing APIs or when traversing expression structures programmatically. Child nodes are exposed through Children; terminal nodes return no children, while non-terminal nodes expose their immediate descendants.

This class also serves as the common base for converting syntax trees back to formula text and for implementing tree traversal patterns in derived node types.

TableItemNode

Represents a table item in the syntax tree.

A table item describes a structured reference to a table, including the table name, the referenced table part, and the source column or column range. Use this class to build or inspect syntax nodes for references such as headers, data, totals, or specific table columns.

TerminalNode

Represents a terminal node in the syntax tree.

TextNode

Represents a string literal node in a formula syntax tree.

Use this class to create or inspect constant text values in expression trees. A TextNode stores a non-null string value and inherits constant-node behavior from ConstNode.

UnParseContext

Contains options for converting a FormulaSyntaxTree to a formula string.

Use this context to control how ToString(UnParseContext) formats references when converting a syntax tree back to text. The context can specify the formula position through 0-based base row and base column values, whether references are formatted in R1C1 style, and the culture used during conversion.

A new instance is empty and uses the invariant culture by default.

WorkbookReference

Represents a reference to an external workbook.

This class identifies an external workbook by file path, URI, or workbook name and is typically used together with Reference when building or modifying formula references. A workbook reference can be created by using FromFilePath(string), FromUri(string), or FromName(string).

Enums

OperatorKind

Specifies the operator used in a formula syntax tree.

Use this enum with OperatorNode to represent arithmetic, comparison, reference, text-concatenation, and dynamic-array operators when building or inspecting parsed formulas.

TableItemType

Represents a part of a table.

This class identifies specific table sections used in structured references, such as headers, data, and totals. It also supports combining multiple table parts by using the bitwise OR operator, such as TableItemType.Headers | TableItemType.Data.