package ch.ntb.inf.deep.ssa.instruction;

import ch.ntb.inf.deep.ssa.SSAValue;

public class Call extends SSAInstruction {
	
	int ref;

	public Call(int opCode) {
		ssaOpcode = opCode;
	}
	
	public Call(int opCode, int ref){
		ssaOpcode = opCode;
		this.ref = ref;
	}
	
	
	public Call(int opCode,SSAValue[] operands){
		ssaOpcode = opCode;
		this.operands = operands;
	}
	
	public Call(int opCode, int ref, SSAValue[] operands){
		ssaOpcode = opCode;
		this.ref = ref;
		this.operands = operands;
	}

	@Override
	public SSAValue[] getOperands() {
		return operands;
	}

	@Override
	public void setOperands(SSAValue[] operands) {
		this.operands = operands;
	}
	
	public void setArg(int ref){
		this.ref = ref;
	}
	
	public int getArg(){
		return ref;
	}
	
	@Override
	public void print(int level) {
		for (int i = 0; i < level*3; i++)System.out.print(" ");
		System.out.print("Call["+ scMnemonics[ssaOpcode]+"] (");
		for (int i=0;i<operands.length-1;i++){
			System.out.print(operands[i].typeName()+", ");
		}
		System.out.println(operands[operands.length-1].typeName()+ ")");
	}

}

@@ -74,16 +74,57 @@
 AValue;%0D
+%0Aimport ch.ntb.inf.deep.strings.HString;%0D
 %0A%0D%0Apubli
@@ -166,23 +166,55 @@
  %7B%0D%0A%09%0D%0A%09
-int ref
+HString methodName;%0D%0A%09HString className
 ;%0D%0A%0D%0A%09pu
@@ -297,58 +297,134 @@
 de, 
-int ref)%7B%0D%0A%09%09ssaOpcode = opCode;%0D%0A%09%09this.ref = ref
+HString className , HString methodName)%7B%0D%0A%09%09ssaOpcode = opCode;%0D%0A%09%09this.methodName = methodName;%0D%0A%09%09this.className = className
 ;%0D%0A%09
@@ -563,23 +563,54 @@
 opCode, 
-int ref
+HString className , HString methodName
 , SSAVal
@@ -652,33 +652,78 @@
 de;%0D%0A%09%09this.
-ref = ref
+methodName = methodName;%0D%0A%09%09this.className = className
 ;%0D%0A%09%09this.op
@@ -942,44 +942,229 @@
 tArg
-(int ref)%7B%0D%0A%09%09this.ref = ref;%0D%0A%09%7D%0D%0A%09
+s(HString className , HString methodName)%7B%0D%0A%09%09this.methodName = methodName;%0D%0A%09%09this.className = className;%0D%0A%09%7D%0D%0A%09%0D%0A%09/**%0D%0A%09 * returns the ClassName at HString%5B0%5D and MethodeNamen at HString%5B1%5D;%0D%0A%09 * @return HString%5B%5D%0D%0A%09 */
 %0D%0A%09p
@@ -1173,18 +1173,25 @@
 lic 
-int
+HString%5B%5D
  getArg
+s
 ()%7B%0D
@@ -1204,11 +1204,54 @@
 urn 
-ref
+new HString%5B%5D%7Bthis.className, this.methodName%7D
 ;%0D%0A%09
@@ -1518,16 +1518,45 @@
 ;%0D%0A%09%09%7D%0D%0A
+%09%09if(operands.length %3E 0)%7B%0D%0A%09
 %09%09System
@@ -1615,16 +1615,60 @@
  %22)%22);%0D%0A
+%09%09%7Delse%7B%0D%0A%09%09%09System.out.println(%22)%22);%0D%0A%09%09%7D%0D%0A
 %09%7D%0D%0A%0D%0A%7D%0D

add fields className and methodName