52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System.Collections.Generic;
|
|
using Upsilon.BaseTypes;
|
|
using Upsilon.Parser;
|
|
using Upsilon.Text;
|
|
|
|
namespace Upsilon.Binder
|
|
{
|
|
public class BoundIndexExpression : BoundExpression
|
|
{
|
|
public BoundIndexExpression(BoundExpression identifier, BoundExpression index, TypeContainer type, TextSpan span) : base(span)
|
|
{
|
|
Identifier = identifier;
|
|
Index = index;
|
|
Type = type;
|
|
}
|
|
|
|
public BoundExpression Identifier { get; }
|
|
public BoundExpression Index { get; }
|
|
|
|
public override BoundKind Kind => BoundKind.BoundIndexExpression;
|
|
|
|
public override IEnumerable<BoundNode> GetChildren()
|
|
{
|
|
yield return Identifier;
|
|
yield return Index;
|
|
}
|
|
|
|
public override TypeContainer Type { get; }
|
|
}
|
|
|
|
public class BoundFullStopIndexExpression : BoundExpression
|
|
{
|
|
public BoundExpression Expression { get; }
|
|
public string Index { get; }
|
|
|
|
public BoundFullStopIndexExpression(BoundExpression expression, string index, TypeContainer type, TextSpan span) : base(span)
|
|
{
|
|
Expression = expression;
|
|
Index = index;
|
|
Type = type;
|
|
}
|
|
|
|
public override BoundKind Kind => BoundKind.BoundFullstopIndexExpression;
|
|
|
|
public override IEnumerable<BoundNode> GetChildren()
|
|
{
|
|
yield return Expression;
|
|
}
|
|
|
|
public override TypeContainer Type { get; }
|
|
}
|
|
} |