Object Classes

Author: Jeff Dalton

Object-class syntax

XML syntax

Here is the XML syntax for object-class and related classes.
DOMAIN ::=
   <domain>
      <name>STRING</name>
      <variable-declarations>
         <list>VARIABLE-DECLARATION...</list>
      </variable-declarations>
      <refinements><list>REFINEMENT...</list></refinements>
      <object-classes><list>OBJECT-CLASS...</list></object-classes>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </domain>

OBJECT-CLASS ::=
   <object-class>
      <name>STRING</name>
      <super-class-names><list>SYMBOL...</list></super-class-names>
      <object-properties><list>OBJECT-PROPERTY...</list></object-properties>
      <annotations><map>MAP-ENTRY...</map></annotations>
   </object-class>

OBJECT-PROPERTY ::=
   <object-property
         name="SYMBOL"
         value-class-name="SYMBOL"
         syntax="OBJECT-PROPERTY__SYNTAX">
   </object-property>

OBJECT-PROPERTY$SYNTAX ::= number | symbol | string | list | object | default
An object-class has the following fields:
name string
The class's name.
super-class-names list-of-symbols
A list of the names of the class's immediate superclasses.
properties list-of-object-properties
A list of descriptions of the properties possessed by instances of the class.
An object-property gives a property's name and syntax:
name symbol
A symbol that is being used as a property name in state information of the form property object = value.
value-class-name symbol
Names the class that an object must have to be allowed as the value of this property.
syntax syntax
One of the names listed as a possible "OBJECT-PROPERTY__SYNTAX" above. The aim is to let the value be represented in a reasonably natural way as text. For example, if the syntax is string, the characters in the string are written without enclosing them in double-quotes. list means that the outermost enclosing parentheses (which are often the only parentheses) are omitted. number and symbol are chiefly to indicate how a value that "looks like a number" should be parsed. If the syntax is object, then no special processing is performed and the value must be written in the usual way with quotes around strings, etc. default, which is equivalent to omitting the field, is similar to object but allows a better syntax to be determined by looking at the current world-state at run time.

LTF syntax

A class definition can be written in a domain in LTF (".lsp") syntax as follows:

object-class ::= (object-class class-name supers object-property*)

supers = (class-name*)

object-property ::= (property-name [class-name] [:syntax syntax])

class-name ::= symbol

property-name ::= symbol


Jeff Dalton <J.Dalton@ed.ac.uk>