public override void ExportCode(ActionBranch currentAction, ActionBranch nextAction, ILimnorCodeCompiler compiler, IMethodCompile methodToCompile, CodeMemberMethod method, CodeStatementCollection statements, bool debug) { IMathExpression mathExp = MathExp; if (mathExp != null) { CodeExpression ceCondition = null; if (Condition != null) { ceCondition = Condition.ExportCode(methodToCompile); if (ceCondition != null) { ceCondition = CompilerUtil.ConvertToBool(Condition.DataType, ceCondition); } } CodeExpression ce = mathExp.ReturnCodeExpression(methodToCompile); if (ce != null) { CodeExpression target = null; CodeVariableDeclarationStatement output = null; if (nextAction != null) { if (nextAction.UseInput) { output = new CodeVariableDeclarationStatement(currentAction.OutputType.TypeString, currentAction.OutputCodeName, ce); statements.Add(output); } } IVariable v = mathExp.OutputVariable; if (v != null) { CodeStatement cs; target = v.ExportCode(methodToCompile); if (output != null) { cs = new CodeAssignStatement(target, new CodeVariableReferenceExpression(currentAction.OutputCodeName)); } else { cs = new CodeAssignStatement(target, ce); } if (ceCondition == null) { statements.Add(cs); } else { CodeConditionStatement cd = new CodeConditionStatement(); cd.Condition = ceCondition; cd.TrueStatements.Add(cs); statements.Add(cd); } } } } }