// ino.module.PostDecExpr.8646.package package mycompiler.mystatement; // ino.end // ino.module.PostDecExpr.8646.import import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; import mycompiler.SyntaxTreeNode; import mycompiler.mybytecode.ClassFile; import mycompiler.mybytecode.CodeAttribute; import mycompiler.mybytecode.JVMCode; import mycompiler.myclass.Class; import mycompiler.myexception.CTypeReconstructionException; import mycompiler.myexception.JVMCodeException; import mycompiler.myexception.SCExcept; import mycompiler.myexception.SCStatementException; import mycompiler.mytype.GenericTypeVar; import mycompiler.mytype.Pair; import mycompiler.mytype.RefType; import mycompiler.mytype.Type; import mycompiler.mytype.Void; import mycompiler.mytypereconstruction.CSupportData; import mycompiler.mytypereconstruction.CTriple; import mycompiler.mytypereconstruction.set.CSubstitutionSet; import mycompiler.mytypereconstruction.set.CTripleSet; import mycompiler.mytypereconstruction.set.CTypeAssumptionSet; import mycompiler.mytypereconstruction.typeassumption.CTypeAssumption; import mycompiler.mytypereconstruction.unify.Unify; import org.apache.log4j.Logger; // ino.end import typinferenz.ConstraintsSet; import typinferenz.JavaCodeResult; import typinferenz.ResultSet; import typinferenz.assumptions.TypeAssumptions; // ino.class.PostDecExpr.25987.declaration public class PostDecExpr extends UnaryExpr // ino.end // ino.class.PostDecExpr.25987.body { // ino.method.PostDecExpr.25991.definition public PostDecExpr(int offset,int variableLength) // ino.end // ino.method.PostDecExpr.25991.body { super(offset,variableLength); } // ino.end // ino.attribute.parserlog.25997.declaration protected static Logger parserlog = Logger.getLogger("parser"); // ino.end // ino.method.set_Expr.26000.definition public void set_Expr(Expr ex) // ino.end // ino.method.set_Expr.26000.body { this.expr = ex; } // ino.end // ino.method.get_Name.26003.definition public String get_Name() // ino.end // ino.method.get_Name.26003.body { return null; } // ino.end // ino.method.codegen.26009.definition public void codegen(ClassFile classfile, CodeAttribute code, Vector paralist) throws JVMCodeException // ino.end // ino.method.codegen.26009.body { if(expr instanceof LocalOrFieldVar) { String local_name = (String)((LocalOrFieldVar)expr).get_Name_Vector().lastElement(); int index = code.get_indexOf_Var(local_name); if(index != -1) { code.add_code(JVMCode.iinc); code.add_code_byte(index); code.add_code_byte(-1); } else { if(expr instanceof LocalOrFieldVar) { LocalOrFieldVar local = (LocalOrFieldVar)expr; Vector name_vector = local.get_Name_Vector(); Vector type_vector = local.get_Type_Vector(); String class_name = null; String type = null; for(int i=0; i < name_vector.size()-1; i++) { local_name = (String)name_vector.elementAt(i); type = JVMCode.get_codegen_Type((String)type_vector.elementAt(i), paralist); index = code.get_indexOf_Var(local_name); if(index != -1) { // LocalVar try{ String local_type = code.get_TypeOf_Var(local_name).getName(); code.add_code(JVMCode.nload_n(local_type, index)); } catch(JVMCodeException e) { // out of nload_n String local_type = code.get_TypeOf_Var(local_name).getName(); code.add_code(JVMCode.nload(local_type)); code.add_code_byte((byte)index); } } else { // FieldVar code.add_code(JVMCode.aload_0); code.add_code(JVMCode.getfield); code.add_code_short(classfile.add_field_ref(local_name, class_name, type)); } class_name = (String)type_vector.elementAt(i); } local_name = (String)name_vector.lastElement(); index = classfile.add_field_ref(local_name, class_name, JVMCode.get_codegen_Type("int", paralist)); code.add_code(JVMCode.dup); code.add_code(JVMCode.getfield); code.add_code_short(index); code.add_code(JVMCode.iconst_1); code.add_code(JVMCode.isub); code.add_code(JVMCode.putfield); code.add_code_short(index); } } } else if(expr instanceof InstVar) { InstVar instvar = (InstVar)expr; String instvar_name = instvar.get_codegen_UsedId(); int index = classfile.add_field_ref(instvar_name, null, null); code.add_code(JVMCode.aload_0); code.add_code(JVMCode.dup); code.add_code(JVMCode.getfield); code.add_code_short(index); code.add_code(JVMCode.iconst_1); code.add_code(JVMCode.isub); code.add_code(JVMCode.putfield); code.add_code_short(index); } else throw new JVMCodeException("JVMCodeException: PostDecExpr: void codegen(ClassFile classfile, Code_attribute code)"); } // ino.end // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26018.definition public void wandleRefTypeAttributes2GenericAttributes(Vector paralist, Vector genericMethodParameters) // ino.end // ino.method.wandleRefTypeAttributes2GenericAttributes.26018.body { } // ino.end public void addOffsetsToExpression(CTypeAssumption localAssumption,String NameVariable,boolean isMemberVariable) { expr.addOffsetsToExpression(localAssumption,NameVariable,isMemberVariable); } @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { // TODO Auto-generated method stub return null; } @Override public Vector getChildren() { Vector ret = new Vector(); ret.add(this.expr); return ret; } } // ino.end