@Override
    public int getAddress(Identifier var, int size)
        throws Exception {
        addressRecord a = usedMem.get(var);
        if(a != null) {
            if(a.size != size) {
                throw new Exception("varaible accessed as different size than expected");
            }
            return a.address;
        }
        int address = freeAddress;
        freeAddress += size;
        usedMem.put(var, new addressRecord(address, size));
        return address;
    }