View previous topic :: View next topic |
Author |
Message |
svanleent
Joined: 25 Sep 2004 Posts: 53
|
Posted: Tue Jun 13, 2006 12:23 pm Post subject: Feature Request |
|
|
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 |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Tue Jun 13, 2006 7:16 pm Post subject: Re: Feature Request |
|
|
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 |
|
|
svanleent
Joined: 25 Sep 2004 Posts: 53
|
Posted: Wed Jun 14, 2006 11:15 am Post subject: Re: Feature Request |
|
|
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 |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Wed Jun 14, 2006 2:38 pm Post subject: |
|
|
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 |
|
|
Derek Parnell
Joined: 22 Apr 2004 Posts: 408 Location: Melbourne, Australia
|
Posted: Wed Jun 14, 2006 11:10 pm Post subject: Re: Feature Request |
|
|
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 |
|
|
svanleent
Joined: 25 Sep 2004 Posts: 53
|
Posted: Thu Jun 15, 2006 10:15 am Post subject: Re: Feature Request |
|
|
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 |
|
|
|
|
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
|