public void ProcessStatementIf(DMASTProcStatementIf statement) { DMExpression.Emit(_dmObject, _proc, statement.Condition); if (statement.ElseBody == null) { string endLabel = _proc.NewLabelName(); _proc.JumpIfFalse(endLabel); _proc.StartScope(); ProcessBlockInner(statement.Body); _proc.EndScope(); _proc.AddLabel(endLabel); } else { string elseLabel = _proc.NewLabelName(); string endLabel = _proc.NewLabelName(); _proc.JumpIfFalse(elseLabel); _proc.StartScope(); ProcessBlockInner(statement.Body); _proc.EndScope(); _proc.Jump(endLabel); _proc.AddLabel(elseLabel); ProcessBlockInner(statement.ElseBody); _proc.AddLabel(endLabel); } }
public void VisitProcStatementIf(DMASTProcStatementIf statementIf) { SimplifyExpression(ref statementIf.Condition); statementIf.Body?.Visit(this); statementIf.ElseBody?.Visit(this); }
public void VisitProcStatementIf(DMASTProcStatementIf statementIf) { SimplifyExpression(ref statementIf.Condition); if (statementIf.Body != null) { statementIf.Body.Visit(this); } if (statementIf.ElseBody != null) { statementIf.ElseBody.Visit(this); } }