Canon/Canon.Core/SyntaxNodes/TerminatedSyntaxNode.cs
ichirinko f993d49856 添加对while-do语句的支持 (#77)
Co-authored-by: jackfiled <xcrenchangjun@outlook.com>
Reviewed-on: PostGuard/Canon#77
Co-authored-by: ichirinko <1621543655@qq.com>
Co-committed-by: ichirinko <1621543655@qq.com>
2024-05-10 13:52:11 +08:00

37 lines
814 B
C#

using Canon.Core.Abstractions;
using Canon.Core.LexicalParser;
namespace Canon.Core.SyntaxNodes;
public class TerminatedSyntaxNode : SyntaxNodeBase
{
public override bool IsTerminated => true;
/// <summary>
/// 是否为For循环定义中的DO节点
/// </summary>
public bool IsForNode { get; set; }
/// <summary>
/// 是否为While循环定义中的DO节点
/// </summary>
public bool IsWhileNode { get; set; }
public override void PreVisit(SyntaxNodeVisitor visitor)
{
visitor.PreVisit(this);
}
public override void PostVisit(SyntaxNodeVisitor visitor)
{
visitor.PostVisit(this);
}
public required SemanticToken Token { get; init; }
public override string ToString()
{
return Token.LiteralValue;
}
}