mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
Simplify TypeContainer class
This commit is contained in:
@@ -8,43 +8,12 @@ namespace Semmle.Extraction.CIL.Entities
|
||||
/// <summary>
|
||||
/// Base class for all type containers (namespaces, types, methods).
|
||||
/// </summary>
|
||||
public abstract class TypeContainer : IGenericContext, IExtractedEntity
|
||||
public abstract class TypeContainer : LabelledEntity, IGenericContext
|
||||
{
|
||||
public Context Cx { get; }
|
||||
|
||||
protected TypeContainer(Context cx)
|
||||
protected TypeContainer(Context cx) : base(cx)
|
||||
{
|
||||
Cx = cx;
|
||||
}
|
||||
|
||||
public virtual Label Label { get; set; }
|
||||
|
||||
public abstract void WriteId(TextWriter trapFile);
|
||||
|
||||
public void WriteQuotedId(TextWriter trapFile)
|
||||
{
|
||||
trapFile.Write("@\"");
|
||||
WriteId(trapFile);
|
||||
trapFile.Write(IdSuffix);
|
||||
trapFile.Write('\"');
|
||||
}
|
||||
|
||||
public abstract string IdSuffix { get; }
|
||||
|
||||
public void Extract(Context cx2) { cx2.Populate(this); }
|
||||
|
||||
public abstract IEnumerable<IExtractionProduct> Contents { get; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
using var writer = new StringWriter();
|
||||
WriteQuotedId(writer);
|
||||
return writer.ToString();
|
||||
}
|
||||
|
||||
public TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.NoLabel;
|
||||
public Location ReportingLocation => throw new NotImplementedException();
|
||||
|
||||
public abstract IEnumerable<Type> MethodParameters { get; }
|
||||
public abstract IEnumerable<Type> TypeParameters { get; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user