forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marc Portier" <...@outerthought.org>
Subject RE: [Fwd: invitation to check out dbdoc/ashkelon]
Date Wed, 31 Jul 2002 06:37:02 GMT
> -----Original Message-----
> From: Steven Noels [mailto:stevenn@outerthought.org]
> Sent: dinsdag 30 juli 2002 14:47
> To: forrest-dev@xml.apache.org
> Subject: Re: [Fwd: invitation to check out dbdoc/ashkelon]
>
>
> Marc Portier wrote:
>
>  > so a source-code-highlighting transformer would be able to parse the
>  > contents and put out the <source> with nested tags to indicate the
>  > language-independant, but rather higlight-directed portions that any
>  > language knows about: literals, keywords, comment, names,...
>  >
>
> As always, I start looking for projects we can steal from:
>
> * http://jakarta.apache.org/alexandria/ has JXR which does some Java
> syntax analysis

jxr seems to have been originated at CoolServlets.com, dunno if there is
license issues?
http://cvs.apache.org/viewcvs/jakarta-alexandria/src/java/org/apache/alexand
ria/jxr/CodeTransform.java?rev=1.20&content-type=text/vnd.viewcvs-markup

looks like a handmade parser (no syntax files, no parser generation stuff)
which means: who is going to update to the java 1.4 syntax etc etc?

also the code seems to directly output the HTML generation
not separation of output/style concerns :-(



> (http://www.peerfear.org/alexandria/content/html/jxr/org/apache/co
> coon/EngineWrapper.html),
> it is also being packaged inside Maven
> (http://jakarta.apache.org/turbine/maven/xref/index.html) - dunnow if it
> has an XML back-end
>

there seems to have been a jxr -> maven link in the past (empty dirs in the
maven repos)
but the output looks too similar to be something different?

inside maven there is a parser generated with jjtree and javacc:
http://cvs.apache.org/viewcvs/jakarta-turbine-maven/src/java/org/apache/mave
n/java/parser/

the grammar file is there as well: JavaParser.jjt

haven't found yet where the visitor is that generates the HTML (hopefully
XML) output...
ah:
http://cvs.apache.org/viewcvs.cgi/jakarta-turbine-maven/src/plugins-build/jx
r/src/java/org/apache/maven/jxr/
jxr is still in there (but on a different location then I was looking
earlier),so  they don't use the javacc/jjtree approach for the java source
code highlighting


The javacc/jjtree approach has the advantage of having quite some grammar
files out there for javacc: http://www.cobase.cs.ucla.edu/pub/javacc/  but
that still doesn't make the output XML of course...

challenge would be to write some JavaParserVisitor that 'dumps' stuff into a
sax contenthandler?
on the other hand: for syntax highlighting we need less detail on the syntax
of the languages I guess?

Still wondering how the editors are doing it though... maybe some
JEdit/netbeans/eclipse or other OSS editor could shed some light?


> * http://chaperon.sourceforge.net/overview.html if we can get hold from
> a Java syntax definition file

haven't found one yet, there seems to be a conversion possible from yacc
style syntax def files to the xml version it needs.
don't know how that relates to the javacc style syntax def files, didn't
find a repository of yacc syntax files

> (http://java.sun.com/docs/books/jls/first_edition/html/19.doc.html),
> already packaged as a Cocoon generator.
>

mui sympatico, wondering though what is going to be easier for us: writing
and maintaining syntax files (how hard would that be starting from
http://java.sun.com/docs/books/jls/second_edition/html/syntax.doc.html) or
writing and maintinaining the XML production and cocoon hookup from some
jjtree approach? (and steal updated syntax files as they become available)

<out-of-the-blue>
maybe the real challenge is to write some jjxml layer on top of javacc (like
jjtree did) so the XML production can be expressed more nicely.
does anyone know if jjtree and or javacc are open source?
</out-of-the-blue>


mmm, all of this not really top of mind now, and it starts to look like the
proverbial can of *wurms*

-marc=


Mime
View raw message