2024-04-26 10:18:49 +08:00
|
|
|
|
using Canon.Core.Abstractions;
|
|
|
|
|
using Canon.Core.LexicalParser;
|
2024-04-07 16:47:28 +08:00
|
|
|
|
|
|
|
|
|
namespace Canon.Core.SyntaxNodes;
|
|
|
|
|
|
|
|
|
|
public class TerminatedSyntaxNode : SyntaxNodeBase
|
|
|
|
|
{
|
|
|
|
|
public override bool IsTerminated => true;
|
|
|
|
|
|
2024-05-10 13:52:11 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否为For循环定义中的DO节点
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsForNode { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 是否为While循环定义中的DO节点
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool IsWhileNode { get; set; }
|
|
|
|
|
|
2024-04-26 10:18:49 +08:00
|
|
|
|
public override void PreVisit(SyntaxNodeVisitor visitor)
|
|
|
|
|
{
|
|
|
|
|
visitor.PreVisit(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PostVisit(SyntaxNodeVisitor visitor)
|
|
|
|
|
{
|
|
|
|
|
visitor.PostVisit(this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-07 16:47:28 +08:00
|
|
|
|
public required SemanticToken Token { get; init; }
|
2024-04-19 14:59:45 +08:00
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return Token.LiteralValue;
|
|
|
|
|
}
|
2024-04-07 16:47:28 +08:00
|
|
|
|
}
|