C# 클래스 Mono.CSharp.TypeInfo

This is used by the flow analysis code to keep track of the type of local variables and variables. The flow code uses a BitVector to keep track of whether a variable has been assigned or not. This is easy for fundamental types (int, char etc.) or reference types since you can only assign the whole variable as such. For structs, we also need to keep track of all its fields. To do this, we allocate one bit for the struct itself (it's used if you assign/access the whole struct) followed by one bit for each of its fields. This class computes this `layout' for each type.
파일 보기 프로젝트 열기: vargaz/mono 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
IsStruct bool
Length int
Offset int
SubStructInfo TypeInfo[]
TotalLength int

공개 메소드들

메소드 설명
GetFieldIndex ( string name ) : int
GetStructField ( string name ) : TypeInfo
GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool

A struct's constructor must always assign all fields. This method checks whether it actually does so.

Reset ( ) : void
ToString ( ) : string

비공개 메소드들

메소드 설명
TypeInfo ( ) : System
TypeInfo ( StructInfo struct_info, int offset ) : System
TypeInfo ( int totalLength ) : System

메소드 상세

GetFieldIndex() 공개 메소드

public GetFieldIndex ( string name ) : int
name string
리턴 int

GetStructField() 공개 메소드

public GetStructField ( string name ) : TypeInfo
name string
리턴 TypeInfo

GetTypeInfo() 공개 정적인 메소드

public static GetTypeInfo ( System.TypeSpec type, IMemberContext context ) : TypeInfo
type System.TypeSpec
context IMemberContext
리턴 TypeInfo

IsFullyInitialized() 공개 메소드

A struct's constructor must always assign all fields. This method checks whether it actually does so.
public IsFullyInitialized ( Mono.CSharp.FlowAnalysisContext fc, VariableInfo vi, Mono.CSharp.Location loc ) : bool
fc Mono.CSharp.FlowAnalysisContext
vi VariableInfo
loc Mono.CSharp.Location
리턴 bool

Reset() 공개 정적인 메소드

public static Reset ( ) : void
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string

프로퍼티 상세

IsStruct 공개적으로 프로퍼티

If this is a struct.
public bool IsStruct
리턴 bool

Length 공개적으로 프로퍼티

Number of bits the simple fields of a variable of this type consume in the flow vector.
public int Length
리턴 int

Offset 공개적으로 프로퍼티

This is only used by sub-structs.
public int Offset
리턴 int

SubStructInfo 공개적으로 프로퍼티

If this is a struct, all fields which are structs theirselves.
public TypeInfo[] SubStructInfo
리턴 TypeInfo[]

TotalLength 공개적으로 프로퍼티

Total number of bits a variable of this type consumes in the flow vector.
public int TotalLength
리턴 int