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.JVMControlFlowInstruction; import st.gravel.support.compiler.jvm.JVMControlFlowInstruction.JVMControlFlowInstruction_Factory; import st.gravel.support.compiler.jvm.PushTrue; import st.gravel.support.compiler.jvm.PushFalse; import st.gravel.support.compiler.jvm.Frame; import st.gravel.support.compiler.jvm.JVMInstructionVisitor; import st.gravel.support.compiler.jvm.JVMStack; import st.gravel.support.compiler.jvm.JVMType; abstract public class Fork extends JVMControlFlowInstruction implements Cloneable { public static Fork_Factory factory = new Fork_Factory(); Frame _falseFrame; Frame _trueFrame; public static class Fork_Factory extends JVMControlFlowInstruction_Factory { public Fork basicNew() { throw new RuntimeException("Fork is an abstract class"); } public Fork r_boolean() { return ((Fork) this.trueFrame_falseFrame_(PushTrue.factory.basicNew().asFrame(), PushFalse.factory.basicNew().asFrame())); } public Fork trueFrame_falseFrame_(final Frame _aFrame, final Frame _aFrame2) { return ((Fork) this.basicNew().initializeTrueFrame_falseFrame_(_aFrame, _aFrame2)); } } static public Fork _r_boolean(Object receiver) { return factory.r_boolean(); } static public Fork _trueFrame_falseFrame_(Object receiver, final Frame _aFrame, final Frame _aFrame2) { return factory.trueFrame_falseFrame_(_aFrame, _aFrame2); } @Override public <X> X accept_(final JVMInstructionVisitor<X> _visitor) { return _visitor.visitFork_(this); } public Fork copy() { try { Fork _temp1 = (Fork) this.clone(); _temp1.postCopy(); return _temp1; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } public Fork_Factory factory() { return factory; } public Frame falseFrame() { return _falseFrame; } @Override public Fork initialize() { if (_trueFrame == null) { _trueFrame = PushTrue.factory.basicNew().asFrame(); } if (_falseFrame == null) { _falseFrame = PushFalse.factory.basicNew().asFrame(); } return this; } public Fork initializeTrueFrame_falseFrame_(final Frame _aFrame, final Frame _aFrame2) { _trueFrame = _aFrame; _falseFrame = _aFrame2; this.initialize(); return this; } @Override public Fork 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; } public Fork pushTypeOnStack_(final JVMStack _aJVMStack) { if (!this.type().isBottomType()) { _aJVMStack.push_(Fork.this.type()); } return this; } @Override public Fork sourceOn_(final StringBuilder _aStream) { return this; } public Frame trueFrame() { return _trueFrame; } @Override public JVMType type() { if (_trueFrame.type().isBottomType()) { return _falseFrame.type(); } if (_falseFrame.type().isBottomType()) { return _trueFrame.type(); } st.gravel.support.jvm.ObjectExtensions.assert_(this, st.gravel.support.jvm.ObjectExtensions.equals_(_trueFrame.type(), _falseFrame.type())); return _falseFrame.type(); } @Override public Fork withReturnType_(final JVMType _aType) { if (st.gravel.support.jvm.ObjectExtensions.equals_(this.type(), _aType)) { return Fork.this; } throw new RuntimeException("niy"); } }