Class IdentifierSyntax
Represents identifier in CIL assembler. Identifier is a name of the member or variable.
Inherited Members
Namespace: CilTools.Syntax
Assembly: CilTools.BytecodeAnalysis.dll
Syntax
public class IdentifierSyntax : SyntaxNode
Remarks
Starting from the version 2.3, identifiers that overlap with CIL assembler keywords are
escaped when converting to text. For example, if the method is called method
,
its name will be represented like 'method'
in text output.
Properties
Content
Gets the content of this identifier as string
Declaration
public string Content { get; }
Property Value
Type | Description |
---|---|
System.String |
IsDefinition
Gets a boolean value indicating whether this node represents a code location where the identified entity is originally defined, not where is is referenced.
Declaration
public bool IsDefinition { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
For example, in .method public void Foo()
, Foo is a definition, while in call void C::Foo()
it is a reference. This property enables code navigation services to detect which identifier is a
target location for navigation.
IsMemberName
Gets the value indicating whether this identifier represents assembly member name
Declaration
public bool IsMemberName { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Kind
Gets the kind of entity identified by this node
Declaration
public IdentifierKind Kind { get; }
Property Value
Type | Description |
---|---|
IdentifierKind |
TargetItem
Gets the item (such as assembly, member or variable) that this identifier represents
Declaration
public object TargetItem { get; }
Property Value
Type | Description |
---|---|
System.Object | The reference to the target item, or |
TargetMember
Gets the assembly member represented by this identifier
Declaration
public MemberInfo TargetMember { get; }
Property Value
Type | Description |
---|---|
System.Reflection.MemberInfo | The reference to the target member, or |
Methods
EnumerateChildNodes()
Enumerates child nodes of this node. For the leaf node, returns an empty collection.
Declaration
public override IEnumerable<SyntaxNode> EnumerateChildNodes()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<SyntaxNode> | The collection of child syntax nodes |
Overrides
ToText(TextWriter)
Writes text representation of this node into the specified TextWriter
Declaration
public override void ToText(TextWriter target)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | target |
Overrides
Remarks
Starting from the version 2.3, identifiers that overlap with CIL assembler keywords are
escaped when converting to text. For example, if the method is called method
,
its name will be represented like 'method'
in text output.