C# Class YAMP.ParseContext

Class that describes the current parse context (available functions, constants, variables, ...).
Afficher le fichier Open project: FlorianRappl/YAMP Class Usage Examples

Private Properties

Свойство Type Description
ApplyPlotTemplate ParseContext
AssignVariable void
ParseContext System
RaiseInputPrompt void
RaiseLastPlotChanged void
RaiseNotification void
RaisePause void
RaiseVariableChanged void
RaiseVariableCreated void
RaiseVariableRemoved void

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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.

Method Details

AddConstant() public méthode

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. ///
Résultat ParseContext

AddFunction() public méthode

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. ///
Résultat ParseContext

AssignVariable() public méthode

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. ///
Résultat ParseContext

ChangeLastPlotTo() public méthode

Sets the lastplot to be used to the given value.
public ChangeLastPlotTo ( PlotValue plot ) : ParseContext
plot PlotValue The plot to change to.
Résultat ParseContext

Clear() public méthode

Clears the list of assigned variables.
public Clear ( ) : ParseContext
Résultat ParseContext

FindConstants() public méthode

Finds the constant with the specified name.
public FindConstants ( String name ) : IConstants
name String /// The symbolic name to retrieve. ///
Résultat IConstants

FindFunction() public méthode

Finds the function instance with the specified name.
public FindFunction ( String name ) : IFunction
name String /// The symbolic name to retrieve. ///
Résultat IFunction

GetDefaultProperties() public méthode

Gets the key value pairs of the specified bin.
public GetDefaultProperties ( String binName ) : Value>.ReadOnlyDictionary
binName String The name of the template bin.
Résultat Value>.ReadOnlyDictionary

GetSymbolContext() public méthode

Gets the exact context of the given symbol.
public GetSymbolContext ( String name ) : ParseContext
name String The name of the symbol.
Résultat ParseContext

GetVariable() public méthode

Gets the value with the specific symbolic name.
public GetVariable ( String name ) : Value
name String /// The variable's name. ///
Résultat Value

GetVariableContext() public méthode

Gets the exact context of the given variable.
public GetVariableContext ( String name ) : ParseContext
name String The name of the variable.
Résultat ParseContext

LoadFunction() public méthode

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). ///
Résultat IFunction

ParseContext() public méthode

Creates a new top context.
public ParseContext ( ) : System
Résultat System

ParseContext() public méthode

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. ///
Résultat System

RemoveConstant() public méthode

Removes a constant from the context.
public RemoveConstant ( String name ) : ParseContext
name String /// The name of the constant. ///
Résultat ParseContext

RemoveFunction() public méthode

Removes a function from the context.
public RemoveFunction ( String name ) : ParseContext
name String /// The name of the function. ///
Résultat ParseContext

RenameConstant() public méthode

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. ///
Résultat ParseContext

RenameFunction() public méthode

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. ///
Résultat ParseContext

SetDefaultProperty() public méthode

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.
Résultat ParseContext