/** * Retrieves the {@link Terminal} object of the production if this is a constant. * Should not be called on other types of productions. * @return the Terminal object */ public Terminal getConstant() { assert isTerminal(); // should be at least a single terminal return (Terminal) items.get(0); }