mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
|
|
namespace Semmle.Extraction.CIL
|
|
{
|
|
/// <summary>
|
|
/// An entity that needs to be populated during extraction.
|
|
/// This assigns a key and optionally extracts its contents.
|
|
/// </summary>
|
|
internal abstract class LabelledEntity : Extraction.LabelledEntity, IExtractedEntity
|
|
{
|
|
public override Context Context => (Context)base.Context;
|
|
|
|
protected LabelledEntity(Context cx) : base(cx)
|
|
{
|
|
}
|
|
|
|
public override Microsoft.CodeAnalysis.Location ReportingLocation => throw new NotImplementedException();
|
|
|
|
public void Extract(Context cx2)
|
|
{
|
|
cx2.Populate(this);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
using var writer = new StringWriter();
|
|
WriteQuotedId(writer);
|
|
return writer.ToString();
|
|
}
|
|
|
|
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
|
|
|
|
public abstract IEnumerable<IExtractionProduct> Contents { get; }
|
|
}
|
|
}
|