Interface IScope
The base interface for scopes.
Namespace: Loretta.CodeAnalysis.Lua
Assembly: cs.temp.dll.dll
Syntax
public interface IScope
Properties
ContainedScopes
Returns the scopes directly contained within this scope.
Declaration
IEnumerable<IScope> ContainedScopes { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IScope> |
ContainingScope
The parent scope (if any).
Declaration
IScope ContainingScope { get; }
Property Value
| Type | Description |
|---|---|
| IScope |
DeclaredVariables
Contains the variables declared within the scope. As variables can be shadowed/redeclared, there may be multiple variables with the same name.
Declaration
IEnumerable<IVariable> DeclaredVariables { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IVariable> |
GotoLabels
The goto labels contained within this scope.
Declaration
IEnumerable<IGotoLabel> GotoLabels { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IGotoLabel> |
Kind
The kind of scope.
Declaration
ScopeKind Kind { get; }
Property Value
| Type | Description |
|---|---|
| ScopeKind |
Node
The syntax node that originated this scope. Not supported for the global scope.
Declaration
SyntaxNode Node { get; }
Property Value
| Type | Description |
|---|---|
| SyntaxNode |
Parent
Deprecated.
Declaration
IScope Parent { get; }
Property Value
| Type | Description |
|---|---|
| IScope |
ReferencedVariables
Variables that are directly referenced by this scope.
Declaration
IEnumerable<IVariable> ReferencedVariables { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IVariable> |
Methods
FindVariable(String, ScopeKind)
Attempts to find a variable with the given name.
Declaration
IVariable FindVariable(string name, ScopeKind kind = ScopeKind.Global)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the variable to search by. |
| ScopeKind | kind | The kind of scope up to which to search the variable in. |
Returns
| Type | Description |
|---|---|
| IVariable |