6.5.4.2. Nodes (Entities)

In the following we describe the possible types of nodes contained in C# RFGs.

Assembly

node-assembly Assembly (inherits from: node-file-system-entity File_System_Entity)

Subtypes

none

Containing Views

Assembly, Assembly References, Include

Description

A node of type node-assembly Assembly represents the contents of a .NET assembly.

Attributes

Attribute name

Attribute type

Inherited from

Element.From_Bytecode

Toggle

-

Element.Has_Internal_Visibility

Toggle

-

Element.Has_Private_Protected_Visibility

Toggle

-

Element.Has_Private_Visibility

Toggle

-

Element.Has_Protected_Internal_Visibility

Toggle

-

Element.Has_Protected_Visibility

Toggle

-

Element.Has_Public_Visibility

Toggle

-

Element.Is_Artificial

Toggle

-

Element.Is_Inherited

Toggle

-

Element.Is_Referenced_Assembly

Toggle

-

Linkage.Is_Ambiguous_Name

Toggle

-

Linkage.Is_Definition

Toggle

-

Linkage.Name

String

File_System_Entity

Source.Column

Integer

File_System_Entity

Source.File

String

File_System_Entity

Source.Line

Integer

File_System_Entity

Source.Name

String

File_System_Entity

Source.Path

String

File_System_Entity

Source.Physical_Column

Integer

File_System_Entity

Source.Physical_File

String

File_System_Entity

Source.Physical_Line

Integer

File_System_Entity

Source.Physical_Path

String

File_System_Entity

Source.Physical_Region_Length

Integer

File_System_Entity

Source.Physical_Region_Start

Integer

File_System_Entity

Source.Region_Length

Integer

File_System_Entity

Source.Region_Start

Integer

File_System_Entity

Elements are contained in an assembly by edge-enclosing Enclosing edges just like members are enclosed in types. node-assembly Assembly is not a subtype of node-object Source_Entity; it can be tagged with the following attributes:

  • Linkage.Name: Contains a unique identifier for the assembly, containing its file path.

  • Source.Name: Contains the value of the attribute Assembly_Title of the assembly.

  • Source.File: Contains the file name of the corresponding assembly.

  • Source.Path: Contains the directory path of the corresponding assembly.

  • is_referenced_assembly-iconElement.Is_Referenced_Assembly: Is set to true if the assembly is a referenced assembly (otherwise it is a source assembly).

Class

node-class Class (inherits from: node-type Type)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

The node-class Class node type represents nongeneric C# classes, in particular reference classes and value classes like structs), delegates (not enums, they are represented by node-type Type). The term Class subsumes in particular all user-defined types, with the exception of interfaces, and is not equivalent to the types defined by the class key word in C#.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Anonymous

Toggle

-

Element.Is_Delegate

Toggle

-

Element.Is_Extension

Toggle

-

Element.Is_Final

Toggle

-

Element.Is_New

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Struct

Toggle

-

Element.Is_Template_Instance

Toggle

-

Element.Is_Unsafe

Toggle

-

Element.Is_Abstract

Toggle

Type

Element.Is_Enum

Toggle

Type

Element.Is_File_Local

Toggle

Type

Element.Is_Reference_Type

Toggle

Type

Element.Is_Static

Toggle

Type

Element.Is_Template_Parameter

Toggle

Type

Element.Is_Value_Type

Toggle

Type

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

The .NET common type system distinguishes between value types (e.g. enums and structs) and reference types (e.g. actual (reference) classes and delegates). Value types have the attribute is_value_type-icon Element.Is_Value_Type set, reference types have the attribute is_reference_type-iconElement.Is_Reference_Type set. Nested classes are contained within their outer class by using edges of type edge-enclosing Enclosing.

Similarly to methods and fields, the attribute is_unsafe-icon Element.Is_Unsafe indicates that the type is tagged with the unsafe modifier (the code text of the type is then considered an unsafe context).

Class kinds.

The different subtypes of node-class Class nodes are represented by the following attributes:

  • is_delegate-iconElement.Is_Delegate : the entity is a delegate (a type offering roughly the functionality of a type-safe function pointer, see C# specification 4.0, 4.2.7),

  • is_struct-iconElement.Is_Struct : the entity is a value class ( struct),

If none of these attributes is set, the entity is an actual reference class ( class).

Note

Code Example

public class AClass
{
  protected struct ANestedStruct
  {
  }

  protected internal enum ANestedEnum
  {
    Value1, 
    Value2
  }

  internal delegate void ADelegate();
}
Example: Classes, structs, delegates, and enums.

Example: Classes, structs, delegates, and enums.

Note

Code Example

public delegate void EventHandler ();

public class AClass {
    public event EventHandler Change;

    public void doSomething ()
    {   
        Change ();
    }
}

// Class which handles the event
public class HandlerClass
{
    public HandlerClass (AClass param) {
        param.Change += new EventHandler ( somethingChanges );
    }
    private void somethingChanges () { }
}

// Class to test it all
public class GameTest
{
    public static void Main () {
        AClass ac = new AClass();
        HandlerClass hc = new HandlerClass (ac);
    }
}
An event and a delegate.

An event and a delegate.

Class_Template

node-class-template Class_Template (inherits from: node-template Template)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

A node-class-template Class_Template models an uninstantiated (open) generic class. It is connected to its instances (which are node-class Class nodes) via edge-instance-of Instance_Of edges.

Note

We use the term Template also for generic entities in C# to stay consistent with the language models of the other supported languages.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_Delegate

Toggle

-

Element.Is_Extension

Toggle

-

Element.Is_File_Local

Toggle

-

Element.Is_Final

Toggle

-

Element.Is_New

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Reference_Type

Toggle

-

Element.Is_Static

Toggle

-

Element.Is_Struct

Toggle

-

Element.Is_Value_Type

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Nodes of type node-class-template Class_Template can have the same attributes set as nodes of type node-class Class with the exception of the is_template_instance-iconElement.Is_Template_Instance attribute and the is_anonymous-iconElement.Is_Anonymous attribute.

Note

Code Example

public class AGenericClass<T, U>
{ }

public struct AGenericStruct<V>
{ }

public class AClass
{
  
  AGenericStruct<int> Member;

}
Example: Generic class.

Example: Generic class.

Constant

node-constant Constant (inherits from: node-object Object)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

The node-constant Constant node type represents enum constants.

Attributes

Attribute name

Attribute type

Inherited from

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Directory

node-directory Directory (inherits from: node-file-system-entity File_System_Entity)

Subtypes

none

Containing Views

Include

Description

In addition to the language representation, the Axivion Suite captures the containment of declarations/definitions in modules, files, and directories.

A node-directory Directory represents a directory in the file system. A node-directory Directory node can contain node-file File nodes and node-directory Directory nodes.

Note

You can configure the topmost directory that will be used for a system, see Architecture-Dependencies.

Attributes

Attribute name

Attribute type

Inherited from

Linkage.Name

String

File_System_Entity

Source.Column

Integer

File_System_Entity

Source.File

String

File_System_Entity

Source.Line

Integer

File_System_Entity

Source.Name

String

File_System_Entity

Source.Path

String

File_System_Entity

Source.Physical_Column

Integer

File_System_Entity

Source.Physical_File

String

File_System_Entity

Source.Physical_Line

Integer

File_System_Entity

Source.Physical_Path

String

File_System_Entity

Source.Physical_Region_Length

Integer

File_System_Entity

Source.Physical_Region_Start

Integer

File_System_Entity

Source.Region_Length

Integer

File_System_Entity

Source.Region_Start

Integer

File_System_Entity

File

node-file File (inherits from: node-file-system-entity File_System_Entity)

Subtypes

none

Containing Views

Include

Description

A node-file File node represents a source file. It contains all declarations and definitions by incoming edge-enclosing Enclosing edges. A node-file File node itself may be contained in a node-directory Directory node. The path is expressed by the hierarchy of node-directory Directory nodes.

Attributes

Attribute name

Attribute type

Inherited from

Linkage.Name

String

File_System_Entity

Source.Column

Integer

File_System_Entity

Source.File

String

File_System_Entity

Source.Line

Integer

File_System_Entity

Source.Name

String

File_System_Entity

Source.Path

String

File_System_Entity

Source.Physical_Column

Integer

File_System_Entity

Source.Physical_File

String

File_System_Entity

Source.Physical_Line

Integer

File_System_Entity

Source.Physical_Path

String

File_System_Entity

Source.Physical_Region_Length

Integer

File_System_Entity

Source.Physical_Region_Start

Integer

File_System_Entity

Source.Region_Length

Integer

File_System_Entity

Source.Region_Start

Integer

File_System_Entity

The Source.Name of a node-file File node is the name of the file in the file system (with extension).

File_System_Entity

node-file-system-entity File_System_Entity

Subtypes

node-assembly Assembly, node-directory Directory, node-file File

Containing Views

Include

Description

The node-file-system-entity File_System_Entity node type is the base type of all nodes representing entities of the file system, like directories and files.

Attributes

Attribute name

Attribute type

Inherited from

Linkage.Name

String

-

Source.Column

Integer

-

Source.File

String

-

Source.Line

Integer

-

Source.Name

String

-

Source.Path

String

-

Source.Physical_Column

Integer

-

Source.Physical_File

String

-

Source.Physical_Line

Integer

-

Source.Physical_Path

String

-

Source.Physical_Region_Length

Integer

-

Source.Physical_Region_Start

Integer

-

Source.Region_Length

Integer

-

Source.Region_Start

Integer

-

Interface

node-interface Interface (inherits from: node-type Type)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

An node-interface Interface models a non-generic C# interface type.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Interface

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Template_Instance

Toggle

-

Element.Is_Abstract

Toggle

Type

Element.Is_Enum

Toggle

Type

Element.Is_File_Local

Toggle

Type

Element.Is_Reference_Type

Toggle

Type

Element.Is_Static

Toggle

Type

Element.Is_Template_Parameter

Toggle

Type

Element.Is_Value_Type

Toggle

Type

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Since interfaces are reference types, the attribute is_reference_type-icon Element.Is_Reference_Type is always set for them.

Note

Code Example

public interface IForward
{
    void Next ();
}

public interface IBackward
{
    void Prev ();
}

public class Navigator: IForward, IBackward
{
    public void Next () 
    { }

    public void Prev () 
    { }
}
Example: Interfaces.

Example: Interfaces.

Interface_Template

node-interface Interface_Template (inherits from: node-template Template)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

A node-interface-template Interface_Template models an uninstantiated (open) generic interface. It is connected to its instances (which are node-interface Interface nodes) via edge-instance-of Instance_Of edges.

Note

We use the term Template also for generic entities in C# to stay consistent with the language models of the other supported languages.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_File_Local

Toggle

-

Element.Is_Interface

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Reference_Type

Toggle

-

Element.Is_Template_Instance

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Note

Code Example

public interface IProvider<T>
{ }

public class AClass<U> : IProvider<int>
{ }
Example: Generic interface.

Example: Generic interface.

Member

node-member Member (inherits from: node-object Source_Entity)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

The node-member Member node type is used for fields and special syntactic member constructs like properties.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_Const

Toggle

-

Element.Is_Event

Toggle

-

Element.Is_Final

Toggle

-

Element.Is_Indexer

Toggle

-

Element.Is_New

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Property

Toggle

-

Element.Is_Readonly

Toggle

-

Element.Is_Ref

Toggle

-

Element.Is_Required

Toggle

-

Element.Is_Static

Toggle

-

Element.Is_Unsafe

Toggle

-

Element.Is_Volatile

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Modelling of special members

For members being properties, indexers, and events, the attributes

  • is_property-iconElement.Is_Property,

  • is_indexer-iconElement.Is_Indexer, and

  • is_event-iconElement.Is_Event

are set, respectively. These entities have accessor methods enclosed in them.

Modifiers.

Fields, properties and events can be static; then they are tagged with the attribute is_static-iconElement.Is_Static.

The attribute is_new-iconElement.Is_New indicates that the entity is tagged with the new modifier (i.e., in the source code it is specified that the entity hides an entity of the same name in a base class of its declaring type, see also C# specification 4.0, 10.3.4 and C# specification 4.0, 3.7.1.2). The attribute is_unsafe-iconElement.Is_Unsafe indicates that a property is tagged with the unsafe modifier (the code text of the property is then considered an unsafe context). The attributes is_const-iconElement.Is_Const, is_volatile-iconElement.Is_Volatile and is_readonly-icon Element.Is_ReadOnly indicate that a field is const, volatile, or readonly, respectively (see e.g. C# specification 4.0, 10.5.3).

Note

For an automatic property like int AProperty { get; set; }, an artificial backing field is created (here of type int) which holds the actual value of the property. The backing field has the attribute is_artificial-icon Element.Is_Artificial set and is not enclosed within the node-member Property node of the property.

Note

Code Example

using System;

class ParentClass 
{
  public int AnInstanceProperty { set; get; }
}

class AClass : ParentClass {
  public new int AnInstanceProperty { set; get; }
  
  public static event Func<int, int> AStaticEvent
  {      
    add { }
    remove { }
  }
}
Properties, indexers, and events.

Properties, indexers, and events.

Method

node-method Method (inherits from: node-routine Routine)

Subtypes

none

Containing Views

Assembly, Call, Code Facts

Description

The node-method Method node type is used for modelling all kinds of nongeneric methods: ordinary methods, constructors and destructors, operators, accessors of properties, indexers, and events. Additionally, instances of generic methods are also represented as methods.

A special kind of routines in C# programs are anonymous functions, which represent “an ’in-line’ method-definition” (C# specification 4.0, 7.15). There are two different kinds of anonymous functions, lambda expressions and anonymous method expressions. Both are represented by node-method Method in the RFG, with the attribute Source.Name set to ?.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_Adder

Toggle

-

Element.Is_Constructor

Toggle

-

Element.Is_Destructor

Toggle

-

Element.Is_Final

Toggle

-

Element.Is_Getter

Toggle

-

Element.Is_Initonly

Toggle

-

Element.Is_New

Toggle

-

Element.Is_PInvoke

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Remover

Toggle

-

Element.Is_Setter

Toggle

-

Element.Is_Static

Toggle

-

Element.Is_Template_Instance

Toggle

-

Element.Is_Unsafe

Toggle

-

Element.Is_Virtual_Method

Toggle

-

Element.Is_Anonymous

Toggle

Routine

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Method kinds

The different kinds of methods are indicated by the following attributes:

  • is_constructor-iconElement.Is_Constructor: the method is an instance constructor or static constructor,

  • is_destructor-iconElement.Is_Destructor : the method is a destructor,

  • is_setter-iconElement.Is_Setter / is_getter-icon Element.Is_Getter : the method is a setter respectively getter of a property or indexer, and

  • is_adder-iconElement.Is_Adder / is_remover-icon Element.Is_Remover : the method is an adder respectively a remover of an event.

Additionally, the following attributes can be set for methods:

  • is_abstract-iconElement.Is_Abstract: indicates that the method is abstract (in particular, no method body is present),

  • is_final-iconElement.Is_Final: the method is sealed,

  • is_new-iconElement.Is_New: the method is tagged with the new modifier in the source code (this indicates that method hides a method of the same name in a base class of its declaring type, see also C# specification 4.0, 10.3.4),

  • is_static-iconElement.Is_Static: the method is static,

  • is_pinvoke-iconElement.Is_PInvoke: the method is tagged with the DllImport attribute (i.e., refers to an unmanaged method within another library),

  • is_template_instance-iconElement.Is_Template_Instance: indicates that the method is an instance of a generic type.

  • is_unsafe-iconElement.Is_Unsafe: indicates that the method is tagged with the unsafe modifier (the code of the method is then considered an unsafe context).

  • is_virtual_method-iconElement.Is_Virtual_Method: the method is virtual.

  • is_initonly-iconElement.Is_Initonly: the method is a property init-only setter. This attribute is set in addition to the is_setter-iconElement.Is_Setter attribute.

Note

Some routines and methods are generated by the C# compiler and do not appear directly in source code. This includes special operators and default constructors. In the RFG the corresponding nodes have the attribute is_artificial-icon Element.Is_Artificial set.

Note

Code Example

public class AClass
{
  public delegate void Foo();

  protected string AProperty { get { return ""; } set {} }
  
  private int this[int i1, int i2]
  {
    get { return 1; }
  }

  public event Foo AnEvent { add {} remove {}}
}
Accessors of properties, indexers, and events.

Accessors of properties, indexers, and events.

Note

Code Example

public class AClass
{
  delegate int ADelegate(int parameter);

  public int Member1;
  public int Member2;
  
  public void AMethod()
  {
    ADelegate f1 = x => { Member1 = x; return x; };
    ADelegate f2 = delegate (int x) { Member2 = x; return x; };
  }
}
Anonymous functions.

Anonymous functions.

Note

Code Example

public unsafe class AClass
{
  public AClass()
  {}

  ~AClass() 
  {}
  
  public void AnInstanceMethod() {}

  public static void AStaticMethod() {}  

  public static unsafe void AnUnsafeStaticMethod() {}
}
Different kinds of methods.

Different kinds of methods.

Method_Template

node-method-template Method_Template (inherits from: node-routine-template Routine_Template)

Subtypes

none

Containing Views

Assembly, Call, Code Facts

Description

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_Anonymous

Toggle

-

Element.Is_New

Toggle

-

Element.Is_Partial

Toggle

-

Element.Is_Static

Toggle

-

Element.Is_Virtual_Method

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Nodes of type node-method-template Method_Template can have the same attributes set as the node-method Method with the exception of the is_template_instance-iconElement.Is_Template_Instance attribute.

Note

Code Example

public class AClass
{
  public T AMethod<T>(T t)
  {
    return t;
  }

  public void Foo()
  {
    int x = AMethod<int>(1);
  }
}
Example: Generic method.

Example: Generic method.

Namespace

node-namespace Namespace (inherits from: node-object Source_Entity)

Subtypes

none

Containing Views

Assembly, Code Facts

Description

A node of type node-namespace Namespace groups together elements of a C# namespace; it is a subtype of node-object Source_Entity. Elements are contained in a namespaces by edge-enclosing Enclosing edges just like members are enclosed in types.

Attributes

Attribute name

Attribute type

Inherited from

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Apart from attributes inherited from node-object Source_Entity, node-namespace Namespace does not have any additional attributes.

Routine

node-routine Routine (inherits from: node-object Source_Entity)

Subtypes

node-method Method

Containing Views

Assembly, Call, Code Facts

Description

An artificial routine represents the entry point of a project (generated by rule:tool:Architecture-Dependencies). Apart of that, there appear no other nodes of type node-routine Routine in C# RFGs (only nodes of its subtype node-method Method).

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Anonymous

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Source_Entity

node-object Source_Entity

Subtypes

node-member Member, node-namespace Namespace, node-object Object, node-routine Routine, node-template Template, node-type Type

Containing Views

none (only subtypes of node-object Source_Entity are contained in views)

Description

The node-object Source_Entity node type is the base type of all source-related entities like types, routines, fields, and namespaces.

Attributes

Attribute name

Attribute type

Inherited from

Element.From_Bytecode

Toggle

-

Element.Has_Internal_Visibility

Toggle

-

Element.Has_Private_Protected_Visibility

Toggle

-

Element.Has_Private_Visibility

Toggle

-

Element.Has_Protected_Internal_Visibility

Toggle

-

Element.Has_Protected_Visibility

Toggle

-

Element.Has_Public_Visibility

Toggle

-

Element.Is_Artificial

Toggle

-

Element.Is_Inherited

Toggle

-

Linkage.Is_Ambiguous_Name

Toggle

-

Linkage.Is_Definition

Toggle

-

Linkage.Name

String

-

Source.Column

Integer

-

Source.Declaration_Start

Integer

-

Source.File

String

-

Source.Line

Integer

-

Source.Name

String

-

Source.Path

String

-

Source.Physical_Column

Integer

-

Source.Physical_File

String

-

Source.Physical_Line

Integer

-

Source.Physical_Path

String

-

Source.Physical_Region_Length

Integer

-

Source.Physical_Region_Start

Integer

-

Source.Region_Length

Integer

-

Source.Region_Start

Integer

-

Source.Signature_Start

Integer

-

Nodes of type node-object Source_Entity (or one of its subtypes) might be tagged with attributes describing their visibility, their source position, and information about the compilation process.

One of the most important attributes of source entities is Source.Name, which contains the name of the entity. Two nodes can in general have the same source name (e.g. a constructor of a type A has A as its source name, so does the type itself). The attribute is_artificial-icon Element.Is_Artificial is set for entities that are generated by the compiler and do not have an exact corresponding entity in the source code.

Visibility

Visibility is expressed by the attributes

  • has_internal_visibility-iconElement.Has_Internal_Visibility,

  • has_private_visibility-iconElement.Has_Private_Visibility,

  • has_protected_visibility-iconElement.Has_Protected_Visibility,

  • has_private_protected_visibility-icon Element.Has_Private_Protected_Visibility,

  • has_protected_internal_visibility-icon Element.Has_Protected_Internal_Visibility, and

  • has_public_visibility-iconElement.Has_Public_Visibility.

Source location

The location of an entity in a source file (if there is one) is specified by Source.Column and Source.Line. The source file can be located by the attributes Source.Path and Source.File. If the source file makes use of #line directives, the attributes with the Physical_ prefix provide the physical/untranslated location, and the unprefixed attributes provide the mapped location information, otherwise both attribute groups refer to the same location.

If the entity has a signature, the attributes Source.Declaration_Start and Source.Signature_Start provide the first (physical) line number of the declaration and signature, respectively. The declaration start includes attribute lists, if present. The signature starts from the first modifier keyword.

If the entity spans a larger region in the code, the attributes Source.Region_Start and Source.Region_Length provide its starting line and total number of lines.

Compilation process

The attribute Linkage.Is_Definition is set if the node represents a definition of e.g. a method. For distinguishing nodes from each other, the attribute Linkage.Name contains a unique identifier of the node.

Note

For facilitating analyses that investigate architectural problems, nodes for inherited entities might be copied: E.g., if a type A contains a method f(), and a class B inherits from A without overriding it, then a call b.f() with b having static type B causes a copy of f() to be inserted as a child of the node representing B. These copies are marked by the attributes is_artificial-icon Element.Is_Artificial and is_inherited-icon Element.Is_Inherited.

Type

node-type Type (inherits from: node-object Source_Entity)

Subtypes

node-class Class, node-interface Interface

Containing Views

Assembly, Code Facts

Description

The node-type Type node type is the base type of non-generic types. It represents in particular enums and generic parameters, and has the subtypes node-class Class and node-interface Interface.

Attributes

Attribute name

Attribute type

Inherited from

Element.Is_Abstract

Toggle

-

Element.Is_Enum

Toggle

-

Element.Is_File_Local

Toggle

-

Element.Is_Reference_Type

Toggle

-

Element.Is_Static

Toggle

-

Element.Is_Template_Parameter

Toggle

-

Element.Is_Value_Type

Toggle

-

Element.From_Bytecode

Toggle

Source_Entity

Element.Has_Internal_Visibility

Toggle

Source_Entity

Element.Has_Private_Protected_Visibility

Toggle

Source_Entity

Element.Has_Private_Visibility

Toggle

Source_Entity

Element.Has_Protected_Internal_Visibility

Toggle

Source_Entity

Element.Has_Protected_Visibility

Toggle

Source_Entity

Element.Has_Public_Visibility

Toggle

Source_Entity

Element.Is_Artificial

Toggle

Source_Entity

Element.Is_Inherited

Toggle

Source_Entity

Linkage.Is_Ambiguous_Name

Toggle

Source_Entity

Linkage.Is_Definition

Toggle

Source_Entity

Linkage.Name

String

Source_Entity

Source.Column

Integer

Source_Entity

Source.Declaration_Start

Integer

Source_Entity

Source.File

String

Source_Entity

Source.Line

Integer

Source_Entity

Source.Name

String

Source_Entity

Source.Path

String

Source_Entity

Source.Physical_Column

Integer

Source_Entity

Source.Physical_File

String

Source_Entity

Source.Physical_Line

Integer

Source_Entity

Source.Physical_Path

String

Source_Entity

Source.Physical_Region_Length

Integer

Source_Entity

Source.Physical_Region_Start

Integer

Source_Entity

Source.Region_Length

Integer

Source_Entity

Source.Region_Start

Integer

Source_Entity

Source.Signature_Start

Integer

Source_Entity

Abstract types are tagged with the is_abstract-iconElement.Is_Abstract attribute. If the type is a generic instance, the attribute is_template_instance-icon Element.Is_Template_Instance is set.

Type kinds

A type in C# and .NET can either be

  • a value type: then it is tagged with the is_value_type-icon Element.Is_Value_Type attribute, or

  • a reference type, then it is tagged with the is_reference_type-icon Element.Is_Reference_Type.

Enums are represented by nodes of type node-type Type, tagged by the is_enum-iconElement.Is_Enum attribute. This representation is done to harmonize the representation with the C/C++ language model (technically, enums in C# are value classes). A special kind of types are generic parameters; they are tagged with the attribute is_template_parameter-iconElement.Is_Template_Parameter.

Note

Code Example

public class AClass<T> where T : class
{
}
Example: Generic type parameter.

Example: Generic type parameter.