public override string ToString(ExpressionFormatStyle style) { var childAsString = RightNode != null?RightNode.ToString(style) : "??"; var result = style == ExpressionFormatStyle.Canonical ? $"{Operator}{{{childAsString}}}" : $"{Operator}{childAsString}"; Debug.Assert(result != null, "resulting string cannot be null."); return(result); }
public override string ToString(ExpressionFormatStyle style) { var leftAsString = LeftNode != null?LeftNode.ToString(style) : "??"; var rightAsString = RightNode != null?RightNode.ToString(style) : "??"; string result = null; if (style == ExpressionFormatStyle.Arithmetic) { result = $"{leftAsString} {Operator} {rightAsString}"; } else if (style == ExpressionFormatStyle.Polish) { result = $"{Operator} {leftAsString} {rightAsString}"; } else if (style == ExpressionFormatStyle.Canonical) { result = $"{Operator}{{{leftAsString},{rightAsString}}}"; } Debug.Assert(result != null, "resulting string cannot be null."); return(result); }
public override string ToString() { return("(" + LeftNode + ", " + OpToken + ", " + RightNode.ToString() + "" + ")"); }