bbjcpl - BBj Compiler
Syntax
bbjcpl [-x<ext> | -X] [-d<directory>] [-e<errorlog>]
[-t [-P<prefix>|-c<configFile>] [-W]]
[-r] [-n] [-D] [-s#] [-i#] [--renum] [-p<password>] [-R] [-N] [-F]
[-CP<classpath>] [--verbose]
[-@<filelist>] <file1> <file2> ...
Description
The bbjcpl utility is a program that can compile input as BBj code, outputting updated files or useful analytics. It can process different types of input, including text files, PRO/5 or Visual PRO/5 tokenized code, and BBj tokenized code. It can perform many functions with this input, including converting it to tokenized BBj program files, performing static type checking, checking for syntax errors, removing line numbers, and renumbering files. Because the BBj compiler is more strict than the PRO/5 and Visual PRO/5 compilers, this utility can be used to find syntax errors in PRO/5 and Visual PRO/5 code.
The bbjcpl utility can be used as a pipe (read from stdin, write to stdout). In this mode, any specified type-checking options are ignored.
On Windows, the bbjcplw utility is the same as the bbjcpl utility, but does not create a console window
Parameter |
Description |
BBj Version |
---|---|---|
-? |
Prints a usage summary. |
|
-@<filelist> |
Reads files names from the filelist file, which is a list of filenames delimited by line terminators (line feed, carriage return, or carriage return/line feed). |
BBj 5.0 |
-c<configFile> |
Specifies the configuration file that the static type checker can use. Programs that use custom objects will often contain USE statements that tell the program where to find the definitions of custom objects defined in other files. At runtime, BBj applies the standard prefix algorithm to the filenames in these USE statements in order to resolve the names to files on disk. When using bbjcpl to type check a program, it does not have access to the prefix that will be in effect when the programs are actually run. The static type checker will use the prefix list contained in the <configFile> when resolving the filenames contained in use statements. Since bbjcpl does not have access to the BBj filesystem, it will ignore entries that specify data server syntax. In BBj 17.0 and higher, bbjcpl also retrieves any USE directives from the specified config.bbx file and hands them off to the type system to resolve any unqualified class references. The –c option can only be used in conjunction with –t. The -c option must not be used with the -P option. |
|
-CP<classpath> |
This option causes If this option is not set, |
BBj 10.0 |
-D |
Removes line numbers from the program. If there are statements within the program that reference line numbers, labels will be inserted at the appropriate places. |
BBj 6.0 |
-d<directory> |
Name
of the directory in which to place the output files. If this switch
is used, the output files will have exactly the same names as
the input files. I=SCALL("bbjcpl –d/home/bbj file1 file2 file3") |
|
-e<errorlog> |
Writes the error output into the specified errorlog file. |
|
-F
|
If writing the output file would overwrite the source file, bbjcpl will stop with an error. The -F setting forces overwriting the input file. |
BBj 7.0 |
files |
File(s) to be compiled (BBj program files, PRO/5 program files, Visual PRO/5 program files, or text files).
|
|
-i<interval> |
Specifies the increment interval to be used when assigning line numbers to programs that do not already have line numbers. The default value is 10. |
|
-n |
Renumbers the generated program. If the source file does not include line numbers, bbjcpl 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. See also -s, -i, and --renum. |
|
-N |
Prevents writing out any files. This can be used to check for errors and warnings from the command line without generating any code. See -X and -F. |
BBj 7.0 |
-p<password> |
Generates a protected program, equivalent to saving the program using SAVEP. If the optional password is specified, bbjcpl will act as though a password had been supplied to the SAVEP verb. If a password is not specified, the "unclearable password" will be used. |
BBj 11.0 |
-P<prefix> |
Specifies a prefix to use. Programs that use custom objects will often contain USE statements that tell the program where to find the definitions of custom objects defined in other files. At runtime, BBj applies the standard prefix algorithm to the filenames in these USE statements in order to resolve the names to files on disk. When using bbjcpl to typecheck a program, it does not have access to the prefix that will be in effect when the programs are actually run. Using the -P<prefix> option tells the static type checker to search for files containing custom object class definitions in the directories specified. Enter the directory names separated by semicolons on Windows environments or by colons on UNIX-like environments, similar to the PATH environment variable on the respective platforms. The -P option can only be used in conjunction with -t. The -P option must not be used with the -c option. |
|
-R |
Use recursion when a directory is specified to compile each file found in the specific directory and subdirectories. If used in conjunction with the -d option, all output subdirectories will be automatically created. bbjcpl –R –d/usr/BBx/compiled /usr/BBx/listings |
|
-r |
Removes all REM statements. |
|
--renum |
Causes the renumbering options (-n, -s, -i) to also process renumbering commands embedded in REM statements when adding line numbers to a program that didn't originally include line numbers. |
BBj 19.01 |
-s<line #> |
Specifies a starting line number to use when assigning line numbers to programs that do not have line numbers. The default value is either 10 or the increment value assigned by the -i flag. |
|
-t |
Enables static type checking. After bbjcpl compiles the given programs to output files, it checks the output files and generates a listing of all program lines that contain type check errors. Perform just a type check by combining the options -t-N-X. |
|
--verbose |
Prints debugging information that may be useful in reporting issues to BASIS. |
BBj 10.0 |
-W |
Enables warnings about undeclared code, and must be used in conjunction with the -t option. After compiling the given programs and generating a list of all programs containing type check errors, bbjcpl will also generate a listing of all lines that it could not check because they contained undeclared variables. |
|
-x<extension> |
Appends the specified extension to the file names. |
|
-X |
Keeps the extension of the input files. This allows using the same name for both input and output files, which allows running from either source or compiled versions of files. |
BBj 7.0 |
Example
The following compiles four files to be named file1.bbj, file2.bbj, file3.bbj, and file4.bbj:
LET I=SCALL("bbjcpl file1 file2 file3 file4")
Diagnostics
All error messages contain both the BBj line number and the ASCII file line number. In addition to normal syntax errors, bbjcpl will issue error messages for duplicate labels and duplicate DEF FN names. All error messages are written to stderr.