Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.TXT | 2004-07-31 | 2.5 kB | |
b4.jar | 2004-07-31 | 15.6 kB | |
Totals: 2 Items | 18.1 kB | 0 |
B4 is a pre-processor written in java and aims to become a fully functional pre-processor. It can be used with any programming language. Currently support features are 1. //#ifdef 2. //#elifdef 3. //#else 4. //#endif 5. Nesting allowed 6. Ant task available Take a look at test/input.java for usage examples. Use ant to compile and jar. The jar will be in tojar folder. To run, use the main class Before. Usage: java -classpath b4.jar [-D<defines>] com.aligo.before.Before file1.java file2.java ... [-o outputdir] [-np] [-r rootdir] [-e] where -D<defines> is for defining variables for pre-processing, for example -D__DEBUG -o outputdir is for specifying the output directory for the files, for example -o output, default is "processed" -np is for not preserving the path structure, meaning only the file name will be saved in the output directory by default if a path is specified for the file it is preserved when outputting to output directory -r rootdir is for specifying the base directory under which the files are present, useful when running from a different location than where the base directory is located and the file tree structure under the base directory needs to be preserved -e is for specifying that empty files need to be preserved, by default if after preprocessing the file is empty it is removed. Sample Usage: java -classpath b4.jar -D__DEBUG com.aligo.before.Before src/file1.java src/dir2/file2.java -o debugdir Ant task Sample Usage: <taskdef name="b4" classname="com.aligo.before.task.B4Task" classpath="lib/b4.jar"/> <target name="precompile"> <b4 todir="debugdir"> <property name="__DEBUG" value="true"/> <fileset dir="src"/> </b4> </target> #### Feature logs Added new feature to pass multiple filenames, specify output directory using flag -o and disable preserving paths is using the flag -np. Added new feature to pass a root directory using the flag -r that will used as a base directory for all files. Added new feature to delete empty output files by default as leaving them could cause compilation errors on some compilers. This feature can be disabled by using the flag -e. #### If you have any feature requests please e-mail pramod@aligo.com *The acronym B4 is for before, another word for pre, in pre-processor. The acronym itself is from StarTrek Nemesis where it is Data's predecessor/brother's name. Thanks, Pramod Immaneni.