override public void Pretty(PrettyBuilder builder) { builder.NewLine(); builder.Append("{"); builder.Indent(); builder.PrettyStm(stmList); builder.Unindent(); builder.NewLine(); builder.Append("}"); }
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(); }
override public void Pretty(PrettyBuilder builder) { builder.NewLine(); builder.Append("return "); returnValue.Pretty(builder); builder.Append(";"); }
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(); }
// 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(); } }
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(); }
override public void Pretty(PrettyBuilder builder) { builder.NewLine(); decl.Pretty(builder); builder.Append(";"); }
override public void Pretty(PrettyBuilder builder) { builder.NewLine(); builder.Append("return;"); }