2018-11-27 17:38:28 +00:00
|
|
|
using System.Collections.Generic;
|
2018-11-18 13:18:24 +00:00
|
|
|
using Upsilon.BaseTypes;
|
|
|
|
using Upsilon.Parser;
|
2018-11-25 18:30:18 +00:00
|
|
|
using Upsilon.Text;
|
2018-11-18 13:18:24 +00:00
|
|
|
|
|
|
|
namespace Upsilon.Binder
|
|
|
|
{
|
|
|
|
public class BoundIndexExpression : BoundExpression
|
|
|
|
{
|
2019-01-26 12:23:12 +00:00
|
|
|
public BoundIndexExpression(BoundExpression identifier, BoundExpression index, TypeContainer type, TextSpan span) : base(span)
|
2018-11-18 13:18:24 +00:00
|
|
|
{
|
|
|
|
Identifier = identifier;
|
|
|
|
Index = index;
|
|
|
|
Type = type;
|
|
|
|
}
|
|
|
|
|
2018-11-18 15:08:20 +00:00
|
|
|
public BoundExpression Identifier { get; }
|
2018-11-18 13:18:24 +00:00
|
|
|
public BoundExpression Index { get; }
|
|
|
|
|
|
|
|
public override BoundKind Kind => BoundKind.BoundIndexExpression;
|
2018-11-25 18:30:18 +00:00
|
|
|
|
2019-01-17 12:56:53 +00:00
|
|
|
public override IEnumerable<BoundNode> GetChildren()
|
|
|
|
{
|
|
|
|
yield return Identifier;
|
|
|
|
yield return Index;
|
|
|
|
}
|
|
|
|
|
2019-01-18 15:09:25 +00:00
|
|
|
public override TypeContainer Type { get; }
|
2018-11-18 13:18:24 +00:00
|
|
|
}
|
2018-11-20 13:05:34 +00:00
|
|
|
|
|
|
|
public class BoundFullStopIndexExpression : BoundExpression
|
|
|
|
{
|
|
|
|
public BoundExpression Expression { get; }
|
|
|
|
public string Index { get; }
|
|
|
|
|
2019-01-19 15:38:33 +00:00
|
|
|
public BoundFullStopIndexExpression(BoundExpression expression, string index, TypeContainer type, TextSpan span) : base(span)
|
2018-11-20 13:05:34 +00:00
|
|
|
{
|
|
|
|
Expression = expression;
|
|
|
|
Index = index;
|
2018-11-27 13:37:58 +00:00
|
|
|
Type = type;
|
2018-11-20 13:05:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override BoundKind Kind => BoundKind.BoundFullstopIndexExpression;
|
2018-11-25 18:30:18 +00:00
|
|
|
|
2019-01-17 12:56:53 +00:00
|
|
|
public override IEnumerable<BoundNode> GetChildren()
|
|
|
|
{
|
|
|
|
yield return Expression;
|
|
|
|
}
|
|
|
|
|
2019-01-18 15:09:25 +00:00
|
|
|
public override TypeContainer Type { get; }
|
2018-11-20 13:05:34 +00:00
|
|
|
}
|
2018-11-18 13:18:24 +00:00
|
|
|
}
|