29 lines
754 B
C#
29 lines
754 B
C#
|
using CanonSharp.Pascal.Scanner;
|
|||
|
|
|||
|
namespace CanonSharp.Pascal.SyntaxTree;
|
|||
|
|
|||
|
public sealed class SubprogramHead : SyntaxNodeBase
|
|||
|
{
|
|||
|
public override SyntaxNodeType NodeType => SyntaxNodeType.SubprogramHead;
|
|||
|
|
|||
|
public LexicalToken Identifier { get; }
|
|||
|
|
|||
|
public List<Parameter> Parameters { get; } = [];
|
|||
|
|
|||
|
public SyntaxNodeBase? TypeToken { get; }
|
|||
|
|
|||
|
public SubprogramHead(LexicalToken identifier, IEnumerable<Parameter> parameters)
|
|||
|
{
|
|||
|
Identifier = identifier;
|
|||
|
Parameters.AddRange(parameters);
|
|||
|
TypeToken = null;
|
|||
|
}
|
|||
|
|
|||
|
public SubprogramHead(LexicalToken identifier, IEnumerable<Parameter> parameters, SyntaxNodeBase typeToken) : this(
|
|||
|
identifier, parameters)
|
|||
|
{
|
|||
|
TypeToken = typeToken;
|
|||
|
}
|
|||
|
|
|||
|
}
|