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>
34 lines
665 B
C#
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;
|
|
}
|