47 lines
1.3 KiB
Java
Raw Normal View History

2013-10-18 13:33:46 +02:00
// ino.module.MinusOp.8603.package
2014-09-02 10:33:54 +02:00
package de.dhbwstuttgart.syntaxtree.operator;
2013-10-18 13:33:46 +02:00
// ino.end
// ino.module.MinusOp.8603.import
import java.util.Vector;
2014-09-02 10:33:54 +02:00
2014-09-04 16:35:44 +02:00
import de.dhbwstuttgart.bytecode.ClassFile;
import de.dhbwstuttgart.bytecode.CodeAttribute;
import de.dhbwstuttgart.bytecode.JVMCode;
import de.dhbwstuttgart.myexception.JVMCodeException;
2014-09-02 10:33:54 +02:00
import de.dhbwstuttgart.syntaxtree.statement.Binary;
import de.dhbwstuttgart.syntaxtree.statement.Expr;
2013-10-18 13:33:46 +02:00
// ino.class.MinusOp.24211.declaration
public class MinusOp extends AddOp
// ino.end
// ino.class.MinusOp.24211.body
{
// ino.method.MinusOp.24215.definition
public MinusOp(int offset, int variableLength)
// ino.end
// ino.method.MinusOp.24215.body
{
super(offset,variableLength);
}
// ino.end
// ino.method.codegen.24218.definition
public void codegen(ClassFile classfile, CodeAttribute code, Expr expr, boolean neg, Vector paralist)
throws JVMCodeException
// ino.end
// ino.method.codegen.24218.body
{
Expr expr1 = ((Binary)expr).get_Expr1();
Expr expr2 = ((Binary)expr).get_Expr2();
expr1.codegen(classfile, code, paralist);
expr2.codegen(classfile, code, paralist);
if(!neg) code.add_code(JVMCode.nsub(expr1.getTypeName()));
else code.add_code(JVMCode.nadd(expr1.getTypeName()));
}
// ino.end
}
// ino.end