Gutenberg

Namespace Gutenberg.Expression

Classes

BinaryOperator<T>

Represents a binary (infix) operator with a given precedence

BinaryOperatorType

The associativity of the BinaryOperator<T>: left-associative, right-associative, or non-associative

Expression<T>

Represents an expression composed of operators applied to Document<T>s.

You can use Expression<T> to pretty-print code in an expression-based language with operators and precedence. Expression<T> will automatically insert parentheses into the resulting document to create an unambiguous display.

To get started, use the OperatorFactory<T> to create objects representing each of the operators in your language. Then those operators can be applied to Document<T>s and other expressions to create complex expressions. Finally, when you PrettyPrint() the expression, it will return a Document<T> with parentheses inserted in the correct locations.

OperatorFactory<T>

Methods to create UnaryOperator<T> and BinaryOperator<T> values.

UnaryOperator<T>

Represents a unary (prefix or postfix) operator with a given precedence

UnaryOperatorType

The type of the UnaryOperator<T>: prefix or postfix