Class OperatorScope
- Namespace
- Farkle.Builder.OperatorPrecedence
- Assembly
- Farkle.dll
Represents a collection of AssociativityGroups that are ordered by precedence and can be used to resolve conflicts when building the parser state machine.
public sealed class OperatorScope : IEnumerable<AssociativityGroup>, IEnumerable
- Inheritance
-
OperatorScope
- Implements
Remarks
An operator scope can be created with C# 12's collection expressions.
Constructors
OperatorScope(params AssociativityGroup[])
Creates an OperatorScope.
public OperatorScope(params AssociativityGroup[] associativityGroups)
Parameters
associativityGroups
AssociativityGroup[]The AssociativityGroups that will comprise the scope, in ascending order of precedence.
OperatorScope(bool, params AssociativityGroup[])
Creates an OperatorScope.
public OperatorScope(bool canResolveReduceReduceConflicts, params AssociativityGroup[] associativityGroups)
Parameters
canResolveReduceReduceConflicts
boolThe value of CanResolveReduceReduceConflicts.
associativityGroups
AssociativityGroup[]The AssociativityGroups that will comprise the scope, in ascending order of precedence.
OperatorScope(bool, params ImmutableArray<AssociativityGroup>)
Creates an OperatorScope.
public OperatorScope(bool canResolveReduceReduceConflicts, params ImmutableArray<AssociativityGroup> associativityGroups)
Parameters
canResolveReduceReduceConflicts
boolThe value of CanResolveReduceReduceConflicts.
associativityGroups
ImmutableArray<AssociativityGroup>The AssociativityGroups that will comprise the scope, in ascending order of precedence.
OperatorScope(params ImmutableArray<AssociativityGroup>)
Creates an OperatorScope.
public OperatorScope(params ImmutableArray<AssociativityGroup> associativityGroups)
Parameters
associativityGroups
ImmutableArray<AssociativityGroup>The AssociativityGroups that will comprise the scope, in ascending order of precedence.
Properties
CanResolveReduceReduceConflicts
Whether the operator scope can be used to resolve reduce-reduce conflicts.
public bool CanResolveReduceReduceConflicts { get; }
Property Value
Remarks
This capability is not enabled by default.
- See Also