feat: 针对C的代码生成 (#50)

Co-authored-by: Lan_G <2911328695@qq.com>
Reviewed-on: PostGuard/Canon#50
This commit is contained in:
2024-04-21 22:24:35 +08:00
parent 4353fb0c01
commit 3a584751dc
36 changed files with 906 additions and 31 deletions

View File

@@ -1,4 +1,5 @@
using System.Text;
using Canon.Core.SemanticParser;
namespace Canon.Core.CodeGenerators;
@@ -9,6 +10,11 @@ public class CCodeBuilder
{
private readonly StringBuilder _builder = new();
/// <summary>
/// 符号表
/// </summary>
public SymbolTable SymbolTable { get; } = new();
public void AddString(string code)
{
_builder.Append(code);