Syntax guidelines

Pedro Szekely ([email protected])
Thu, 22 Dec 1994 08:58:29 PST

Hi,

Here are some guidelines for the model syntax.

The files containing ascii versions of the model have extension mtf
(Mastermind Text Format). We cannot use mif because that extension is
already used by framemaker.

- Each object is defined within {}.
- The first word after the { is the name of the interface in IDL.
- After the name come attribute value pairs
. The name of the attribute should be the same as the name in the model (IDL)
. Attributes that have collection values have the values enclodes in ()
. If an attribute has a collection as a value, and the add method is called
add_xxx,
then the name of the attribute in the syntax should be xxx
- Each object has a unique ID in the syntax file, so that it can be
refered to by other obejcts. References use the syntactic marker @
(sse example of grids below).
. I am assuming that the program that saves models to files assigns ID
numbers to all internal objects that need to be saved in a file.

Open issues.
- How to refer to object defined in other files.
One possibility is as follows:
- Top level objects can have a name attribute.
- Top level objects can be refered to with @name-of-object (see
example with button below).

Here is an example.

{Template
ID 1000
guides
(
{Guide
ID 1001
direction VERTICAL
position 50
margin-1 4
margin-2 3}
{Guide
ID 1002
direction VERTICAL
position 290
margin-1 0
margin-2 6}
)
grids
(
{Grid
direction HORIZONTAL
stretchable FALSE
distance 50
start @1001
end @1002}
)
parts
(
{Template
ID 1003}
{Template
ID 1004}
{@button
}
)}

I think all model components can be written out in a syntax like this one. It
is a bit verbose, but easy to understand, easy to parse and easy to generate.

Comments?

Pedro Szekely
USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292
Phone: 310/822-1511, Fax: 310/823-6714
URL: http://www.isi.edu/isd/HUMANOID-HOME.html