Syntax highlighting lib for reqT based on RSyntaxTextArea and JFlex. Many thanks to those excellent projects! The repo is used to build a customized rsyntaxtextarea.jar to be used as a lib for reqT.
The build process is a bit tricky as it involves manual patching of a generated lexer source file. It involves updating the grammar (if desired), then generating the lexer using jflex, then building the rsyntaxttextarea.jar, then putting that jar in the reqT repo and rebuild reqT. Detailed instructions follows.
Install these applications first if you don't have them already:
- Java JDK to compile the code
- JFlex to generate token generator
- Apache Ant to build the project
-
If you have changed the metamodel of reqT inside reqT, regenerate the
reqT-flex-clauses.txt
by using the-f
parameter to reqt with the commandjava -jar reqT.jar -f
and a new file will be written. -
Insert the new clauses from the
reqT-flex-clause.txt
file in theReqTTokenGenerator.flex
file (look for comment/* reqT BEGIN */
in the file to find what to replace). -
Run
jflex ReqTTokenMaker.flex
to generate a new ReqTTokenMaker.java -
Patch by hand the generated ReqTTokenGenerator.java file according to the instructions in how-to-patch.txt
-
Put the patched ReqTTokenGenerator.java in this dir by replacing the old one: src\org\fife\ui\rsyntaxtextarea\modes Copy-replace in your desktop or use commands in terminal similar to:
rm src/org/fife/ui/rsyntaxtextarea/modes/ReqTTokenMaker.java cp ReqTTokenMaker.java src/org/fife/ui/rsyntaxtextarea/modes/.
-
Run
ant
to build a newrsyntaxtextarea.jar
(ignore the 4 deprecation warnings) -
Put the dist/rsyntaxtextarea.jar file in your reqT repo under reqT/lib
-
Run the
makebin
script and then thebuild
script in the main reqT repo