46 lines
1.6 KiB
C#
Raw Normal View History

namespace EightBit
2024-06-05 12:51:40 +01:00
{
namespace Files
{
namespace Symbols
{
//scope id = 0, name = "", mod = 0, size = 1137, span = 355 + 354
//scope id = 1, name = "stack", mod = 0, type = scope, size = 7, parent = 0, span = 15
//scope id = 7, name = "print_box_break_vertical", mod = 0, type = scope, size = 6, parent = 0, sym = 33, span = 72
public class Scope(Parser container) : NamedSection(container)
2024-06-05 12:51:40 +01:00
{
[SectionReference("mod")]
2024-06-05 12:51:40 +01:00
public Symbols.Module Module => this.TakeModuleReference();
[SectionProperty("type")]
2024-06-05 12:51:40 +01:00
public string? Type => this.MaybeTakeString("type");
[SectionProperty("size")]
public int Size => this.TakeInteger("size");
2024-06-05 12:51:40 +01:00
[SectionReference("parent")]
2024-06-05 12:51:40 +01:00
public Scope? Parent => this.MaybeTakeParentReference();
private bool _symbolAvailable;
private Symbols.Symbol? _symbol;
[SectionReference("sym")]
public Symbols.Symbol? Symbol
{
get
{
if (!this._symbolAvailable)
{
this._symbol = this.MaybeTakeSymbolReference();
this._symbolAvailable = true;
}
return this._symbol;
}
}
2024-06-05 12:51:40 +01:00
[SectionReferences("span")]
public List<Span> Spans => this.TakeSpanReferences();
2024-06-05 12:51:40 +01:00
}
}
}
}