Files
serein-flow/Serein.Script/Node/BinaryOperationNode.cs
2025-07-29 14:25:31 +08:00

43 lines
936 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Serein.Script.Node
{
/// <summary>
/// 二元表达式节点
/// </summary>
public class BinaryOperationNode : ASTNode
{
/// <summary>
/// 左元
/// </summary>
public ASTNode Left { get; }
/// <summary>
/// 操作符(布尔运算符 > 比较运算符 > 加减乘除
/// </summary>
public string Operator { get; }
/// <summary>
/// 右元
/// </summary>
public ASTNode Right { get; }
public BinaryOperationNode(ASTNode left, string op, ASTNode right)
{
Left = left;
Operator = op;
Right = right;
}
public override string ToString()
{
return $"({Left} {Operator} {Right})";
}
}
}