|
Java Front-End OverviewMaintained by Karl Trygve Kalleberg The Java front-end source lives in src/java/java2csf. It consists of the Java grammar written by Terrence Parr and friends for the ANTLR parser tool, along with the java2csf.java which just traverses the ANTLR-provided AST to create a CSF-tree which it dumps to disk. The entire 2.6.x ANTLR tool is included with SDS in the directory src/antlr. It has been slightly cut down. All the examples have been removed, for one thing. Using the Java front-endAfter SDS has been make installed, the java front-end will reside in <prefix>/bin as java2csf.jar. The support libraries will be installed in <prefix>/lib, as sds.base.jar, sds.api.csf.jar and antlr.jar. A bash script, called java2csf has been installed in <prefix>/bin/java2csf. If assumes your CLASSPATH is already set to your JRE's java.* libraries, and that java is in the path. Edit <prefix>/bin/java2csf if this is not so, then take it out for a spin: $ <prefix>/bin/java2csf sds/src/java/JavaPrefs.java -o -l dump.xmlCheck that the file dump.xml contains readable output. The -l option tells the parser to be lenient towards certain common misspellings, such as the semi-colon in: "class foo {};" $ <prefix>/bin/java2csf . -o dump.xmlwill parse all the .java files in the current and subdirectories. java2csf will not calculate any dependencies, like javac does. Note: You can pass options through the java2csf script to your java run time system by setting the JAVA_OPTIONS environment variable, like this (in tcsh): setenv JAVA_OPTIONS '-ms10000000 -mx100000000'This sets the JRE's initial heap size to 10MB and maximum heap size to 100MB. This is sometimes needed to parse large projects. See the howto for fuller explanation on how to install and use SDS. Front-ends for other languages exist, check the front-ends page. java2csf does what cxx2csf or lisp2csf do, only for Java. Testing and conformanceThe java code has been compiled and tested with the following Java tools:
See the status page for the situation on conformance to the CSF spec. |