public string Display(int indent) { string tmp = ""; for (int i = 0; i < indent; i++) { tmp += " "; } tmp += "|While: "; tmp += test.Display(indent); tmp += body.Display(indent) + "\n"; return(tmp); }
public string Display(int indent) { string tmp = ""; for (int i = 0; i < indent; i++) { tmp += " "; } tmp += "|Conditional: "; for (int i = 0; i < indent; i++) { tmp += " "; } tmp += "|Test: "; tmp += test.Display(indent + 1) + "\n"; for (int i = 0; i < indent; i++) { tmp += " "; } tmp += "|Then: "; tmp += thenBranch.Display(indent + 1) + "\n"; if (!(elseBranch.GetType() == typeof(Skip))) { for (int i = 0; i < indent; i++) { tmp += " "; } tmp += "|Else: "; tmp += elseBranch.Display(indent + 1) + "\n"; } return(tmp); }