C# Класс ABB.Swum.ContextBuilder

Contains various helper functions to build context objects from SrcML.
Показать файл Открыть проект

Открытые методы

Метод Описание
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