C# Класс YAMP.ParseContext

Class that describes the current parse context (available functions, constants, variables, ...).
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ApplyPlotTemplate ParseContext
AssignVariable void
ParseContext System
RaiseInputPrompt void
RaiseLastPlotChanged void
RaiseNotification void
RaisePause void
RaiseVariableChanged void
RaiseVariableCreated void
RaiseVariableRemoved void

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

Метод Описание
AddConstant ( String name, IConstants constant ) : ParseContext

Adds a constant to the context.

AddFunction ( String name, IFunction func ) : ParseContext

Adds a function to the context.

AssignVariable ( String name, Value value ) : ParseContext

Assigns a value to a symbolic name.

ChangeLastPlotTo ( PlotValue plot ) : ParseContext

Sets the lastplot to be used to the given value.

Clear ( ) : ParseContext

Clears the list of assigned variables.

FindConstants ( String name ) : IConstants

Finds the constant with the specified name.

FindFunction ( String name ) : IFunction

Finds the function instance with the specified name.

GetDefaultProperties ( String binName ) : Value>.ReadOnlyDictionary

Gets the key value pairs of the specified bin.

GetSymbolContext ( String name ) : ParseContext

Gets the exact context of the given symbol.

GetVariable ( String name ) : Value

Gets the value with the specific symbolic name.

GetVariableContext ( String name ) : ParseContext

Gets the exact context of the given variable.

LoadFunction ( String symbolName ) : IFunction

Tries to load a function from a given file.

ParseContext ( ) : System

Creates a new top context.

ParseContext ( ParseContext parentContext ) : System

Creates a new context with a custom parent (nested, i.e. more local layer).

RemoveConstant ( String name ) : ParseContext

Removes a constant from the context.

RemoveFunction ( String name ) : ParseContext

Removes a function from the context.

RenameConstant ( String oldName, String newName ) : ParseContext

Renames a constant from the context.

RenameFunction ( String oldName, String newName ) : ParseContext

Renames a function from the context.

SetDefaultProperty ( String binName, String propertyName, Value propertyValue ) : ParseContext

Sets a template property in the dictionary.

Приватные методы

Метод Описание
ApplyPlotTemplate ( PlotValue plot ) : ParseContext

Applies the template set for plots.

AssignVariable ( ParseContext context, String name, Value value ) : void

Assigns a variable to the given context.

ParseContext ( Value>.IDictionary shadowVariables ) : System
RaiseInputPrompt ( UserInputEventArgs e ) : void

Raises the input prompt if in interactive mode.

RaiseLastPlotChanged ( PlotEventArgs e ) : void

This is raised when the last plot has been changed.

RaiseNotification ( NotificationEventArgs e ) : void

Raises the notification if in interactive mode.

RaisePause ( PauseEventArgs e ) : void

Raises the input prompt if in interactive mode.

RaiseVariableChanged ( VariableEventArgs e ) : void

This is raised when a variable has changed.

RaiseVariableCreated ( VariableEventArgs e ) : void

This is raised when a variable has been created.

RaiseVariableRemoved ( VariableEventArgs e ) : void

This is raised when a variable has been removed.

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

AddConstant() публичный Метод

Adds a constant to the context.
public AddConstant ( String name, IConstants constant ) : ParseContext
name String /// The name of the constant. ///
constant IConstants /// The class instance of the constant. ///
Результат ParseContext

AddFunction() публичный Метод

Adds a function to the context.
public AddFunction ( String name, IFunction func ) : ParseContext
name String /// The name of the function. ///
func IFunction /// The IFunction instance to add. ///
Результат ParseContext

AssignVariable() публичный Метод

Assigns a value to a symbolic name.
public AssignVariable ( String name, Value value ) : ParseContext
name String /// The name to assign a value to. ///
value Value /// The value of the symbol. ///
Результат ParseContext

ChangeLastPlotTo() публичный Метод

Sets the lastplot to be used to the given value.
public ChangeLastPlotTo ( PlotValue plot ) : ParseContext
plot PlotValue The plot to change to.
Результат ParseContext

Clear() публичный Метод

Clears the list of assigned variables.
public Clear ( ) : ParseContext
Результат ParseContext

FindConstants() публичный Метод

Finds the constant with the specified name.
public FindConstants ( String name ) : IConstants
name String /// The symbolic name to retrieve. ///
Результат IConstants

FindFunction() публичный Метод

Finds the function instance with the specified name.
public FindFunction ( String name ) : IFunction
name String /// The symbolic name to retrieve. ///
Результат IFunction

GetDefaultProperties() публичный Метод

Gets the key value pairs of the specified bin.
public GetDefaultProperties ( String binName ) : Value>.ReadOnlyDictionary
binName String The name of the template bin.
Результат Value>.ReadOnlyDictionary

GetSymbolContext() публичный Метод

Gets the exact context of the given symbol.
public GetSymbolContext ( String name ) : ParseContext
name String The name of the symbol.
Результат ParseContext

GetVariable() публичный Метод

Gets the value with the specific symbolic name.
public GetVariable ( String name ) : Value
name String /// The variable's name. ///
Результат Value

GetVariableContext() публичный Метод

Gets the exact context of the given variable.
public GetVariableContext ( String name ) : ParseContext
name String The name of the variable.
Результат ParseContext

LoadFunction() публичный Метод

Tries to load a function from a given file.
public LoadFunction ( String symbolName ) : IFunction
symbolName String /// The name of the function (equals the name of the file). ///
Результат IFunction

ParseContext() публичный Метод

Creates a new top context.
public ParseContext ( ) : System
Результат System

ParseContext() публичный Метод

Creates a new context with a custom parent (nested, i.e. more local layer).
public ParseContext ( ParseContext parentContext ) : System
parentContext ParseContext /// The parent context for the new context. ///
Результат System

RemoveConstant() публичный Метод

Removes a constant from the context.
public RemoveConstant ( String name ) : ParseContext
name String /// The name of the constant. ///
Результат ParseContext

RemoveFunction() публичный Метод

Removes a function from the context.
public RemoveFunction ( String name ) : ParseContext
name String /// The name of the function. ///
Результат ParseContext

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

Renames a constant from the context.
public RenameConstant ( String oldName, String newName ) : ParseContext
oldName String /// The old name of the constant. ///
newName String /// The new name for the constant. ///
Результат ParseContext

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

Renames a function from the context.
public RenameFunction ( String oldName, String newName ) : ParseContext
oldName String /// The old name of the function. ///
newName String /// The new name for the function. ///
Результат ParseContext

SetDefaultProperty() публичный Метод

Sets a template property in the dictionary.
public SetDefaultProperty ( String binName, String propertyName, Value propertyValue ) : ParseContext
binName String The category of the default property.
propertyName String The name of the property.
propertyValue Value The default value of the property.
Результат ParseContext