summaryrefslogtreecommitdiff
path: root/Jennisys/Ast.fs
diff options
context:
space:
mode:
Diffstat (limited to 'Jennisys/Ast.fs')
-rw-r--r--Jennisys/Ast.fs38
1 files changed, 37 insertions, 1 deletions
diff --git a/Jennisys/Ast.fs b/Jennisys/Ast.fs
index 746307a4..f527ba55 100644
--- a/Jennisys/Ast.fs
+++ b/Jennisys/Ast.fs
@@ -1,8 +1,44 @@
namespace Ast
open System
+open System.Numerics
+
+
+type Type =
+ | NamedType of string
+ | InstantiatedType of string * Type
+
+type VarDecl =
+ | Var of string * Type option
type Expr =
+ | IntLiteral of BigInteger
| IdLiteral of string
+ | Star
| Dot of Expr * string
- | BinExpr of string * Expr * Expr
+ | UnaryExpr of string * Expr
+ | BinaryExpr of (int * string) * Expr * Expr
+ | SelectExpr of Expr * Expr
+ | UpdateExpr of Expr * Expr * Expr
+ | SequenceExpr of Expr list
+ | SeqLength of Expr
+ | ForallExpr of VarDecl list * Expr
+
+type Stmt =
+ | Block of Stmt list
+ | Assign of Expr * Expr
+
+type Signature =
+ | Sig of VarDecl list * VarDecl list
+
+type Member =
+ | Field of VarDecl
+ | Constructor of string * Signature * Expr * Stmt list
+ | Method of string * Signature * Expr * Stmt list
+
+type TopLevelDecl =
+ | Class of string * string list * Member list
+ | Model of string * string list * VarDecl list * Expr list * Expr
+ | Code of string * string list
+type Program =
+ | Program of TopLevelDecl list