C# Class Pytocs.TypeInference.State

Implements a scope, which maps names to sets of bindings.
ファイルを表示 Open project: uxmal/pytocs Class Usage Examples

Public Properties

Property Type Description
globalNames ISet
stateType StateType
supers List
table ISet>.IDictionary

Public Methods

Method Description
AddGlobalName ( string name ) : void
Bind ( Analyzer analyzer, Exp target, DataType rvalue, BindingKind kind ) : void

Bind a name to this scope, including destructuring assignment.

Bind ( Analyzer analyzer, Identifier id, DataType rvalue, BindingKind kind ) : void
Bind ( Analyzer analyzer, List xs, DataType rvalue, BindingKind kind ) : void
BindByScope ( Analyzer analyzer, Exp target, DataType rvalue ) : void

Without specifying a kind, bind determines the kind according to the type of the scope.

BindIterator ( Analyzer analyzer, Exp target, Exp iter, DataType iterType, BindingKind kind ) : void
Clone ( ) : State
GetGlobalTable ( ) : State
Insert ( Analyzer analyzer, string id, Exp node, DataType type, BindingKind kind ) : Binding
Insert ( Analyzer analyzer, string id, Module node, DataType type, BindingKind kind ) : Binding
IsGlobalName ( string name ) : bool
Lookup ( string name ) : ISet

Look up a name in the current symbol table. If not found, recurse on the parent table.

LookupAttribute ( string attr ) : ISet
LookupAttributeType ( string attr ) : DataType

Look for an attribute named and if found, return its type.

LookupLocal ( string name ) : ISet

Look up a name in the current symbol table only. Don't recurse on the parent table.

LookupScope ( string name ) : ISet

Look up a name in the module if it is declared as global, otherwise look it up locally.

MakeUnion ( ISet bs ) : DataType
Merge ( State other ) : void
Overwrite ( State s ) : void
Remove ( string id ) : void
State ( State s ) : System
State ( State parent, StateType type ) : System
ToString ( ) : string
Update ( string id, Binding b ) : ISet
Update ( string id, ISet bs ) : ISet
addSuper ( State sup ) : void
entrySet ( ) : ISet>>.ICollection
extendPath ( Analyzer analyzer, string pathname ) : string
getForwarding ( ) : State
getStateOfType ( StateType type ) : State

Find a symbol table of a certain type in the enclosing scopes.

lookupType ( string name ) : DataType

Look for a binding named {@code name} and if found, return its type.

merge ( State state1, State state2 ) : State
putAll ( State other ) : void
setStateType ( StateType type ) : void
transformExpr ( Analyzer analyzer, Exp n, State s ) : DataType
transformExprs ( Analyzer analyzer, List exprs, State s ) : void

Private Methods

Method Description
ReportUnpackMismatch ( Analyzer analyzer, List xs, int vsize ) : void
getModuleBindingIfGlobal ( string name ) : ISet

If {@code name} is declared as a global, return the module binding.

setAttr ( Analyzer analyzer, AttributeAccess attr, DataType attrType, DataType targetType ) : void
setAttrType ( Analyzer analyzer, AttributeAccess attr, DataType targetType, DataType attrType ) : void

Method Details

AddGlobalName() public method

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

Bind() public method

Bind a name to this scope, including destructuring assignment.
public Bind ( Analyzer analyzer, Exp target, DataType rvalue, BindingKind kind ) : void
analyzer Analyzer
target Exp
rvalue DataType
kind BindingKind
return void

Bind() public method

public Bind ( Analyzer analyzer, Identifier id, DataType rvalue, BindingKind kind ) : void
analyzer Analyzer
id Identifier
rvalue DataType
kind BindingKind
return void

Bind() public method

public Bind ( Analyzer analyzer, List xs, DataType rvalue, BindingKind kind ) : void
analyzer Analyzer
xs List
rvalue DataType
kind BindingKind
return void

BindByScope() public method

Without specifying a kind, bind determines the kind according to the type of the scope.
public BindByScope ( Analyzer analyzer, Exp target, DataType rvalue ) : void
analyzer Analyzer
target Exp
rvalue DataType
return void

BindIterator() public method

public BindIterator ( Analyzer analyzer, Exp target, Exp iter, DataType iterType, BindingKind kind ) : void
analyzer Analyzer
target Exp
iter Exp
iterType DataType
kind BindingKind
return void

Clone() public method

public Clone ( ) : State
return State

GetGlobalTable() public method

public GetGlobalTable ( ) : State
return State

Insert() public method

public Insert ( Analyzer analyzer, string id, Exp node, DataType type, BindingKind kind ) : Binding
analyzer Analyzer
id string
node Exp
type DataType
kind BindingKind
return Binding

Insert() public method

public Insert ( Analyzer analyzer, string id, Module node, DataType type, BindingKind kind ) : Binding
analyzer Analyzer
id string
node Pytocs.Syntax.Module
type DataType
kind BindingKind
return Binding

IsGlobalName() public method

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

Lookup() public method

Look up a name in the current symbol table. If not found, recurse on the parent table.
public Lookup ( string name ) : ISet
name string
return ISet

LookupAttribute() public method

public LookupAttribute ( string attr ) : ISet
attr string
return ISet

LookupAttributeType() public method

Look for an attribute named and if found, return its type.
public LookupAttributeType ( string attr ) : DataType
attr string
return DataType

LookupLocal() public method

Look up a name in the current symbol table only. Don't recurse on the parent table.
public LookupLocal ( string name ) : ISet
name string
return ISet

LookupScope() public method

Look up a name in the module if it is declared as global, otherwise look it up locally.
public LookupScope ( string name ) : ISet
name string
return ISet

MakeUnion() public static method

public static MakeUnion ( ISet bs ) : DataType
bs ISet
return DataType

Merge() public method

public Merge ( State other ) : void
other State
return void

Overwrite() public method

public Overwrite ( State s ) : void
s State
return void

Remove() public method

public Remove ( string id ) : void
id string
return void

State() public method

public State ( State s ) : System
s State
return System

State() public method

public State ( State parent, StateType type ) : System
parent State
type StateType
return System

ToString() public method

public ToString ( ) : string
return string

Update() public method

public Update ( string id, Binding b ) : ISet
id string
b Binding
return ISet

Update() public method

public Update ( string id, ISet bs ) : ISet
id string
bs ISet
return ISet

addSuper() public method

public addSuper ( State sup ) : void
sup State
return void

entrySet() public method

public entrySet ( ) : ISet>>.ICollection
return ISet>>.ICollection

extendPath() public method

public extendPath ( Analyzer analyzer, string pathname ) : string
analyzer Analyzer
pathname string
return string

getForwarding() public method

public getForwarding ( ) : State
return State

getStateOfType() public method

Find a symbol table of a certain type in the enclosing scopes.
public getStateOfType ( StateType type ) : State
type StateType
return State

lookupType() public method

Look for a binding named {@code name} and if found, return its type.
public lookupType ( string name ) : DataType
name string
return DataType

merge() public static method

public static merge ( State state1, State state2 ) : State
state1 State
state2 State
return State

putAll() public method

public putAll ( State other ) : void
other State
return void

setStateType() public method

public setStateType ( StateType type ) : void
type StateType
return void

transformExpr() public static method

public static transformExpr ( Analyzer analyzer, Exp n, State s ) : DataType
analyzer Analyzer
n Exp
s State
return DataType

transformExprs() public static method

public static transformExprs ( Analyzer analyzer, List exprs, State s ) : void
analyzer Analyzer
exprs List
s State
return void

Property Details

globalNames public_oe property

public ISet globalNames
return ISet

stateType public_oe property

public StateType stateType
return StateType

supers public_oe property

public List supers
return List

table public_oe property

public IDictionary> table
return ISet>.IDictionary