Class AstFormatter

Namespace
LogicalOptimizer
Assembly
LogicalOptimizer.Core.dll

Single precedence-based renderer for expression trees. Every node's ToString delegates here, so parenthesization rules live in exactly one place: a child is wrapped in parentheses only when its precedence is lower than its parent requires. N-ary connectives render flat (a & b & c), an OR under an AND is parenthesized, derived binary operators (XOR/NAND/NOR/ EQV/IMP) parenthesize any compound child because they have no precedence in the input grammar, and NOT renders as !x for atomic operands and !(...) for compound ones.

public static class AstFormatter
Inheritance
AstFormatter
Inherited Members

Methods

Format(AstNode)

Render a node to its canonical textual form.

public static string Format(AstNode node)

Parameters

node AstNode

Returns

string