C# Класс Jurassic.Compiler.Scope

Represents an enclosing context where variables are uniquely defined.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
DeclareVariable DeclaredVariable
GenerateDeclarations void
GenerateScopeCreation void
GenerateScopeDestruction void
GetDeclaredVariable DeclaredVariable
HasDeclaredVariable bool
RemovedDeclaredVariable void

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

Метод Описание
Delete ( string variableName ) : bool

Deletes the variable from the scope.

GetValue ( string variableName ) : object

Returns the value of the given variable.

HasValue ( string variableName ) : bool

Returns true if the given variable exists in this scope.

SetValue ( string variableName, object value ) : void

Sets the value of the given variable.

Защищенные методы

Метод Описание
Scope ( Scope parentScope ) : System

Creates a new Scope instance.

Scope ( Scope parentScope, int declaredVariableCount ) : System

Creates a new Scope instance.

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

Метод Описание
DeclareVariable ( string name, Jurassic.Compiler.Expression valueAtTopOfScope = null, bool writable = true, bool deletable = false ) : DeclaredVariable

Declares a variable or function in this scope. This will be initialized with the value of the given expression.

GenerateDeclarations ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates code that initializes the variable and function declarations.

GenerateScopeCreation ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates code that creates a new scope.

GenerateScopeDestruction ( ILGenerator generator, OptimizationInfo optimizationInfo ) : void

Generates code that restores the parent scope as the active scope.

GetDeclaredVariable ( string variableName ) : DeclaredVariable

Gets the index of the given variable.

HasDeclaredVariable ( string name ) : bool

Returns true if the given variable has been declared in this scope.

RemovedDeclaredVariable ( string name ) : void

Removes a declared variable from the scope.

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

Delete() публичный абстрактный Метод

Deletes the variable from the scope.
public abstract Delete ( string variableName ) : bool
variableName string The name of the variable.
Результат bool

GetValue() публичный абстрактный Метод

Returns the value of the given variable.
public abstract GetValue ( string variableName ) : object
variableName string The name of the variable.
Результат object

HasValue() публичный абстрактный Метод

Returns true if the given variable exists in this scope.
public abstract HasValue ( string variableName ) : bool
variableName string The name of the variable to check.
Результат bool

Scope() защищенный Метод

Creates a new Scope instance.
protected Scope ( Scope parentScope ) : System
parentScope Scope A reference to the parent scope, or null if this is /// the global scope.
Результат System

Scope() защищенный Метод

Creates a new Scope instance.
protected Scope ( Scope parentScope, int declaredVariableCount ) : System
parentScope Scope A reference to the parent scope, or null if this is /// the global scope.
declaredVariableCount int The number of variables declared in this scope.
Результат System

SetValue() публичный абстрактный Метод

Sets the value of the given variable.
public abstract SetValue ( string variableName, object value ) : void
variableName string The name of the variable.
value object The new value of the variable.
Результат void