public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { if (LambdaType != null) { builder.Append("new "); CodeGenerationHelper.AppendClassName(builder, LambdaType); builder.Append("("); } builder.Append('('); var delimiter = ""; foreach (var parameter in ParamNames) { builder.Append(delimiter); parameter.Render(builder); delimiter = ","; } builder.Append(") => {"); Block.Render(builder, isInnerClass, level + 1, indent); builder.Append("}"); if (LambdaType != null) { builder.Append(")"); } }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { if (_methodNode.AssignedMethod == null) { throw new IllegalStateException("Method has no assignment for " + _methodNode.AdditionalDebugInfo); } if (_methodNode.AssignedProviderClassName != null) { builder.Append(_methodNode.AssignedProviderClassName); builder.Append("."); } builder.Append(_methodNode.AssignedMethod.Name).Append("("); var delimiter = ""; // pass explicit parameters first foreach (var expression in _parameters) { builder.Append(delimiter); expression.Render(builder, isInnerClass, level, indent); delimiter = ","; } // pass pass-thru second if (_methodNode.OptionalSymbolProvider == null) { foreach (var name in _methodNode.DeepParameters) { builder.Append(delimiter); builder.Append(name); delimiter = ","; } } builder.Append(")"); }
public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { if (isWhile) { builder.Append("while ("); condition.Render(builder, isInnerClass, level + 1, indent); builder.Append(") {\n"); } else { builder.Append("do {\n"); } Block.Render(builder, isInnerClass, level + 1, indent); indent.Indent(builder, level); builder.Append("}\n"); if (!isWhile) { indent.Indent(builder, level); builder.Append("while ("); condition.Render(builder, isInnerClass, level + 1, indent); builder.Append(");\n"); } }
public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { var enumerator = _blocks.GetEnumerator(); enumerator.MoveNext(); var first = enumerator.Current; first.Render(builder, isInnerClass, level, indent); while (enumerator.MoveNext()) { builder.Append(" else "); enumerator.Current.Render(builder, isInnerClass, level, indent); } if (_optionalElse != null) { builder.Append(" else {\n"); _optionalElse.Render(builder, isInnerClass, level + 1, indent); indent.Indent(builder, level); builder.Append("}"); } builder.Append("\n"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { if (_target != null) { AppendClassName(builder, _target); } else { builder.Append(_targetClassName); } builder.Append("."); builder.Append(_methodName); if (_methodTypeArgs.Length > 0) { var delimiter = ""; builder.Append('<'); foreach (var methodTypeArg in _methodTypeArgs) { builder.Append(delimiter); AppendClassName(builder, methodTypeArg); delimiter = ","; } builder.Append('>'); } builder.Append("("); RenderExpressions(builder, _params, isInnerClass); builder.Append(")"); }
public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("new "); AppendClassName(builder, interfaceOrSuperClass); builder.Append("("); RenderExpressions(builder, ctorParams.ToArray(), isInnerClass); builder.Append(") {\n"); var methods = new CodegenClassMethods(); var properties = new CodegenClassProperties(); foreach (var pair in this.methods) { CodegenStackGenerator.RecursiveBuildStack( pair.Second, pair.First, methods, properties); } // public properties var delimiter = ""; foreach (var publicMethod in properties.PublicProperties) { builder.Append(delimiter); publicMethod.Render(builder, true, isInnerClass, indent, level + 1); delimiter = "\n"; } // private properties delimiter = ""; foreach (var method in properties.PrivateProperties) { builder.Append(delimiter); method.Render(builder, false, isInnerClass, indent, level + 1); delimiter = "\n"; } // public methods delimiter = ""; foreach (var publicMethod in methods.PublicMethods) { builder.Append(delimiter); publicMethod.Render(builder, true, isInnerClass, indent, level + 1); delimiter = "\n"; } // private methods delimiter = ""; foreach (var method in methods.PrivateMethods) { builder.Append(delimiter); method.Render(builder, false, isInnerClass, indent, level + 1); delimiter = "\n"; } indent.Indent(builder, level); builder.Append("}"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { RenderClass(target, builder); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append(_ref).Append(_increment ? "++" : "--"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("false"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _field.Render(builder); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("if (").Append(var).Append("== null) { return false;}\n"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { Render(builder, isInnerClass, 4, new CodegenIndent(true)); }
public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { throw new NotImplementedException(); }
public virtual void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append(_ref); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { RenderConstant(builder, _constant); }
public override void RenderStatement( StringBuilder builder, bool isInnerClass) { var indent = new CodegenIndent(true); @ref.Render(builder, isInnerClass, 1, indent); builder.Append("="); assignment.Render(builder, isInnerClass, 1, indent); }
public override void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { base.Render(builder, isInnerClass, level, indent); builder.Append(_col); }
public override void RenderStatement( StringBuilder builder, bool isInnerClass) { var codegenIndent = new CodegenIndent(true); _lhs.Render(builder, isInnerClass, 1, codegenIndent); builder.Append('='); _assignment.Render(builder, isInnerClass, 1, codegenIndent); }
public virtual void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { RenderStatement(builder, isInnerClass); builder.Append(";\n"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _expr.Render(builder, isInnerClass, level, indent); builder.Append(_increment ? "++" : "--"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _lhs.Render(builder, isInnerClass, level, indent); builder.Append("="); _rhs.Render(builder, isInnerClass, level, indent); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("new ").Append(_innerName).Append("("); CodegenExpressionBuilder.RenderExpressions(builder, _params, isInnerClass); builder.Append(")"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("(("); AppendClassName(builder, _clazz); builder.Append(")").Append(_ref).Append(")"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _instance.Render(builder, isInnerClass, level, indent); builder.Append('.'); builder.Append(_fieldNode.Name); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("if ("); _expression.Render(builder, isInnerClass, level + 1, indent); builder.Append(" == null) {return null;}\n"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { builder.Append("default("); builder.Append(_type.CleanName()); builder.Append(")"); }
public override void RenderStatement( StringBuilder builder, bool isInnerClass) { var indent = new CodegenIndent(true); array.Render(builder, isInnerClass, 1, indent); builder.Append("["); index.Render(builder, isInnerClass, 1, indent); builder.Append("]="); expression.Render(builder, isInnerClass, 1, indent); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { foreach (var statement in statements) { indent.Indent(builder, level); statement.Render(builder, isInnerClass, level, indent); } }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _expression.Render(builder, isInnerClass, level, indent); builder.Append("["); _index.Render(builder, isInnerClass, level, indent); builder.Append("]"); }
public void Render( StringBuilder builder, bool isInnerClass, int level, CodegenIndent indent) { _lhs.Render(builder, isInnerClass, level, indent); builder.Append(" "); builder.Append(_not ? "!=" : "=="); builder.Append(" null"); }