EMS Manual

Compiled Filters
EMS Manual426909-005
5-44
The Filter Compiler
Example
This filter executes the compound statement only if the application actually passed the
MY^TKN^STIME parameter token to the distributor:
[ #DEF myssid STRUCT LIKE ZSPI^DDL^SSID; ]
[ #SET myssid [myorg].[mynum].[myver] ]
FILTER ptest( SSID ( myssid, MY^TKN^STIME ) OPTIONAL );
BEGIN
IF TOKENPRESENT ( MY^TKN^STIME) THEN
BEGIN
.
.
.
END;
END;
The Filter Compiler
This subsection describes how to compile a filter specification. It describes the EMF
(Event Management Service filter) language compilation command, compiler
directives, format of compiler input and output, compiler errors, and compiler
completion-codes.
The compiler generates a filter object program, which can be loaded later by operator
or program into a collector or distributor.
For an introduction to the filter language and the filter compiler used by compiled filters,
see Writing and Compiling Filters on page 5-1. This subsection and The Filter
Language on page 5-7 cover these topics in more detail.
Compiler Input and Output
The filter compiler reads language text from an EDIT file that contains a filter
specification or accepts statements interactively from a terminal.
TACL is used as a preprocessor of the language source text. Therefore, any text that is
input to the compiler (filter statements or compiler directives) is interpreted first by
TACL and must therefore be acceptable to TACL. This leads to some restrictions on
the usage of characters that are special to TACL as follows.
Follow TACL rules if you use TACL special characters in the way TACL expects, such
as using brackets ([]) to request macro expansion. For information on using TACL
special characters in other ways, see Escape Character (~) on page 5-9.
TACL expands text enclosed in brackets ([]) before the filter compiler sees it.
Note. Because of the interface of the filter language to TACL, symbolic names in this section
are in TACL form, using circumflex (^) symbols rather than hyphens.