;;; $Id: parsed-exp.def,v 1.5 1998/10/26 23:49:26 leavens Exp $

(defrep parsed-exp datum)

;;; Figure B.1 : page 465

; define is a form, not an expression

(deftype varref? (-> (parsed-exp) boolean))
(deftype make-varref (-> (symbol) parsed-exp))
(deftype varref->var (-> (parsed-exp) symbol))

(deftype lit? (-> (parsed-exp) boolean))
(deftype make-lit (-> (number) parsed-exp))
(deftype lit->datum (-> (parsed-exp) number))

(deftype app? (-> (parsed-exp) boolean))
(deftype make-app (-> (parsed-exp (list parsed-exp)) parsed-exp))
(deftype app->rator (-> (parsed-exp) parsed-exp))
(deftype app->rands (-> (parsed-exp) (list parsed-exp)))

(deftype if? (-> (parsed-exp) boolean))
(deftype make-if (-> (parsed-exp parsed-exp parsed-exp) parsed-exp))
(deftype if->test-exp (-> (parsed-exp) parsed-exp))
(deftype if->then-exp (-> (parsed-exp) parsed-exp))
(deftype if->else-exp (-> (parsed-exp) parsed-exp))

(deftype let? (-> (parsed-exp) boolean))
(deftype make-let (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype let->decls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype let->body (-> (parsed-exp) parsed-exp))

(deftype proc? (-> (parsed-exp) boolean))
(deftype make-proc (-> ((list symbol) parsed-exp) parsed-exp))
(deftype proc->formals (-> (parsed-exp) (list symbol)))
(deftype proc->body (-> (parsed-exp) parsed-exp))

(deftype varassign? (-> (parsed-exp) boolean))
(deftype make-varassign (-> (symbol parsed-exp) parsed-exp))
(deftype varassign->var (-> (parsed-exp) symbol))
(deftype varassign->exp (-> (parsed-exp) parsed-exp))

(deftype letmutable? (-> (parsed-exp) boolean))
(deftype make-letmutable (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype letmutable->decls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype letmutable->body (-> (parsed-exp) parsed-exp))

(deftype begin? (-> (parsed-exp) boolean))
(deftype make-begin (-> (parsed-exp parsed-exp) parsed-exp))
(deftype begin->exp1 (-> (parsed-exp) parsed-exp))
(deftype begin->exp2 (-> (parsed-exp) parsed-exp))

(deftype letrecproc? (-> (parsed-exp) boolean))
(deftype make-letrecproc (-> ((list (procdecl parsed-exp)) parsed-exp) parsed-exp))
(deftype letrecproc->procdecls (-> (parsed-exp) (list (procdecl parsed-exp))))
(deftype letrecproc->body (-> (parsed-exp) parsed-exp))

(deftype letrec? (-> (parsed-exp) boolean))
(deftype make-letrec (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype letrec->decls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype letrec->body (-> (parsed-exp) parsed-exp))

(deftype dynassign? (-> (parsed-exp) boolean))
(deftype make-dynassign (-> (symbol parsed-exp parsed-exp) parsed-exp))
(deftype dynassign->var (-> (parsed-exp) symbol))
(deftype dynassign->exp (-> (parsed-exp) parsed-exp))
(deftype dynassign->body (-> (parsed-exp) parsed-exp))

;;; Figure B.2 : page 466 %%%%% This is for 3rd printing %%%%%%

; definearray is a form, not an expression

(deftype letdynamic? (-> (parsed-exp) boolean))
(deftype make-letdynamic (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype letdynamic->decls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype letdynamic->body (-> (parsed-exp) parsed-exp))

(deftype letarray? (-> (parsed-exp) boolean))
(deftype make-letarray (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype letarray->arraydecls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype letarray->body (-> (parsed-exp) parsed-exp))

(deftype arrayref? (-> (parsed-exp) boolean))
(deftype make-arrayref (-> (parsed-exp parsed-exp) parsed-exp))
(deftype arrayref->array (-> (parsed-exp) parsed-exp))
(deftype arrayref->index (-> (parsed-exp) parsed-exp))

(deftype arrayassign? (-> (parsed-exp) boolean))
(deftype make-arrayassign (-> (parsed-exp parsed-exp parsed-exp) parsed-exp))
(deftype arrayassign->array (-> (parsed-exp) parsed-exp))
(deftype arrayassign->index (-> (parsed-exp) parsed-exp))
(deftype arrayassign->exp (-> (parsed-exp) parsed-exp))

(deftype letproc? (-> (parsed-exp) boolean))
(deftype make-letproc (-> ((list (procdecl parsed-exp)) parsed-exp) parsed-exp))
(deftype letproc->procdecls (-> (parsed-exp) (list (procdecl parsed-exp))))
(deftype letproc->body (-> (parsed-exp) parsed-exp))

(deftype local? (-> (parsed-exp) boolean))
(deftype make-local (-> ((list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype local->decls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype local->body (-> (parsed-exp) parsed-exp))

;;; Figure B.3 : page 466

(deftype super-meth-app? (-> (parsed-exp) boolean))
(deftype make-super-meth-app (-> (symbol (list parsed-exp)) parsed-exp))
(deftype super-meth-app->name (-> (parsed-exp) symbol))
(deftype super-meth-app->rands (-> (parsed-exp) (list parsed-exp)))

(deftype meth-app? (-> (parsed-exp) boolean))
(deftype make-meth-app (-> (symbol (list parsed-exp)) parsed-exp))
(deftype meth-app->name (-> (parsed-exp) symbol))
(deftype meth-app->rands (-> (parsed-exp) (list parsed-exp)))

(deftype i-varref? (-> (parsed-exp) boolean))
(deftype make-i-varref (-> (symbol) parsed-exp))
(deftype i-varref->var (-> (parsed-exp) symbol))

(deftype c-varref? (-> (parsed-exp) boolean))
(deftype make-c-varref (-> (symbol) parsed-exp))
(deftype c-varref->var (-> (parsed-exp) symbol))

(deftype i-varassign? (-> (parsed-exp) boolean))
(deftype make-i-varassign (-> (symbol parsed-exp) parsed-exp))
(deftype i-varassign->var (-> (parsed-exp) symbol))
(deftype i-varassign->exp (-> (parsed-exp) parsed-exp))

(deftype c-varassign? (-> (parsed-exp) boolean))
(deftype make-c-varassign (-> (symbol parsed-exp) parsed-exp))
(deftype c-varassign->var (-> (parsed-exp) symbol))
(deftype c-varassign->exp (-> (parsed-exp) parsed-exp))

(deftype method? (-> (parsed-exp) boolean))
(deftype make-method (-> ((list symbol) parsed-exp) parsed-exp))
(deftype method->formals (-> (parsed-exp) (list symbol)))
(deftype method->body (-> (parsed-exp) parsed-exp))

(deftype new-simpleinst? (-> (parsed-exp) boolean))
(deftype make-new-simpleinst (-> (parsed-exp) parsed-exp))
(deftype new-simpleinst->class-exp (-> (parsed-exp) parsed-exp))

(deftype new-simpleclass? (-> (parsed-exp) boolean))
(deftype make-new-simpleclass (-> ((list symbol) (list symbol) (list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype new-simpleclass->c-vars (-> (parsed-exp) (list symbol)))
(deftype new-simpleclass->i-vars (-> (parsed-exp) (list symbol)))
(deftype new-simpleclass->methdecls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype new-simpleclass->init-exp (-> (parsed-exp) parsed-exp))

(deftype new-class? (-> (parsed-exp) boolean))
(deftype make-new-class (-> (parsed-exp (list symbol) (list symbol) (list (decl parsed-exp)) parsed-exp) parsed-exp))
(deftype new-class->parent-exp (-> (parsed-exp) parsed-exp))
(deftype new-class->c-vars (-> (parsed-exp) (list symbol)))
(deftype new-class->i-vars (-> (parsed-exp) (list symbol)))
(deftype new-class->methdecls (-> (parsed-exp) (list (decl parsed-exp))))
(deftype new-class->init-exp (-> (parsed-exp) parsed-exp))

(deftype new-instance? (-> (parsed-exp) boolean))
(deftype make-new-instance (-> (parsed-exp parsed-exp (list symbol) (list (decl parsed-exp))) parsed-exp))
(deftype new-instance->class-exp (-> (parsed-exp) parsed-exp))
(deftype new-instance->parent-exp (-> (parsed-exp) parsed-exp))
(deftype new-instance->i-vars (-> (parsed-exp) (list symbol)))
(deftype new-instance->methdecls (-> (parsed-exp) (list (decl parsed-exp))))

(deftype abort? (-> (parsed-exp) boolean))
(deftype make-abort (-> (parsed-exp) parsed-exp))
(deftype abort->exp (-> (parsed-exp) parsed-exp))

(deftype letcont? (-> (parsed-exp) boolean))
(deftype make-letcont (-> (symbol parsed-exp) parsed-exp))
(deftype letcont->var (-> (parsed-exp) symbol))
(deftype letcont->body (-> (parsed-exp) parsed-exp))

(deftype callcc? (-> (parsed-exp) boolean))
(deftype make-callcc (-> (parsed-exp) parsed-exp))
(deftype callcc->exp (-> (parsed-exp) parsed-exp))

(deftype coroutine? (-> (parsed-exp) boolean))
(deftype make-coroutine (-> (parsed-exp) parsed-exp))
(deftype coroutine->exp (-> (parsed-exp) parsed-exp))

(deftype wind? (-> (parsed-exp) boolean))
(deftype make-wind (-> (parsed-exp parsed-exp parsed-exp) parsed-exp))
(deftype wind->pre (-> (parsed-exp) parsed-exp))
(deftype wind->body (-> (parsed-exp) parsed-exp))
(deftype wind->post (-> (parsed-exp) parsed-exp))

(deftype sum? (-> (parsed-exp) boolean))
(deftype make-sum (-> (parsed-exp) parsed-exp))
(deftype sum->rands (-> (parsed-exp) parsed-exp))
