A few new semantics

This commit is contained in:
waldemar%netscape.com 2001-02-09 05:00:28 +00:00
parent af4f6480ae
commit c1f0f50f76

View File

@ -99,6 +99,7 @@
(%subsection :semantics "Slots") (%subsection :semantics "Slots")
(deftype slot (tuple (deftype slot (tuple
(id id) (id id)
(type class)
(v (address value)))) (v (address value))))
(define (find-slot (id id) (slots (vector slot))) slot (define (find-slot (id id) (slots (vector slot))) slot
@ -112,7 +113,7 @@
(%subsection :semantics "Properties") (%subsection :semantics "Properties")
(deftype property (tuple (deftype property (tuple
(name property-name) (name qualified-name)
(getter accessor) (getter accessor)
(setter accessor) (setter accessor)
(fixed boolean) (fixed boolean)
@ -120,27 +121,19 @@
(deletable boolean))) (deletable boolean)))
(deftype property-opt (oneof no-prop (prop property))) (deftype property-opt (oneof no-prop (prop property)))
(deftype property-name (tuple (namespace namespace) (name string))) (deftype qualified-name (tuple (namespace namespace) (name string)))
(define (same-property-name (m property-name) (n property-name)) boolean (define (same-qualified-name (m qualified-name) (n qualified-name)) boolean
(and (id= (& id (& namespace m)) (& id (& namespace n))) (and (id= (& id (& namespace m)) (& id (& namespace n)))
(string-equal (& name m) (& name n)))) (string-equal (& name m) (& name n))))
(define (find-property (n property-name) (properties (vector property))) (vector property) (define (find-property (n qualified-name) (properties (vector property))) (vector property)
(map properties p p (same-property-name n (& name p)))) (map properties p p (same-qualified-name n (& name p))))
#|
(if (empty properties)
(oneof no-prop)
(let ((p property (nth properties 0)))
(if (same-property-name n (& name p))
(oneof prop p)
(find-property n (subseq properties 1))))))|#
(%subsection :semantics "Accessors") (%subsection :semantics "Accessors")
(deftype accessor (tuple (deftype accessor (tuple
(self-type class) (self-type class)
(slot-type class)
(final boolean) (final boolean)
(data accessor-data))) (data accessor-data)))
@ -150,7 +143,7 @@
(constant value) (constant value)
(slot-id id) (slot-id id)
(indirect value) (indirect value)
(alias property-name))) (alias qualified-name)))
(%subsection :semantics "Operators") (%subsection :semantics "Operators")
@ -204,7 +197,21 @@
(user value))) (user value)))
(%subsection :semantics "Environments")
(deftype static-env (tuple
(labels (vector string))
(can-return boolean)
(constants (vector definition))))
(deftype dynamic-env (tuple
(parent dynamic-env-opt)
(definitions (vector definition))))
(deftype dynamic-env-opt (oneof no-frame (frame dynamic-env)))
(deftype definition (tuple
(name qualified-name)
(getter accessor)
(setter accessor)))
(%section "Expressions") (%section "Expressions")
(grammar-argument :beta allow-in no-in) (grammar-argument :beta allow-in no-in)