SourceServer; CodingStyle; ReplaceSourceServer
A utility program that cleans up source code so that it conforms to the accepted CodingStyle of the person running the program (whatever that may be). It does this by reading preferences from a text file, or from the JOS::PrettyPrinter namespace.
It is written in Perl, not Java. I started a version in Java, but I felt the expense (memory/CPU usage) of doing a full, proper parse tree was too much. Instead, I make heavy use of Perl regex's, and PP can now parse a 62K source file in about 1 second (P200). Not bad. :)
You can place bug reports here just like adding comments anywhere else on the site:
[Your bug reports here. Please include example code, or point me to your uploaded source.]
I recently saw a fully hyperlinked HTML version of the Linux kernel code. The idea sounded ridiculous at first, but linking symbol references to definitions makes for a simple and efficient code browser. You can look at http://lxr.linux.no/source/ to see what I'm talking about.
It would be stellar to have a version of your PrettyPrinter's HTML output with complete hyperlinking! What do you think?
-MichaelNygard 2/26/98
The linux code HTML is wicked cool. Now.. if this were merged with a source code control system, so people could check out / check in the master copy and look at revision history......
Just dreaming -- ClarkEvans 2/26/98
Weird... somehow the formatting from the headers in this page was wiped out. Oh well.
As for the linking of the source, that is definitely in my plans. I have written most of my SourceServer, but I haven't had a chance to actually get it up and running yet (maybe today/tomorrow). Once I get the basics down (perfect source formatting, basic linking between packages), we can then add in all kinds of cool stuff.
SourceServer allows for the uploading of files, specifically source code files, and keeps a backup (which only goes back one step). It also makes an attempt at ensuring the person uploading is a JOS member, although this would need to really be improved with a password to make it more secure.
SourceServer will also keep track of what source has been uploading, and you will be able to browse through all the source code much like you would view the documentation from javadoc pages by going through each package/sub-package.
Clark... I'm not sure I understand the revision history part. We could keep track of the date the source code was uploaded, and by whom, but the revision history on the source would need to be written by the author(s), correct?
Oh it will be very cool... :)
-- (2/26/98)
<nolink>http://localhost:8080/servlet/syntax?org.jos.app.editor.EditorWhere is source code stored? In compressed zip files. Each Java package is stored in its own zip file. The servlet uses the
java.util.zip
package to read .java files from a zip.
<source>/Source-org.jos.app.editor.zip
I am beginning to think that the ultimate web-based pretty printer should be implemented as a Java servlet. I like the idea of expanding syntax highlighting to a full-blown pretty printer, with additional options for seeing the code using different coding conventions.
Before I knew it, I had something a lot better than what I had been aiming for. I've been working on the JOS Registry. I combined the registry with my old code browser. Suddenly, I've got a code browser that does syntax highlighting as it converts Java source code to HTML. And it is customize-able because the source directory, colors and keywords are stored in a registry file. -- GilbertHerschberger (9 July 1999)