rwlprogram

NAME
SYNTAX
DESCRIPTION
SYNTAX
COMMENTS
PRINTVAR
NOTES
COPYRIGHT
SEE ALSO

NAME

rwlprogram − RWP*Load Simulator program syntax

SYNTAX

rwlprogram ::=
  programelement ; { programelement ; }


programelement ::=
  statement
| declaration
| threadexecution
| printvar identifier { , identifier }
| printvar all

DESCRIPTION

An RWP*Load Simulator program consists of a sequence of statements (which include simple declarations), declarations and thread execution commands; all are terminated by a semicolon. Each input file to the rwloadsim executable must be a complete rwl program element and it is strongly recommended that files are named with a .rwl suffix.

SYNTAX

In all syntax diagrams, the following "loose" BNF notation is used:

bold

Anything written in bold are keywords or punctuation.

[ ]

The square brackets are used around optional elements.

{ }

The curly braces means zero or more and are primarily used to show repetition.

( )

The ordinary parentheses are used for grouping.

|

The single bar is used to separate two ore more alternatives.

roman

Text that is not bold refers to another syntax element.

COMMENTS

Comments in rwloadsim programs are anything from # and until the end of the line. To embed a comment within SQL statements or PL/SQL blocks, the appropriate -- or /* must be used.

Inside string constants, # will become part of the string; this includes multi-line string constants.

PRINTVAR

printvar v1,v2, ...
printvar all

The printvar statement is a debugging tool that will cause the declaration and the current value of one or more variables to be output. For procedures and functions, the complete internal p-code will be output in a mnemonic form. If the all keyword is provided, all variables declared by the user will be printed.

Note that printvar is not a statement, so it can only be used directly in your main program; it is typically used at the very end.

NOTES

There is a frequent notation of the "rwl main" program, which is the code that is executed during parsing of the provided rwl source files. For the simple statements, these are executed as soon as they are parsed. Procedures (and functions) are parsed and saved ready for execution, and will similarly be executed directly if they are called as part of the main program. Any compound statement is internally compiled and saved as if it were a procedure, and is executed as soon as the terminating end of that compound statement has been parsed.

In addition to this "main program", threads can be started using the program element starting with the run keyword.

Although rwloadsim does have the typical elements from ordinary programming languages, scan, parse and execute, the latter are combined into one and there is no concept of "linking" known from e.g. C. This is somewhat similar to writing shell scripts, where functions can be compiled and executed separately, but where other command lines are executed as soon as they are read from the script file.

Since the scan and parse in rwloadsim is done using flex(1) and bison(1) respectively, there is a strict separation between keywords and identifiers.

The rwloadsim programming language is case sensitive except during scan for SQL or PL/SQL.

COPYRIGHT

Copyright © 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

SEE ALSO

simpledeclaration(1rwl), statement(1rwl), declaration(1rwl), threadexecution(1rwl), sqldeclaration(1rwl)