C# Class While.SymbolTable

Symbol table to keep track of variables and their scope. Used both in the parsing phase, and again in the compilation phase.
显示文件 Open project: einaregilsson/While-Language

Public Methods

Method Description
Clear ( ) : void
DefineArgument ( string name ) : void
DefineResultArgument ( string name ) : void
DefineVariable ( string name ) : void
FindScopeForVariable ( string name ) : int>.Dictionary
GetValue ( string name ) : int

Returns the number for the variable (since the CLR only understands numbers, not names)

IsArgument ( string name ) : bool
IsDeclaredInCurrentScope ( string name ) : bool
IsInScope ( string name ) : bool
IsResultArgument ( string name ) : bool
PopScope ( ) : void
PushScope ( ) : void

Method Details

Clear() public method

public Clear ( ) : void
return void

DefineArgument() public method

public DefineArgument ( string name ) : void
name string
return void

DefineResultArgument() public method

public DefineResultArgument ( string name ) : void
name string
return void

DefineVariable() public method

public DefineVariable ( string name ) : void
name string
return void

FindScopeForVariable() public method

public FindScopeForVariable ( string name ) : int>.Dictionary
name string
return int>.Dictionary

GetValue() public method

Returns the number for the variable (since the CLR only understands numbers, not names)
public GetValue ( string name ) : int
name string The variable name
return int

IsArgument() public method

public IsArgument ( string name ) : bool
name string
return bool

IsDeclaredInCurrentScope() public method

public IsDeclaredInCurrentScope ( string name ) : bool
name string
return bool

IsInScope() public method

public IsInScope ( string name ) : bool
name string
return bool

IsResultArgument() public method

public IsResultArgument ( string name ) : bool
name string
return bool

PopScope() public method

public PopScope ( ) : void
return void

PushScope() public method

public PushScope ( ) : void
return void