2024-02-04 18:50:45 -06:00
|
|
|
namespace Microsoft.Iris.Asm.Models;
|
|
|
|
|
|
|
|
|
|
public interface IAsmItem
|
|
|
|
|
{
|
|
|
|
|
public int Line { get; set; }
|
|
|
|
|
public int Column { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public abstract record AsmItem : IAsmItem
|
|
|
|
|
{
|
|
|
|
|
public int Line { get; set; } = -1;
|
|
|
|
|
public int Column { get; set; } = -1;
|
2024-02-04 22:09:21 -06:00
|
|
|
|
|
|
|
|
internal const string DebuggerDisplay = "({Line}, {Column})";
|
2024-02-04 18:50:45 -06:00
|
|
|
}
|
|
|
|
|
|
2024-02-04 22:23:10 -06:00
|
|
|
public interface IDirective : IAsmItem
|
|
|
|
|
{
|
|
|
|
|
string Identifier { get; init; }
|
|
|
|
|
}
|
|
|
|
|
public abstract record Directive(string Identifier) : AsmItem, IDirective
|
|
|
|
|
{
|
|
|
|
|
public override string ToString() => $".{Identifier}";
|
|
|
|
|
}
|
2024-02-04 18:50:45 -06:00
|
|
|
|
|
|
|
|
public interface IImport : IDirective;
|
2024-02-04 22:23:10 -06:00
|
|
|
public abstract record Import : Directive, IImport
|
|
|
|
|
{
|
|
|
|
|
public Import(string Type) : base($"import-{Type}")
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString() => base.ToString();
|
|
|
|
|
}
|
2024-02-04 18:50:45 -06:00
|
|
|
|
|
|
|
|
public interface IBodyItem : IAsmItem;
|
|
|
|
|
public abstract record BodyItem : AsmItem, IBodyItem;
|