[]
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.
public abstract class SyntaxNode : ICloneable
Public MustInherit Class SyntaxNode
Implements ICloneable
SyntaxNode node = SyntaxNode.Parse("SUM(A1:A3)+B1");
IList<SyntaxNode> children = node.Children;
string formulaText = node.ToString();
| Name | Description |
|---|---|
| SyntaxNode() |
| Name | Description |
|---|---|
| Children | Gets the child nodes of this syntax node. Use this property to traverse the formula syntax tree and inspect the immediate operands or arguments represented by the current node. |
| Name | Description |
|---|---|
| Clone() | Clones this syntax node. This method creates a copy of the current formula syntax node by traversing the syntax tree and rebuilding the node structure. If the node is mutable, the returned value is a cloned node. Otherwise, this method returns an equivalent node from the object pool. |
| Equals(object) | Checks whether this syntax node is equal to another object.
If |
| GetHashCode() | This object doesn't support getting hash code, because all fields are mutable. |
| Parse(string) | Loads a This method calls Parse(string, ParseContext) with the default parse context. |
| Parse(string, ParseContext) | Loads a SyntaxNode from a formula string using the specified ParseContext. Use the parse context to control how references in the formula are interpreted, including the 0-based base row, 0-based base column, and whether the formula uses R1C1 reference style.
If |
| ToString() | Returns the formula text for this node using the default unparse context. This method converts the syntax node back to a formula string by using GrapeCity.Documents.Excel.Expressions.UnParseContext.Default. |
| ToString(UnParseContext) | Returns the formula text for this node, optionally specifying context. |