FIRE Logo

Writers (Code Generation Back-ends)

The generated DFA is translated into high-level java source or VM bytecode. It is then compiled by javac (included in JDK 1.6 or later) or jasmin. The compiled classes are stored in the $HOME_DIR/.firej directory.

Java Code Generator

Used only for experimentation, the Java code-generation produces much slower code, but faster than most of many implementations. To work it requires javac installed. You can use it through the RegexFactory class:
WriterPlugins.getInstance().load("org.firej.writers.velocity.JavaVelocityWriter");

Bytecode Code Generator

The main code generator engine of FIRE/J. Generates direct VM bytecode, tailored for each regular expression. The result is fast execution time. For the compilation the jasmin compiler is used (a modified version, so DO NOT USE THE JAR from the jasmin distribution site). There are two versions of the Bytecode Code Generator, the Direct and the Non-Direct.

Their differences is only an intermediate file that is generated for debugging puproses (non-direct), which is not generated in the direct bytecode generator for performance. The direct version is enabled by default. Both versions can be activated through the following statements:
// Non-direct
WriterPlugins.getInstance().load("org.firej.writers.velocity.BytecodeVelocityWriter");
// Direct (enabled by default)
WriterPlugins.getInstance().load("org.firej.writers.velocity.BytecodeDirectWriter");