/**
* Pushes a Type object onto the stack.
*/
public void push(Type type){
if (type == null) {
throw new AssertionViolatedException("Cannot push NULL onto OperandStack.");
}
if (type == Type.BOOLEAN || type == Type.CHAR || type == Type.BYTE || type == Type.SHORT){
throw new AssertionViolatedException("The OperandStack does not know about '"+type+"'; use Type.INT instead.");
}
if (slotsUsed() >= maxStack){
throw new AssertionViolatedException("OperandStack too small, should have thrown proper Exception elsewhere. Stack: "+this);
}
stack.add(type);
}