Package jminusminus

Examples of jminusminus.CLEmitter.addLabel()


        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ICONST_1);
        e.addBranchInstruction(IF_ICMPGT, "Label1");
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(IRETURN);
        e.addLabel("Label1");
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ALOAD_0);
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ICONST_1);
        e.addNoArgInstruction(ISUB);
View Full Code Here


        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ICONST_1);
        e.addBranchInstruction(IF_ICMPGT, "falseLabel");
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(IRETURN);
        e.addLabel("falseLabel");
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ALOAD_0);
        e.addNoArgInstruction(ILOAD_1);
        e.addNoArgInstruction(ICONST_1);
        e.addNoArgInstruction(ISUB);
View Full Code Here

        accessFlags.add("public");
        accessFlags.add("static");
        e.addMethod(accessFlags, "main", "([Ljava/lang/String;)V", null, true);
        e.addExceptionHandler("tryStart", "tryEnd", "catch",
                "java/lang/NumberFormatException");
        e.addLabel("tryStart");
        e.addReferenceInstruction(NEW, "Factorial");
        e.addNoArgInstruction(DUP);
        e.addMemberAccessInstruction(INVOKESPECIAL, "Factorial", "<init>",
                "()V");
        e.addNoArgInstruction(ASTORE_1);
View Full Code Here

                "append", "(I)Ljava/lang/StringBuffer;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/lang/StringBuffer",
                "toString", "()Ljava/lang/String;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/io/PrintStream",
                "println", "(Ljava/lang/String;)V");
        e.addLabel("tryEnd");
        e.addBranchInstruction(GOTO, "done");
        e.addLabel("catch");
        e.addNoArgInstruction(ASTORE_1);
        e.addMemberAccessInstruction(GETSTATIC, "java/lang/System", "err",
                "Ljava/io/PrintStream;");
View Full Code Here

                "toString", "()Ljava/lang/String;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/io/PrintStream",
                "println", "(Ljava/lang/String;)V");
        e.addLabel("tryEnd");
        e.addBranchInstruction(GOTO, "done");
        e.addLabel("catch");
        e.addNoArgInstruction(ASTORE_1);
        e.addMemberAccessInstruction(GETSTATIC, "java/lang/System", "err",
                "Ljava/io/PrintStream;");
        e.addReferenceInstruction(NEW, "java/lang/StringBuffer");
        e.addNoArgInstruction(DUP);
View Full Code Here

                "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/lang/StringBuffer",
                "toString", "()Ljava/lang/String;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/io/PrintStream",
                "println", "(Ljava/lang/String;)V");
        e.addLabel("done");
        e.addNoArgInstruction(RETURN);

        // Write Factorial.class to file system
        e.write();
    }
View Full Code Here

        e.addNoArgInstruction(LCONST_1);
        e.addNoArgInstruction(LCMP);
        e.addBranchInstruction(IFGT, "falseLabel");
        e.addNoArgInstruction(LLOAD_1);
        e.addNoArgInstruction(LRETURN);
        e.addLabel("falseLabel");
        e.addNoArgInstruction(LLOAD_1);
        e.addNoArgInstruction(ALOAD_0);
        e.addNoArgInstruction(LLOAD_1);
        e.addNoArgInstruction(LCONST_1);
        e.addNoArgInstruction(LSUB);
View Full Code Here

        accessFlags.add("public");
        accessFlags.add("static");
        e.addMethod(accessFlags, "main", "([Ljava/lang/String;)V", null, true);
        e.addExceptionHandler("tryStart", "tryEnd", "catch",
                "java/lang/NumberFormatException");
        e.addLabel("tryStart");
        e.addReferenceInstruction(NEW, "LongFactorial");
        e.addNoArgInstruction(DUP);
        e.addMemberAccessInstruction(INVOKESPECIAL, "LongFactorial", "<init>",
                "()V");
        e.addNoArgInstruction(ASTORE_1);
View Full Code Here

                "append", "(J)Ljava/lang/StringBuffer;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/lang/StringBuffer",
                "toString", "()Ljava/lang/String;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/io/PrintStream",
                "println", "(Ljava/lang/String;)V");
        e.addLabel("tryEnd");
        e.addBranchInstruction(GOTO, "done");
        e.addLabel("catch");
        e.addNoArgInstruction(ASTORE_1);
        e.addMemberAccessInstruction(GETSTATIC, "java/lang/System", "err",
                "Ljava/io/PrintStream;");
View Full Code Here

                "toString", "()Ljava/lang/String;");
        e.addMemberAccessInstruction(INVOKEVIRTUAL, "java/io/PrintStream",
                "println", "(Ljava/lang/String;)V");
        e.addLabel("tryEnd");
        e.addBranchInstruction(GOTO, "done");
        e.addLabel("catch");
        e.addNoArgInstruction(ASTORE_1);
        e.addMemberAccessInstruction(GETSTATIC, "java/lang/System", "err",
                "Ljava/io/PrintStream;");
        e.addReferenceInstruction(NEW, "java/lang/StringBuffer");
        e.addNoArgInstruction(DUP);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.