This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Compiling packages with gnu.expr
- To: kawa at sources dot redhat dot com
- Subject: Compiling packages with gnu.expr
- From: Daniel Bonniot <Daniel dot Bonniot at inria dot fr>
- Date: Tue, 02 Oct 2001 17:39:17 +0200
I am trying to figure out how to use gnu.expr to generate packages a la
java.
For simplification, suppose I want to write a java compiler with
gnu.expr as the backend (!).
So I need to generate a gnu.expr.Expression that represents the code,
and then ask it to compile and write the bytecode files. For the moment
I came up with:
Create a (dummy) ModuleExp as the root expression. It is dummy in the
sense that it do not represent a particular compiled package. For each
generated class I create a ClassExp object, and add it to the root
ModuleExp with addMethod. In turn, if a class has field or method they
are added to the ClassExp object.
Then I can call compileToFiles or compileToArchive on the root
ModuleExp.
Here are my questions:
- would it make sense to create a ModuleExp for each java package
generated, possibly as children of a root ModuleExp?
- How can I declare the package each ClassExp belongs to?
- It seems some changes should be made, if for nothing else to the name
generation mechanism in Compilation.generateClassName: it creates names
of the form <root moduleExp>$name
Possibly, there could be a flag somewhere to indicate what style of
naming one wants (Scheme or Java). Or should it be by subclassing
ModuleExp with say a PackageExp? Would you be interested in me
contributing this extension (that would be backward compatible with the
current API of course)
Daniel Bonniot