class TermEscaperBase {

    private StringBuilder out;

    /**
     * "Runs the scanner [as documented by JFlex].
     * <p>[The method] can be used to get the next token from the input."
     * <p>"Consume[s] input until one of the expressions in the specification
     * is matched or an error occurs."
     * @return a value returned by the lexer specification if defined or the
     * {@code EOF} value upon reading end-of-file
     * @throws IOException if an error occurs reading the input
     */
    abstract boolean yylex() throws IOException;

    /**
     * @param out the target to append
     */
    void setOut(StringBuilder out) {
        this.out = out;
    }

    void appendOut(char c) {
        out.append(c);
    }

    void appendOut(String s) {
        out.append(s);
    }

    /**
     * Call {@link #yylex()} until {@code false}, which consumes all input so
     * that the argument to {@link #setOut(StringBuilder)} contains the entire
     * transformation.
     */
    @SuppressWarnings("java:S3626")
    void consume() {<FILL_FUNCTION_BODY>}
}

        try {
            while (yylex()) {
                continue;
            }
        } catch (IOException ex) {
            // cannot get here with StringBuilder operations
        }
    
<no_super_class>