(defpackage #:sarcasm.ast (:use #:cl #:sarcasm.types) (:import-from #:sarcasm.util #:def/class) (:local-nicknames (#:a #:alexandria-2) (#:util #:sarcasm.util) (#:instr #:sarcasm.instr))) (in-package #:sarcasm.ast) ;;; TYPES ;;; MODULE-STRUCTURES (def/class instr () ((name :prefix :type keyword) (code :prefix :type (vector byte)) (type :prefix :type stack-effect-type))) (def/class numeric-instr (instr)) (def/class func () (type :prefix :type typeidx) (locals :type (vector valtype)) (body :prefix :type expr)) ;;; MODULES (def/class module () (types funcs tables mems globals elems datas imports exports :type vector :initform (vector)) (start :type (or null t) ; TODO: what is this value type? :initform nil))