Re: issue with automatic iterable detection?

2011-03-03 Thread Andi Vajda


Indeed, this is why I put that assertion there :-)
It's a bit of guesswork what all the possibilities are there.
I'll add support for arrays there.

Andi..

On Thu, 3 Mar 2011, Bill Janssen wrote:


This looks like a problem.

This is with an svn checkout of branch_3x.

Bill

122, in _run_module_as_main
   __main__, fname, loader, pkg_name)
 File /usr/lib/python2.6/runpy.py, line 34, in _run_code
   exec code in run_globals
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/__main__.py,
 line 98, in module
   cpp.jcc(sys.argv)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 548, in jcc
   addRequiredTypes(cls, typeset, generics)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 233, in addRequiredTypes
   addRequiredTypes(cls, typeset, True)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 238, in addRequiredTypes
   addRequiredTypes(ta, typeset, True)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 240, in addRequiredTypes
   raise NotImplementedError, repr(cls)
NotImplementedError: Type: double[]
%



Re: issue with automatic iterable detection?

2011-03-03 Thread Andi Vajda


On Thu, 3 Mar 2011, Bill Janssen wrote:


Did a fresh checkout and here's the next issue.

This one may be harder to fix...


No, it's just another one of these Type classes, WildcardType.
I should have a fix shortly. Sorry for the mess.

Andi..



Bill

Traceback (most recent call last):
 File /usr/lib/python2.6/runpy.py, line 122, in _run_module_as_main
   __main__, fname, loader, pkg_name)
 File /usr/lib/python2.6/runpy.py, line 34, in _run_code
   exec code in run_globals
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/__main__.py,
 line 98, in module
   cpp.jcc(sys.argv)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 551, in jcc
   addRequiredTypes(cls, typeset, generics)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 233, in addRequiredTypes
   addRequiredTypes(cls, typeset, True)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 238, in addRequiredTypes
   addRequiredTypes(ta, typeset, True)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 238, in addRequiredTypes
   addRequiredTypes(ta, typeset, True)
 File 
/usr/local/lib/python2.6/dist-packages/JCC-2.7-py2.6-linux-x86_64.egg/jcc/cpp.py,
 line 243, in addRequiredTypes
   raise NotImplementedError, repr(cls)
NotImplementedError: Type: ?



Re: issue with automatic iterable detection?

2011-03-03 Thread Andi Vajda


On Thu, 3 Mar 2011, Bill Janssen wrote:


Andi Vajda va...@apache.org wrote:


  Bill,

Did that solve your problem ?


Hmmm, I'm still seeing it.  And some other stuff:


Could you please send me the Java code that triggers this ?

Andi..


build/_GoodStuff/__wrap03__.cpp: In function ?PyObject* 
com::parc::goodstuff::relations::t_Something1SeqIterator_nextElement(com::parc::goodstuff::relations::t_Something1SeqIterator*,
 PyObject*)?:
build/_GoodStuff/__wrap03__.cpp:9122: error: ?class 
com::parc::goodstuff::relations::t_Something1SeqIterator? has no member named 
?parameters?
build/_GoodStuff/__wrap03__.cpp:9122: error: ?class 
com::parc::goodstuff::relations::t_Something1SeqIterator? has no member named 
?parameters?
build/_GoodStuff/__wrap03__.cpp: In function ?PyObject* 
com::parc::goodstuff::family::t_Something2Iterator_nextElement(com::parc::goodstuff::family::t_Something2Iterator*,
 PyObject*)?:
build/_GoodStuff/__wrap03__.cpp:15376: error: ?class 
com::parc::goodstuff::family::t_Something2Iterator? has no member named 
?parameters?
build/_GoodStuff/__wrap03__.cpp:15376: error: ?class 
com::parc::goodstuff::family::t_Something2Iterator? has no member named 
?parameters?
build/_GoodStuff/__wrap03__.cpp: At global scope:
build/_GoodStuff/__wrap03__.cpp:27749: error: ?t_JArray? was not declared in 
this scope
build/_GoodStuff/__wrap03__.cpp:27749: error: parse error in template argument 
list
build/_GoodStuff/__wrap03__.cpp:27749: error: insufficient contextual 
information to determine type
build/_GoodStuff/__wrap03__.cpp:27749: warning: ?? operator will be treated 
as two right angle brackets in C++0x
build/_GoodStuff/__wrap03__.cpp:27749: warning: suggest parentheses around ?? 
expression
build/_GoodStuff/__wrap03__.cpp:27749: error: spurious ??, use ?? to 
terminate a template argument list
build/_GoodStuff/__wrap03__.cpp:27749: error: expected primary-expression 
before ?)? token
build/_GoodStuff/__wrap03__.cpp:27749: error: too many initializers for 
?PyTypeObject?
build/_GoodStuff/__wrap03__.cpp:41430: error: ?t_JArray? was not declared in 
this scope
build/_GoodStuff/__wrap03__.cpp:41430: error: parse error in template argument 
list
build/_GoodStuff/__wrap03__.cpp:41430: error: insufficient contextual 
information to determine type
build/_GoodStuff/__wrap03__.cpp:41430: error: expected primary-expression 
before ?)? token
build/_GoodStuff/__wrap03__.cpp:41430: error: too many initializers for 
?PyTypeObject?
error: command 'gcc' failed with exit status 1

I think when I tried it this afternoon (I was running out the door and
kind of rushed) I just did a wrap, and not a --build.

Sorry about that.

Bill




Andi..

On Feb 28, 2011, at 20:05, Andi Vajda va...@apache.org wrote:



On Sun, 27 Feb 2011, Bill Janssen wrote:


Andi Vajda va...@apache.org wrote:


It may be simplest if you can send me the source file for this class
as well as a small jar file I can use to reproduce this ?


Turns out to be simple to reproduce.  Put the attached in a file called
test.java, and run this sequence:

% javac -classpath . test.java
% jar cf test.jar *.class
% python -m jcc.__main__ --python test --shared --jar /tmp/test.jar --build 
--vmarg -Djava.awt.headless=true


This was a tougher one. It was triggered by a combination of things:
 - no wrapper requested for java.io.File or --package java.io
 - a subclass of a parameterized class or interface implementor of a
   parameterized interface wasn't pulling in classes used as type
   parameters (java.io.File here).

A fix is checked into jcc trunk/branch_3x rev 1075642.
This also includes the earlier fix about using absolute class names.

Andi..




Using JCC / PyLucene with JEPP?

2011-03-03 Thread Bill Janssen
New topic.

I'd like to wrap my UpLib codebase, which is Python using PyLucene, in
Java using JEPP (http://jepp.sourceforge.net/), so that I can use it
with Tomcat.

Now, am I going to have to do some trickery to get a VM?  Or will
getVMEnv() just work with a previously initialized JVM?

Bill


Re: issue with automatic iterable detection?

2011-03-03 Thread Bill Janssen
Here's one of the generated lines that's causing me grief.

DECLARE_TYPE(RankIterator, t_RankIterator, ::java::lang::Object, 
RankIterator, t_RankIterator_init_, PyObject_SelfIter, ((PyObject 
*(*)(t_RankIterator *)) get_nextt_RankIterator,t_JArray jint ,JArray jint 
), t_RankIterator__fields_, 0, 0);

It yields this:

build/_PPD/__wrap02__.cpp:27284: error: ‘t_JArray’ was not declared in this 
scope
build/_PPD/__wrap02__.cpp:27284: error: parse error in template argument list
build/_PPD/__wrap02__.cpp:27284: error: insufficient contextual information to 
determine type
build/_PPD/__wrap02__.cpp:27284: warning: ‘’ operator will be treated as two 
right angle brackets in C++0x
build/_PPD/__wrap02__.cpp:27284: warning: suggest parentheses around ‘’ 
expression
build/_PPD/__wrap02__.cpp:27284: error: spurious ‘’, use ‘’ to terminate a 
template argument list
build/_PPD/__wrap02__.cpp:27284: error: expected primary-expression before ‘)’ 
token
build/_PPD/__wrap02__.cpp:27284: error: too many initializers for ‘PyTypeObject’

Where does t_JArray get defined?  I can't find it.

Bill


Re: issue with automatic iterable detection?

2011-03-03 Thread Andi Vajda


On Thu, 3 Mar 2011, Andi Vajda wrote:



On Mar 3, 2011, at 22:09, Bill Janssen jans...@parc.com wrote:


Here's one of the generated lines that's causing me grief.

   DECLARE_TYPE(RankIterator, t_RankIterator, ::java::lang::Object, RankIterator, 
t_RankIterator_init_, PyObject_SelfIter, ((PyObject *(*)(t_RankIterator *)) 
get_nextt_RankIterator,t_JArray jint ,JArray jint ),


Ah yes, that's invalid c++. Nested generics need to insert a space between ''. 
Otherwise, the c++ parser gets it as the bit shifting operator, believe it or not. 
Should be easy enough to fix in jcc.


Fixed in trunk/branch_3x rev 1077828.

Andi..



Andi..


t_RankIterator__fields_, 0, 0);

It yields this:

build/_PPD/__wrap02__.cpp:27284: error: ?t_JArray? was not declared in this 
scope
build/_PPD/__wrap02__.cpp:27284: error: parse error in template argument list
build/_PPD/__wrap02__.cpp:27284: error: insufficient contextual information to 
determine type
build/_PPD/__wrap02__.cpp:27284: warning: ?? operator will be treated as two 
right angle brackets in C++0x
build/_PPD/__wrap02__.cpp:27284: warning: suggest parentheses around ?? 
expression
build/_PPD/__wrap02__.cpp:27284: error: spurious ??, use ?? to terminate a 
template argument list
build/_PPD/__wrap02__.cpp:27284: error: expected primary-expression before ?)? 
token
build/_PPD/__wrap02__.cpp:27284: error: too many initializers for ?PyTypeObject?

Where does t_JArray get defined?  I can't find it.

Bill