ExcelFormulaSyntaxTree
OfficeIMO.Excel
Immutable syntax tree for reference-bearing Excel formula text. It preserves all non-reference tokens verbatim and provides the common rewriter used by public conversion and search APIs.
Inheritance
- object
- ExcelFormulaSyntaxTree
Usage
Explore 2 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 2
- Property ExcelFormulaCellInfo.SyntaxTree
- Method ExcelFormulaSyntaxTree.Parse
Methods
public string ConvertReferences(ExcelReferenceStyle outputStyle, int anchorRow = 1, int anchorColumn = 1) #Converts every parsed reference to A1 or R1C1 notation.
Parameters
- outputStyle OfficeIMO.Excel.ExcelReferenceStyle
- anchorRow int = 1
- anchorColumn int = 1
Returns
stringpublic static ExcelFormulaSyntaxTree Parse(string formula) #Parses A1 formula references while preserving all other tokens verbatim.
Parameters
- formula string
Returns
ExcelFormulaSyntaxTreepublic static ExcelFormulaSyntaxTree Parse(string formula, ExcelReferenceStyle inputStyle, int anchorRow = 1, int anchorColumn = 1) #Parses references in the selected notation, resolving relative R1C1 coordinates at the supplied cell.
Parameters
- formula string
- inputStyle OfficeIMO.Excel.ExcelReferenceStyle
- anchorRow int = 1
- anchorColumn int = 1
Returns
ExcelFormulaSyntaxTreepublic string Rewrite(Func<ExcelReference, ExcelReference?> rewriter, ExcelReferenceStyle outputStyle = A1, int anchorRow = 1, int anchorColumn = 1) #Rewrites reference nodes once while preserving literals and all other syntax.
Parameters
- rewriter System.Func<OfficeIMO.Excel.ExcelReference, OfficeIMO.Excel.ExcelReference?>
- outputStyle OfficeIMO.Excel.ExcelReferenceStyle = A1
- anchorRow int = 1
- anchorColumn int = 1
Returns
stringpublic string RewriteNames(Func<string, string?> rewriter) #Rewrites defined-name nodes while preserving all other formula syntax.
Parameters
- rewriter System.Func<string, string?>
Returns
stringpublic string RewriteStructuredReferences(Func<string?, string, string?> rewriter) #Rewrites structured table-reference nodes while preserving all other formula syntax.
Parameters
- rewriter System.Func<string?, string, string?>
Returns
stringpublic string RewriteTableNames(Func<string, string?> rewriter) #Rewrites table identifiers in structured and bare table-reference nodes.
Parameters
- rewriter System.Func<string, string?>
Returns
stringInherited Methods
Properties
public IReadOnlyList<ExcelFormulaSyntaxNode> Nodes { get; } #Ordered syntax nodes preserving the authored formula.