forked from JavaTX/JavaCompilerCore
64 lines
1.8 KiB
Java
Executable File
64 lines
1.8 KiB
Java
Executable File
// ino.module.LessOp.8601.package
|
|
package de.dhbwstuttgart.syntaxtree.operator;
|
|
// ino.end
|
|
// ino.module.LessOp.8601.import
|
|
import de.dhbwstuttgart.typeinference.Menge;
|
|
|
|
import de.dhbwstuttgart.bytecode.ClassFile;
|
|
import de.dhbwstuttgart.bytecode.CodeAttribute;
|
|
import de.dhbwstuttgart.bytecode.JVMCode;
|
|
import de.dhbwstuttgart.myexception.JVMCodeException;
|
|
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
|
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
|
|
|
|
|
|
|
|
|
// ino.class.LessOp.24173.declaration
|
|
public class LessOp extends RelOp
|
|
// ino.end
|
|
// ino.class.LessOp.24173.body
|
|
{
|
|
// ino.method.LessOp.24177.definition
|
|
public LessOp(int offset, int variableLength)
|
|
// ino.end
|
|
// ino.method.LessOp.24177.body
|
|
{
|
|
super(offset,variableLength);
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.codegen.24180.definition
|
|
public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean not, Menge paralist)
|
|
throws JVMCodeException
|
|
// ino.end
|
|
// ino.method.codegen.24180.body
|
|
{
|
|
Expr expr1 = ((Binary)expr).get_Expr1();
|
|
Expr expr2 = ((Binary)expr).get_Expr2();
|
|
expr1.codegen(classfile, code, paralist);
|
|
expr2.codegen(classfile, code, paralist);
|
|
if(!not) code.add_code(JVMCode.if_icmpge);
|
|
else code.add_code(JVMCode.if_icmplt);
|
|
code.add_code_short((short)7);
|
|
code.add_code(JVMCode.iconst_1);
|
|
code.add_code(JVMCode.goto_);
|
|
code.add_code_short((short)4);
|
|
code.add_code(JVMCode.iconst_0);
|
|
}
|
|
// ino.end
|
|
|
|
// ino.method.if_codegen.24183.definition
|
|
public void if_codegen(ClassFile classfile, CodeAttribute code, String type, boolean not)
|
|
throws JVMCodeException
|
|
// ino.end
|
|
// ino.method.if_codegen.24183.body
|
|
{
|
|
if(!not) code.add_code(JVMCode.if_icmpge);
|
|
else code.add_code(JVMCode.if_icmplt);
|
|
}
|
|
// ino.end
|
|
|
|
}
|
|
// ino.end
|