Canon/Canon.Core/CodeGenerators/CCodeBuilder.cs
jackfiled 3a584751dc feat: 针对C的代码生成 (#50)
Co-authored-by: Lan_G <2911328695@qq.com>
Reviewed-on: PostGuard/Canon#50
2024-04-21 22:24:35 +08:00

29 lines
498 B
C#

using System.Text;
using Canon.Core.SemanticParser;
namespace Canon.Core.CodeGenerators;
/// <summary>
/// 构建C语言代码
/// </summary>
public class CCodeBuilder
{
private readonly StringBuilder _builder = new();
/// <summary>
/// 符号表
/// </summary>
public SymbolTable SymbolTable { get; } = new();
public void AddString(string code)
{
_builder.Append(code);
}
public string Build()
{
return _builder.ToString();
}
}