|
From: Sandro S. <st...@ke...> - 2011-05-07 06:45:33
|
On Fri, May 06, 2011 at 10:49:42PM +0800, nalaginrut wrote:
> hi all!
> I'm a new comer for libming. And I found there're many languages
> supported by libming. But I'm a Guile user, so I want to write a new
> language extension for Guile user.
> I've done most wrapping work. But I found a problem. Must I keep the
> wrapping-function-name coincide with the native-function-name in
> libming? Say, "newSWFAction" must be "newSWFAction" in Guile wrapping or
> could be "new-swf-action"?
> I ask this because I need to implement "swftoguile" to generate guile
> file. I'm not very clear about how "swftoxxx" works. I fear that if I
> use "new-swf-action" it won't generate a valid program.
> Any help would be appreciated. Thanks!
See outputscript.c.
The idea is that the "Action" part remains literal, in every language.
Then, for each language you can define a prefix ("SWF::" for perl, "SWF"
for others") and other syntactic things. See the start of the file.
For instanctiation a 'newobj' static function is used. There's some
language-specific handling in there, so I guess you could lowercase
the class name too.
The weakest part of all swftoxxxx is lack of regress testing.
It'd be nice to get something setup to avoid wild regressions.
Maybe "tagging" existing tests as _reversible_ (not all of them are)
to try a round-trip.
--strk;
What comes next is just spam, don't bother scrolling
|