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