Class GrammarRule<T>

Type Parameters

  • T

Hierarchy

  • GrammarRule

Constructors

Properties

NT: string

The reduce target.

callback: Callback<T>
commit: Condition<T>
rejecter: Condition<T>
rollback: Callback<T>
rule: readonly Grammar[]
str?: string

Cache the string representation.

traverser?: Traverser<T>

Methods

  • Check if the tail of this's rule is the same as the head of another. Which means this rule want's to reduce, and another rule want's to shift.

    Parameters

    Returns {
        length: number;
        reducerRule: Readonly<GrammarRule<T>>;
        shifterRule: Readonly<GrammarRule<T>>;
    }[]

  • Return { NT: `grammar rules` }.

    Parameters

    • gr: {
          NT: string;
          rule: readonly Grammar[];
      }
      • NT: string
      • rule: readonly Grammar[]

    Returns string

Generated using TypeDoc