





 |
|
Expressor
Source Code Compression and
Language Translator
Expressor is the application
which is the heart of SSDS. Expressor is a program that compresses a source
file from any language. Through its compression algorithm, Expressor translates
source code from one language into its own language, Express.
Compression is achieved in
seven steps:
- All unnecessary whitespace
(tabs, spaces, returns) is removed from the file.
- Comments are removed.
- Each occurrence of a variable
name, object name, argument name, and procedure name (all words which
are not reserved language objects) is replaced by minimal sequence of
letters and numbers. For example, if the variables, gCounter and bIsNeeded,
were the most frequently used variables within a source file, respectively;
each occurrence of gCounter would be replaced by the character, a, and
each occurrence of bIsNeeded would be replaced by the letter, b.
- Reserved language words
are replaced by a minimal sequence of characters. For example, the Java
method, paint(), can be replaced by @A.
- Repetitive elements are
replaced by a minimal set of characters. For example, in a C source
file, a deeply nested 'if' statement may end with four '}'. The four
'}' would be replaced by $4. '$' symbol would represent '}', and the
second number represents the number of repetitions.
- The use of special symbols
in steps 4 and 5 would allow for the elimination of even more whitespace
since variable names and reserved keywords would no longer need to be
separated by whitespace. For example, a Java variable declaration would
be "boolean bIsFlag;". A space is needed between the two words
so that the compiler can know where the declaration ends and the variable
name begins. The space is not need in Express because Expressor would
convert the statement to "@#c;". The compiler would know that
the "@" is beginning of declaration which has a two character
format. Any symbols which comes after the two characters must be variable
names.
- The source file generated
by Express itself can be compressed further with industry standard Ziv-Lempel
compression. The file would be decompressed before compilation begins.
Expressor does not have to
perform all of the compression steps in order to be effective. Performing
steps 1-3 alone yields significant compression ratios, while keeping the
source files compilable by today's compilers. Performing steps 4-6 would
require that compilers and libraries (zbo) would have to be redesigned
in order to compile an Express file.
I converted a java graphical
program to an ebo file. The original Java source file was 132 KB. The
uncompressed jar file created from the java program was 47 KB. After performing
steps 1-3, the Ebo file was 42 KB. This Ebo file is still compilable by
the standard java compiler. After performing steps 1-6, the Ebo file was
27 KB. Therefore, Ebo files are compact enough to be sent over the net..
|