C Code Generation

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Tue Jan 23 17:35:24 UTC 2001


On Tue, 23 Jan 2001, Edward P Luwish wrote:

> Can anyone describe the subset?  For those of us who need to dink with
> the CCodeGenerator, it would be helpful to have, if not a formal
> syntax and semantics, at least some examples of what can NOT currently
> be translated (the Interpreter class has sufficient examples of what
> CAN).

Basically you can only handle primitive types, that is numbers and arrays,
and the C built-in operations on them, which translate straight into C.
You have control structures, but no general blocks. See CCodeGenerator,
protocol "C translation".

What you cannot do is call any method on "regular" objects.

Imagine it like C with Smalltalk syntax.  When you write a method it is
translated to a function.  You can call it via a self-send, which is
translated to a function call. To interface to the image, you need to call
functions on interpreterProxy.

-- Bert





More information about the Squeak-dev mailing list