This repository has been archived on 2025-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
nub-lang-archive-2/compiler/NubLang/Generation/QBE/QBEWriter.cs
nub31 fd27d2709d ...
2025-09-11 21:22:30 +02:00

39 lines
676 B
C#

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();
}
}