public override void Visit(IfStatement node) { VisitNode(node.Condition); VisitNode(node.Then); VisitNode(node.Else); Visit((Statement)node); }
public override void Visit(IfStatement node) { PushLocation(node); System.Reflection.Emit.Label endLabel; System.Reflection.Emit.Label elseLabel = _ilGen.DefineLabel(); var stackState = _localVars.GetTemporaryStackState(); VisitNode(node.Condition); AsBoolean(); _ilGen.Brfalse(elseLabel); _localVars.PopTemporariesAfter(stackState); VisitNode(node.Then); if (node.Else != null) { endLabel = _ilGen.DefineLabel(); _ilGen.Br(endLabel); _ilGen.MarkLabel(elseLabel); VisitNode(node.Else); _ilGen.MarkLabel(endLabel); } else _ilGen.MarkLabel(elseLabel); PopLocation(); }
public override void Visit(IfStatement node) { Visit((Statement)node); }
public override void Visit(IfStatement node) { PushLocation(node); VisitNode(node.Condition); _stackModel.Pop(1); var conditionIndex = _stackModel.StackPointer; var gotoElseIndex = ReserveNewICIndex(); VisitNode(node.Then); int elseIndex; if (node.Else != null) { var gotoEndIndex = ReserveNewICIndex(); elseIndex = gotoEndIndex + 1; VisitNode(node.Else); var endIndex = GetCurrentICIndex() + 1; BeginICMethod("GotoEnd"); Br(endIndex); EndICMethod(gotoEndIndex); } else elseIndex = GetCurrentICIndex() + 1; BeginICMethod("GotoElse"); Brfalse(conditionIndex, elseIndex); EndICMethod(gotoElseIndex); PopLocation(); }
public IfStatement MakeIfStatement(IExpression condition, IStatement thenStatement, IStatement elseStatement = null) { var booleanCondition = MakeToBoolean((Expression)condition); var n = new IfStatement(booleanCondition, (Statement)thenStatement, (Statement)elseStatement); return n; }
public override void Visit(IfStatement node) { throw new NotImplementedException(); }
public override void Visit(IfStatement node) { VisitNode(node.Then); VisitNode(node.Else); }