Canon/Canon.Core/SyntaxNodes/ValueParameter.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

31 lines
818 B
C#

using Canon.Core.CodeGenerators;
using Canon.Core.Enums;
namespace Canon.Core.SyntaxNodes;
public class ValueParameter : NonTerminatedSyntaxNode
{
public override NonTerminatorType Type => NonTerminatorType.ValueParameter;
/// <summary>
/// 声明的变量列表
/// </summary>
public IdentifierList IdentifierList => Children[0].Convert<IdentifierList>();
/// <summary>
/// 声明的变量类型
/// </summary>
public BasicType BasicType => Children[2].Convert<BasicType>();
public static ValueParameter Create(List<SyntaxNodeBase> children)
{
return new ValueParameter { Children = children };
}
public override void GenerateCCode(CCodeBuilder builder)
{
//可能涉及符号表访问
builder.AddString("valueParam ");
}
}