Class SourceCodeTokenizer¶
Namespace: OfficeOpenXml.FormulaParsing.LexicalAnalysis
Assembly: EPPlus.dll
Source code tokenizer
Inheritance¶
Implements¶
Inherited Members¶
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()
Constructors¶
SourceCodeTokenizer(IFunctionNameProvider, INameValueProvider, bool, bool, bool)¶
public SourceCodeTokenizer(IFunctionNameProvider functionRepository, INameValueProvider nameValueProvider, bool r1c1 = false, bool keepWhitespace = false, bool pivotFormula = false)
Parameters¶
functionRepository IFunctionNameProvider
A function name provider
nameValueProvider INameValueProvider
A name value provider
r1c1 bool
If true the tokenizer will use the R1C1 format
keepWhitespace bool
If true whitspaces in formulas will be preserved
pivotFormula bool
If the formula is from a calculated column in a pivot table.
Properties¶
Default¶
The default tokenizer. This tokenizer will remove and ignore whitespaces.
Property Value¶
Default_KeepWhiteSpaces¶
The default tokenizer. This tokenizer will remove and ignore whitespaces.
Property Value¶
PivotFormula¶
Property Value¶
R1C1¶
The tokenizer used for r1c1 format. This tokenizer will keep whitespaces and add them as tokens.
Property Value¶
Methods¶
Tokenize(string)¶
Split the input string into tokens used by the formula parser
Parameters¶
input string
Returns¶
Tokenize(string, string)¶
Splits a formula in tokens used in when calculating for example a worksheet cell, defined name or a pivot table field formula.
Parameters¶
input string
The formula to tokenize
worksheet string
The worksheet name.
Returns¶
Exceptions¶
Thrown if the formula is not valid.