XLParser  1.7.2
XLParser.FormulaAnalyzer Class Reference

This class can do some simple analysis on the trees produced by the parser. More...

Public Member Functions

 FormulaAnalyzer (ParseTreeNode root)
 Provide formula analysis functions on a tree More...
 
 FormulaAnalyzer (string formula)
 Provide formula analysis functions More...
 
IEnumerable< ParseTreeNode > References ()
 Get all references that aren't part of another reference expression More...
 
IEnumerable< string > Functions ()
 
IEnumerable< double > Numbers ()
 
int Depth ()
 Return the depth of the parse tree, the number of nested Formulas More...
 
int OperatorDepth (ISet< string > operators=null)
 Get function/operator depth More...
 
int ConditionalComplexity ()
 Get the conditional complexity of the formula More...
 
IEnumerable< ParserReferenceParserReferences ()
 Get all references (to cells or ranges) included in the formula More...
 

Properties

ParseTreeNode Root [get]
 
List< ParseTreeNode >?? AllNodes [get]
 Lazy cached version of all nodes More...
 

Detailed Description

This class can do some simple analysis on the trees produced by the parser.

To prevent bloating this class, please make a new (sub)class and file when you want to add a coherent set of other analyses.

Constructor & Destructor Documentation

◆ FormulaAnalyzer() [1/2]

XLParser.FormulaAnalyzer.FormulaAnalyzer ( ParseTreeNode  root)

Provide formula analysis functions on a tree

◆ FormulaAnalyzer() [2/2]

XLParser.FormulaAnalyzer.FormulaAnalyzer ( string  formula)

Provide formula analysis functions

Member Function Documentation

◆ ConditionalComplexity()

int XLParser.FormulaAnalyzer.ConditionalComplexity ( )

Get the conditional complexity of the formula

◆ Depth()

int XLParser.FormulaAnalyzer.Depth ( )

Return the depth of the parse tree, the number of nested Formulas

◆ OperatorDepth()

int XLParser.FormulaAnalyzer.OperatorDepth ( ISet< string >  operators = null)

Get function/operator depth

Parameters
operatorsIf not null, count only specific functions/operators

◆ ParserReferences()

IEnumerable<ParserReference> XLParser.FormulaAnalyzer.ParserReferences ( )

Get all references (to cells or ranges) included in the formula

◆ References()

IEnumerable<ParseTreeNode> XLParser.FormulaAnalyzer.References ( )

Get all references that aren't part of another reference expression

Property Documentation

◆ AllNodes

List<ParseTreeNode>?? XLParser.FormulaAnalyzer.AllNodes
get

Lazy cached version of all nodes


The documentation for this class was generated from the following file: