jackfiled
cf19f8197e
Reviewed-on: https://git.bupt-hpc.cn/jackfiled/CanonSharp/pulls/3 Co-authored-by: jackfiled <xcrenchangjun@outlook.com> Co-committed-by: jackfiled <xcrenchangjun@outlook.com>
27 lines
690 B
C#
27 lines
690 B
C#
namespace CanonSharp.Pascal.SyntaxTree;
|
|
|
|
public sealed class IfNode : SyntaxNodeBase
|
|
{
|
|
public override SyntaxNodeType NodeType => SyntaxNodeType.If;
|
|
|
|
public SyntaxNodeBase Condition { get; }
|
|
|
|
public SyntaxNodeBase Statement { get; }
|
|
|
|
public SyntaxNodeBase? ElseStatement { get; }
|
|
|
|
public IfNode(SyntaxNodeBase condition, SyntaxNodeBase statement)
|
|
{
|
|
Condition = condition;
|
|
Statement = statement;
|
|
ElseStatement = null;
|
|
}
|
|
|
|
public IfNode(SyntaxNodeBase condition, SyntaxNodeBase statement, SyntaxNodeBase elseStatement)
|
|
{
|
|
Condition = condition;
|
|
Statement = statement;
|
|
ElseStatement = elseStatement;
|
|
}
|
|
}
|