Class OperatorFactory<T>
Methods to create UnaryOperator<T> and BinaryOperator<T> values.
Inheritance
- Object
- OperatorFactory<T>
Declaration
public static class OperatorFactory<T> : Object
Type Parameters
Name | Description |
---|---|
T |
Methods
Infix(BinaryOperatorType, Int32, Document<T>)
Creates a BinaryOperator<T>
representing the given symbol
,
with the given type
and
precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static BinaryOperator<T> Infix(BinaryOperatorType type, int precedence, Document<T> symbol)
Parameters
Type | Name | Description |
---|---|---|
type |
The type of the BinaryOperator<T> |
|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
Returns
Type | Description |
---|---|
See Also
Infix(BinaryOperatorType, Int32, Document<T>, IBracketer<T>)
Creates a BinaryOperator<T>
representing the given symbol
,
with the given type
and
precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static BinaryOperator<T> Infix(BinaryOperatorType type, int precedence, Document<T> symbol, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
type |
The type of the BinaryOperator<T> |
|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
InfixL(Int32, Document<T>)
Creates a left-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static BinaryOperator<T> InfixL(int precedence, Document<T> symbol)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
Returns
Type | Description |
---|---|
A left-associative BinaryOperator<T>. |
See Also
InfixL(Int32, Document<T>, IBracketer<T>)
Creates a left-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static BinaryOperator<T> InfixL(int precedence, Document<T> symbol, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
A left-associative BinaryOperator<T>. |
InfixN(Int32, Document<T>)
Creates a non-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static BinaryOperator<T> InfixN(int precedence, Document<T> symbol)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
Returns
Type | Description |
---|---|
A non-associative BinaryOperator<T>. |
See Also
InfixN(Int32, Document<T>, IBracketer<T>)
Creates a non-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static BinaryOperator<T> InfixN(int precedence, Document<T> symbol, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
A non-associative BinaryOperator<T>. |
InfixR(Int32, Document<T>)
Creates a right-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static BinaryOperator<T> InfixR(int precedence, Document<T> symbol)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
Returns
Type | Description |
---|---|
A right-associative BinaryOperator<T>. |
See Also
InfixR(Int32, Document<T>, IBracketer<T>)
Creates a right-associative BinaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static BinaryOperator<T> InfixR(int precedence, Document<T> symbol, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the BinaryOperator<T> |
|
Document<T> |
symbol |
How to display the BinaryOperator<T> |
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
A right-associative BinaryOperator<T>. |
Postfix(Int32, Document<T>, Boolean)
Creates a postfix UnaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static UnaryOperator<T> Postfix(int precedence, Document<T> symbol, bool chainable = false)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
Returns
Type | Description |
---|---|
A postfix UnaryOperator<T>. |
See Also
Postfix(Int32, Document<T>, Boolean, IBracketer<T>)
Creates a postfix UnaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static UnaryOperator<T> Postfix(int precedence, Document<T> symbol, bool chainable, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
|
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
A postfix UnaryOperator<T>. |
Prefix(Int32, Document<T>, Boolean)
Creates a prefix UnaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
the K&R style is used.
Declaration
public static UnaryOperator<T> Prefix(int precedence, Document<T> symbol, bool chainable = false)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
Returns
Type | Description |
---|---|
A prefix UnaryOperator<T>. |
See Also
Prefix(Int32, Document<T>, Boolean, IBracketer<T>)
Creates a prefix UnaryOperator<T>
representing the given symbol
,
with the given precedence
.
When the expression needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static UnaryOperator<T> Prefix(int precedence, Document<T> symbol, bool chainable, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
|
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|
A prefix UnaryOperator<T>. |
Unary(UnaryOperatorType, Int32, Document<T>, Boolean)
Creates a UnaryOperator<T>
representing the given symbol
,
with the given type
and
precedence
. When the expression
needs to be surrounded by parentheses, the K&R
style is used.
Declaration
public static UnaryOperator<T> Unary(UnaryOperatorType type, int precedence, Document<T> symbol, bool chainable = false)
Parameters
Type | Name | Description |
---|---|---|
type |
The type of the UnaryOperator<T> |
|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
Returns
Type | Description |
---|---|
See Also
Unary(UnaryOperatorType, Int32, Document<T>, Boolean, IBracketer<T>)
Creates a UnaryOperator<T>
representing the given symbol
,
with the given type
and
precedence
.When the expression
needs to be surrounded by parentheses,
bracketer
is used.
Declaration
public static UnaryOperator<T> Unary(UnaryOperatorType type, int precedence, Document<T> symbol, bool chainable, IBracketer<T> bracketer)
Parameters
Type | Name | Description |
---|---|---|
type |
The type of the UnaryOperator<T> |
|
precedence |
The precedence of the UnaryOperator<T> |
|
Document<T> |
symbol |
How to display the UnaryOperator<T> |
chainable |
Whether the operator is chainable. If a non-chainable operator is applied multiple times, the inner expressions are parenthesised. |
|
IBracketer<T> |
bracketer |
An IBracketer<T> which will be called when the operator needs to be parenthesised. |
Returns
Type | Description |
---|---|