CanonSharp/CanonSharp.Pascal/SyntaxTree/BinaryOperatorNode.cs
jackfiled cf19f8197e feat: Grammar Parser (#3)
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>
2024-08-18 12:01:27 +08:00

34 lines
665 B
C#

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