C# Класс YAMP.ParserExtensions

Useful extensions for the Parser class.
Показать файл Открыть проект

Открытые методы

Метод Описание
AddCustomConstant ( this parser, String name, Double constant ) : void

Adds a custom constant to the parser (to the primary context).

AddCustomConstant ( this parser, String name, Value constant ) : void

Adds a custom constant to the parser (to the primary context).

AddCustomFunction ( this parser, String name, FunctionDelegate f ) : void

Adds a custom function to be used by the parser (to the primary context).

AddVariable ( this parser, String name, Value value ) : void

Adds a variable to be used by the parser (to the primary context).

Evaluate ( this parser, String input ) : Value

Execute the evaluation of this parser instance without any external symbols.

Evaluate ( this parser, String input, Object values ) : Value

Execute the evaluation of this parser instance with external symbols.

LoadPlugin ( this parser, Assembly assembly ) : System.Guid

Loads an external library (assembly) that uses IFunction, Operator, ..., into the primary context.

RemoveCustomConstant ( this parser, String name ) : void

Removes a custom constant (to the primary context).

RemoveCustomFunction ( this parser, String name ) : void

Removes a custom function (to the primary context).

RemoveVariable ( this parser, String name ) : void

Removes a variable from the workspace (to the primary context).

RenameConstant ( this parser, String oldName, String newName ) : void

Renames an existing constant (custom or defined).

RenameFunction ( this parser, String oldName, String newName ) : void

Renames an existing function (custom or defined).

UnloadPlugin ( this parser, System.Guid pluginId ) : void

Unloads a previously loaded plugin.

Описание методов

AddCustomConstant() публичный статический Метод

Adds a custom constant to the parser (to the primary context).
public static AddCustomConstant ( this parser, String name, Double constant ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the constant. ///
constant Double /// The value of the constant. ///
Результат void

AddCustomConstant() публичный статический Метод

Adds a custom constant to the parser (to the primary context).
public static AddCustomConstant ( this parser, String name, Value constant ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the constant. ///
constant Value /// The value of the constant. ///
Результат void

AddCustomFunction() публичный статический Метод

Adds a custom function to be used by the parser (to the primary context).
public static AddCustomFunction ( this parser, String name, FunctionDelegate f ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the function that should be added. ///
f FunctionDelegate /// The function that fulfills the signature Value f(Value v). ///
Результат void

AddVariable() публичный статический Метод

Adds a variable to be used by the parser (to the primary context).
public static AddVariable ( this parser, String name, Value value ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the variable that should be added. ///
value Value /// The value of the variable. ///
Результат void

Evaluate() публичный статический Метод

Execute the evaluation of this parser instance without any external symbols.
public static Evaluate ( this parser, String input ) : Value
parser this The parser to extend.
input String The input to evaluate.
Результат Value

Evaluate() публичный статический Метод

Execute the evaluation of this parser instance with external symbols.
public static Evaluate ( this parser, String input, Object values ) : Value
parser this The parser to extend.
input String The input to evaluate.
values Object /// The values in an anonymous object - containing name - value pairs. ///
Результат Value

LoadPlugin() публичный статический Метод

Loads an external library (assembly) that uses IFunction, Operator, ..., into the primary context.
public static LoadPlugin ( this parser, Assembly assembly ) : System.Guid
parser this The parser to extend.
assembly System.Reflection.Assembly /// The assembly to load as a plugin. ///
Результат System.Guid

RemoveCustomConstant() публичный статический Метод

Removes a custom constant (to the primary context).
public static RemoveCustomConstant ( this parser, String name ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the constant that should be removed. ///
Результат void

RemoveCustomFunction() публичный статический Метод

Removes a custom function (to the primary context).
public static RemoveCustomFunction ( this parser, String name ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the function that should be removed. ///
Результат void

RemoveVariable() публичный статический Метод

Removes a variable from the workspace (to the primary context).
public static RemoveVariable ( this parser, String name ) : void
parser this The parser to extend.
name String /// The name of the symbol corresponding to the variable that should be removed. ///
Результат void

RenameConstant() публичный статический Метод

Renames an existing constant (custom or defined).
public static RenameConstant ( this parser, String oldName, String newName ) : void
parser this The parser to extend.
oldName String The old name of the constant.
newName String The new name for the constant.
Результат void

RenameFunction() публичный статический Метод

Renames an existing function (custom or defined).
public static RenameFunction ( this parser, String oldName, String newName ) : void
parser this The parser to extend.
oldName String The old name of the function.
newName String The new name for the function.
Результат void

UnloadPlugin() публичный статический Метод

Unloads a previously loaded plugin.
public static UnloadPlugin ( this parser, System.Guid pluginId ) : void
parser this The parser to extend.
pluginId System.Guid The ID for the assembly to unload.
Результат void