New Presentation Model

Kurt Stirewalt ([email protected])
Fri, 14 Apr 1995 09:09:06 -0400

Hello Pedro -

Per your suggestions I have modified the presentation model to be
recognized by the new mrl parser. It's included below. Please give it a look
to see if I made any semantic errors in the transcription. Thanks.

-- kurt.

8X---------------------- Cut Here -------------------------X8

// Conventions:
// - lowercase for attribute names.
// - capitalized for object types, enums and enum values.
// - if two objects have an attribute of the same name,
// use the object symbol in one of them as prefix.

//
// ENUMERATION SYMBOLS
//

/*
Left = s->get_name_symbol ("Left");
Top = s->get_name_symbol ("Top");
*/

Enum Direction {
Horizontal "...",
Vertical "..."
};

Object Expression;

Object Guide {
attribute direction : Direction;
attribute position : Float;
attribute margin1 : Float;
attribute margin2 : Float;
};

Object Magnitude {
attribute value : Float;
};

Object Parameter {
// What should value be, an Any or what?
attribute value : Any;
};

Object Exception {
// Attribute symbols used in objects Generic and Grid respectively.
attribute exception_index : Long;
attribute exception_distance : Float;
};

Object Grid {
attribute direction : Direction;
attribute distance : Float;
attribute num_lines : Long;
attribute start : Float;
attribute end : Float;
attribute stretchable : Bool;
part attribute exceptions : Collection<Exception>;
};

// Forward declaration to resolve cyclic dependence.
Object Replication;
Object Presentation;
Object Conditional;

Object Reference {
// Eventually, instead of having two slots, have multiple types.
attribute grid_reference : Grid;
attribute replication_reference : Replication;
attribute end_condition : Expression; // Here type is Bool
attribute init_procedure : Expression; // Here type is None
// stands for void.
};

// Replications

Object Replication {
// Not sure that repl data should be declared this way.
attribute replication_data : Parameter;
part attribute references : Collection<Reference> ;
attribute anchor : Presentation;
part attribute generics : Collection<Presentation> ;
attribute on_demand : Bool;
};

//
// OBJECT AND ATTRIBUTE SYMBOLS
//

Object Presentation "..." {
attribute x_origin : Float "X of coordinates origin";
attribute y_origin : Float "Y of coordinates origin";
part attribute guides : Collection<Guide> "blahblah";

part attribute magnitudes : Collection<Magnitude>;

part attribute parameters : Collection<Parameter> ;
part attribute grids : Collection<Grid>;
part attribute parts : Collection<Presentation> ;
attribute replication :Replication;

// I've defined conditionals as a collection of collections (of
// conditionals) instead of a more complex tree. So, basically
// "parallel" conditionals will only happen at top-level.
// Note that type specifications don't have more than two levels (primary and
// secondary type). Should we support more (i.e. specify that the
// Object_Type elements are actually of type_object Conditional)?
part attribute conditional : Collection<Collection<Conditional>>;

plays_role inherits (guides);
};

Object Generic {
attribute index : Long;
// Attribute symbol already used (in object Conditional).
attribute generic_condition : Expression; // Here type is Bool
};

Object Case {
attribute where : Presentation;
attribute specification : Presentation;
};

// Conditionals

Object Conditional {
attribute condition : Expression; // Here type is Bool
part attribute cases : Collection<Case> ;
};