Struct LrAction
- Namespace
- Farkle.Grammars.StateMachines
- Assembly
- Farkle.dll
Specifies what an LR parser will do if it encounters a terminal.
public readonly struct LrAction : IEquatable<LrAction>
- Implements
- Inherited Members
Properties
Error
An LrAction that will cause a syntax error.
public static LrAction Error { get; }
Property Value
- See Also
IsError
Whether this LrAction will cause a syntax error.
public bool IsError { get; }
Property Value
- See Also
IsReduce
Whether this LrAction will reduce a production.
public bool IsReduce { get; }
Property Value
- See Also
IsShift
Whether this LrAction will shift to another state.
public bool IsShift { get; }
Property Value
- See Also
ReduceProduction
The production this LrAction will reduce.
public ProductionHandle ReduceProduction { get; }
Property Value
Exceptions
ShiftState
The state this LrAction will shift to.
public int ShiftState { get; }
Property Value
Exceptions
Methods
CreateReduce(ProductionHandle)
Creates an LrAction that will reduce the specified ProductionHandle.
public static LrAction CreateReduce(ProductionHandle production)
Parameters
production
ProductionHandleThe production to reuse.
Returns
Exceptions
- See Also
CreateShift(int)
Creates an LrAction that will shift to the specified state.
public static LrAction CreateShift(int state)
Parameters
state
intThe state's number, starting from zero.
Returns
Exceptions
- ArgumentOutOfRangeException
state
is negative.
- See Also
Equals(LrAction)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(LrAction other)
Parameters
other
LrActionAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? other)
Parameters
other
object
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(LrAction, LrAction)
Checks two LrActions for equality.
public static bool operator ==(LrAction left, LrAction right)
Parameters
Returns
operator !=(LrAction, LrAction)
Checks two LrActions for inequality.
public static bool operator !=(LrAction left, LrAction right)