package runEnv; public class RunAddress extends RunValue { /* Represents the "value" of a var parameter */ RunValue value; private Multiple base; private int offset; public RunAddress( Multiple base, int offset ) { if ( offset < 0 || offset >= base.size() ) throw new Error( "Invalid address" ); this.base = base; this.offset = offset; } public RunAddress( Multiple base ) { this( base, 0 ); } public RunValue getValue() { return base.getValue( offset ); } public void setValue( RunValue value ) { base.setValue( offset, value ); } public RunAddress getAddress( int index ) { return new RunAddress( base, offset + index ); } public RunAddress addressValue() { return this; } public String toString() { // new Error( "RunAddress" ).printStackTrace(); // System.exit( 0 ); return "(" + Integer.toHexString( base.size() ) + ")+" + Integer.toHexString( offset ); } }