CanonSharp/CanonSharp.Pascal/SyntaxTree/BinaryOperatorNode.cs

34 lines
665 B
C#
Raw Normal View History

namespace CanonSharp.Pascal.SyntaxTree;
public enum BinaryOperatorType
{
Add,
Subtract,
Multiply,
// Pascal特有的整数除法关键词div
IntegerDivide,
Divide,
Mod,
And,
Or,
Equal,
NotEqual,
Greater,
GreaterEqual,
Less,
LessEqual
}
public sealed class BinaryOperatorNode(BinaryOperatorType operatorType, SyntaxNodeBase left, SyntaxNodeBase right)
: SyntaxNodeBase
{
public override SyntaxNodeType NodeType => SyntaxNodeType.BinaryOperator;
public BinaryOperatorType OperatorType => operatorType;
public SyntaxNodeBase Left => left;
public SyntaxNodeBase Right => right;
}