Skip to content

Class SourceCodeTokenizer

Namespace: OfficeOpenXml.FormulaParsing.LexicalAnalysis
Assembly: EPPlus.dll

public class SourceCodeTokenizer : ISourceCodeTokenizer

Inheritance

object ← SourceCodeTokenizer

Implements

ISourceCodeTokenizer

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)

Constructor

public SourceCodeTokenizer(IFunctionNameProvider functionRepository, INameValueProvider nameValueProvider, bool r1c1 = false, bool keepWhitespace = 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

Properties

Default

The default tokenizer. This tokenizer will remove and ignore whitespaces.

public static ISourceCodeTokenizer Default { get; }

Property Value

ISourceCodeTokenizer

R1C1

The tokenizer used for r1c1 format. This tokenizer will keep whitespaces and add them as tokens.

public static ISourceCodeTokenizer R1C1 { get; }

Property Value

ISourceCodeTokenizer

Methods

Tokenize(string)

Split the input string into tokens used by the formula parser

public IList<Token> Tokenize(string input)

Parameters

input string

Returns

IList<Token>

Tokenize(string, string)

Split the input string into tokens used by the formula parser

public IList<Token> Tokenize(string input, string worksheet)

Parameters

input string

worksheet string

Returns

IList<Token>

Exceptions

InvalidFormulaException