C# Class Pchp.CodeAnalysis.FlowAnalysis.TypeRefContext

Context of TypeRefMask and ITypeRef instances. Contains additional information for routine context like current namespace, current type context etc.
Show file Open project: iolevel/peachpie Class Usage Examples

Private Properties

Property Type Description
AddToContext void
AddToContextNoCheck int
GetPrimitiveTypeRefMask TypeRefMask
GetPrimitiveTypeRefMaskNoCheck TypeRefMask
GetTypeCtxMask TypeRefMask
GetTypeMaskOfReservedClassName TypeRefMask
GetTypes IList
SetLateStaticBindType void
TypeRefContext System
UpdateMasks void

Public Methods

Method Description
AddToContext ( TypeRefContext context, TypeRefMask mask ) : TypeRefMask

Adds properly types from another context matching given mask.

AddToContext ( ITypeRef typeRef ) : int

Ensures given type is in the context.

GetArrayTypeMask ( ) : TypeRefMask

Gets type mask of generic array with element of any type.

GetArrayTypeMask ( TypeRefMask elementType ) : TypeRefMask

Gets type mask of array with elements of given type.

GetArraysFromMask ( TypeRefMask mask ) : TypeRefMask

Gets mask representing only array types in given mask. (Only bits corresponding to an array type will be set).

GetBooleanTypeMask ( ) : TypeRefMask

Gets bool type for this context.

GetCallableTypeMask ( ) : TypeRefMask

Gets type mask of all callable types.

GetDoubleTypeMask ( ) : TypeRefMask

Gets double type for this context.

GetElementType ( TypeRefMask mask ) : TypeRefMask

In case of array type, gets its possible element types.

GetLongTypeMask ( ) : TypeRefMask

Gets int type for this context.

GetNullTypeMask ( ) : TypeRefMask

Gets type mask corresponding to System.Object and not including any subclasses.

GetNumberTypeMask ( ) : TypeRefMask

Gets number (int and double) type for this context.

GetObjectTypes ( TypeRefMask mask ) : IList

Gets types of type object (classes, interfaces, traits) referenced by given type mask.

GetObjectsFromMask ( TypeRefMask mask ) : TypeRefMask

Gets mask representing only object types in given mask. (Only bits corresponding to an object type will be set).

GetParentTypeMask ( ) : TypeRefMask

Gets parent type for this context.

GetSelfTypeMask ( ) : TypeRefMask

Gets self type for this context.

GetStaticTypeMask ( ) : TypeRefMask

Gets static type for this context.

GetStringTypeMask ( ) : TypeRefMask

Gets string type for this context.

GetSystemObjectTypeMask ( ) : TypeRefMask

Gets type mask corresponding to System.Object.

GetThisTypeMask ( ) : TypeRefMask

Gets type of $this in current context.

GetTypeIndex ( ITypeRef typeref ) : int

Gets index of the given type within the context. Returns -1 if such type is not present.

GetTypeMask ( Devsense.PHP.Syntax.Ast tref, bool includesSubclasses = true ) : TypeRefMask

Gets type mask corresponding to given TypeRef within this context.

GetTypeMask ( ITypeRef typeref, bool includesSubclasses ) : TypeRefMask

Helper method that builds TypeRefMask for given type in this context.

GetTypeMask ( QualifiedName qname, bool includesSubclasses = true ) : TypeRefMask

Gets type mask corresponding to given qualified name within this context.

GetTypes ( TypeRefMask mask ) : IList

Gets types referenced by given type mask.

GetWritableStringTypeMask ( ) : TypeRefMask

Gets writable string type (a string builder) for this context.

IsAString ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a string type (readonly or writable).

IsArray ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents an array.

IsBoolean ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a boolean.

IsDouble ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a double type.

IsLambda ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a lambda function or callable primitive type.

IsLong ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents an integer type.

IsNullable ( TypeRefMask mask ) : bool

Gets value indicating whether given type can be null.

IsNumber ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a number.

IsObject ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents an object.

IsPrimitiveType ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a primitive type.

IsReadonlyString ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents UTF16 readonly string.

IsWritableString ( TypeRefMask mask ) : bool

Gets value indicating whether given type mask represents a writablke string (string builder).

ToString ( TypeRefMask mask ) : string

Gets string representation of types contained in given type mask.

Private Methods

Method Description
AddToContext ( TypeRefContext other ) : void

Adds properly types from another context.

AddToContextNoCheck ( ITypeRef typeRef ) : int
GetPrimitiveTypeRefMask ( PrimitiveTypeRef typeref ) : TypeRefMask
GetPrimitiveTypeRefMaskNoCheck ( PrimitiveTypeRef typeref ) : TypeRefMask

Does not lookup existing types whether there is typeref already.

GetTypeCtxMask ( Devsense.PHP.Syntax.Ast typeCtx ) : TypeRefMask

Gets type mask corresponding to self with includesSubclasses flag set whether type is not final.

GetTypeMaskOfReservedClassName ( Name name ) : TypeRefMask

Gets type mask for reserved class name (self, parent, static).

GetTypes ( TypeRefMask typemask, ulong bitmask ) : IList

Gets enumeration of types matching given masks.

SetLateStaticBindType ( TypeRefMask staticTypeMask ) : void

Explicitly defines late static bind type (type of static).

TypeRefContext ( SourceUnit sourceUnit, SourceTypeSymbol containingType ) : System
UpdateMasks ( ITypeRef typeRef, int index ) : void

Updates internal masks for newly added type.

Method Details

AddToContext() public method

Adds properly types from another context matching given mask.
public AddToContext ( TypeRefContext context, TypeRefMask mask ) : TypeRefMask
context TypeRefContext Context of .
mask TypeRefMask Type mask representing types in .
return TypeRefMask

AddToContext() public method

Ensures given type is in the context.
public AddToContext ( ITypeRef typeRef ) : int
typeRef ITypeRef Type reference to be in the context.
return int

GetArrayTypeMask() public method

Gets type mask of generic array with element of any type.
public GetArrayTypeMask ( ) : TypeRefMask
return TypeRefMask

GetArrayTypeMask() public method

Gets type mask of array with elements of given type.
public GetArrayTypeMask ( TypeRefMask elementType ) : TypeRefMask
elementType TypeRefMask
return TypeRefMask

GetArraysFromMask() public method

Gets mask representing only array types in given mask. (Only bits corresponding to an array type will be set).
public GetArraysFromMask ( TypeRefMask mask ) : TypeRefMask
mask TypeRefMask
return TypeRefMask

GetBooleanTypeMask() public method

Gets bool type for this context.
public GetBooleanTypeMask ( ) : TypeRefMask
return TypeRefMask

GetCallableTypeMask() public method

Gets type mask of all callable types.
public GetCallableTypeMask ( ) : TypeRefMask
return TypeRefMask

GetDoubleTypeMask() public method

Gets double type for this context.
public GetDoubleTypeMask ( ) : TypeRefMask
return TypeRefMask

GetElementType() public method

In case of array type, gets its possible element types.
public GetElementType ( TypeRefMask mask ) : TypeRefMask
mask TypeRefMask
return TypeRefMask

GetLongTypeMask() public method

Gets int type for this context.
public GetLongTypeMask ( ) : TypeRefMask
return TypeRefMask

GetNullTypeMask() public method

Gets type mask corresponding to System.Object and not including any subclasses.
public GetNullTypeMask ( ) : TypeRefMask
return TypeRefMask

GetNumberTypeMask() public method

Gets number (int and double) type for this context.
public GetNumberTypeMask ( ) : TypeRefMask
return TypeRefMask

GetObjectTypes() public method

Gets types of type object (classes, interfaces, traits) referenced by given type mask.
public GetObjectTypes ( TypeRefMask mask ) : IList
mask TypeRefMask
return IList

GetObjectsFromMask() public method

Gets mask representing only object types in given mask. (Only bits corresponding to an object type will be set).
public GetObjectsFromMask ( TypeRefMask mask ) : TypeRefMask
mask TypeRefMask
return TypeRefMask

GetParentTypeMask() public method

Gets parent type for this context.
public GetParentTypeMask ( ) : TypeRefMask
return TypeRefMask

GetSelfTypeMask() public method

Gets self type for this context.
public GetSelfTypeMask ( ) : TypeRefMask
return TypeRefMask

GetStaticTypeMask() public method

Gets static type for this context.
public GetStaticTypeMask ( ) : TypeRefMask
return TypeRefMask

GetStringTypeMask() public method

Gets string type for this context.
public GetStringTypeMask ( ) : TypeRefMask
return TypeRefMask

GetSystemObjectTypeMask() public method

Gets type mask corresponding to System.Object.
public GetSystemObjectTypeMask ( ) : TypeRefMask
return TypeRefMask

GetThisTypeMask() public method

Gets type of $this in current context.
public GetThisTypeMask ( ) : TypeRefMask
return TypeRefMask

GetTypeIndex() public method

Gets index of the given type within the context. Returns -1 if such type is not present.
public GetTypeIndex ( ITypeRef typeref ) : int
typeref ITypeRef
return int

GetTypeMask() public method

Gets type mask corresponding to given TypeRef within this context.
public GetTypeMask ( Devsense.PHP.Syntax.Ast tref, bool includesSubclasses = true ) : TypeRefMask
tref Devsense.PHP.Syntax.Ast
includesSubclasses bool
return TypeRefMask

GetTypeMask() public method

Helper method that builds TypeRefMask for given type in this context.
public GetTypeMask ( ITypeRef typeref, bool includesSubclasses ) : TypeRefMask
typeref ITypeRef
includesSubclasses bool
return TypeRefMask

GetTypeMask() public method

Gets type mask corresponding to given qualified name within this context.
public GetTypeMask ( QualifiedName qname, bool includesSubclasses = true ) : TypeRefMask
qname QualifiedName
includesSubclasses bool
return TypeRefMask

GetTypes() public method

Gets types referenced by given type mask.
public GetTypes ( TypeRefMask mask ) : IList
mask TypeRefMask
return IList

GetWritableStringTypeMask() public method

Gets writable string type (a string builder) for this context.
public GetWritableStringTypeMask ( ) : TypeRefMask
return TypeRefMask

IsAString() public method

Gets value indicating whether given type mask represents a string type (readonly or writable).
public IsAString ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsArray() public method

Gets value indicating whether given type mask represents an array.
public IsArray ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsBoolean() public method

Gets value indicating whether given type mask represents a boolean.
public IsBoolean ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsDouble() public method

Gets value indicating whether given type mask represents a double type.
public IsDouble ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsLambda() public method

Gets value indicating whether given type mask represents a lambda function or callable primitive type.
public IsLambda ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsLong() public method

Gets value indicating whether given type mask represents an integer type.
public IsLong ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsNullable() public method

Gets value indicating whether given type can be null.
public IsNullable ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsNumber() public method

Gets value indicating whether given type mask represents a number.
public IsNumber ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsObject() public method

Gets value indicating whether given type mask represents an object.
public IsObject ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsPrimitiveType() public method

Gets value indicating whether given type mask represents a primitive type.
public IsPrimitiveType ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsReadonlyString() public method

Gets value indicating whether given type mask represents UTF16 readonly string.
public IsReadonlyString ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

IsWritableString() public method

Gets value indicating whether given type mask represents a writablke string (string builder).
public IsWritableString ( TypeRefMask mask ) : bool
mask TypeRefMask
return bool

ToString() public method

Gets string representation of types contained in given type mask.
public ToString ( TypeRefMask mask ) : string
mask TypeRefMask
return string