next up previous top
Next: Composite Implementation
Up: Primitive Implementation
Previous: Primitive Implementation

Variant

Description

A variant is simply an alternative implementation in a primitive implementation of a component. It 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. The name of a variant is significant if there are multiple variants in a primitive implementation. The specific variant to be used during system construction can be selected using the Variant property in an instantiation of the component. The <filespec> in a variant is the specification of the path to the file in the file system that contains the component's implementation. It contains the name of the file, and (optionally) the path specification. The path specification, if present, can be a relative path or an absolute path. The following are examples of legal <filespec>s for a file named stack.c:

  stack.c
  /usr/gz/src/stack.c
  ../../../src/stack.c
Typically, the system designer will specify the ImplType property in the <variant> property list. By default, if this property is not specified, the UniCon compiler assumes that the implementation type of the file named in the <filespec> is Source.

Syntax

The following is the syntax for a variant in UniCon:

  <variant> :==  
    VARIANT <identifier> IN "<filespec>"
      <property_list>
    END <identifier>
<filespec> :== a Unix filename, optionally prepended with a path

Properties

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: Composite Implementation
Up: Primitive Implementation
Previous: Primitive Implementation

Comments? Mail the current maintainer of this page.

Author: Gregory Zelesnik

Last Modified: May 12, 1996