Class ByteStore


			
class ByteStore
Programmer: Matt Splett

Description:

This is the temporary holding store for compiled bytecodes. It will be used to create Compiled Methods from.

Public Methods:

ByteStore ( );
I am the default constructor

ByteStore (const ByteStore &);
I am the copy constructor.

ByteStore (const ByteStore & source, const UInteger & start, const UInteger & stop);
I am the subset constructor... I copy a subset of source from start up to stop So if you want a copy of the entire bytestream, use: Bytestore(source, 0, source.count());

~ByteStore ( );
destructor - nothing different

void pushStackTop ();


void pushActiveContext ();


void pushSelf ();


void popStackTop ();


void returnBlock ();


void returnMessage ();


void pushReceiver (const UInteger & index);


void pushTemporary (const UInteger & index);


void pushLiteral (const UInteger & index);


void pushAssociation (const UInteger & index);


void pushSpecial (const UInteger & index);


void popReceiver (const UInteger & index);


void popTemporary (const UInteger & index);


void popLiteral (const UInteger & index);


void popAssociation (const UInteger & index);


void storeReceiver (const UInteger & index);


void storeTemporary (const UInteger & index);


void storeLiteral (const UInteger & index);


void storeAssociation (const UInteger & index);


void returnIndex (const UInteger & index);


void jump (const SInteger & distance);


void jumpTrue (const SInteger & distance);


void jumpFalse (const SInteger & distance);


void send (const UInteger & index, const UInteger & argCount);


void sendSuper (const UInteger & index, const UInteger & argCount);


void sendStatic (const UInteger & index, const UInteger & argCount);


UInteger count ();
Returns myCount, the current number of bytes in the store and the index of the next byte to be added.

void append (const ByteStore &);
I append the contents of a bytestore to the end of my bytestream.

Byte & operator[] ( const UInteger & index );
Byte & operator[]( const UInteger & index ) const; needs to be done in dynblock Returns the byte at index in the bytestore.

const Byte & operator[] ( const UInteger & index );
Byte & operator[]( const UInteger & index ) const; needs to be done in dynblock Returns the byte at index in the bytestore.

Protected Methods:

void push (const OpCode1);
opCode - no args.

void push (const OpCode2, const Byte);
opCode - one arg.

void push (const OpCode3, const BigByte);
opCode - signed large arg.

void push (const OpCode4, const Byte, const Byte);
opCode - one arg. test driver TESTING

Protected Members:


DynBlock<Byte> myStore;
myStore - container for opcodes.


UInteger myCount;
myCount the number of bytes in the store.