The text of the component driver is processed by Processor Expert macroprocessor. This is special macroprocessor designed for this kind of component drivers. The macroprocessor supports:
Macro is an identifier that holds any value. Identifier of a macro can contain characters: a..z, A..Z, 0..9, _ and cannot start with a digit. The value can be string or number. If macro value is a number or a string, the macro identifier can be directly replaced by its value in the driver text.
%{def_name}, %'{def_name}', %"{def_name}", %~{def_name}~ will be replaced by its value.
Example:
%define MyMacro local_value
MyMacro=%MyMacro
MyMacro=%'MyMacro'_3333
After processing by macroprocessor the result will be:
MyMacro=local_value
MyMacro=local_value_3333
There are several types of macros:
Command starts with character % as a first non-space character on line. The command ends at the end of line.
A source file may be a driver ( *.DRV), TST or TS2 script file and CHG script file. Source file is processed by Processor Expert macro-processor to validate component settings or generate code.
Processor Expert defines the following symbols (macros) prior to script execution:
Symbol small/capital letters are distinguished; however, two identical symbols differing only by a small/capital letter in the symbol name cannot be used due to the backward compatibility. The driver-defined symbol names are subject to the conventions described herein.
Methods
Symbols determining generating methods match method names; if pre-defined, the user will require the method in the source code, otherwise, the method will not be required. Method name small/capital letters are distinguished and included in the description. The symbol values correspond to method user names or match the method symbols unless method renaming has been opted by the user.
If the target language does not support identical method names in different modules (or the object approach), a method name will be created as %'ModuleName'_MethodName. The "_" character positioned between the module name and method is defined using "%." macro and depends on the compiler.
Events
Symbols determining handling the events in question match event names. If pre-defined, the user will require event handling in the source code, where the symbol value will correspond the name of the procedure to be executed at each event.
This chapter consists of the following topics: