31 lines
818 B
C#
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 ");
|
|
}
|
|
}
|