Next: , Previous: , Up: Architecture   [Contents][Index]


6.2 Time objects

All of Libmarpa’s major classes, except the configuration class, are time classes. An object in a time class is a time object. Except for objects in the grammar class, all time objects are created from a time object of the class before it in the sequence. A recognizer cannot be created without a precomputed grammar; a bocage cannot be created without a recognizer; and so on.

When one time object is used to create a second time object, the first time object is the parent object and the second time object is the child object. For example, when a bocage is created from a recognizer, the recognizer is the parent object, and the bocage is the child object.

Grammars have no parent object. Every other time object has exactly one parent object. Value objects have no child objects. All other time objects can have any number of children, from zero up to a maximum determined by memory availability or some other environment limit.

An object is the ancestor of another object if it is the parent of that object, or if it is the parent of an ancestor of that object. An object is the descendant of another object if it is the child of that object, or if it is the child of an descendant of that object. The following three statements are mutually exclusive:

It follows from the definitions of “parent” and “ancestor” that, for any time object class, an object can have at most one ancestor of that class. On the other hand, if an object has descendants in a class, there can be many of them.

An object is a base of another object, if it is that object, or if it is the ancestor of the object. For each time object class, an object has at most one base object. For example, a recognizer is its own base recognizer, and has exactly one base grammar.

The base grammar of a time object is of special importance. Every time object has a base grammar. A grammar object is its own base grammar. The base grammar of a recognizer is its parent grammar, the one that it was created with. The base grammar of any other time object is the base grammar of its parent object. For example, the base grammar of a bocage is the base grammar of the recognizer that it was created with.


Next: , Previous: , Up: Architecture   [Contents][Index]