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

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

public class DyadicRef extends Dyadic {
	int ref;

	public DyadicRef(int opCode) {
		super(opCode);
	}

	public DyadicRef(int opCode, int ref) {
		super(opCode);
		this.ref = ref;
	}

	public DyadicRef(int opCode, SSAValue operand1,	SSAValue operand2) {
		super(opCode, operand1, operand2);
	}

	public DyadicRef(int opCode, int ref, SSAValue operand1, SSAValue operand2) {
		super(opCode, operand1, operand2);
		this.ref = ref;
	}

	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.println("DyadicRef["+ scMnemonics[ssaOpcode]+"] ( "+ operands[0].typeName() + ", " + operands[1].typeName() + " )");
	}
}

@@ -74,16 +74,57 @@
 AValue;%0D
+%0Aimport ch.ntb.inf.deep.strings.HString;%0D
 %0A%0D%0Apubli
@@ -160,23 +160,33 @@
 dic %7B%0D%0A%09
-int ref
+HString fieldName
 ;%0D%0A%0D%0A%09pu
@@ -269,23 +269,33 @@
 opCode, 
-int ref
+HString fieldName
 ) %7B%0D%0A%09%09s
@@ -312,33 +312,45 @@
 e);%0D%0A%09%09this.
-ref = ref
+fieldName = fieldName
 ;%0D%0A%09%7D%0D%0A%0D%0A%09pu
@@ -491,23 +491,33 @@
 opCode, 
-int ref
+HString fieldName
 , SSAVal
@@ -592,33 +592,45 @@
 2);%0D%0A%09%09this.
-ref = ref
+fieldName = fieldName
 ;%0D%0A%09%7D%0D%0A%0D%0A%09pu
@@ -650,36 +650,58 @@
 Arg(
-int ref) %7B%0D%0A%09%09this.ref = ref
+HString fieldName) %7B%0D%0A%09%09this.fieldName = fieldName
 ;%0D%0A%09
@@ -713,19 +713,23 @@
 %09public 
+HStr
 in
-t
+g
  getArg(
@@ -746,11 +746,17 @@
 urn 
-ref
+fieldName
 ;%0D%0A%09

add field fieldName