On 03/03/2014 01:16 AM, Jochen Theodorou wrote:

Better if we can do the Enter/MemberEnter phases of javac on B.java
before we start compiling A.L1.  And we might want to only doing a
first pass on A.L1 before we get back to B.java.  Things may need to
be compiled on-demand, as mentioned in:
http://openjdk.java.net/groups/compiler/doc/compilation-overview/

It should be possible to write a multi-language compiler tool that
extends javac.  That's what we did for JavaFX Script, but in that
case the entire JavaFX Script compiler was based on javac.  It may
be more difficult to wrap an existing L1 compiler.  E.g. the internal
L1 compiler objects have to be mapped to javac Symbol objects.

For eclipse we have something like this already actually. And while
there is a command line eclipse compiler for a long time already, we
have the problem, that jdt does not expose everything as needed. So a
modified JDT is required. The goal of our project would be to have
something more lightweight... in example not have to ship a modified jdt

javac does support a fair amount of pluggability, in the sense that you
can extend and replace the various phases and classes.

For Kawa you could do something like:
(1) Read the "header" of each Kawa source file, to determine the
name of the generated main class.
(2) Enter these class names into the javac tables as "uncompeted"
classes.
(3) Start compiling the java files.  When this requires the members
of the of the Kawa classes, switch to the Kawa files.  From javac,
treat these as pre-compiled .class files.  I.e. we treat the Kawa
compiler as a black box that produces Symbols in the same way as
reading class files.

This approach may not immediately provide as robust mixed-language
support as ideal, but it is more amenable to incremental improvement
that a standalone stub-generator.
--
        --Per Bothner
p...@bothner.com   http://per.bothner.com/

--
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jvm-languages+unsubscr...@googlegroups.com.
To post to this group, send email to jvm-languages@googlegroups.com.
Visit this group at http://groups.google.com/group/jvm-languages.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to