2024-12-20 23:39:29 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Script.Node
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 表示对象的成员访问
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class MemberAccessNode : ASTNode
|
|
|
|
|
|
{
|
2025-07-09 21:49:26 +08:00
|
|
|
|
/// <summary>
|
2025-07-11 20:52:21 +08:00
|
|
|
|
/// 对象来源
|
2025-07-09 21:49:26 +08:00
|
|
|
|
/// </summary>
|
2024-12-20 23:39:29 +08:00
|
|
|
|
public ASTNode Object { get; }
|
2025-07-09 21:49:26 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-07-11 20:52:21 +08:00
|
|
|
|
/// 对象中要获取的成员的名称
|
2025-07-09 21:49:26 +08:00
|
|
|
|
/// </summary>
|
2024-12-20 23:39:29 +08:00
|
|
|
|
public string MemberName { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public MemberAccessNode(ASTNode obj, string memberName)
|
|
|
|
|
|
{
|
|
|
|
|
|
Object = obj;
|
|
|
|
|
|
MemberName = memberName;
|
|
|
|
|
|
}
|
2025-07-29 14:25:31 +08:00
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
|
{
|
|
|
|
|
|
return $"{Object}.{MemberName}";
|
|
|
|
|
|
}
|
2024-12-20 23:39:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|