...
Code Block |
---|
;; Given (define-struct add (mleft nright)) (define-struct sub (mleft nright)) (define-struct mul (mleft nright)) (define-struct div (mleft nright)) ;; an Arithmetic-Expression (AExp) is either: ;; - a number ; ;; - (make-add ml nr) where m,n are AExps; ;; - (make-sub ml nr) where m,n are AExps; ;; - (make-mul ml nr) where m,n are AExps; or ;; - (make-div ml nr) where m,n are AExps, |
Using this data definition, the arithmetic expression above corresponds to the structure ae1
defined by
...