module Ast type Ident = string type Expr = | Int of int | Float of float | Var of Ident | FunCall of Expr * Expr list | Subscript of Expr * Expr | Dot of Expr * Ident and Type = Ident * string option(*type qualifier*) * string option(*param qualifier*) and Decl = Type * (Ident * Expr option (*array size*) * Expr option (*initializer*)) list and Instr = | Block of Instr list | Decl of Decl | Expr of Expr | If of Expr * Instr (*then*) * Instr option (*else*) | ForD of Decl * Expr option * Expr option * Instr (*for loop starting with a declaration*) | ForE of Expr option * Expr option * Expr option * Instr (*for loop starting with an expression*) | While of Expr * Instr | DoWhile of Expr * Instr | Keyword of string * Expr option (*break, continue, return, discard*) and FunctionType = Type (*return*) * Ident (*name*) * Decl list (*args*) and Record = Ident * Decl list and TopLevel = | Macro of string | Function of FunctionType * Instr | TLDecl of Decl | Record of Record