🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #1031

[Q] How do I use a source code generator?

#1031
From: David Phillip Oster
Date: Tue, 26 Feb 2002 16:47
32 lines
3013 bytes
What is the best way to use a source code generator with Codewarrior?

Say, I've got something like lex or yacc, that takes source code in a 
little language and generates a new file or stream of c++ source code, 
and that my input file has #includes in it. How do I:

1.) Tell Codewarrior that after it runs the translator on the input 
file, it should run the compiler on the resulting output file?

2.) Tell Codewarrior that the output C file depends on the input file, 
and also the include files?

3.) What if the translator generates both a .cp file, and a .r file?

Should I be writing my translator as a preprocessor plugin?

Should I junk the whole idea of seamless integration with Codewarrior, 
and just use MPW and MPW's makeFiles to do all the non-Codewarrior 
processing, then have it send an appleEvent to codewarrior to build the 
resulting C++?

What part of the Metrowerks documentation should I have read?

-----
This posting was inspired by the article in C/C++ Users Journal, March 
2002 issue, <http://www.cuj.com/> "A Technique for Efficient Logging and 
Monitoring of Real-Time Systems", by Bill Pyritz, which involves adding 
very concise tags to your C++ source code, then running the result 
through a processing program which expands the tags, depending on the 
context, to add verbose logging and tracing code. (Thus keeping the 
logging code out of the main flow of the source code, keeping the source 
code easy to read.)
Technical Details
Message-ID: <oster-B8530D.08470726022002@newssvr14-ext.news.prodigy.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.stealth.net!newscon02.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,daecabf3b262f1cb,start
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,daecabf3b262f1cb,start
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-02-26 08:48:02 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.stealth.net!newscon02.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!not-for-mail
From: David Phillip Oster <oster@ieee.org>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: [Q] How do I use a source code generator?
Organization: http://www.TurboZen.com
User-Agent: MT-NewsWatcher/3.1 (PPC)
X-Face: iR>C6?LNAcg&!xxr{}\7y$W@~UW,\:5'<H=KmFr^OY!`48#Nqao]VO#+oxocr        ="e"*!AxDM1my!y7uoK4<&hQ-9c\KxG_b3eD{JlM2+r0BYXAo<~N|g'3p<tXe37b[79@        ?46JFrQ?^D479N=<Au~;,ax]LOils0QyP.qY!Mw5o'2$<qA{V)<J-<2Y8K
Message-ID: <oster-B8530D.08470726022002@newssvr14-ext.news.prodigy.com>
Lines: 32
NNTP-Posting-Host: 64.167.142.226
X-Complaints-To: abuse@prodigy.net
X-Trace: newssvr14.news.prodigy.com 1014742026 ST000 64.167.142.226 (Tue, 26 Feb 2002 11:47:06 EST)
NNTP-Posting-Date: Tue, 26 Feb 2002 11:47:06 EST
X-UserInfo1: Q[OMRWWGPRR_RV\XNCOF_W\@PJ_^PBQLGPQRJWQHBATBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN
Date: Tue, 26 Feb 2002 16:47:06 GMT