示例#1
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     builder.Append("{");
     builder.Indent();
     builder.PrettyStm(stmList);
     builder.Unindent();
     builder.NewLine();
     builder.Append("}");
 }
示例#2
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     builder.Append("if(");
     exp.Pretty(builder);
     builder.Append(")");
     //builder.Indent();
     ifstm.Pretty(builder);
     //builder.Unindent();
     builder.NewLine();
     builder.Append("else");
     //builder.Indent();
     elsestm.Pretty(builder);
     //builder.Unindent();
 }
示例#3
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     builder.Append("return ");
     returnValue.Pretty(builder);
     builder.Append(";");
 }
示例#4
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     builder.Append("while(");
     exp.Pretty(builder);
     builder.Append(")");
     //builder.Indent();
     stm.Pretty(builder);
     //builder.Unindent();
     //builder.NewLine();
 }
示例#5
0
        // public Expression Expression1;
        // public Expression Expression2;

        override public void Pretty(PrettyBuilder builder, int outerPrecedence, bool opposite)
        {
            if (outerPrecedence > 0)
            {
                builder.Append("(");
                builder.Indent();
                builder.NewLine();
            }
            Expression1.Pretty(builder, 0, false);
            builder.Append(", ");
            builder.NewLine();
            Expression2.Pretty(builder, 0, false);
            if (outerPrecedence > 0)
            {
                builder.Unindent();
                builder.NewLine();
                builder.Append(")");
                builder.NewLine();
            }
        }
示例#6
0
        override public void Pretty(PrettyBuilder builder)
        {
            builder.NewLine();
            builder.Append(types[type] + " ");
            builder.Append(id.id);
            builder.Append("(");
            builder.Intersperse(arg, ", ");
            builder.Append(")");

            stm.Pretty(builder);

            //builder.NewLine();
        }
示例#7
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     decl.Pretty(builder);
     builder.Append(";");
 }
示例#8
0
 override public void Pretty(PrettyBuilder builder)
 {
     builder.NewLine();
     builder.Append("return;");
 }