public Call(Label p, int n) { TAC ic = new TAC(Operator.CALL, Constant.Create(n), p); pos = tuples.Count; tuples.Add(ic); }
public Return() { TAC ic = new TAC(Operator.RETURN, null, null); pos = tuples.Count; tuples.Add(ic); }
public RetVal(Address x) // return x { TAC ic = new TAC(Operator.RETVAL, x, null); pos = tuples.Count; tuples.Add(ic); }
public IfTrue(Address x, Label L) // if x goto L { TAC ic = new TAC(Operator.IFTRUE, x, L); pos = tuples.Count; tuples.Add(ic); }
public Param(Address x) // param x { TAC ic = new TAC(Operator.PARAM, x, null); pos = tuples.Count; tuples.Add(ic); }
public IfFalse(Address x, Label L) // ifFalse x goto L { TAC ic = new TAC(Operator.IFFALSE, x, L); pos = tuples.Count; tuples.Add(ic); }
public ToMemory(Address x, Address y) // *x = y { TAC ic = new TAC(Operator.TOMEMORY, x, y); pos = tuples.Count; tuples.Add(ic); }
public Goto(Label L) // goto L { TAC ic = new TAC(Operator.GOTO, null, L); pos = tuples.Count; tuples.Add(ic); }
public Unary(Operator op, Address x, Address y) // x = op y { TAC ic = new TAC(op, x, y); pos = tuples.Count; tuples.Add(ic); target = ic.Arg1; }
public FromMemory(Address x, Address y) // x = *y { TAC ic = new TAC(Operator.FROMMEMORY, x, y); pos = tuples.Count; tuples.Add(ic); target = ic.Arg1; }
public AddressOf(Address x, Address y) // x = &y { TAC ic = new TAC(Operator.ADDRESS, x, y); pos = tuples.Count; tuples.Add(ic); target = ic.Arg1; }
public IfExp(Operator oprel, Address x, Address y, Label L) // if x oprel y goto L ===> tmp := x oprel y, if tmp goto L { TAC ic; ic = new TAC(Operator.IFEXP, null, L); pos = tuples.Count; tuples.Add(ic); ic = new TAC(oprel, x, y); tuples.Add(ic); }
public Binary(Operator op, Address x, Address y, Address z) { TAC ic; ic = new TAC(op, y, z); pos = tuples.Count; tuples.Add(ic); ic = new TAC(Operator.CONTINUE, null, x); tuples.Add(ic); target = ic.Arg2; }
public ToArray(Address x, Address i, Address y) // x[i] = y ===> tmp = x[i], *tmp = y { TAC ic; ic = new TAC(Operator.TOARRAY, x, i); pos = tuples.Count; tuples.Add(ic); ic = new TAC(Operator.CONTINUE, y, null); tuples.Add(ic); }
public FromArray(Address x, Address i, Address y) // x = y[i] ===> tmp = y[i], x = tmp { TAC ic; ic = new TAC(Operator.FROMARRAY, y, i); pos = tuples.Count; tuples.Add(ic); ic = new TAC(Operator.CONTINUE, x, null); tuples.Add(ic); target = ic.Arg1; }
public Copy(Address x, Address y) // x = y { TAC ic = new TAC(Operator.COPY, x, y); pos = tuples.Count; if (tuples != null) { tuples.Add(ic); } else { pos = -1; } target = ic.Arg1; }