pro5cpl - PRO/5 Compiler

Syntax

pro5cpl {-?} {-d<directory>} {-e<errorlog>} {files} {-i<line #>} {-k} {-l}
{-m<buffersize>} {-r} {-s<line #>} {-x<extension>}

Description

The pro5cpl utility is a stand-alone program that turns ASCII text files into tokenized PRO/5 program files. The main advantage of pro5cpl is its speed. Program generators benefit from using pro5cpl as opposed to the slower CPL() function found in PRO/5.

Parameter

Description

-?

Provides a syntax listing.

-d<directory>

Name of the directory in which to place the output files. If this switch is used, the output files have exactly the same names as the input files but are in a different directory.

I=SCALL("pro5cpl -d/usr/BBx file1 file2 file3")

-e<errorlog>

Writes the error output into an errorlog file.

files

ASCII string text source files to be compiled.

  • If no file names are specified, pro5cpl will read from standard input and write to standard output. This allows it to be used with pipes.

  • If file names do not include extensions, upon compilation, .BBx will be appended to them.

  • If file names already include extensions, upon compilation, they will be stripped from the file name.

  • A source file may or may not contain line numbers. If the first line does not contain a line number, then pro5cpl will automatically assign line numbers as it compiles. In this mode, any line beginning with a line number, or any reference to a line number, will be flagged as an error. A source file with no line numbers should use labels for all line references.

-i<line #>

Specifies the increment interval to be used when assigning line numbers to programs that do not already have line numbers. Default: 10

-k

Forces all PRO/5 verbs to be reserved keywords. This serves two purposes: First, it helps ensure that the choice of variable names is reduced. Second, it removes the requirement that an IF statement be followed with a THEN statements

-l

Converts all line label references to line number references. This switch should not be used with programs greater than 64K.

-m<buffersize>

Kilobytes of RAM to be allocated for program size. The default is 64. It may contain any value from 1 to 1024.

-r

Removes all REM statements, including those used as copyright statements.

-s<line #>

Specifies a starting line number to use when assigning line numbers to programs that do not have line numbers. Default: Increment interval.

-x<extension>

Appends the extension to the file name.

The pro5cpl utility uses a bottom-up parser, which is different from the parser found in PRO/5. Because of the difference in parsers, the following, although legal in PRO/5, are not legal in pro5cpl:

  • Non-verb and non-function keywords are illegal as variable names. This includes keywords such as THEN, ELSE, and STEP. Verb names and most function names may be used as variable names when there is no ambiguity.

  • PRO/5 functions that take no argument, such as DAY, TIM, and ERR, may not be used as variable names.

  • I/O options, such as DOM and IND, are legal as variable names but should be avoided because they may be ambiguous in some contexts.

  • IF statements that are not followed by THEN statements (unless the -k option is invoked).

Example

The following compiles four files to be named file1.BBx, file2.BBx, file3.BBx, and file4.BBx:

LET I=SCALL("pro5cpl file1 file2 file3 file4")

Diagnostics

All error messages contain both the PRO/5 line number as well as the ASCII file line number. In addition to normal syntax errors, pro5cpl will issue error messages for duplicate labels and duplicate DEF FN names. All error messages are written to STDERR.

See Also

Alphabetical Utilities

Functional Listing of Utilities