Skip to main content

Software > Software Development > IBM REXX Family >

NetRexx

Technical detail

News and enhanced options

The options instruction is used to pass special requests to the language processor (for example, an interpreter or compiler). See [NRL 100].

This section describes new or enhanced option words supported by the NetRexx reference implementation. Unless stated otherwise, these may be used either with an options instruction or as ?flags’ passed to the implementation with a leading ?-’.

comments

Comments from the NetRexx source program will be passed through to the the Java output file (which may be saved with a .java.keep extension by using the -keep command option).

Line comments become Java line comments (introduced by ?//’). Block comments become Java block comments (delimited by ?/*’ and ?*/’), with nested block comments having their delimiters changed to ?(-’ and ?-)’).

compact

Requests that warnings and error messages be displayed in compact form. This format is more easily parsed than the default format, and is intended for use by editing environments.

Each error message is presented as a single line, prefixed with the error token identification enclosed in square brackets. The error token identification comprises three words, with one blank separating the words. The words are: the source file specification, the line number of the error token, the column in which it starts, and its length. For example (all on one line):

  [D:\test\test.nrx 3 8 5] Error: The external name
'class' is a Java reserved word, so would not be
usable from Java programs
Any blanks in the file specification are replaced by a null ('\0') character. Additional words could be added to the error token identification later.
console

Requests that compiler messages be written to console (the default). Use -noconsole to prevent messages being written to the console.

This option must be used only as a compiler option, and applies to all programs being compiled.

decimal

Decimal arithmetic may be used in the program. If nodecimal is specified, the language processor will report operations that use (or, like normal string comparison, might use) decimal arithmetic as an error. This option is intended for performance-critical programs where the overhead of inadvertent use of decimal arithmetic is unacceptable.

explicit

Requires that all local variables must be explicitly declared (by assigning them a type but no value) before assigning any value to them. This option is intended to permit the enforcement of ?house styles’ (but note that the NetRexx compiler always checks for variables which are referenced before their first assignment, and warns of variables which are set but not used).

java

Requests that Java source code be produced by the translator. If nojava is specified, no Java source code will be produced; this can be used to save a little time when checking of a program is required without any compilation or Java code resulting.

savelog

Requests that compiler messages be written to the file NetRexxC.log in the current directory. The messages are also displayed on the console, unless -noconsole is specified.

This option must be used only as a compiler option, and applies to all programs being compiled.

sourcedir

Requests that all .class files be placed in the same directory as the source file from which they are compiled. Other output files are already placed in that directory. Note that using this option will prevent the -run command option from working unless the source directory is the current directory.

strictargs

Requires that method invocations always specify parentheses, even when no arguments are supplied. Also, if strictargs is in effect, method arguments are checked for usage – a warning is given if no reference to the argument is made in the method.

strictimport

Requires that all imported packages and classes be imported explicitly using import instructions. That is, if in effect, there will be no automatic imports, except those related to the package instruction.

This option must be used only as a compiler option, and applies to all programs being compiled.

strictprops

Requires that all properties, including those local to the current class, be qualified in references. That is, if in effect, local properties cannot appear as simple names but must be qualified by this. (or equivalent) or the class name (for static properties).

symbols

Symbol table information (names of local variables, etc.) will be included in any generated .class file. This option is provided to aid the production of classes that are easy to analyse with tools that can understand the symbol table information. The use of this option increases the size of .class files.

trace, traceX

If given as trace, trace1, or trace2, then trace instructions are accepted. The trace output is directed according to the option word: trace1 requests that trace output is written to the standard output stream, trace or trace2 imply that the output should be written to the standard error stream (the default).

If notrace is given, then trace instructions are ignored. The latter can be useful to prevent tracing overheads while leaving trace instructions in a program.

utf8

As of NetRexx 1.1 (July 1997), this option must be used as a compiler option, and applies to all programs being compiled. If present on an options instruction, it is checked and must match the compiler option (this allows processing with or without the utf8 option to be enforced).

Prefixing any of the above with ?no’ turns the selected option off.

The default settings of these options are:

  nocomments nocompact console decimal noexplicit java
nosavelog nosourcedir nostrictargs nostrictimport
nostrictprops nosymbols trace2 noutf8

Supplement to The NetRexx Language by Mike Cowlishaw, mfc@uk.ibm.com (ISBN 0-13-806332-X, 197pp, Prentice-Hall, 1997).

 

 

PreviousTable of contents Next
We're here to help
Easy ways to get the answers you need.
Request a quote
E-mail IBM

or call us at
877-426-3774
Priority code:
104CBW67