C# Class xFunc.Maths.Lexer

The lexer for mathematical expressions.
Inheritance: ILexer
Afficher le fichier Open project: sys27/xFunc Class Usage Examples

Méthodes publiques

Méthode Description
Lexer ( ) : System

Initializes a new instance of the Lexer class.

Tokenize ( string function ) : IEnumerable

Converts the string into a sequence of tokens.

Private Methods

Méthode Description
CountParams ( List tokens ) : IEnumerable

Calculates the number of parametes of functions.

CreateConst ( string match, IList tokens ) : void

Creates the constant token from matched string.

CreateFunction ( string match, IList tokens ) : void

Creates the function token from matched string.

CreateOperations ( string match, IList tokens ) : void

Creates the operation token from matched string.

CreateSymbol ( string match, IList tokens ) : void

Creates the symbol token from matched string.

IsBalanced ( string str ) : bool

Determines whether brackets in the specified string is balanced.

_CountParams ( List tokens, int index ) : int

Method Details

Lexer() public méthode

Initializes a new instance of the Lexer class.
public Lexer ( ) : System
Résultat System

Tokenize() public méthode

Converts the string into a sequence of tokens.
Throws when the parameter is null or empty. Throws when has the not supported symbol.
public Tokenize ( string function ) : IEnumerable
function string The string that contains the functions and operators.
Résultat IEnumerable