C# Class LSharp.Environment

Inheritance: IEnumerable
显示文件 Open project: RobBlackwell/LSharp Class Usage Examples

Public Methods

Method Description
AssignLocal ( LSharp.Symbol symbol, object value ) : object

Asssigns value to a local variable symbol in this local environment (irrespective of whether symbol is defined in any parent environments).

Contains ( LSharp.Symbol symbol ) : bool

Determines whether the environment contains a definition for a variable with the given symbol

Contents ( ) : string

Returns the contents of the environment as a string suitable for use in a debugger or IDE.

Environment ( ) : System.Collections
Environment ( Environment environment ) : System.Collections

Creates a new environment which has access to a previous environment

GetEnumerator ( ) : IEnumerator

Make environment enumerable so that they are convenient to use from within LSharp itself

GetValue ( LSharp.Symbol symbol ) : object
GlobalReset ( ) : void
Set ( LSharp.Symbol symbol, object value ) : object

Sets a variable with given symbol to a given value

Private Methods

Method Description
GetEnvironment ( LSharp.Symbol symbol ) : Environment

Returns the environment in which a given variable is defined, or null

Method Details

AssignLocal() public method

Asssigns value to a local variable symbol in this local environment (irrespective of whether symbol is defined in any parent environments).
public AssignLocal ( LSharp.Symbol symbol, object value ) : object
symbol LSharp.Symbol
value object
return object

Contains() public method

Determines whether the environment contains a definition for a variable with the given symbol
public Contains ( LSharp.Symbol symbol ) : bool
symbol LSharp.Symbol
return bool

Contents() public method

Returns the contents of the environment as a string suitable for use in a debugger or IDE.
public Contents ( ) : string
return string

Environment() public method

public Environment ( ) : System.Collections
return System.Collections

Environment() public method

Creates a new environment which has access to a previous environment
public Environment ( Environment environment ) : System.Collections
environment Environment
return System.Collections

GetEnumerator() public method

Make environment enumerable so that they are convenient to use from within LSharp itself
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetValue() public method

public GetValue ( LSharp.Symbol symbol ) : object
symbol LSharp.Symbol
return object

GlobalReset() public method

public GlobalReset ( ) : void
return void

Set() public method

Sets a variable with given symbol to a given value
public Set ( LSharp.Symbol symbol, object value ) : object
symbol LSharp.Symbol
value object
return object