C# Class ScriptNET.Runtime.ScriptScope

Script Scope represents a tree of local scopes. Scopes stores variables and types tables. Run-time queries ScriptScope through ScriptContext for: Resolving names of types and variables; Resolving names of functions; Adding new function into scope; Assigning values to variables.
Inheritance: IScriptScope
Exibir arquivo Open project: Zepheus/Fiesta_Utils Class Usage Examples

Public Methods

Method Description
Clean ( ) : void

Cleans Scope (Removes items)

GetFunctionDefinition ( string name ) : IInvokable

Gets Invokable object (Function) by a given name

GetItem ( string id, bool throwException ) : object

Returns value of the variable. Throws ScriptIdNotFoundException

HasVariable ( string id ) : bool

Returns true if excatly this scope has variable with given id

ScriptScope ( ) : System

Default Constructor

ScriptScope ( IScriptScope parent ) : System
SetItem ( string id, object value ) : void

Sets Item: variable or type

Protected Methods

Method Description
GetVariableInternal ( string id, bool searchHierarchy ) : object

Searches the scope hierarchy for the given id, should return NoVariable if it is not found

Method Details

Clean() public method

Cleans Scope (Removes items)
public Clean ( ) : void
return void

GetFunctionDefinition() public method

Gets Invokable object (Function) by a given name
public GetFunctionDefinition ( string name ) : IInvokable
name string Name
return IInvokable

GetItem() public method

Returns value of the variable. Throws ScriptIdNotFoundException
public GetItem ( string id, bool throwException ) : object
id string Variable ID
throwException bool
return object

GetVariableInternal() protected method

Searches the scope hierarchy for the given id, should return NoVariable if it is not found
protected GetVariableInternal ( string id, bool searchHierarchy ) : object
id string
searchHierarchy bool
return object

HasVariable() public method

Returns true if excatly this scope has variable with given id
public HasVariable ( string id ) : bool
id string
return bool

ScriptScope() public method

Default Constructor
public ScriptScope ( ) : System
return System

ScriptScope() public method

public ScriptScope ( IScriptScope parent ) : System
parent IScriptScope
return System

SetItem() public method

Sets Item: variable or type
public SetItem ( string id, object value ) : void
id string item's id
value object value
return void