| iMatix home page
| Libero home page | Libero documentation
| << | < | > | >>
Libero Libero
Version 2.32

Control Variables

Libero supplies various control variables. A control variable affects some aspects of code generation; you set the control variable to tell Libero how to handle something specific for the language you want to generate. Control variables are usually 'write-only'. You don't normally refer to these variables in the code, though you can if you want to. To change a control variable you use the :set command:

$array_base
Specifies the base value for tables. You use this when building an array of values. By default this is 0; in some languages it is more useful to start at 1. The $array_base affects the value of $number in a :do block.
$comma_before
This value is used as $comma when the current item being output is not the last. Default is ",".
$comma_last
This value is used as $comma when the current item being output is the last. Default is empty.
$comment_ind
Comment indicator in schema command lines. Default is '#'.
$module_line
libero looks for single lines that look like this when creating new module stubs. By default: "MODULE %s (void)". The '%s' symbol represents the module name.
$number_fmt
This value is used to format the $number value; numbers are always signed long ints. It must be a valid printf format string. Default is "%ld".
$row_first
This value is used to format the first numeric item in a $row value. It must be a valid printf format string. Default is "%ld".
$row_after
This value is used to format numeric items in a $row value after the first one. It must be a valid printf format string. Default is ",%ld".
$row_clean
Tells Libero to clean-up overflow rows. You get overflow rows when you generate a table that is wider than the $row_width. When $row_clean is 1, Libero removes any non-numeric data from the start of overflow rows. When 0, Libero leaves overflow rows as they are. Default is 0.
$row_null
This value is used in $rows when there is no event defined in a certain state. This is by default 0, but can be set to any numeric value by the schema.
$row_width
Maximum space, in characters, for a $row item in the generated source. Default is the compile-time constant LR_ROW_WIDTH, defined as 60. Rows longer than this are chopped into 'overflow' pieces.
$run_away
If a :do loop does more than this number of iterations, Libero halts it with an error message. Default is the compile-time constant LR_RUNAWAY_LIMIT, defined as 1000. This lets you generate at least a table with the maximum number ofstates, events, or modules (up to 1000 depending on the schema).
$stub_before
Used to generate new module stubs. If this string value is not empty, it is output before each module stub header. By default it is "" (empty).
$stub_between
Used to generate new module stubs: this string value is repeated to build-up a stub header. Default is "*".
$stub_first
Used to generate new module stubs: this string value is output at the start of a stub header line. Default is "/".
$stub_last
Used to generate new module stubs: this string value is output at the end of a stub header line. Default is "/".
$stub_width
Used to generate new module stubs: defines the width of the stub line. Default is the compile-time constant LR_HEADER_WIDTH, defined as 79.

To see the value that a control variable had for code-generation, use the -trace option when you generate code. The .lst file produced shows the symbol table, including all control variables, as code generation ended.


| << | < | > | >>
| Libero Technical Reference | Read-Only Variables | Schema Commands | Syntax Of Expressions | Syntax Of Logical Conditions | Control Variables | Standard :do Conditions | Extra Variables In A :do Loop | General Rules for Code Generation | Generating Module Stubs | Generating COBOL Code | The State Machine Algorithm | Compiled-In Limitations | Quick Reference - Libero Schema Language
iMatix
Copyright © 1996-97 iMatix