2023-06-25 01:15:37 +00:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// THIS FILE IS GENERATED. //
|
|
|
|
// DO NOT EDIT. //
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
2023-07-02 19:19:42 +00:00
|
|
|
#nullable enable
|
2023-07-02 05:13:24 +00:00
|
|
|
|
2023-06-25 01:15:37 +00:00
|
|
|
namespace Finn.AST;
|
|
|
|
|
2023-07-02 20:27:12 +00:00
|
|
|
public abstract record Expr() {
|
2023-07-11 06:51:51 +00:00
|
|
|
public abstract TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor);
|
|
|
|
}
|
|
|
|
public interface IExprVisitor<TContext, TResult> {
|
|
|
|
TResult visitSequenceExpr(TContext context, Sequence expr);
|
|
|
|
TResult visitBinaryExpr(TContext context, Binary expr);
|
|
|
|
TResult visitGroupingExpr(TContext context, Grouping expr);
|
|
|
|
TResult visitLiteralExpr(TContext context, Literal expr);
|
|
|
|
TResult visitUnaryExpr(TContext context, Unary expr);
|
|
|
|
TResult visitIfExpr(TContext context, If expr);
|
|
|
|
TResult visitVariableExpr(TContext context, Variable expr);
|
|
|
|
TResult visitListExpr(TContext context, List expr);
|
|
|
|
TResult visitVariantExpr(TContext context, Variant expr);
|
|
|
|
TResult visitRecordExpr(TContext context, Record expr);
|
|
|
|
TResult visitSelectorExpr(TContext context, Selector expr);
|
|
|
|
TResult visitIndexerExpr(TContext context, Indexer expr);
|
|
|
|
TResult visitCallExpr(TContext context, Call expr);
|
|
|
|
TResult visitLetExpr(TContext context, Let expr);
|
|
|
|
TResult visitWhenExpr(TContext context, When expr);
|
2023-06-25 01:15:37 +00:00
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Sequence(Expr Left, Expr Right) : Expr()
|
2023-06-28 23:18:31 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-28 23:18:31 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitSequenceExpr(context, this);
|
2023-06-28 23:18:31 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Binary(Expr Left, Token Op, Expr Right) : Expr()
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitBinaryExpr(context, this);
|
2023-06-25 01:15:37 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Grouping(Expr Expression) : Expr()
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitGroupingExpr(context, this);
|
2023-06-25 01:15:37 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Literal(System.Object Value) : Expr()
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitLiteralExpr(context, this);
|
2023-06-25 01:15:37 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Unary(Token Op, Expr Right) : Expr()
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-25 01:15:37 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitUnaryExpr(context, this);
|
2023-06-25 01:15:37 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record If(Expr Condition, Expr Then, Expr Else) : Expr()
|
2023-06-28 22:26:08 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-06-28 22:26:08 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitIfExpr(context, this);
|
2023-06-28 22:26:08 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-17 05:30:20 +00:00
|
|
|
public partial record Variable(Token Value) : Expr()
|
2023-07-01 06:12:02 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-01 06:12:02 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitVariableExpr(context, this);
|
2023-07-01 06:12:02 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record List(Expr[] Elements) : Expr()
|
2023-07-02 05:13:24 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 05:13:24 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitListExpr(context, this);
|
2023-07-02 05:13:24 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-17 05:30:20 +00:00
|
|
|
public partial record Variant(Token Tag, Expr? Argument) : Expr()
|
2023-07-02 05:30:24 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 05:30:24 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitVariantExpr(context, this);
|
2023-07-02 05:30:24 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Record(Field[] Extensions, BaseRecord? Base) : Expr()
|
2023-07-02 17:38:48 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 17:38:48 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitRecordExpr(context, this);
|
2023-07-02 17:38:48 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-17 05:30:20 +00:00
|
|
|
public partial record Selector(Expr Left, Token FieldName) : Expr()
|
2023-07-01 06:12:02 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-01 06:12:02 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitSelectorExpr(context, this);
|
2023-07-01 06:12:02 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Indexer(Expr Left, Expr Index) : Expr()
|
2023-07-02 17:46:18 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 17:46:18 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitIndexerExpr(context, this);
|
2023-07-02 17:46:18 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 20:27:12 +00:00
|
|
|
public partial record Call(Expr Left, Expr?[] Arguments) : Expr()
|
2023-07-02 18:05:46 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 18:05:46 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitCallExpr(context, this);
|
2023-07-02 18:05:46 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 22:37:06 +00:00
|
|
|
public partial record Let(Binding[] Bindings, Expr Body) : Expr()
|
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-02 22:37:06 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitLetExpr(context, this);
|
2023-07-02 22:37:06 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-11 19:55:06 +00:00
|
|
|
public partial record When(Expr Head, VarBinding[] Cases) : Expr()
|
2023-07-05 14:52:14 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IExprVisitor<TContext, TResult> visitor)
|
2023-07-05 14:52:14 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitWhenExpr(context, this);
|
2023-07-05 14:52:14 +00:00
|
|
|
}
|
|
|
|
}
|