Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

patch to add access data for static member declarations

0 views
Skip to first unread message

Daniel Rogers

unread,
Jun 23, 2009, 6:59:37 PM6/23/09
to dev-stati...@lists.mozilla.org
This patch adds an "access" property for all global declarations, not just
non-static members of classes and structs. I use this in building C++ ->
Java bindings to identify static methods that should have native lang
accessors.

Taras Glek

unread,
Jun 23, 2009, 7:01:40 PM6/23/09
to Daniel Rogers, dev-stati...@lists.mozilla.org

Daniel Rogers

unread,
Jun 23, 2009, 7:47:14 PM6/23/09
to Taras Glek, dev-stati...@lists.mozilla.org
On Jun 23, 2009, at 4:01 PM, Taras Glek wrote:

> Hi Daniel,
> This sounds useful, but the mailing list strips attachments.
>
> Please file a bug and attach

https://bugzilla.mozilla.org/show_bug.cgi?id=500078

So, speaking of language bindings, the ability to create directories
would be useful. Would anyone object if I added a mkdir style
function? Also, how does one identify the linkage type from within
dehydra.c (as in extern "C" { ...)? Those two bits (and the patch)
are the last pieces I need to finish my automatic C/C++ -> Java
language binding generator.

--
Daniel

Benjamin Smedberg

unread,
Jun 23, 2009, 7:54:29 PM6/23/09
to
On 6/23/09 7:47 PM, Daniel Rogers wrote:

> So, speaking of language bindings, the ability to create directories
> would be useful. Would anyone object if I added a mkdir style
> function? Also, how does one identify the linkage type from within

I suspect that it would be more productive to add a generic system()
function rather than mkdir and whatever else people need.

system(['mkdir', '/path/foo/bar']);

> dehydra.c (as in extern "C" { ...)? Those two bits (and the patch) are
> the last pieces I need to finish my automatic C/C++ -> Java language
> binding generator.

I don't think that's exposed through dehydra, although it's likely you can
reach it via treehydra somehow... you probably need to read cp-tree.h to
find the correct macro and translate that into JS.

--BDS

Taras Glek

unread,
Jun 23, 2009, 8:03:39 PM6/23/09
to Daniel Rogers, dev-stati...@lists.mozilla.org
Daniel Rogers wrote:
> On Jun 23, 2009, at 4:01 PM, Taras Glek wrote:
>
>> Hi Daniel,
>> This sounds useful, but the mailing list strips attachments.
>>
>> Please file a bug and attach
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=500078
>
> So, speaking of language bindings, the ability to create directories
> would be useful. Would anyone object if I added a mkdir style
> function? Also, how does one identify the linkage type from within
> dehydra.c (as in extern "C" { ...)? Those two bits (and the patch)
> are the last pieces I need to finish my automatic C/C++ -> Java
> language binding generator.
Neat, hopefully your generator will be downloadable somewhere.

DECL_EXTERN_C_P in cp-tree.h is what you want. In general tree.def,
cp-tree.def and corresponding .h files are good to look at.

I'll take a patch for an isExternC attribute on variables.

Taras

Daniel Rogers

unread,
Jun 26, 2009, 1:11:07 AM6/26/09
to Taras Glek, Daniel Rogers, dev-stati...@lists.mozilla.org

>> On Jun 23, 2009, at 4:01 PM, Taras Glek wrote:

> I'll take a patch for an isExternC attribute on variables.

https://bugzilla.mozilla.org/show_bug.cgi?id=500596

Jean-Marc Desperrier

unread,
Jun 30, 2009, 11:04:03 AM6/30/09
to
Daniel Rogers wrote:
>> I'll take a patch for an isExternC attribute on variables.

> https://bugzilla.mozilla.org/show_bug.cgi?id=500596

Should (Will ?) the attribute be set when compiling C files ?

I tend to think that yes, it will probably make easier the live of
peoples whose tree is a mix of C and C++, and aren't those the ones
primarily concerned by it ?

Taras Glek

unread,
Jun 30, 2009, 12:34:42 PM6/30/09
to Jean-Marc Desperrier, dev-stati...@lists.mozilla.org
It probably wont. In JavaScript you should be able to define isExtern on
every decl using prototypes.

I still haven't heard of anybody using dehydra C in the wild. Can't
seriously consider C-related issues until I see some bug/success reports.

Taras

Jean-Marc Desperrier

unread,
Jul 2, 2009, 4:35:59 AM7/2/09
to
Taras Glek wrote:
> I still haven't heard of anybody using dehydra C in the wild. Can't
> seriously consider C-related issues until I see some bug/success reports.

Tarmik above seemed to be willing to use it, but we apparently have lost
him :-(

Daniel Rogers

unread,
Jul 2, 2009, 10:30:06 AM7/2/09
to Jean-Marc Desperrier, dev-stati...@lists.mozilla.org

I don't know. At the moment it depends entirely on if the compiler
marks it as such when compiling C. I'll test it.

Also, let me actually get this patch out. Been very busy with family.

--
Daniel

Daniel Rogers

unread,
Jul 2, 2009, 10:40:21 AM7/2/09
to Jean-Marc Desperrier, dev-stati...@lists.mozilla.org

On Jun 30, 2009, at 8:04 AM, Jean-Marc Desperrier wrote:

> Should (Will ?) the attribute be set when compiling C files ?

Yes. It does. I added a test case that verifies this. I think it
should because GCC does and it can substantially simplify the
procedure for writing language bindings (which is my primary interest).

--
Daniel

0 new messages