www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - DMDFE on dsource

reply Brad Beveridge <brad somewhere.net> writes:
Hi all,
I notice that there is a DMDFE project on dsource.org, but there doesn't 
appear to be any downloads & the SVN tree is empty.  Is dsource the 
proper place to look for the latest DMDFE?

I am planning on using DMDFE to try and generate D to Lua bindings 
automatically - am I correct in assuming that DMDFE is suitable for this 
purpose?

Thanks
Brad
Jun 10 2005
next sibling parent reply Mike Parker <aldacron71 yahoo.com> writes:
Brad Beveridge wrote:
 Hi all,
 I notice that there is a DMDFE project on dsource.org, but there doesn't 
 appear to be any downloads & the SVN tree is empty.  Is dsource the 
 proper place to look for the latest DMDFE?

http://home.comcast.net/~benhinkle/dmdfe/
 
 I am planning on using DMDFE to try and generate D to Lua bindings 
 automatically - am I correct in assuming that DMDFE is suitable for this 
 purpose?

No, that's not what it's for. DMDFE is for parsing D source, not for generating D bindings to C libraries. It's the same code that's in your dmd\src\dmd directory, but with the calls to the backend stubbed out. As to the Lua binding, Clay Smith already created one. Look in the trunk of the Bindings project at dsource.
Jun 10 2005
parent Brad Beveridge <brad somewhere.net> writes:
Mike Parker wrote:
 No, that's not what it's for. DMDFE is for parsing D source, not for 
 generating D bindings to C libraries. It's the same code that's in your 
 dmd\src\dmd directory, but with the calls to the backend stubbed out.
 
 As to the Lua binding, Clay Smith already created one. Look in the trunk 
 of the Bindings project at dsource.
 

wrappers from D code, so that your embedded Lua code can call into D. Brad
Jun 10 2005
prev sibling next sibling parent reply "Ben Hinkle" <bhinkle mathworks.com> writes:
"Brad Beveridge" <brad somewhere.net> wrote in message 
news:d8cd6v$1ekm$1 digitaldaemon.com...
 Hi all,
 I notice that there is a DMDFE project on dsource.org, but there doesn't 
 appear to be any downloads & the SVN tree is empty.  Is dsource the proper 
 place to look for the latest DMDFE?

I need to put the code up there. I'll try to do that today. For the time being the original site http://home.comcast.net/~benhinkle/dmdfe/ (plus some changes to get it built on Linux) has the port for dmd.121 (old, I know!)
 I am planning on using DMDFE to try and generate D to Lua bindings 
 automatically - am I correct in assuming that DMDFE is suitable for this 
 purpose?

I'm not sure what you have in mind. DMDFE will parse D source code into the parse tree the compiler uses, runs the compiler's semantic analysis phases and then quits. It is useful for tools that want to parse and manipulate D source code. Are you thinking your tool would take some D code and spit out some Lua wrappers? It might be better to check out SWIG.
Jun 10 2005
parent Brad Beveridge <brad somewhere.net> writes:
Ben Hinkle wrote:
 I'm not sure what you have in mind. DMDFE will parse D source code into the 
 parse tree the compiler uses, runs the compiler's semantic analysis phases 
 and then quits. It is useful for tools that want to parse and manipulate D 
 source code. Are you thinking your tool would take some D code and spit out 
 some Lua wrappers? It might be better to check out SWIG. 

ultimately want to do is parse D code and generate Lua wrappers for public functions. This will involve having to generate intermediate C wrappers for the D functions (I think). I was hoping to use DMDFE to parse out the function definitions and work from there, but considering how simple the D grammer is I may be able to write a simple parser that can extract functions without using DMDFE. I don't think that SWIG will suit me, as I understand it SWIG is basically a C/C++ parser that can generate wrappers that allow other languages to interface to existing C code. I want to make a tool that takes existing D code and allows Lua to call D functions (by first calling C functions). Perhaps a good first step will be making a tool that wraps C functions around D functions. Does anyone have thoughts on this? Thanks Brad
Jun 10 2005
prev sibling parent reply Ben Hinkle <Ben_member pathlink.com> writes:
I notice that there is a DMDFE project on dsource.org, but there doesn't 
appear to be any downloads & the SVN tree is empty.  Is dsource the 
proper place to look for the latest DMDFE?

Just a quick follow-up. I added dmdfe for dmd.126 to the svn tree.
Jun 12 2005
parent Brad Beveridge <brad somewhere.net> writes:
Ben Hinkle wrote:
I notice that there is a DMDFE project on dsource.org, but there doesn't 
appear to be any downloads & the SVN tree is empty.  Is dsource the 
proper place to look for the latest DMDFE?

Just a quick follow-up. I added dmdfe for dmd.126 to the svn tree.

cheap D parser that is simply interested in extracting variable/class declarations and function signatures. It wasn't too hard (or too many lines of code) to get something reasonable working. Personally, I am just going to stick with my simple code - I don't think that I'll need the full syntax parse. If/when I get my program generating C wrapper code I'll put it up on dsource. (Note - I know I said before that I am going to generate Lua callable code, but I need to generate C code as a first step toward this) As an aside, should Phobos perhaps have a Tokenizer class that can act on streams? I wrote a crappy one & it would have been nice to have a full featured on in the standard library. Brad
Jun 13 2005