This commit is contained in:
nub31
2025-09-11 21:22:30 +02:00
parent 5fecfeba43
commit fd27d2709d
46 changed files with 5339 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
using System.Text;
namespace NubLang.Generation.QBE;
internal class QBEWriter
{
private readonly StringBuilder _builder = new();
public void Indented(string value)
{
_builder.Append('\t');
_builder.AppendLine(value);
}
public void Comment(string comment)
{
_builder.AppendLine("# " + comment);
}
public void WriteLine(string text)
{
_builder.AppendLine(text);
}
public void Write(string text)
{
_builder.Append(text);
}
public void NewLine()
{
_builder.AppendLine();
}
public override string ToString()
{
return _builder.ToString();
}
}