The source code for the server is in WEB-INF/lps/server. This directory contains the sources for three libraries: LPS, and two of the libraries that it links against, JGenerator (in jgenerator-2.2/src), and oswego (in src/EDU).
The source code for LPS proper consists of:
- the Java sources (*.java) in src/com/laszlosystems; and
- generated Java files which are placed in build/src.
The build.xml file in that WEB-INF/lps/server generates the files in build/src, and compiles LPS.jar from the Java files in src (this includes both LPS and oswego sources), build/src (LPS generated Java files), and jgenerator-2.2/src (JGenerator). The intermediate class files are placed in build/com and build/EDU, and the jar is placed in lib.
The build file in the directory that *contains* WEB-INF copies WEB-INF/lps/server/lib/LPS.jar to the deployment directory, WEB-INF/lib. This is where servlet containers expect it.
There are three types of generated Java files.
- The *.java.proto files in src are copied into *.java files into src, with @BUILDDATE@ replaced by the build date, and some other token substitutions listed in the server build.xml file. (All these files and directories are relative to the WEB-INF/lps/server directory.)
- A custom copy of jython is used to compile the files in sc into Java files in build/src. ("sc" in server/sc stands for "script compiler".)
- Finally, javacc is used to compile src/com/laszlosystems/css/CSSParser.jj and sc/src/com/laszlosystems/sc/Parser.jjt into Java files in build/src.
'ant build' in the server directory handles all this for you as for as *building* is concerned, but you still need to know this in order to find the sources
We would like to eliminate the *.java.proto -> *.java step, and simply use Java sources files that read a property file at runtime. We would also like to remove our dependency on Jython, by porting the script compiler to Java --- Jython has caused some problems, and porting this would speed up the compiler a lot. if anyone is interested in a porting project, or in learning how a compiler works, this would be an interesting project. The final class of generated code, javacc, will remain in place forever (unless we replace javacc by ANTLR at some point, in which case it would still be generated though).