AstCount
Description
Defines the cardinality of AST nodes.
Based on the initial values Zero and One, the following cardinalities are possible when using Add and Or:
[0]
: zero
[0..1]
: zero or one
[0..n]
: zero or more
[1]
: one
[1..n]
: one or more
[2..n]
: two or more
The AstCount.ToString can be used to obtain the string representations mentioned above.
Public / Methods
Add
Combines this AstCount value with the given one.
The Add operation is commutative and defined as follows:
Add | [1..n] | [0..1] | [1] | [0] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [1..n] | [2..n] | [1..n] | [2..n] | [1..n] | [2..n] | [1..n] -------+--------+--------+--------+--------+--------+------- [0..1] | [1..n] | [0..n] | [1..n] | [0..1] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [1] | [2..n] | [1..n] | [2..n] | [1] | [2..n] | [1..n] -------+--------+--------+--------+--------+--------+------- [0] | [1..n] | [0..1] | [1] | [0] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [2..n] | [2..n] | [2..n] | [2..n] | [2..n] | [2..n] | [2..n] -------+--------+--------+--------+--------+--------+------- [0..n] | [1..n] | [0..n] | [1..n] | [0..n] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+-------
Or
Combines this AstCount value with the given one.
The Or operation is commutative and defined as follows:
Or | [1..n] | [0..1] | [1] | [0] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [1..n] | [1..n] | [0..n] | [1..n] | [0..n] | [1..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [0..1] | [0..n] | [0..1] | [0..1] | [0..1] | [0..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [1] | [1..n] | [0..1] | [1] | [0..1] | [1..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [0] | [0..n] | [0..1] | [0..1] | [0] | [0..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [2..n] | [1..n] | [0..n] | [1..n] | [0..n] | [2..n] | [0..n] -------+--------+--------+--------+--------+--------+------- [0..n] | [0..n] | [0..n] | [0..n] | [0..n] | [0..n] | [0..n] -------+--------+--------+--------+--------+--------+-------