2024-12-20 23:39:29 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
2025-07-29 14:25:31 +08:00
|
|
|
|
using System.Xml.Linq;
|
2024-12-20 23:39:29 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Serein.Script.Node
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-18 22:45:06 +08:00
|
|
|
|
/// 变量赋值节点
|
2024-12-20 23:39:29 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class AssignmentNode : ASTNode
|
|
|
|
|
|
{
|
2025-03-14 21:38:07 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 变量名称
|
|
|
|
|
|
/// </summary>
|
2025-07-11 20:52:21 +08:00
|
|
|
|
public ASTNode Target { get; }
|
2025-03-14 21:38:07 +08:00
|
|
|
|
/// <summary>
|
2025-07-18 22:45:06 +08:00
|
|
|
|
/// 值来源
|
2025-03-14 21:38:07 +08:00
|
|
|
|
/// </summary>
|
2024-12-20 23:39:29 +08:00
|
|
|
|
public ASTNode Value { get; }
|
2025-03-14 21:38:07 +08:00
|
|
|
|
|
2025-07-13 17:34:03 +08:00
|
|
|
|
public AssignmentNode(ASTNode target, ASTNode value) => (Target, Value) = (target, value);
|
2025-07-29 14:25:31 +08:00
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return $"{Target} = {Value}";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-20 23:39:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|