Running BFPX

 

This page describes how you can download and run the BFPX compiler and how you run BFPX programs.


Prerequisites

The BFPX compiler and runtime require Java version 1.5 or newer to run. In order to test that you have the right version of Java installed, enter “java -version” on the command line. The output should appear more or less as shown in the terminal window below.


This screenshot shows that Java version 1.5.0_06 is being used. Fix any error messages you see before proceeding.




Getting the Code

BFPX version 1.0 comes as a single distribution package. It includes both the source code for the program and a pre-compiled binary. Once you downloaded the package, unzip it in a directory of your choosing.


Compiling Brainfuck Programs

For compiling the programs we need to include both bfpx.jar and bcel-5.1.jar in the classpath. Bfpx.jar is the BFPX compiler, which uses the Byte Code Engineering Library (BCEL) to generate class files.


The screenshot below shows how we can recompile a sample.


The class file is generated into our current working directory.


Running Brainfuck Programs

Bfpx.jar doubles as the runtime library for compiled programs. Invoking the compiled program

Be careful for to accidentally use the “-jar” switch when running a BFPX program. Also, do not forget to include the directory where the generated class file resides. In our case that is the current working directory, denoted as “.”.
 
photo: Christos Crshttp://www.sxc.hu/profile/crs
if you find this interesting, terrible or just would like to know more, e-mail memailto:kjkoster@kjkoster.org?subject=
web statistics
http://java-monitor.com/