2013-10-18 11:33:46 +00:00
|
|
|
// ino.module.LessOp.8601.package
|
2014-09-02 08:33:54 +00:00
|
|
|
package de.dhbwstuttgart.syntaxtree.operator;
|
2013-10-18 11:33:46 +00:00
|
|
|
// ino.end
|
|
|
|
// ino.module.LessOp.8601.import
|
|
|
|
import java.util.Vector;
|
2014-09-02 08:33:54 +00:00
|
|
|
|
|
|
|
import de.dhbwstuttgart.syntaxtree.statement.Binary;
|
|
|
|
import de.dhbwstuttgart.syntaxtree.statement.Expr;
|
2013-10-18 11:33:46 +00:00
|
|
|
import mycompiler.mybytecode.ClassFile;
|
|
|
|
import mycompiler.mybytecode.CodeAttribute;
|
|
|
|
import mycompiler.mybytecode.JVMCode;
|
|
|
|
import mycompiler.myexception.JVMCodeException;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 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, Vector 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
|