multi-language GUI / shells in Smalltalk

Yoshiki Ohshima yoshiki at squeakland.org
Tue May 22 21:03:22 UTC 2007


  Step and everybody,

> did you publish it on squeaksource or place like that :)

  I finally uploaded a SAR package (sort of gave up on making
mcz... sorry) and created a SqueakMap entry for the META
implementation in Squeak.

http://map.squeak.org/account/package/e3cdcb13-a408-49c8-9a97-5e9b8befa4ac

  This package includes a sample implementation of Squeak Smalltalk-80
parser that can generate a simple intermediate form, and then
ParseNode and then Squeak bytecode.  I spent some time to make sure
this generates identical bytecode with the default Squeak compiler...
Now, a test like following:

------------
| m sq o |
o := Morph.
[o selectors do: [:sel |
	sq := SqueakParseNodeBuilder new encoder: (Encoder new init: o context: nil notifying: nil).
	m := (sq parse: (MSqueakParser2 match: (o sourceCodeAt: sel) string with: #method)) generate: #(0 0 0 0).
	(m decompileClass: o selector: sel) printString = (o decompile: sel) printString ifFalse: [self halt].
]] timeToRun
------------

that compiles the source code, decompile the result, and compare it
with the method compiled with the default compiler.  For example, all
the method of Morph seem to generate identical bytecode.

  My compiler doesn't do any fancy error handling...  However, with
the unlimited lookahead feature, it *should* be easier to write
necessary syntax error detection in the grammar itself.

-- Yoshiki



More information about the Squeak-dev mailing list