🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1036
From: Richard Wesley
Date: Wed, 27 Feb 2002 20:56
47 lines
2687 bytes
In article 
<oster-B8530D.08470726022002@newssvr14-ext.news.prodigy.com>,
 David Phillip Oster <oster@ieee.org> wrote:

> 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?

David -

I did this with Alex's flex/bison plugins last summer and it was pretty 
simple.  CW seems to just get it if you set up the link order correctly.

You _do_ have to add the output file, but it is not a big deal.

HTH,

-- 

- rmgw

http://www.electricfish.com/hawkfish/

----------------------------------------------------------------------------
Richard Wesley           Electric Fish, Inc.       hawkfish@electricfish.com

"You miss too much these days if you stop to think."
                  - U2, "Waiting for the End of the World"
Technical Details
Message-ID: <hawkfish-6969EC.12561827022002@brokaw.wa.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp.abs.net!newsfeed.cwix.com!nwnews.wa.com!brokaw.wa.com!hawkfish
References: <oster-B8530D.08470726022002@newssvr14-ext.news.prodigy.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,daecabf3b262f1cb
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,daecabf3b262f1cb
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-02-27 13:10:06 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp.abs.net!newsfeed.cwix.com!nwnews.wa.com!brokaw.wa.com!hawkfish
From: Richard Wesley <hawkfish@electricfish.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: Re: [Q] How do I use a source code generator?
Date: Wed, 27 Feb 2002 12:56:19 -0800
Organization: Electric Fish, Inc.
Lines: 47
Message-ID: <hawkfish-6969EC.12561827022002@brokaw.wa.com>
References: <oster-B8530D.08470726022002@newssvr14-ext.news.prodigy.com>
NNTP-Posting-Host: fugu.electricfish.com
X-Trace: brokaw.wa.com 1014843377 18928 206.63.251.169 (27 Feb 2002 20:56:17 GMT)
NNTP-Posting-Date: 27 Feb 2002 20:56:17 GMT
User-Agent: MT-NewsWatcher/3.1 (PPC)