Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / March 2004



Tip: Looking for answers? Try searching our database.

Plugin to modify source code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Paul Sexton - 04 Mar 2004 19:08 GMT
I've seen this asked but not answered:

I need to modify source code before the C++ compiler sees it, with
minimal user impact.

I see several approaches:

- Somebody said (January) that CW9 supports a new type of plugin that
can access the source between the  preprocessor and the compiler.  I
can find no reference to this anywhere in the SDK docs - is it for
real?

- Is it possible for one plugin to call another, i.e., a shim
"compiler" that would preprocess a file and then call the real
compiler to handle them? Ron, someone asked about this in December and
you said the engineers were gone for the holidays - was there an
answer that google can't find?

I've considered (but would prefer to avoid):

A perl script that processes the entire source tree on every build and
generates new source files that are added to the project. This might
actually be faster (since files could be cached) but seems messy.

Any thoughts?

Paul
<paul AT patchdance DOT com>
MW Ron - 04 Mar 2004 21:20 GMT
>I've seen this asked but not answered:
>
[quoted text clipped - 21 lines]
>
>Any thoughts?

If you look in the CodeWarrior SDK there is a sample preprocessor
project  you should be able to use that to make your own plugin.

Ron

Signature

Announcing  CodeWarrior Development Tools for Windows v9.2
http://www.metrowerks.com/MW/Develop/Desktop/Windows/Professional/Default.htm
Ron Liechty - MWRon@metrowerks.com - <http://www.metrowerks.com>

Ben Combee - 05 Mar 2004 03:40 GMT
>  - Is it possible for one plugin to call another, i.e., a shim
> "compiler" that would preprocess a file and then call the real
> compiler to handle them? Ron, someone asked about this in December and
> you said the engineers were gone for the holidays - was there an
> answer that google can't find?

A compiler can process one file type, adding or updating a file in the
project.  In the Palm OS world, there's one plugin that turns .rcp files
into .r files that then get built with Rez, and there's another
compiler, part of the Sybase Ultralite product, that processes SQL
statements into generated code.  To use these, your source needs to have
a different extension to be associated with the other compiler.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.