> From: bill lam <[EMAIL PROTECTED]>
> 
> On Sat, 20 Sep 2008, Oleg Kobchenko wrote:
> 
> > There's now a test example in xml/xslt addon,
> > which uses SWIG and XSLT to translate such C header
> > 
> > /* ================================================ test.h == */
> > 
> > double mul(float argFloat1, float argFloat2);
> > int sub(int argInt3, int argInt4);
> > char* subs(char* argStr5, char** argPtrStr6, int argInt7);
> > 
> > 
> > to such J code
> > 
> > NB. ================================================= test.j ==
> > 
> > mul=: 'mul > d f f' cdx
> > sub=: 'sub > i i i' cdx
> > subs=: 'subs > *c *c * i' cdx
> 
> How does it handle typedef? suppose that for another test1.h
> typedef long L;
> typedef L UL;
> struct var {
> int a1;
> L a2;
> };
> double mul(long *, L, UL, struct var *);
> 
> can it translate it to J definition without manual editing script to
> add provision for the new types?

It's up to you. The method does the dirty work of parsing
C code and presenting in XML format which you translate
in a combination of XSLT and J processing. You make decisions
like that making the processing smarter. But it does not have
to be manual.


      
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to