C# Class ICSharpCode.NRefactory.Cpp.Resolver

Exibir arquivo Open project: AlexAlbala/Alter-Native

Public Properties

Property Type Description
boostLink bool

Public Methods

Method Description
AddDefaultConstructor ( TypeDeclaration type, List extraStatements = null ) : void
AddToStringMethod ( TypeDeclaration type ) : void
ConvertToExternTypeArguments ( AstNodeCollection parameters ) : List
ConvertToExternTypeParameters ( AstNodeCollection parameters ) : AstNodeCollection
DereferenceMembers ( AstNode node, string identifier ) : void
ExtractAllTypesFrom ( AstNodeCollection elist ) : List
ExtractAllTypesFrom ( Expression e ) : List
GetChildrenOf ( AstNode member, Type type ) : List

Returns the childs nodes of type specified by variable type

GetChildrenOf ( CSharp member, Type type ) : List

Returns the childs nodes of type specified by variable type

GetCppName ( string CSharpName ) : string

Tries to extract the C++ name of a C# name

GetDelegateArgs ( String type ) : ParameterDeclaration[]

Returns the arguments of a delegate type

GetDelegateArgsNum ( String type ) : int

Returns the number of input arguments of a delegate type

GetDelegateReturnType ( String identifier ) : string

Returns the return type name of a delegate type

GetEntryPointFromDllImport ( CSharp attributes ) : string

Returns the name of the target external function

GetExplicitInterfaceTypes ( TypeDeclaration currentType ) : void

Builds and adds the needed nested types in a current type representing explicit interfaces

GetExtraDLLs ( ) : List
GetHeaderNode ( AstNode node, AstNode headerNode ) : void

Return a header node form of a specified standard node

GetInlineConversionConstructorDeclarationCall ( ConversionConstructorDeclaration conv ) : string

Returns the member string for calling a conversion constructor declaration: i.e. operator IB*();

GetLibraryFromDllImport ( CSharp attributes ) : string

Gets the library in which the external method is located

GetNeededNamespaces ( ) : string[]

Gets the needed namespaces of the current type

GetParentOf ( AstNode member, Type type ) : AstNode

Returns the first parent node of type specified by variable type

GetParentOf ( CSharp member, Type type ) : CSharp.AstNode

Returns the first parent node of type specified by variable type

GetType ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : AstType

Tries to combine all of the provided parameters to extract the AstType class of an object with the identifier specified (Extracts the type of Field or variable, or parameters)

GetTypeIncludes ( ) : string[]

Gets the types have to be included

GetTypeName ( Ast type ) : string

Returns the name of a given AstType

GetTypeName ( CSharp type ) : string

Returns the name of a given AstType

HasChildOf ( AstNode member, Type type ) : bool

Returns if the node has a child of a specified type

HasChildOf ( CSharp member, Type type ) : bool

Returns if the node has a child of a specified type

IdentifierIsDelegate ( String identifier, String &type ) : bool

Returns if an identifier belongs to a delegate type

InferNamespace ( CSharp type ) : string
IsChildOf ( AstNode member, Type type ) : bool

Checks if the node is child of other node of the specified type

IsChildOf ( CSharp member, Type type ) : bool

Checks if the node is child of other node of the specified type

IsCustomEventCall ( MemberReferenceExpression memberReferenceExpression, string currentTypeName ) : bool

Returns if a member reference expression in C# is a call over a C# custom event

IsDLLImportMethod ( CSharp method ) : bool

Returns if a method is marked as an external method or not

IsDelegateType ( AstType type ) : bool

Returns if the specified type name is a delegate type

IsDelegateType ( CSharp type ) : bool

Returns if the specified type name is a delegate type

IsDelegateType ( String type ) : bool

Returns if the specified type name is a delegate type

IsDirectChildOf ( AstNode member, Type type ) : bool

Checks if the node is direct child of other node of the specified type

IsDirectChildOf ( CSharp member, Type type ) : bool

Checks if the node is direct child of other node of the specified type

IsEnumType ( String type ) : bool

Returns if a type is Enum type

IsLibraryType ( string type ) : bool

Tells if a specified type is mapped with a library file

IsPointer ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool

Returns if an identifier is a pointer expression. This method checks if the identifier (declared in a method parameter, method variable, or class field) is a pointer. The method will search the identifier depending of the filled parameters or the null parameters CurrentType + currentFieldVarialbe CurrentMethod + CurrentParameter CurrentMethod + CurrentField_Variable

IsPropertyCall ( MemberReferenceExpression memberReferenceExpression, string currentTypeName ) : bool

Returns if a member reference expression in C# is a call over a C# property

IsStringSwitch ( SwitchStatement switchStatement ) : bool
IsStructReference ( MemberReferenceExpression memberReferenceExpression, string currentTypeName, string currentMethodName ) : bool

Returns if a member reference expression in C# is a call over a struct

IsStructType ( String type ) : bool
IsSynchronizedMethod ( CSharp method ) : bool

Returns if a method is marked as synchronized or not

IsSynchronizedMethod ( MethodDeclaration method ) : bool

Returns if a method is marked as synchronized or not

IsTemplatizedAbstractMethod ( string type, string method ) : bool

Returns if a method is an abstract method returning a templatized type (useful for avoiding covariance errors)

IsTemplatizedType ( AstType type ) : bool

Returns if a type has template arguments

IsTemplatizedType ( CSharp type ) : bool

Returns if a type has template arguments

IsTypeArgument ( AstType type ) : bool

Returns if a specified type is a type argument

IsUnsafe ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool

Returns if an identifier is an unsafe expression. This method checks if the identifier (declared in a method parameter, method variable, or class field) is an unsasfe pointer variable. The method will search the identifier depending of the filled parameters or the null parameters CurrentType + currentFieldVarialbe CurrentMethod + CurrentParameter CurrentMethod + CurrentField_Variable

IsValueType ( string currentNamespace, string type ) : bool
NeedsDereference ( CSharp node, string currentType, string currentMethod ) : bool

Returns if a node (i.e expression, identifier...) needs a dereference

NeedsDereference ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool

Returns if an identifier needs a dereference operation

NeedsForwardDeclaration ( string fw_dcl_type1, string &fw_dcl_type2 ) : bool

Returns if a forward declaration is needed between two types

OneInheritsFromOther ( string one, string other ) : bool
ProcessIncludes ( string typeDeclarationName ) : void

Makes the preprocessing of the includes list

RefactorAllIdentifiers ( AstNode node, string identifier, Expression newIdentifier ) : void
RefactorPropety ( Expression input, String currentTypeName, String accessor ) : Expression

Refactors the C# property accessors to methods (i.e getProperty() setProperty(value)

RefactorStringSwitchStatement ( SwitchStatement switchStatement ) : String
RemoveHeaderNode ( AstNode node, TypeDeclaration type ) : void

Removes a node from the header nodes list of a specified type

RemoveInclude ( string typeName ) : void
ResolveMemberType ( CSharp mref ) : Mono.Cecil.TypeDefinition
ResolveNamespace ( string type ) : string

Resolves the namespace of a given type name

Restart ( ) : void

Restarts the resolver class variables

TryPatchTemplateToObjectType ( AstType type, AstType &newType ) : bool

Converts template types to Object type (useful for inline methods and template specialization types)

Private Methods

Method Description
IdentifierIsEvent ( string identifier, string &type ) : bool

Returns if an identifier belongs to an event type

Reaches ( string type1, string type2, Dictionary includes ) : bool

Tells if one type includes other type (recursively)

Resolver ( ) : System

Method Details

AddDefaultConstructor() public static method

public static AddDefaultConstructor ( TypeDeclaration type, List extraStatements = null ) : void
type TypeDeclaration
extraStatements List
return void

AddToStringMethod() public static method

public static AddToStringMethod ( TypeDeclaration type ) : void
type TypeDeclaration
return void

ConvertToExternTypeArguments() public static method

public static ConvertToExternTypeArguments ( AstNodeCollection parameters ) : List
parameters AstNodeCollection
return List

ConvertToExternTypeParameters() public static method

public static ConvertToExternTypeParameters ( AstNodeCollection parameters ) : AstNodeCollection
parameters AstNodeCollection
return AstNodeCollection

DereferenceMembers() public static method

public static DereferenceMembers ( AstNode node, string identifier ) : void
node AstNode
identifier string
return void

ExtractAllTypesFrom() public static method

public static ExtractAllTypesFrom ( AstNodeCollection elist ) : List
elist AstNodeCollection
return List

ExtractAllTypesFrom() public static method

public static ExtractAllTypesFrom ( Expression e ) : List
e Expression
return List

GetChildrenOf() public static method

Returns the childs nodes of type specified by variable type
public static GetChildrenOf ( AstNode member, Type type ) : List
member AstNode Original node
type System.Type Target type of
return List

GetChildrenOf() public static method

Returns the childs nodes of type specified by variable type
public static GetChildrenOf ( CSharp member, Type type ) : List
member CSharp Original node
type System.Type Target type of
return List

GetCppName() public static method

Tries to extract the C++ name of a C# name
public static GetCppName ( string CSharpName ) : string
CSharpName string
return string

GetDelegateArgs() public static method

Returns the arguments of a delegate type
public static GetDelegateArgs ( String type ) : ParameterDeclaration[]
type String The delegate type
return ParameterDeclaration[]

GetDelegateArgsNum() public static method

Returns the number of input arguments of a delegate type
public static GetDelegateArgsNum ( String type ) : int
type String The delegate type
return int

GetDelegateReturnType() public static method

Returns the return type name of a delegate type
public static GetDelegateReturnType ( String identifier ) : string
identifier String Delegate type
return string

GetEntryPointFromDllImport() public static method

Returns the name of the target external function
public static GetEntryPointFromDllImport ( CSharp attributes ) : string
attributes CSharp
return string

GetExplicitInterfaceTypes() public static method

Builds and adds the needed nested types in a current type representing explicit interfaces
public static GetExplicitInterfaceTypes ( TypeDeclaration currentType ) : void
currentType TypeDeclaration
return void

GetExtraDLLs() public static method

public static GetExtraDLLs ( ) : List
return List

GetHeaderNode() public static method

Return a header node form of a specified standard node
public static GetHeaderNode ( AstNode node, AstNode headerNode ) : void
node AstNode
headerNode AstNode
return void

GetInlineConversionConstructorDeclarationCall() public static method

Returns the member string for calling a conversion constructor declaration: i.e. operator IB*();
public static GetInlineConversionConstructorDeclarationCall ( ConversionConstructorDeclaration conv ) : string
conv ConversionConstructorDeclaration The conversion constructor declaration
return string

GetLibraryFromDllImport() public static method

Gets the library in which the external method is located
public static GetLibraryFromDllImport ( CSharp attributes ) : string
attributes CSharp
return string

GetNeededNamespaces() public static method

Gets the needed namespaces of the current type
public static GetNeededNamespaces ( ) : string[]
return string[]

GetParentOf() public static method

Returns the first parent node of type specified by variable type
public static GetParentOf ( AstNode member, Type type ) : AstNode
member AstNode Original node
type System.Type Target type of
return AstNode

GetParentOf() public static method

Returns the first parent node of type specified by variable type
public static GetParentOf ( CSharp member, Type type ) : CSharp.AstNode
member CSharp Original node
type System.Type Target type of
return CSharp.AstNode

GetType() public static method

Tries to combine all of the provided parameters to extract the AstType class of an object with the identifier specified (Extracts the type of Field or variable, or parameters)
public static GetType ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : AstType
currentField_Variable string
currentType string
currentMethod string
currentParameter string
return AstType

GetTypeIncludes() public static method

Gets the types have to be included
public static GetTypeIncludes ( ) : string[]
return string[]

GetTypeName() public static method

Returns the name of a given AstType
public static GetTypeName ( Ast type ) : string
type Ast
return string

GetTypeName() public static method

Returns the name of a given AstType
public static GetTypeName ( CSharp type ) : string
type CSharp
return string

HasChildOf() public static method

Returns if the node has a child of a specified type
public static HasChildOf ( AstNode member, Type type ) : bool
member AstNode Original node
type System.Type Target type of
return bool

HasChildOf() public static method

Returns if the node has a child of a specified type
public static HasChildOf ( CSharp member, Type type ) : bool
member CSharp Original node
type System.Type Target type of
return bool

IdentifierIsDelegate() public static method

Returns if an identifier belongs to a delegate type
public static IdentifierIsDelegate ( String identifier, String &type ) : bool
identifier String The identifier
type String Out variable: the type delegate if found
return bool

InferNamespace() public static method

public static InferNamespace ( CSharp type ) : string
type CSharp
return string

IsChildOf() public static method

Checks if the node is child of other node of the specified type
public static IsChildOf ( AstNode member, Type type ) : bool
member AstNode Node
type System.Type Type of the parent node
return bool

IsChildOf() public static method

Checks if the node is child of other node of the specified type
public static IsChildOf ( CSharp member, Type type ) : bool
member CSharp Node
type System.Type Type of the parent node
return bool

IsCustomEventCall() public static method

Returns if a member reference expression in C# is a call over a C# custom event
public static IsCustomEventCall ( MemberReferenceExpression memberReferenceExpression, string currentTypeName ) : bool
memberReferenceExpression MemberReferenceExpression
currentTypeName string
return bool

IsDLLImportMethod() public static method

Returns if a method is marked as an external method or not
public static IsDLLImportMethod ( CSharp method ) : bool
method CSharp
return bool

IsDelegateType() public static method

Returns if the specified type name is a delegate type
public static IsDelegateType ( AstType type ) : bool
type AstType Identifier
return bool

IsDelegateType() public static method

Returns if the specified type name is a delegate type
public static IsDelegateType ( CSharp type ) : bool
type CSharp Identifier
return bool

IsDelegateType() public static method

Returns if the specified type name is a delegate type
public static IsDelegateType ( String type ) : bool
type String Identifier
return bool

IsDirectChildOf() public static method

Checks if the node is direct child of other node of the specified type
public static IsDirectChildOf ( AstNode member, Type type ) : bool
member AstNode Node
type System.Type Type of the parent node
return bool

IsDirectChildOf() public static method

Checks if the node is direct child of other node of the specified type
public static IsDirectChildOf ( CSharp member, Type type ) : bool
member CSharp Node
type System.Type Type of the parent node
return bool

IsEnumType() public static method

Returns if a type is Enum type
public static IsEnumType ( String type ) : bool
type String
return bool

IsLibraryType() public static method

Tells if a specified type is mapped with a library file
public static IsLibraryType ( string type ) : bool
type string
return bool

IsPointer() public static method

Returns if an identifier is a pointer expression. This method checks if the identifier (declared in a method parameter, method variable, or class field) is a pointer. The method will search the identifier depending of the filled parameters or the null parameters CurrentType + currentFieldVarialbe CurrentMethod + CurrentParameter CurrentMethod + CurrentField_Variable
public static IsPointer ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool
currentField_Variable string The variable or field that is being checked
currentType string The current type name
currentMethod string The current method
currentParameter string The parameter that is being checked
return bool

IsPropertyCall() public static method

Returns if a member reference expression in C# is a call over a C# property
public static IsPropertyCall ( MemberReferenceExpression memberReferenceExpression, string currentTypeName ) : bool
memberReferenceExpression MemberReferenceExpression
currentTypeName string
return bool

IsStringSwitch() public static method

public static IsStringSwitch ( SwitchStatement switchStatement ) : bool
switchStatement SwitchStatement
return bool

IsStructReference() public static method

Returns if a member reference expression in C# is a call over a struct
public static IsStructReference ( MemberReferenceExpression memberReferenceExpression, string currentTypeName, string currentMethodName ) : bool
memberReferenceExpression MemberReferenceExpression
currentTypeName string
currentMethodName string
return bool

IsStructType() public static method

public static IsStructType ( String type ) : bool
type String
return bool

IsSynchronizedMethod() public static method

Returns if a method is marked as synchronized or not
public static IsSynchronizedMethod ( CSharp method ) : bool
method CSharp
return bool

IsSynchronizedMethod() public static method

Returns if a method is marked as synchronized or not
public static IsSynchronizedMethod ( MethodDeclaration method ) : bool
method MethodDeclaration
return bool

IsTemplatizedAbstractMethod() public static method

Returns if a method is an abstract method returning a templatized type (useful for avoiding covariance errors)
public static IsTemplatizedAbstractMethod ( string type, string method ) : bool
type string
method string
return bool

IsTemplatizedType() public static method

Returns if a type has template arguments
public static IsTemplatizedType ( AstType type ) : bool
type AstType
return bool

IsTemplatizedType() public static method

Returns if a type has template arguments
public static IsTemplatizedType ( CSharp type ) : bool
type CSharp
return bool

IsTypeArgument() public static method

Returns if a specified type is a type argument
public static IsTypeArgument ( AstType type ) : bool
type AstType
return bool

IsUnsafe() public static method

Returns if an identifier is an unsafe expression. This method checks if the identifier (declared in a method parameter, method variable, or class field) is an unsasfe pointer variable. The method will search the identifier depending of the filled parameters or the null parameters CurrentType + currentFieldVarialbe CurrentMethod + CurrentParameter CurrentMethod + CurrentField_Variable
public static IsUnsafe ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool
currentField_Variable string The variable or field that is being checked
currentType string The current type name
currentMethod string The current method
currentParameter string The parameter that is being checked
return bool

IsValueType() public static method

public static IsValueType ( string currentNamespace, string type ) : bool
currentNamespace string
type string
return bool

NeedsDereference() public static method

Returns if a node (i.e expression, identifier...) needs a dereference
public static NeedsDereference ( CSharp node, string currentType, string currentMethod ) : bool
node CSharp
currentType string
currentMethod string
return bool

NeedsDereference() public static method

Returns if an identifier needs a dereference operation
public static NeedsDereference ( string currentField_Variable, string currentType, string currentMethod, string currentParameter ) : bool
currentField_Variable string Variable or field to look for
currentType string Current type
currentMethod string CurrentMethod
currentParameter string Parameter to look for
return bool

NeedsForwardDeclaration() public static method

Returns if a forward declaration is needed between two types
public static NeedsForwardDeclaration ( string fw_dcl_type1, string &fw_dcl_type2 ) : bool
fw_dcl_type1 string The type to test
fw_dcl_type2 string If the method is true, the second type is placed here
return bool

OneInheritsFromOther() public static method

public static OneInheritsFromOther ( string one, string other ) : bool
one string
other string
return bool

ProcessIncludes() public static method

Makes the preprocessing of the includes list
public static ProcessIncludes ( string typeDeclarationName ) : void
typeDeclarationName string
return void

RefactorAllIdentifiers() public static method

public static RefactorAllIdentifiers ( AstNode node, string identifier, Expression newIdentifier ) : void
node AstNode
identifier string
newIdentifier Expression
return void

RefactorPropety() public static method

Refactors the C# property accessors to methods (i.e getProperty() setProperty(value)
public static RefactorPropety ( Expression input, String currentTypeName, String accessor ) : Expression
input Expression Property expression
currentTypeName String Current type deompliated
accessor String Get or Set accessor
return Expression

RefactorStringSwitchStatement() public static method

public static RefactorStringSwitchStatement ( SwitchStatement switchStatement ) : String
switchStatement SwitchStatement
return String

RemoveHeaderNode() public static method

Removes a node from the header nodes list of a specified type
public static RemoveHeaderNode ( AstNode node, TypeDeclaration type ) : void
node AstNode
type TypeDeclaration
return void

RemoveInclude() public static method

public static RemoveInclude ( string typeName ) : void
typeName string
return void

ResolveMemberType() public static method

public static ResolveMemberType ( CSharp mref ) : Mono.Cecil.TypeDefinition
mref CSharp
return Mono.Cecil.TypeDefinition

ResolveNamespace() public static method

Resolves the namespace of a given type name
public static ResolveNamespace ( string type ) : string
type string
return string

Restart() public static method

Restarts the resolver class variables
public static Restart ( ) : void
return void

TryPatchTemplateToObjectType() public static method

Converts template types to Object type (useful for inline methods and template specialization types)
public static TryPatchTemplateToObjectType ( AstType type, AstType &newType ) : bool
type AstType
newType AstType
return bool

Property Details

boostLink public_oe static_oe property

public static bool boostLink
return bool