[m-rev.] Java: Foreign language interface support

Michael Wybrow mjwybrow at cs.mu.OZ.AU
Tue Feb 11 13:19:32 AEDT 2003


On Mon, 10 Feb 2003, Fergus Henderson wrote:
> On 10-Feb-2003, Michael Wybrow <mjwybrow at cs.mu.OZ.AU> wrote:
> > 
> >  build_object_code(ModuleName, java, _, ErrorStream, _Imports, Succeeded) -->
> > -	compile_target_code__compile_java_file(ErrorStream,
> > -		ModuleName, Succeeded).
> > +	module_name_to_file_name(ModuleName, ".java", no, JavaFile),
> 
> Shouldn't that be "yes" rather than "no" there?

Yes, fixed.


> Please test that Java compilation works with `--use-subdirs'. 

It works, but class files are currently put in the wrong directory.
Also, because javac generates a .class file for each class in the 
original .java file, not all the class files get cleaned up.

I'll post a seperate change soon that addresses these issues.


> > --- mlds_to_java.m	23 Jan 2003 04:26:36 -0000	1.35
> > +++ mlds_to_java.m	10 Feb 2003 03:17:14 -0000
> > @@ -20,13 +20,14 @@
> >  % TODO: 
> >  %	General code cleanup
> >  %	handle static ground terms
> >  %	RTTI (requires static ground terms)
> >  %	generate names of classes etc. correctly (mostly same as IL backend)
> >  %
> > -%	handle foreign code written in Java
> >  %	handle foreign code written in C 
> 
> You should add "support foreign_import_module for Java" to this list.

Done.


> > +:- pred output_target_code_component(mlds__context, target_code_component,
> > +		io__state, io__state).
> > +:- mode output_target_code_component(in, in, di, uo) is det.
> > +
> > +output_target_code_component(_Context, user_target_code(CodeString,
> > +		_MaybeUserContext, _Attrs), !IO) :-
> > +	io__write_string(CodeString, !IO).
> 
> Does Java support `#line' or equivalent?

As Peter Moulder said, no it doesn't.  I've added a short comment to
the code that states this.


Michael

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list