C# Class YAMP.ParseContext

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

Private Properties

Property Type Description
ApplyPlotTemplate ParseContext
AssignVariable void
ParseContext System
RaiseInputPrompt void
RaiseLastPlotChanged void
RaiseNotification void
RaisePause void
RaiseVariableChanged void
RaiseVariableCreated void
RaiseVariableRemoved void

Public Methods

Method 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

Method 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 method

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. ///
return ParseContext

AddFunction() public method

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. ///
return ParseContext

AssignVariable() public method

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. ///
return ParseContext

ChangeLastPlotTo() public method

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

Clear() public method

Clears the list of assigned variables.
public Clear ( ) : ParseContext
return ParseContext

FindConstants() public method

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

FindFunction() public method

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

GetDefaultProperties() public method

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

GetSymbolContext() public method

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

GetVariable() public method

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

GetVariableContext() public method

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

LoadFunction() public method

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). ///
return IFunction

ParseContext() public method

Creates a new top context.
public ParseContext ( ) : System
return System

ParseContext() public method

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. ///
return System

RemoveConstant() public method

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

RemoveFunction() public method

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

RenameConstant() public method

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. ///
return ParseContext

RenameFunction() public method

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. ///
return ParseContext

SetDefaultProperty() public method

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.
return ParseContext