bbjcpl - BBj Compiler

Syntax

bbjcpl [-x<ext> | -X] [-d<directory>] [-e<errorlog>] [-t [-P<prefix>|-c<config.bbx>] [-W]]
[-r] [-n] [-D] [-s#] [-i#] [-p<password>] [-R] [-N] [-F] [-CP<classpath>] [--verbose]
[-@<flist>] <file1> <file2> ...

Description

For Windows-specific information, see bbjcplw - BBj Compiler (Windows Only).

The bbjcpl utility is a stand-alone program that turns ASCII text files into tokenized BBj program files.

If a password is specified, it will be used as the SAVEP password. Otherwise the "unclearable password" will be used.

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.

 

Parameter

Description

-?

Prints a usage summary.

-@<filelist>

In BBj 5.0 and higher, 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).

-c

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 affect when the programs are actually run.

Using the –c<configFile> option specifies a configuration file that the static type checker can use. 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; -c option must not be used with the –P option.

-CP<classpath>

In BBj 10.0 and higher, use this option causes bbjcpl to use the session-specific classpath associated with <classpath> name. This allows bbjcpl to type-check programs that refer to Java classes from jar files in a session-specific classpath. If this option is not set, bbjcpl will use the default session classpath. See Session-specific Classpath.

-D

In BBj 6.0 and higher, removes line numbers from the program. If statements within the program contain references to line numbers, labels will be inserted at the appropriate places.

-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 an errorlog file.

-F

 

In BBj 7.0 and higher, if writing the output file would overwrite the source file, bbjcpl will stop with an error. The -F setting forces overwriting the input file.

Files

File(s) to be compiled (BBj program files, BBx program files, or ASCII source files).

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

If an input file does not have an extension, the corresponding output file will have an extension of .bbj.

  • If an input file has an extension, the corresponding output file will be created without an extension.

  • A source file may or may not contain line numbers. If the –n flag was specified and the first line of the source file does not have a line number, 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.

-i<line #>

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, they will be created. See also –s and –i.

-N

In BBj 7.0 and higher, this parameter causes bbjcpl to avoid writing out any files. This can be used to check for errors and/or warnings from the command line without generating any code. See –X and –F.

-p<password>

In BBj 11.0 and higher, this parameter causes bbjcpl to generate 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. See SAVEP - BBj.

-P

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 affect when the programs are actually run.

Using the –P<directory list> option tells the static type checker to search for files containing custom object class definitions in the directories specified. Enter the directory names separated with semicolons on Windows environments or by colons on UNIX-like environments, similar to the PATH environment variable on the respective

The P option can only be used in conjunction with t; -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.

-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 (-i).

-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

In BBj 10.0 and higher, causes  bbjcpl to print debugging information that may be useful in reporting issues to BASIS.

-W

Enables warnings about undeclared code and may only 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 name.

-X

In BBj 7.0 and higher, this parameter 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.

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.



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.