C# 클래스 ABB.Swum.ContextBuilder

Contains various helper functions to build context objects from SrcML.
파일 보기 프로젝트 열기: abb-iss/Swum.NET

공개 메소드들

메소드 설명
BuildFieldContext ( System.Xml.Linq.XElement declElement ) : FieldContext

Builds a FieldContext object based on the given field element.

BuildMethodContext ( System.Xml.Linq.XElement methodTag ) : MethodContext

Builds a MethodContext object based on the given method element.

ConstructTypeName ( System.Xml.Linq.XElement typeElement ) : string

Extracts the type name from a type srcML element. A type element may contain several name and type modifier elements. This function returns only the actual type name, ignoring any access modifiers, such as static, private or public. Type modifiers such as '*' or '&' are treated as part of the type name and concatenated with the name text.

ConstructTypeName ( System.Xml.Linq.XElement typeElement, bool &isPrimitive ) : string

Extracts the type name from a type srcML element. A type element may contain several name and type modifier elements. This function returns only the actual type name, ignoring any access modifiers, such as static, private or public. Type modifiers such as '*' or '&' are treated as part of the type name and concatenated with the name text.

비공개 메소드들

메소드 설명
FindEnclosingClassElement ( System.Xml.Linq.XElement startElement ) : System.Xml.Linq.XElement

Finds the nearest class or struct element that encloses the given element.

GetNameFromNameElement ( System.Xml.Linq.XElement nameElement ) : string

Given a name element, this function extracts the identifier name from it. A name element may potentially contain several child name elements. For example, when a name has the form [ClassName]::[Identifier]. This function assumes that the last child name element is the desired name, and returns that. If there are no child name elements, the text of the name element is returned.

메소드 상세

BuildFieldContext() 공개 정적인 메소드

Builds a FieldContext object based on the given field element.
Thrown if the passed XElement does not represent a decl element.
public static BuildFieldContext ( System.Xml.Linq.XElement declElement ) : FieldContext
declElement System.Xml.Linq.XElement An XElement representing the decl element of the field.
리턴 FieldContext

BuildMethodContext() 공개 정적인 메소드

Builds a MethodContext object based on the given method element.
The passed XElement does not represent a function, constructor, or destructor element. methodTag is null.
public static BuildMethodContext ( System.Xml.Linq.XElement methodTag ) : MethodContext
methodTag System.Xml.Linq.XElement An XElement representing the method to build the context for. This can be either a function, constructor or destructor element.
리턴 MethodContext

ConstructTypeName() 공개 정적인 메소드

Extracts the type name from a type srcML element. A type element may contain several name and type modifier elements. This function returns only the actual type name, ignoring any access modifiers, such as static, private or public. Type modifiers such as '*' or '&' are treated as part of the type name and concatenated with the name text.
typeElement does not represent a type element.
public static ConstructTypeName ( System.Xml.Linq.XElement typeElement ) : string
typeElement System.Xml.Linq.XElement A type srcML element.
리턴 string

ConstructTypeName() 공개 정적인 메소드

Extracts the type name from a type srcML element. A type element may contain several name and type modifier elements. This function returns only the actual type name, ignoring any access modifiers, such as static, private or public. Type modifiers such as '*' or '&' are treated as part of the type name and concatenated with the name text.
typeElement does not represent a type element.
public static ConstructTypeName ( System.Xml.Linq.XElement typeElement, bool &isPrimitive ) : string
typeElement System.Xml.Linq.XElement A type srcML element.
isPrimitive bool An output parameter indicating whether the type is a primitive data type.
리턴 string