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


3.2 Time objects

All of Libmarpa’s major classes, except the configuration class, are “time” classes. Except for objects in the grammar class, all time objects are created from another time object. Each time object is 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 number determined by memory or some other machine-determined limit.

Every time object has a base grammar. A grammar object is its own base grammar. The base grammar of a recognizer is the grammar 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.