public static UnparseControl Create(Grammar grammar, Formatter defaultFormatter, params ParenthesizedExpression[] parenthesizedExpressionsForPrecedenceBasedUnparse) { return new UnparseControl(grammar) { ExpressionToParenthesesHasBeenSet = true, DefaultFormatter = defaultFormatter, expressionToParentheses = parenthesizedExpressionsForPrecedenceBasedUnparse.ToDictionary(parenthesizedExpression => parenthesizedExpression.Expression) }; }
public static string AsText(this IEnumerable<Utoken> utokens, Formatter formatter) { return string.Concat(utokens.Select(utoken => utoken.ToText(formatter))); }
public static void WriteToStream(this IEnumerable<Utoken> utokens, Stream stream, Formatter formatter) { using (StreamWriter sw = new StreamWriter(stream)) { foreach (Utoken utoken in utokens) sw.Write(utoken.ToText(formatter)); } }
private FormatYielder(FormatYielder that) { this.formatter = that.formatter; this.direction = that.direction; }
public FormatYielder(Formatter formatter) { this.formatter = formatter; }