Beispiel #1
0
 public override void RenderText_Value(ILTextCanvas canvas)
 {
     canvas.AppendToLine("{");
     canvas.AppendNewline();
     canvas.Indent();
     statement.RenderText_StatementEX(canvas);
     canvas.Dedent();
     canvas.AppendToNewline("}");
 }
Beispiel #2
0
        public override void RenderText_Statement(ILTextCanvas canvas)
        {
            canvas.AppendNewline();

            canvas.AppendToLine("if(false)");
            canvas.AppendToNewline("{");
            canvas.Indent();
            entry_label.RenderText_Statement(canvas);
            statement.RenderText_StatementEX(canvas);
            canvas.Dedent();
            canvas.AppendToNewline("}");
        }
Beispiel #3
0
        public override void RenderText_Statement(ILTextCanvas canvas)
        {
            canvas.AppendNewline();

            canvas.AppendToLine("while(");
            condition.RenderText_ValueEX(canvas);
            canvas.AppendToLine(")");

            canvas.AppendToNewline("{");
            canvas.Indent();
            while_statement.RenderText_StatementEX(canvas);
            canvas.Dedent();
            canvas.AppendToNewline("}");
        }
Beispiel #4
0
        public void RenderText_Case(ILTextCanvas canvas)
        {
            canvas.AppendNewline();
            canvas.AppendNewline();

            canvas.AppendToLine("case ");
            label.RenderText_Value(canvas);
            canvas.AppendToLine(":");

            canvas.Indent();
            statement.RenderText_Statement(canvas);
            canvas.AppendToNewline("break;");
            canvas.Dedent();
        }
Beispiel #5
0
        public override void RenderText_Statement(ILTextCanvas canvas)
        {
            canvas.AppendNewline();

            canvas.AppendToLine("switch(");
            input.RenderText_ValueEX(canvas);
            canvas.AppendToLine(")");

            canvas.AppendToNewline("{");
            canvas.Indent();
            cases.Process(c => c.RenderText_Case(canvas));

            if (default_statement != null)
            {
                canvas.AppendToNewline("default case:");
                canvas.Indent();
                default_statement.RenderText_StatementEX(canvas);
                canvas.AppendToNewline("break;");
                canvas.Dedent();
            }
            canvas.Dedent();
            canvas.AppendToNewline("}");
        }
Beispiel #6
0
        public override void RenderText_Statement(ILTextCanvas canvas)
        {
            canvas.AppendNewline();

            canvas.AppendToLine("if(");
            condition.RenderText_ValueEX(canvas);
            canvas.AppendToLine(")");

            canvas.AppendToNewline("{");
            canvas.Indent();
            if_true_statement.RenderText_StatementEX(canvas);
            canvas.Dedent();
            canvas.AppendToNewline("}");

            if (HasElse())
            {
                canvas.AppendToNewline("else");
                canvas.AppendToNewline("{");
                canvas.Indent();
                if_false_statement.RenderText_StatementEX(canvas);
                canvas.Dedent();
                canvas.AppendToNewline("}");
            }
        }
Beispiel #7
0
        public override string ToString()
        {
            ILTextCanvas canvas = new ILTextCanvas(method);

            canvas.AppendToLine(method.ToStringEX());
            canvas.AppendToNewline("{");
            canvas.Indent();

            statement.RenderText_Statement(canvas);

            canvas.Dedent();
            canvas.AppendToNewline("}");

            canvas.AppendNewline();
            canvas.AppendNewline();
            Write(canvas);

            return(canvas.ToString());
        }