CanonSharp/CanonSharp.Pascal/SyntaxTree/IfNode.cs

27 lines
690 B
C#
Raw Normal View History

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;
}
}