/** * Reverses the order of tokens appearing in the RHS of this production. This is used to change a * right recursive language to a left recursive language, or vice versa. * * @return */ public Production reverse() { SequenceUnion reversedRHS = rhs.reverseAll(); return new Production(lhs, reversedRHS); }
public String toString() { return lhs.toString() + " -> " + rhs.toString(); }