Next: SeqFile
Up: Component Type
Previous: SharedData
Filter
Semantics
The component type Filter is intended to capture the semantics of Unix filters. A Unix filter is a self-contained process in the Unix environment that reads input from the standard input port of the process, performs some type of computation, and writes output to the standard output port. A filter may start generating output before all of the input is consumed. It may also generate warning or error messages to the standard error port. A Unix filter does not interact with any other human, process, or file system entity in any other way.
The type Filter is a departure from the previous three types we've already seen: Module, Computation, and SharedData. Whereas these three types describe compilation units developed in some programming language, Filter describes a process in the Unix environment.
Player types
Players of the following types can be legally exposed in the interface of a component of type Filter:
- data arriving as an input stream at a port in a Unix filter
- data exiting as an output stream from a port in a Unix filter
Properties
The following properties can be legally included in the property list of a component of type Filter. Properties legal in an <interface> property list have a C in parentheses after the property name; those legal in an <instantiation> property list have an I:
- The syntax for an InstFormals property in a component of type Filter is a comma-separated list of <parameter>s enclosed in parentheses. A <parameter> consists of an <identifier>, followed by a `=', followed by a <complex string> or the language keyword NODEFAULT. A <complex string> is a simple "string" or a sequence of "string"s concatenated by the `&' character:
- INSTFORMALS (first_parameter = "an initial value",
second_parameter = "a much" &
"longer initial value that " &
"will not fit on one line",
third_parameter = NODEFAULT)
- The syntax for a Variant property in a component of type Filter is a single <identifier> or "string" surrounded by parentheses:
- VARIANT (a_variant_name)
VARIANT ("a variant name")
- The syntax for a Processor property in a component of type Filter is a single <identifier> or "string" surrounded by parentheses:
- PROCESSOR (a_processor_name)
PROCESSOR ("a.processor.name")
Semantic Checks
No special semantic checks are made for components of type Filter.
Implementation Considerations
A Filter component is implemented as a program, containing a "main" function, that performs input and output via the ports of the Unix process that is created for the program at run-time.
All ports that the filter will read from and write to are assumed to be already open at process creation time. This means that if, for example, the program assumes that there will be input on port 4, then port 4 will already have been opened for input by the time the first line of code in the program is executed.
Next: SeqFile
Up: Component Type
Previous: SharedData
Comments?
Mail the current maintainer of this page.
Author:
Gregory Zelesnik
Last Modified: May 12, 1996