|
|---|
|
Domain Modeling Language (DML) Reference Manual |
|
| DML Grammar in BNF Format | ||||
Simplified English translation
| ||||
| DML Schema Format | ||||
|
A schema specifies a concrete DML attribute tree by specifying key names, attribute value types, and the allowed number of attribute instances. Conveniently, DML schemas can be written using the DML syntax, where an attribute's value type and number of instances are represented by a formatting expression embedded in the DML Value of String type. A value type is expressed in a microlanguage whose syntax is:
Notes: A keypath uniquely identifies an attribute in a schema tree (either internal or leaf) by a sequence of dot-separated keynames along the path from the root to the attribute. This is analogous to filesystem pathnames on Unix machines. %[SFI]count (String, Float, Integer) specify leaf attribute value type and number of instances. %Scount:regexp uses regular expression matching to restrict strings that may be values of a leaf attribute. Warning: This feature is currently not supported. %Tcount:keypath specifies a substitution of value by the content of another schema. This allows to specify the count of non-leaf attributes. count
Examples: Reserved attribute names
When present in an internal attribute, the keypath points to another dml tuple that contains the schema for that internal attribute. Used by Schema Checker for validation.
When present in an internal attribute, is replaced by the last attribute specified in the keypath (has-a relation).
When present in an internal attribute, makes this attribute inherit all attributes contained in the attribute pointed to by keypath (is-a relation). See how these directives are used in the examples below. Attribute ordering in a tupleThe order of different-name attributes is insignificant, but the order of same-name attributes is significant and tools should preserve it. So, for example, when you write:
the order of ProtocolSession attributes in a host configuration database can be used to determine the order of protocol initialization during the model instantiation phase, as initialization of a higher protocol may depend on the completion of a lower protocol initialization. In SSFNet, when the simulation starts, the protocols are initialized in the reverse order of their appearance in the graph attribute, thus assuring that ip is initialized first, followed by tcp, socket, and server, in this order. | ||||
| DML Schema Checker | ||||
|
The DML package includes a schema checker that validates the
syntactic correctness of an attribute whenever the attribute
specifies a Example: DML schema file
Example: DML database fragment in a model configuration file:
In the above example, the Schema Checker will consult the schema .dictionary.schemas.machinespecs to evaluate the syntactic correctness of this particular instance of the attribute machinespecs when it is loaded during model instantiation. Note that the toplevel attribute dictionary specifies no schema (i.e., a deliberate polymorphism) so this will not cause an error when loaded against the previous schema file, which also contains a toplevel attribute dictionary with entirely different subtree. | ||||
| Inline attribute substitution | ||||
|
Attribute _find keypath is used for in-line substitution of the attribute referred to in keypath. There may be arbitrarily many instances of _find in an attribute. Note that the Example: DML database fragment that uses both previous dictionaries:
Therefore, upon the expansion of the value of _find, the last example is equivalent to
A word of warning: if any of the keys in the keypath used as the value of _find had multiple instances, _find would expand to the enumeration of values of all instances of the terminal attribute, which would be an error in this example, because machinespecs must have exactly one instance. | ||||
| DML Inheritance Semantics | ||||
|
The attribute _extends keypath implements multiple inheritance with strict ordering. It is easiest to explain by examples. The DML code may use _extends multiple times per attribute, and keys in the extended attribute may overlap with keys in the extending attribute. Order of same-name attributes is the same as that defined by _find, i.e., the imported attributes appear as if they had been defined directly at the position of _extends. For example, given:
the attribute x is equivalent to (note the ordering):
And the Java DML query find(".x.y") will return the enumeration {foo,bar,baz,splat}. One can also write multiple-inheritance configurations, like this example:
where now the attribute tank is equivalent to:
And the DML query (in Java) find(".tank.serial_number") will return the enumeration {1234,5678}.
Last updated October 14, 1999. |