Re: Java pretty printing in/with DocBook

Subject: Re: Java pretty printing in/with DocBook
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxx>
Date: Sun, 22 Feb 1998 15:54:10 -0500
W. Eliot Kimber wrote:
> 

> It would certainly be possible to write DSSSL functions that parse the Java
> source and do the formatting. My first approach would be to see if there's
> an emacs mode for Java (there must be) and see if I could use that as the
> base (as emacs is a lisp application).  Or maybe there's already lisp or
> scheme code for doing Java parsing out there?

Emacs Lisp is quite different from Scheme. Not only is it not
side-effect-free, similarly named things can actually cause side-effects
that you don't mean to cause because of a feature called "dynamic
binding" that has been driven out of most modern Lisp dialects. The
relationship is analgous to C and Java. They look similar, and share
similar concepts, but porting large chunks of code would still be fairly
slow. It would be possible to parse the Java with DSSSL, but without a
library, that strikes me as a large job. (somewhat like an SGML parser
in REXX. :) )

My approach to this would be to use any language with an existing Java
parser to parse the Java code, and output some kind of JavaML that
captures the structure in SGML or XML tags. You could use C/C++, Java,
Python or Emacs Lisp, for example. Then you could batch-convert the Java
to SGML and let "make" take care of dependencies. 

This is not the approach I would take given infinite resources, but on a
deadline, it seems simplest. You could also try to integrate a C++
parser with Jade, but that seems like more work with not much benefit.
Also, the former Java->JavaML converter would probably be useful in
other contexts (e.g. on the Web, with XSL).

Paul Prescod  - http://itrc.uwaterloo.ca/~papresco

[Woody Allen on Hollywood in "Annie Hall"]
Annie: "It's so clean down here."
Woody: "That's because they don't throw their garbage away. They make 
        it into television shows."


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • Java pretty printing in/with DocBook
    • Christian Leutloff - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id GAA20194Sun, 22 Feb 1998 06:29:48 -0500 (EST)
      • Liam Quin - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id BAA07986Mon, 23 Feb 1998 01:28:32 -0500 (EST)
      • <Possible follow-ups>
      • W. Eliot Kimber - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id KAA22240Sun, 22 Feb 1998 10:28:59 -0500 (EST)
        • Paul Prescod - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA25020Sun, 22 Feb 1998 16:01:45 -0500 (EST) <=
          • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA25601Sun, 22 Feb 1998 16:34:24 -0500 (EST)
        • Lassi A. Tuura - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id DAA13860Mon, 23 Feb 1998 03:41:50 -0500 (EST)
      • W. Eliot Kimber - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id QAA25353Sun, 22 Feb 1998 16:26:17 -0500 (EST)
      • Sean Mc Grath - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id GAA15693Mon, 23 Feb 1998 06:34:57 -0500 (EST)