FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Feature Request

 
Post new topic   Reply to topic     Forum Index -> Build
View previous topic :: View next topic  
Author Message
svanleent



Joined: 25 Sep 2004
Posts: 53

PostPosted: Tue Jun 13, 2006 12:23 pm    Post subject: Feature Request Reply with quote

It is (thanks to the D spec) possible to hook up preprocessors to parse specialized pragma(...) statements, before compiling them (as build is using them, for example). However, I'd like to be able to give build a hint at what for preprocessors I might like to use, before actually exectuting DMD. For example, this way, a Reflection library is (a modification of DFlect for example) becomes doable.

Regards,
Sjoerd
_________________
How C++ became ancient
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Tue Jun 13, 2006 7:16 pm    Post subject: Re: Feature Request Reply with quote

svanleent wrote:
It is (thanks to the D spec) possible to hook up preprocessors to parse specialized pragma(...) statements, before compiling them (as build is using them, for example). However, I'd like to be able to give build a hint at what for preprocessors I might like to use, before actually exectuting DMD. For example, this way, a Reflection library is (a modification of DFlect for example) becomes doable.


Can you explain a bit more about what you'd like to see happen or what you want to do. For example, what would this pragma look like and what would Build do with it? Give me a process flow because I don't understand what you are asking for.

It sounds very close to somethings it already does.
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
svanleent



Joined: 25 Sep 2004
Posts: 53

PostPosted: Wed Jun 14, 2006 11:15 am    Post subject: Re: Feature Request Reply with quote

Derek Parnell wrote:

Can you explain a bit more about what you'd like to see happen or what you want to do. For example, what would this pragma look like and what would Build do with it? Give me a process flow because I don't understand what you are asking for.

It sounds very close to somethings it already does.


Perhaps it already does that, but then I'm not aware of it. What I meant was for example:

test.d:
---
Code:
pragma(reflection, Reflect)
public class Something {
}
---

Then automatically, Build would invoke the reflection compiler (for example DFlect) and after that would call DMD. So:

Build-->DFlect-->Build-->DMD

It is not the best example perhaps, but it shows where I am looking for.

Regards,
Sjoerd
_________________
How C++ became ancient
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Wed Jun 14, 2006 2:38 pm    Post subject: Reply with quote

One thing you could do, is save the "to be reflected" modules with the extension .dr rather than plain .d -- then create an RDF pointing to your reflection generator. As I recall, I think the recent version of Build supports RDF utils generating .d files to be included in the build process. (This is what I plan to try doing in my own attempt at a reflector, although I've ran into a couple of issues that block it. Namely, how to store a collection of the FieldDecl and FieldImpl, and the MethodDecl and MethodImpl objects.)
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Derek Parnell



Joined: 22 Apr 2004
Posts: 408
Location: Melbourne, Australia

PostPosted: Wed Jun 14, 2006 11:10 pm    Post subject: Re: Feature Request Reply with quote

svanleent wrote:

Perhaps it already does that, but then I'm not aware of it. What I meant was for example:

test.d:
---
Code:

pragma(reflection, Reflect)
public class Something {
}
---

Then automatically, Build would invoke the reflection compiler (for example DFlect) and after that would call DMD. So:

Build-->DFlect-->Build-->DMD

It is not the best example perhaps, but it shows where I am looking for.


So 'test.d' would be passed to DFlect and that would produce a new source file, say 'test_df.d' and then Build would pass both files to the compiler. Is that how you see it happening? Are both object files to be linked. Would you expect that 'test.d' or one of its imported files would also import 'test_df.d'?
_________________
--
Derek
skype name: derek.j.parnell
Back to top
View user's profile Send private message
svanleent



Joined: 25 Sep 2004
Posts: 53

PostPosted: Thu Jun 15, 2006 10:15 am    Post subject: Re: Feature Request Reply with quote

Derek Parnell wrote:
svanleent wrote:

Perhaps it already does that, but then I'm not aware of it. What I meant was for example:

test.d:
---
Code:

pragma(reflection, Reflect)
public class Something {
}
---

Then automatically, Build would invoke the reflection compiler (for example DFlect) and after that would call DMD. So:

Build-->DFlect-->Build-->DMD

It is not the best example perhaps, but it shows where I am looking for.


So 'test.d' would be passed to DFlect and that would produce a new source file, say 'test_df.d' and then Build would pass both files to the compiler. Is that how you see it happening? Are both object files to be linked. Would you expect that 'test.d' or one of its imported files would also import 'test_df.d'?


The way of processing it could have differences such as:

Build detects D-File
Build detects unknown pragma
Searches for RDF extension
Runs the tool over that file
Uses created file
Continues

--- Or ---

Build detects D-File
Build detects unknown pragma
Searches for RDF extension
Runs the tool over that file
Uses both original as well as created file
Continues

Regards,
Sjoerd
_________________
How C++ became ancient
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Build All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group