本文整理汇总了C#中Exp.UnEx方法的典型用法代码示例。如果您正苦于以下问题:C# Exp.UnEx方法的具体用法?C# Exp.UnEx怎么用?C# Exp.UnEx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Exp
的用法示例。
在下文中一共展示了Exp.UnEx方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TranslateStringRelExp
public Exp TranslateStringRelExp(CJUMP.Rel op, Exp left, Exp right)
{
Expr comp = Frame.ExternalCall("_strcmp", new Tree.ExpList(left.UnEx(), new Tree.ExpList(right.UnEx(), null)));
return new RelCx(op, new Ex(comp), new Ex(new CONST(0)));
}
示例2: TranslateAssignExp
public Exp TranslateAssignExp(Exp lvalue, Exp e)
{
if (lvalue == null)
return null;
return new Nx(new MOVE(lvalue.UnEx(), e.UnEx()));
}
示例3: ProcessEntryExit
public void ProcessEntryExit(Level level, Exp body, bool returnValue)
{
Stm stm = null;
if (returnValue)
stm = new MOVE(new TEMP(level.Frame.RV()), body.UnEx());
else
stm = body.UnNx();
stm = level.Frame.ProcessEntryExit1(stm);
AddFrag(new ProcFrag(stm, level.Frame));
}
示例4: TranslateCalculateExp
public Exp TranslateCalculateExp(BINOP.Op op, Exp left, Exp right)
{
return new Ex(new BINOP(op, left.UnEx(), right.UnEx()));
}
示例5: TranslateLetExp
public Exp TranslateLetExp(ExpList eDec, Exp body, bool isVOID)
{
if (isVOID)
return new Nx(new SEQ(TranslateSeqExp(eDec, true).UnNx(), body.UnNx()));
else
return new Ex(new ESEQ(TranslateSeqExp(eDec, true).UnNx(), body.UnEx()));
}
示例6: TranslateFieldVar
public Exp TranslateFieldVar(Exp var, int num)
{
Expr addr = var.UnEx();
Expr offset = new CONST(num * Frame.WordSize());
return new Ex(new MEM(new BINOP(BINOP.Op.Plus, addr, offset)));
}
示例7: TranslateSubscriptVar
public Exp TranslateSubscriptVar(Exp var, Exp index)
{
Expr array_addr = var.UnEx();
Expr array_offset;
if (index.UnEx() is CONST)
array_offset = new CONST(((CONST)index.UnEx()).Value * Frame.WordSize());
else
array_offset = new BINOP(BINOP.Op.Times, index.UnEx(), new CONST(Frame.WordSize()));
return new Ex(new MEM(new BINOP(BINOP.Op.Plus, array_addr, array_offset)));
}
示例8: TranslateMultiArrayExp
public Exp TranslateMultiArrayExp(Level home, Exp init, Exp size)
{
Expr alloc = home.Frame.ExternalCall("_malloc",
new Tree.ExpList(
new BINOP(BINOP.Op.Times, size.UnEx(), new CONST(Frame.WordSize())),
null));
Temp.Temp addr = new Temp.Temp();
Access var = home.AllocLocal(false);
Stm initial = (new ForExp(home, var, new Ex(new CONST(0)),
new Ex(new BINOP(BINOP.Op.Minus, size.UnEx(), new CONST(1))),
new Nx(new MOVE(new MEM(new BINOP(BINOP.Op.Plus, new TEMP(addr), new BINOP(BINOP.Op.Times, var.Acc.Exp(null), new CONST(Frame.WordSize())))),
init.UnEx())),
new Label())).UnNx();
return new Ex(new ESEQ(new SEQ(new MOVE(new TEMP(addr), alloc), initial), new TEMP(addr)));
}
示例9: TranslateArrayExp
public Exp TranslateArrayExp(Level home, Exp init, Exp size)
{
Expr alloc = home.Frame.ExternalCall("_array", new Tree.ExpList(size.UnEx(), new Tree.ExpList(init.UnEx(), null)));
return new Ex(alloc);
}