IBM
Contents Index Previous Next



Syntax of Monitor Commands


The monitor system waits for commands from the user by issuing the following prompt:

Command :

The syntax to be used for the commands and their parameters are described in the following.

Command Names

A command name may be abbreviated by giving sufficient characters to distinguish it from other command names. A special character, the hyphen (-), is used to separate command names into distinct parts. Any part may be abbreviated as long as the command name does not become ambiguous.

Consider, as an example, the command name List-Process. The command name may be typed List-P or L-P. However, if only List is typed, the monitor system will respond with the message

Command was ambiguous, it might be an abbreviation 
of:

followed by a list of all commands starting with "List," since the command cannot be distinguished from, for example, the commands List-Ready-Queue and List-Timer.

There is no distinction made between upper and lower case letters when matching command names.

Parameters

Command parameters are separated by one or several spaces, carriage returns or tabs. A colon is also accepted between a process name and an instance number, when a PId value is required. If the parameter list following a command name is not complete the interactive monitor system will ask for the missing parameters by prompting with the type of the expected parameters.

Parameters may be abbreviated as long as the parameter value does not become ambiguous. There is no distinction made between upper and lower case letters.

Note:

The SDL keywords Sender, Parent, Self and Offspring may not be abbreviated.

Underscores in SDL Names

Command parameters that are SDL names may also be abbreviated, as long as the abbreviation is unique. The underscore character `_' is used to separate names into distinct parts in the same way as the hyphen character (-) is used with command names. If a name is equal to the first part of another name, as for example Wait and Wait_For_Me, then any abbreviation of Wait is ambiguous. However, if all characters of the shorter name are given (Wait in this example), this is considered as an exact match and the short name will be selected.

The abbreviation facility means that the introduction of underscores in SDL names simplifies simulation. If, for example, you were considering if two signals should be named GenerateOn and GenerateOff or if they should be named Generate_On and Generate_Off, the last alternative is preferable for simulations, as the abbreviations G_On and G_Off are likely to be unique.

Matching of Parameters

When a (possibly abbreviated) parameter name is entered and is to be matched with an unabbreviated name, only names in the entity class of interest are considered. That is, if the monitor expects a process name as parameter, only the names denoting process types will be part of the search for the full name.

Signal names and timer names are in the same entity class; process formal parameters and process variables are in the same entity class; each other type of name (process, procedure, state, block,...) is in an entity class of its own.

Knowledge of previous parameters is used to narrow the search for a given parameter name. Consider for example the command Output-Via, which takes two parameters, a signal and a channel. The channel name is then only searched for among the channels the given signal can be sent via.

Qualifiers

Names can still cause problems, if, for example, there are two process types with the same name in two different blocks, or if the system and a block contain signal definitions with the same name.

In the first situation the process name will always be ambiguous and in the second case the system's signal will always be used. To solve cases like this, qualifiers with the same syntax as in SDL can be used. To reach a process P defined in block B in system S, the following notations can be used:

System S / Block B P
<<System S / Block B>> P

The words "system," "block," "process," "procedure," and "substructure" in the qualifier may not be abbreviated, while all names of, for example, blocks and processes may be abbreviated according to the usual rules. It is only necessary to give those parts of the qualifier that make the qualifier path unique (this is an extension of the qualifier concept in SDL). The slash ( / ) in a qualifier may be omitted and replaced by one or more spaces. The angle brackets that are part of the qualifier when printed may be omitted when entering the qualifier.

Default Parameters

Some command parameters may be omitted, indicating a default value for the parameter. To accept a default parameter value at the prompt, just press <Return>.

If the parameter is given on the same line as the command name and/or other parameters, type a hyphen `-' to indicate a default parameter value.

Example 324 : Default Parameters in Simulator Command

Consider as an example the command Breakpoint-Transition, which takes at least eight parameters. To specify default values for all parameters, except the first and fourth parameter:

Breakpoint-Transition P - - State1 - - - -

Signal and Timer Parameters

When the parameters of a signal instance or a timer instance are to be entered, the interactive monitor system will ask for the parameters one by one, in the same way as for command parameters. The parameters can also be entered directly after the signal or timer name, possibly enclosed by parenthesis.

Example 325 : Signal and Timer Parameters in Simulator Command

Signal name : S
Parameter 1 (Integer) : 3
Parameter 2 (Boolean) : true

The same specification could also be given as:

Signal name : S 3 true

or as:

Signal name : S (3 true)

When entering signal parameters it is not necessary to give all parameter values. By entering `-' at the parameter's position, the parameter is given a "null" value (i.e. the computer's memory for the value is set to 0). By entering `)', the rest of the parameters are given "null" values.

Example 326 : Signal Parameters in Simulator Command

Signal name : S -, true

will give the first parameter a "null" value.

Signal name : S (3, -)

will give the second parameter a "null" value. Could also be given as:

Signal name : S (3)

Errors in Commands

If an error in a command name or in one of its parameters is detected, an error message is printed and the execution of the command is interrupted, that is, a command is either executed completely or not at all. On UNIX, this is the only way to cancel a command that has been entered, when not using the simulator's graphical user interface.

Context-Sensitive Help

By typing a question mark (`?'), a context-sensitive help is obtained. The monitor will respond to a `?' by giving a list of all allowed values at the current position, or by a type name, when it is not suitable to enumerate the values. After the presentation of the list, the input can be continued.

If no default value exists for the requested parameter, the list of all allowed values is also printed if the user simply presses <Return> at the prompt. In these cases, there is no need to type `?'.


http://www.ibm.com/rational
Contents Index Previous Next