com.russell_allen.smallworld
Class SmallInterpreter

java.lang.Object
  extended by com.russell_allen.smallworld.SmallInterpreter

 class SmallInterpreter
extends java.lang.Object

I do all of the heavy lifting, including (currently) the loading and saving of an image to file. I hold references to specific objects in the system: nil, true, false, Array, Block, Context, Integer and the numbers 0-9. From these references, you can get to Class, which holds references to all the classes in the system in Class#classes.


Nested Class Summary
private  class SmallInterpreter.ActionThread
           
 
Field Summary
 SmallObject ArrayClass
           
 SmallObject BlockClass
           
 SmallObject ContextClass
           
 SmallObject falseObject
           
static int imageFormatVersion
           
 SmallObject IntegerClass
           
 SmallObject nilObject
           
 SmallInt[] smallInts
           
 SmallObject trueObject
           
 
Constructor Summary
SmallInterpreter()
           
 
Method Summary
(package private)  SmallObject buildContext(SmallObject oldContext, SmallObject arguments, SmallObject method)
           
(package private)  SmallObject execute(SmallObject context, java.lang.Thread myThread, java.lang.Thread parentThread)
           
 boolean loadImageFromInputStream(java.io.InputStream name)
           
private  SmallObject methodLookup(SmallObject receiver, SmallByteArray messageSelector, SmallObject context, SmallObject arguments)
           
(package private)  SmallInt newInteger(int val)
           
private  boolean saveImageToOutputStream(java.io.OutputStream name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageFormatVersion

public static final int imageFormatVersion
See Also:
Constant Field Values

nilObject

public SmallObject nilObject

trueObject

public SmallObject trueObject

falseObject

public SmallObject falseObject

smallInts

public SmallInt[] smallInts

ArrayClass

public SmallObject ArrayClass

BlockClass

public SmallObject BlockClass

ContextClass

public SmallObject ContextClass

IntegerClass

public SmallObject IntegerClass
Constructor Detail

SmallInterpreter

SmallInterpreter()
Method Detail

loadImageFromInputStream

public boolean loadImageFromInputStream(java.io.InputStream name)

saveImageToOutputStream

private boolean saveImageToOutputStream(java.io.OutputStream name)

newInteger

SmallInt newInteger(int val)

methodLookup

private SmallObject methodLookup(SmallObject receiver,
                                 SmallByteArray messageSelector,
                                 SmallObject context,
                                 SmallObject arguments)
                          throws SmallException
Throws:
SmallException

buildContext

SmallObject buildContext(SmallObject oldContext,
                         SmallObject arguments,
                         SmallObject method)

execute

SmallObject execute(SmallObject context,
                    java.lang.Thread myThread,
                    java.lang.Thread parentThread)
              throws SmallException
Throws:
SmallException