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-10 23:03:57 -06:00
|
|
|
public interface IBodyItem : IAsmItem;
|
|
|
|
|
public abstract record BodyItem : AsmItem, IBodyItem;
|
|
|
|
|
|
|
|
|
|
public interface IDirective : IBodyItem
|
2024-02-04 22:23:10 -06:00
|
|
|
{
|
|
|
|
|
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
|
|
|
|
2025-01-27 19:15:30 -06:00
|
|
|
public interface IImportDirective : IDirective
|
|
|
|
|
{
|
|
|
|
|
string Type { get; init; }
|
|
|
|
|
}
|
|
|
|
|
public abstract record ImportDirective(string Type) : Directive($"import-{Type}"), IImportDirective
|
2024-02-04 22:23:10 -06:00
|
|
|
{
|
|
|
|
|
public override string ToString() => base.ToString();
|
|
|
|
|
}
|
2024-02-04 18:50:45 -06:00
|
|
|
|
2024-02-10 23:03:57 -06:00
|
|
|
public interface ICodeItem : IBodyItem;
|
|
|
|
|
public abstract record CodeItem : BodyItem, ICodeItem;
|