next up previous top
Next: Variant
Up: Component Implementation
Previous: Component Implementation

Primitive Implementation

Description

The implementation of a component describes how it is constructed. A primitive implementation describes a component that is implemented by some source document that is external to UniCon (e.g., source code of a programming language, scripts of commands for an operating system shell, or data in a file in the file system).

The implementation of a primitive component consists of a list of implementation variants. A variant is simply an alternative implementation. If a component has more than one variant defined in its primitive implementation, the specific variant to be used during system construction can be selected using the Variant property when the component is instantiated. A variant definition consists of a name, a pointer to a file in the operating system containing the source document that implements it, and (optionally) properties that further specify the variant. Below is an example of a primitive component implementation in UniCon. Assume that it is from the UniCon definition of a stack component. The source document referenced in the variant is a file containing C source code that implements a stack abstract data type:

  IMPLEMENTATION IS
    VARIANT stack IN "stack.c"
      IMPLTYPE (Source)
    END stack
  END IMPLEMENTATION
NOTE: It is important to note that the UniCon compiler does not check that the source document is consistent with the component definition. For example, if there exists a player of type RoutineDef named "push" in the interface of the component, the UniCon compiler does not open up the file "stack.c" to check that there is a function definition named push defined in the source code. Consistency between the source document implementing a component and the component's interface is the responsibility of the system designer.

Syntax

The following is the syntax for a primitive implementation in UniCon:

  <primitive_implementation> :==
    IMPLEMENTATION IS
      <property_list>
      <variant_list>
    END IMPLEMENTATION
<variant> :== VARIANT <identifier> IN "<filespec>" <property_list> END <identifier>
<filespec> :== a Unix filename, optionally prepended with a path (e.g., /usr/gz/src/stack.c)

Properties

The only property that can be legally included in the <primitive_implementation> property list is the InitActuals property:

The syntax for an InitActuals property in a component implementation is a single <identifier> or "string" surrounded by parentheses:

INITACTUALS ("-f")
The following properties can be legally included in the <variant> property list:

The syntax for a BuildOption property in a variant is a list of items that are either <identifier>s or "string"s surrounded by parentheses:

BUILDOPTION ("+define=DEBUG_OPTION")
BUILDOPTION ("+define=ONE", "+gnu", "+cc=gcc")
The syntax for an ImplType property in a variant is a single
<identifier> or "string" surrounded by parentheses:

IMPLTYPE ("source")
IMPLTYPE (source)

If this property is omitted from the property list of a variant, the following default property is assumed:

IMPLTYPE (source)
The syntax for an InitActuals property in a variant is a single <identifier> or "string" surrounded by parentheses:

INITACTUALS ("-f")

next up previous top
Next: Variant
Up: Component Implementation
Previous: Component Implementation

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996