Using the Bash++ compiler
Basic usage
bpp [options] [file] ...
$ bpp src.bpp # Compile & immediately run the program
$ bpp -o out.sh src.bpp # Compile & save the program to out.sh
$ bpp -o - src.bpp # Compile & print the program to stdout
$ cat src.bpp | bpp # Pipe command output to the compiler
$ bpp -h # Display help
$ bpp -v # Display version
If no input file is specified, the compiler will read from stdin.
Arguments after the input file are passed to the compiled program.
Options
-o <file>
, --output <file>
Specify the output file for the compiled program.
If the output file is -
, the program will be printed to stdout.
If the output file is not specified, the program will be executed immediately after compilation.
-b <version>
, --target-bash <version>
Specify the target Bash version for the compiled program.
The default is Bash 5.2. This affects how the program is compiled, but does not change Bash++ syntax.
-I <path>
, --include <path>
Add a directory to the include paths.
The default include path is /usr/lib/bpp/stdlib
Files in the include paths can be included with @include <file>
. Include paths are searched in the order they are given.
-s
, --no-warnings
Suppress all warnings during compilation.
-t
, --tokens
Display the tokens generated by the lexer (do not compile).
-p
, --parse-tree
Display the parse tree generated by the parser (do not compile).
-h
, --help
Display help information.
-v
, --version
Display the version of the Bash++ compiler.
Include Paths
When an include directive is given with angle-brackets (as in @include <file>
), the compiler will search for the file in the include paths. By default, /usr/lib/bpp/stdlib
is the first include path.
Multiple include paths can be added with the -I
option. The paths are searched in the order they are given.