Using CCodeGenerator for something beyond Plugins

David Pennell dpennell at fastmail.fm
Wed Mar 20 14:13:10 UTC 2002


Well, sort of...

I ported CCodeGenerator to VW 5i.4 and made the following changes:
- pass self as the first argument
- instance variables are structure members
- integrated type definitions with the VW DLL/CC type classes
- used VW pragmas to specify types

I got carried away and ripped out much of the Squeak specific code
since I didn't need it and it was in my way.  Its at the stage where
it will generate proper code, but the inliner is broken.  I haven't 
looked at it in two or three months.

-david 

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Ned Konz
> Sent: Tuesday, March 19, 2002 5:38 PM
> To: squeak-dev at lists.squeakfoundation.org
> Subject: Using CCodeGenerator for something beyond Plugins
> 
> 
> I'm interested in using the Slang support 
> (CCodeGenerator/TParseNode and 
> friends) for emitting C for embedded systems.
> 
> However, the existing classes won't work for more general 
> cases, where there 
> may be more than one object of a particular class. The 
> Plugins convert 
> instance variables into globals and throw away self.
> 
> I was wondering whether anyone has come up with versions of 
> these that differ 
> from the Plugin versions as follows:
> 
> * instance variables become structure members rather than globals
> * don't throw away self; instead pass as initial pointer argument
> 
> Later, I'll want to do versions of these that generate 
> assembly language or 
> microcontroller byte code.
> 
> Oh yes, and I'm generating the Smalltalk with the scripting 
> system. It 
> promises to be an interesting system: draw state diagrams, 
> drag tiles into 
> scripts, then hit the "generate C" button...
> 
> -- 
> Ned Konz
> currently: Stanwood, WA
> email:     ned at bike-nomad.com
> homepage:  http://bike-nomad.com
> 




More information about the Squeak-dev mailing list