Farkle


OperatorScope Type

A group of associativity groups sorted by precedence.

A symbol in an operator scope has higher precedence than another one if it appears in a group below the former symbol's group.

If the same symbol is specified in multiple associativity groups, it will have the precedence of the earliest group in which it appeared.

Symbols from multiple operator scopes cannot be compared for precedence.

A symbol can belong in only one operator scope; if it belongs in more, the operator scope to which the symbol will be assigned is undefined.

Operator scopes are used to automatically resolve Shift-Reduce conflicts. Resolving Reduce-Reduce conflicts can also happen but it must be explicitly opt-in by passing a boolean argument of in the first argument of the appropriate operator scope's constructor overloads.

Constructors

Constructor Description

OperatorScope(assocGroups)

Full Usage: OperatorScope(assocGroups)

Parameters:
Returns: OperatorScope
assocGroups : AssociativityGroup[]
Returns: OperatorScope

OperatorScope(resolveReduceReduceConflicts, assocGroups)

Full Usage: OperatorScope(resolveReduceReduceConflicts, assocGroups)

Parameters:
Returns: OperatorScope
resolveReduceReduceConflicts : bool
assocGroups : AssociativityGroup[]
Returns: OperatorScope

OperatorScope(resolvesReduceReduceConflicts, assocGroups)

Full Usage: OperatorScope(resolvesReduceReduceConflicts, assocGroups)

Parameters:
Returns: OperatorScope
resolvesReduceReduceConflicts : bool
assocGroups : AssociativityGroup seq
Returns: OperatorScope

Instance members

Instance member Description

this.ResolvesReduceReduceConflict

Full Usage: this.ResolvesReduceReduceConflict

Returns: bool

Whether Farkle uses this operator scope to automatically resolve Reduce-Reduce conflicts. Because the impact of this feature is unknown, it is set to false by default. It can be changed by passing true to a constructor overload that accepts a boolean.

Returns: bool

Static members

Static member Description

OperatorScope.Empty

Full Usage: OperatorScope.Empty

Returns: OperatorScope

An operator scope that does not contain any associativity groups.

Returns: OperatorScope