finn-lang/Expr.g.cs

127 lines
3.1 KiB
C#
Raw Normal View History

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-02 20:56:50 +00:00
public abstract T accept<T>(IExprVisitor<T> visitor);
2023-06-25 01:15:37 +00:00
}
2023-07-02 20:56:50 +00:00
public interface IExprVisitor<T> {
2023-06-28 23:18:31 +00:00
T visitSequenceExpr(Sequence expr);
2023-06-25 01:15:37 +00:00
T visitBinaryExpr(Binary expr);
T visitGroupingExpr(Grouping expr);
T visitLiteralExpr(Literal expr);
T visitUnaryExpr(Unary expr);
2023-06-28 22:26:08 +00:00
T visitIfExpr(If expr);
T visitIdentifierExpr(Identifier expr);
2023-07-02 05:13:24 +00:00
T visitListExpr(List expr);
2023-07-02 05:30:24 +00:00
T visitVariantExpr(Variant expr);
2023-07-02 17:38:48 +00:00
T visitRecordExpr(Record expr);
T visitSelectorExpr(Selector expr);
2023-07-02 17:46:18 +00:00
T visitIndexerExpr(Indexer expr);
2023-07-02 18:05:46 +00:00
T visitCallExpr(Call expr);
T visitLetExpr(Let 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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-28 23:18:31 +00:00
{
return visitor.visitSequenceExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-25 01:15:37 +00:00
{
return visitor.visitBinaryExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-25 01:15:37 +00:00
{
return visitor.visitGroupingExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-25 01:15:37 +00:00
{
return visitor.visitLiteralExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-25 01:15:37 +00:00
{
return visitor.visitUnaryExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-06-28 22:26:08 +00:00
{
return visitor.visitIfExpr(this);
}
}
2023-07-02 20:27:12 +00:00
public partial record Identifier(Name Value) : Expr()
{
2023-07-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
{
return visitor.visitIdentifierExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-07-02 05:13:24 +00:00
{
return visitor.visitListExpr(this);
}
}
2023-07-02 20:27:12 +00:00
public partial record Variant(Name Tag, Expr? Argument) : Expr()
2023-07-02 05:30:24 +00:00
{
2023-07-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-07-02 05:30:24 +00:00
{
return visitor.visitVariantExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-07-02 17:38:48 +00:00
{
return visitor.visitRecordExpr(this);
}
}
2023-07-02 20:27:12 +00:00
public partial record Selector(Expr Left, Name FieldName) : Expr()
{
2023-07-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
{
return visitor.visitSelectorExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-07-02 17:46:18 +00:00
{
return visitor.visitIndexerExpr(this);
}
}
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-02 20:56:50 +00:00
public override T accept<T>(IExprVisitor<T> visitor)
2023-07-02 18:05:46 +00:00
{
return visitor.visitCallExpr(this);
}
}
public partial record Let(Binding[] Bindings, Expr Body) : Expr()
{
public override T accept<T>(IExprVisitor<T> visitor)
{
return visitor.visitLetExpr(this);
}
}