From: Arno P. <ar...@pu...> - 2009-09-09 10:59:12
|
Brian, you are certainly pushing XMLVM to the limits. I do agree with you that a native Objective-C version would be the way to go. But one can certainly argue that there is a bug because we cannot handle the code you try to cross-compile. Can you please do me a favor and generate a small, self-contained example that demonstrates the problem? That would be the easiest for me to investigate and (hopefully) fix the bug. Arno Brian Schimmel wrote: > Hi, > > I'm completely new to XMLVM, but due to the external circumstances, I'm > forced to do something rather advanced with it, that is, a > crosscompilation of the Java 6.0 Collections Framework to Objective C. > You might argue that it might be better to use native Objective C > collections and write bridges, but as I need to get the same behaviour > as on Java, I thought crosscompiling would be nice. To make things > easier for XMLVM I already used Retrotranslator to crosscompile the Java > 6.0 classes to Java 1.2, and checked their validity on J2ME. As far as I > can tell, my Java classes are 1.2 compilant and working, but > crosscompilation to Objective C has its quirks. > > Let me first outline the class layout: > > abstract class AbstractList extends AbstractCollection implements List > { > class Itr implements Iterator > { > //... > } > > class ListItr extends Itr implements ListIterator > { > //... > } > > //.. > } > > AbstractList has two inner classes and one of those inherits from the > other one. The problem is, that both AbstractList$Itr and > AbstractList$ListItr have the following synthetic member in their bytecode: > > final synthetic AbstractList this$0; > > Crosscompilation to Objective C works fine and yields two files, each > having the line > > @public packagename_AbstractList_* this$0; > > but because one class extends the other, I get this error from gcc: > > error: duplicate member 'this$0'; > > One option would be to change my Java code, but the Collections > Framework has at least 4 Classes with multiple (even more than two) > inner classes which inherit from each other. So I guess this case should > somehow be handled by the XMLVM crosscompiler, but I'm completely unsure > how this would be done. When emitting the interface in xmlvm2objc.xsl, > we would need to check if there is any superclass which is also an inner > class, thus having a this$0 field. I think this might be beyond the > complexity of what should be done here, isn't it? > > Im happy about any advice. > > With best regards, > Brian > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |