package st.gravel.support.compiler.jvm;
/*
This file is automatically generated from typed smalltalk source. Do not edit by hand.
(C) AG5.com
*/
import java.math.BigInteger;
import st.gravel.support.jvm.NonLocalReturn;
import st.gravel.support.compiler.jvm.Invoke;
import st.gravel.support.compiler.jvm.Invoke.Invoke_Factory;
import st.gravel.support.compiler.jvm.JVMDefinedObjectType;
import st.gravel.support.compiler.jvm.JVMMethodType;
import st.gravel.support.compiler.jvm.JVMInstructionVisitor;
import st.gravel.support.compiler.jvm.JVMStack;
import st.gravel.support.compiler.jvm.JVMInstruction;
import st.gravel.support.compiler.jvm.JVMType;
public class InvokeInterface extends Invoke implements Cloneable {
public static InvokeInterface_Factory factory = new InvokeInterface_Factory();
public static class InvokeInterface_Factory extends Invoke_Factory {
public InvokeInterface basicNew() {
InvokeInterface newInstance = new InvokeInterface();
newInstance.initialize();
return newInstance;
}
@Override
public InvokeInterface ownerType_name_signature_(final JVMDefinedObjectType _aJVMDefinedObjectType, final String _aString, final JVMMethodType _aJVMMethodType) {
return ((InvokeInterface) this.basicNew().initializeOwnerType_name_signature_(_aJVMDefinedObjectType, _aString, _aJVMMethodType));
}
}
static public InvokeInterface _ownerType_name_signature_(Object receiver, final JVMDefinedObjectType _aJVMDefinedObjectType, final String _aString, final JVMMethodType _aJVMMethodType) {
return factory.ownerType_name_signature_(_aJVMDefinedObjectType, _aString, _aJVMMethodType);
}
@Override
public <X> X accept_(final JVMInstructionVisitor<X> _visitor) {
return _visitor.visitInvokeInterface_(this);
}
public InvokeInterface copy() {
try {
InvokeInterface _temp1 = (InvokeInterface) this.clone();
_temp1.postCopy();
return _temp1;
} catch (CloneNotSupportedException e) {
throw new RuntimeException(e);
}
}
@Override
public JVMInstruction effectStack_(final JVMStack _aJVMStack) {
for (int _temp1 = 0; _temp1 < _signature.arguments().length; _temp1++) {
final JVMType _each = _signature.arguments()[(_signature.arguments().length - _temp1) - 1];
_aJVMStack.popType_(_each);
}
_aJVMStack.pop();
if (!_signature.returnType().isVoidType()) {
_aJVMStack.push_(_signature.returnType());
}
return this;
}
public InvokeInterface_Factory factory() {
return factory;
}
@Override
public InvokeInterface initializeOwnerType_name_signature_(final JVMDefinedObjectType _aJVMDefinedObjectType, final String _aString, final JVMMethodType _aJVMMethodType) {
_ownerType = _aJVMDefinedObjectType;
_name = _aString;
_signature = _aJVMMethodType;
this.initialize();
return this;
}
@Override
public InvokeInterface printOn_(final StringBuilder _aStream) {
final String _title;
_title = this.factory().toString();
_aStream.append(st.gravel.support.jvm.CharacterExtensions.isVowel(_title.charAt(0)) ? "an " : "a ");
_aStream.append(_title);
_aStream.append('[');
this.sourceOn_(_aStream);
_aStream.append(']');
return this;
}
@Override
public InvokeInterface sourceOn_(final StringBuilder _aStream) {
_aStream.append(_ownerType.dottedClassName());
_aStream.append(".");
_aStream.append(_name);
_aStream.append(_signature.toString());
return this;
}
@Override
public InvokeInterface withReturnType_(final JVMType _aType) {
if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) {
return InvokeInterface.this;
}
throw new RuntimeException("niy");
}
}