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.JVMInstruction; import st.gravel.support.compiler.jvm.JVMInstruction.JVMInstruction_Factory; import st.gravel.support.compiler.jvm.JVMDefinedObjectType; import st.gravel.support.compiler.jvm.JVMInstructionVisitor; import st.gravel.support.compiler.jvm.JVMStack; import st.gravel.support.compiler.jvm.JVMType; public class NewInstance extends JVMInstruction implements Cloneable { public static NewInstance_Factory factory = new NewInstance_Factory(); JVMDefinedObjectType _type; public static class NewInstance_Factory extends JVMInstruction_Factory { public NewInstance basicNew() { NewInstance newInstance = new NewInstance(); newInstance.initialize(); return newInstance; } public NewInstance className_(final String _aString) { return this.type_(JVMDefinedObjectType.factory.className_(_aString)); } public NewInstance type_(final JVMDefinedObjectType _aJVMDefinedObjectType) { return this.basicNew().initializeType_(_aJVMDefinedObjectType); } } static public NewInstance _className_(Object receiver, final String _aString) { return factory.className_(_aString); } static public NewInstance _type_(Object receiver, final JVMDefinedObjectType _aJVMDefinedObjectType) { return factory.type_(_aJVMDefinedObjectType); } @Override public <X> X accept_(final JVMInstructionVisitor<X> _visitor) { return _visitor.visitNewInstance_(this); } public NewInstance copy() { try { NewInstance _temp1 = (NewInstance) this.clone(); _temp1.postCopy(); return _temp1; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } @Override public JVMInstruction effectStack_(final JVMStack _aJVMStack) { _aJVMStack.push_(this.type()); return this; } public NewInstance_Factory factory() { return factory; } public NewInstance initializeType_(final JVMDefinedObjectType _aJVMDefinedObjectType) { _type = _aJVMDefinedObjectType; this.initialize(); return this; } @Override public NewInstance 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 NewInstance sourceOn_(final StringBuilder _aStream) { return this; } @Override public JVMDefinedObjectType type() { return _type; } @Override public NewInstance withReturnType_(final JVMType _aType) { if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) { return NewInstance.this; } throw new RuntimeException("niy"); } }