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
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class ASTNode
|
|
|
|
|
|
{
|
2025-07-30 21:15:07 +08:00
|
|
|
|
public string Code { get; private set; } = string.Empty;
|
2024-12-20 23:39:29 +08:00
|
|
|
|
public int Row { get; private set; }
|
|
|
|
|
|
public int StartIndex { get; private set; }
|
|
|
|
|
|
public int Length { get; private set; }
|
|
|
|
|
|
|
|
|
|
|
|
internal ASTNode SetTokenInfo(Token token)
|
|
|
|
|
|
{
|
|
|
|
|
|
Row = token.Row;
|
|
|
|
|
|
StartIndex = token.StartIndex;
|
|
|
|
|
|
Length = token.Length;
|
|
|
|
|
|
Code = token.Code;
|
|
|
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|