C# Class Pytocs.TypeInference.State

Implements a scope, which maps names to sets of bindings.
Afficher le fichier Open project: uxmal/pytocs Class Usage Examples

Méthodes publiques

Свойство Type Description
globalNames ISet
stateType StateType
supers List
table ISet>.IDictionary

Méthodes publiques

Méthode 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

Méthode 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 méthode

public AddGlobalName ( string name ) : void
name string
Résultat void

Bind() public méthode

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
Résultat void

Bind() public méthode

public Bind ( Analyzer analyzer, Identifier id, DataType rvalue, BindingKind kind ) : void
analyzer Analyzer
id Identifier
rvalue DataType
kind BindingKind
Résultat void

Bind() public méthode

public Bind ( Analyzer analyzer, List xs, DataType rvalue, BindingKind kind ) : void
analyzer Analyzer
xs List
rvalue DataType
kind BindingKind
Résultat void

BindByScope() public méthode

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
Résultat void

BindIterator() public méthode

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

Clone() public méthode

public Clone ( ) : State
Résultat State

GetGlobalTable() public méthode

public GetGlobalTable ( ) : State
Résultat State

Insert() public méthode

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

Insert() public méthode

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
Résultat Binding

IsGlobalName() public méthode

public IsGlobalName ( string name ) : bool
name string
Résultat bool

Lookup() public méthode

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

LookupAttribute() public méthode

public LookupAttribute ( string attr ) : ISet
attr string
Résultat ISet

LookupAttributeType() public méthode

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

LookupLocal() public méthode

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

LookupScope() public méthode

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
Résultat ISet

MakeUnion() public static méthode

public static MakeUnion ( ISet bs ) : DataType
bs ISet
Résultat DataType

Merge() public méthode

public Merge ( State other ) : void
other State
Résultat void

Overwrite() public méthode

public Overwrite ( State s ) : void
s State
Résultat void

Remove() public méthode

public Remove ( string id ) : void
id string
Résultat void

State() public méthode

public State ( State s ) : System
s State
Résultat System

State() public méthode

public State ( State parent, StateType type ) : System
parent State
type StateType
Résultat System

ToString() public méthode

public ToString ( ) : string
Résultat string

Update() public méthode

public Update ( string id, Binding b ) : ISet
id string
b Binding
Résultat ISet

Update() public méthode

public Update ( string id, ISet bs ) : ISet
id string
bs ISet
Résultat ISet

addSuper() public méthode

public addSuper ( State sup ) : void
sup State
Résultat void

entrySet() public méthode

public entrySet ( ) : ISet>>.ICollection
Résultat ISet>>.ICollection

extendPath() public méthode

public extendPath ( Analyzer analyzer, string pathname ) : string
analyzer Analyzer
pathname string
Résultat string

getForwarding() public méthode

public getForwarding ( ) : State
Résultat State

getStateOfType() public méthode

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

lookupType() public méthode

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

merge() public static méthode

public static merge ( State state1, State state2 ) : State
state1 State
state2 State
Résultat State

putAll() public méthode

public putAll ( State other ) : void
other State
Résultat void

setStateType() public méthode

public setStateType ( StateType type ) : void
type StateType
Résultat void

transformExpr() public static méthode

public static transformExpr ( Analyzer analyzer, Exp n, State s ) : DataType
analyzer Analyzer
n Exp
s State
Résultat DataType

transformExprs() public static méthode

public static transformExprs ( Analyzer analyzer, List exprs, State s ) : void
analyzer Analyzer
exprs List
s State
Résultat void

Property Details

globalNames public_oe property

public ISet globalNames
Résultat ISet

stateType public_oe property

public StateType stateType
Résultat StateType

supers public_oe property

public List supers
Résultat List

table public_oe property

public IDictionary> table
Résultat ISet>.IDictionary