This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Compiling packages with gnu.expr



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]