Exemple #1
0
 public override void RenderStatement(TextWriter textWriter)
 {
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(" ");
     textWriter.Write(_var);
     textWriter.Write("=null");
 }
Exemple #2
0
        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(")");
            }
        }
Exemple #3
0
 public void Render(TextWriter textWriter)
 {
     textWriter.Write("((");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(")");
     _expression.Render(textWriter);
     textWriter.Write(")");
 }
 public void Render(TextWriter textWriter)
 {
     textWriter.Write("new ");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write("(");
     CodegenExpressionBuilder.RenderExpressions(textWriter, _parameters);
     textWriter.Write(")");
 }
Exemple #5
0
 public void Render(TextWriter textWriter)
 {
     CodeGenerationHelper.AppendClassName(textWriter, _target, null);
     textWriter.Write(".");
     textWriter.Write(_methodName);
     textWriter.Write("(");
     CodegenExpressionBuilder.RenderExpressions(textWriter, _parameters);
     textWriter.Write(")");
 }
 public override void RenderStatement(TextWriter textWriter)
 {
     textWriter.Write("if (!(");
     textWriter.Write(_var);
     textWriter.Write(" is ");
     CodeGenerationHelper.AppendClassName(textWriter, _type, null);
     textWriter.Write(")) return ");
     CodegenExpressionUtil.RenderConstant(textWriter, _constant);
 }
Exemple #7
0
 public void Render(TextWriter textWriter)
 {
     textWriter.Write("((");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(")");
     _ref.Render(textWriter);
     textWriter.Write(".Underlying)");
     textWriter.Write("[");
     textWriter.Write(_index);
     textWriter.Write("]");
 }
Exemple #8
0
 public override void RenderStatement(TextWriter textWriter)
 {
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(" s");
     textWriter.Write(_streamNum);
     textWriter.Write("=(");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(")eventsPerStream[");
     textWriter.Write(_streamNum);
     textWriter.Write("].Underlying");
 }
Exemple #9
0
 public void Render(TextWriter textWriter)
 {
     textWriter.Write("((");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     textWriter.Write(")");
     _expression.Render(textWriter);
     textWriter.Write(".Underlying).");
     textWriter.Write(_method);
     textWriter.Write("(");
     CodegenExpressionUtil.RenderConstant(textWriter, _constant);
     textWriter.Write(")");
 }
Exemple #10
0
 public void Render(
     StringBuilder builder,
     bool isInnerClass,
     int level,
     CodegenIndent indent)
 {
     builder.Append("new ");
     CodeGenerationHelper.AppendClassName(builder, _clazz);
     builder.Append("(");
     CodegenExpressionBuilder.RenderExpressions(builder, _params, isInnerClass);
     builder.Append(")");
 }
 public void Render(TextWriter textWriter)
 {
     int numDimensions = TypeHelper.GetNumberOfDimensions(_component);
     Type outermostType = TypeHelper.GetComponentTypeOutermost(_component);
     textWriter.Write("new ");
     CodeGenerationHelper.AppendClassName(textWriter, outermostType, null);
     textWriter.Write("[");
     _expression.Render(textWriter);
     textWriter.Write("]");
     for (int i = 0; i < numDimensions; i++)
     {
         textWriter.Write("[]");
     }
 }
 public void Render(TextWriter textWriter)
 {
     CodeGenerationHelper.AppendClassName(textWriter, _target, null);
     textWriter.Write(".");
     textWriter.Write(_methodName);
     textWriter.Write("(");
     _expression.Render(textWriter);
     foreach (object constant in _consts)
     {
         textWriter.Write(",");
         CodegenExpressionUtil.RenderConstant(textWriter, constant);
     }
     textWriter.Write(")");
 }
Exemple #13
0
 public void Render(TextWriter textWriter)
 {
     if (_not)
     {
         textWriter.Write("!(");
     }
     _lhs.Render(textWriter);
     textWriter.Write(" ");
     textWriter.Write("is ");
     CodeGenerationHelper.AppendClassName(textWriter, _clazz, null);
     if (_not)
     {
         textWriter.Write(")");
     }
 }
Exemple #14
0
 public void Render(TextWriter textWriter)
 {
     CodeGenerationHelper.AppendClassName(textWriter, _target, null);
     textWriter.Write(".");
     textWriter.Write(_methodName);
     textWriter.Write("(");
     string delimiter = "";
     foreach (string parameter in _refs)
     {
         textWriter.Write(delimiter);
         textWriter.Write(parameter);
         delimiter = ",";
     }
     textWriter.Write(")");
 }
        public void Render(
            StringBuilder builder,
            bool isInnerClass,
            int level,
            CodegenIndent indent)
        {
            builder.Append("out ");

            if (_variableType != null)
            {
                CodeGenerationHelper.AppendClassName(builder, _variableType);
                builder.Append(' ');
            }

            builder.Append(_variableName);
        }
Exemple #16
0
 public void Render(
     StringBuilder builder,
     bool isInnerClass,
     int level,
     CodegenIndent indent)
 {
     int numDimensions = GetNumberOfDimensions(component);
     Type outermostType = GetComponentTypeOutermost(component);
     builder.Append("new ");
     CodeGenerationHelper.AppendClassName(builder, outermostType);
     builder.Append("[");
     expression.Render(builder, isInnerClass, level, indent);
     builder.Append("]");
     for (int i = 0; i < numDimensions; i++) {
         builder.Append("[]");
     }
 }
Exemple #17
0
        public override void Render(
            StringBuilder builder,
            bool isInnerClass)
        {
            var indent = new CodegenIndent(true);

            builder.Append(_method);

            if (_methodTypeParameters != null && _methodTypeParameters.Length > 0)
            {
                var delimiter = "";
                builder.Append('<');

                foreach (var typeParameter in _methodTypeParameters)
                {
                    builder.Append(delimiter);
                    CodeGenerationHelper.AppendClassName(builder, typeParameter);
                    delimiter = ",";
                }

                builder.Append('>');
            }

            builder.Append('(');

            if (_optionalParams != null)
            {
                var delimiter = "";
                foreach (var param in _optionalParams)
                {
                    builder.Append(delimiter);
                    param.Render(builder, isInnerClass, 1, indent);
                    delimiter = ",";
                }
            }

            builder.Append(')');
        }