class TroffAnalyzer extends TextAnalyzer {

    /**
     * Creates a new instance of TroffAnalyzer.
     * @param factory defined instance for the analyzer
     */
    protected TroffAnalyzer(AnalyzerFactory factory) {
        super(factory, () -> new JFlexTokenizer(new TroffFullTokenizer(
                AbstractAnalyzer.DUMMY_READER)));
    }

    /**
     * @return {@code null} as there is no aligned language
     */
    @Override
    public String getCtagsLang() {
        return null;
    }

    /**
     * Gets a version number to be used to tag processed documents so that
     * re-analysis can be re-done later if a stored version number is different
     * from the current implementation.
     * @return 20180112_00
     */
    @Override
    protected int getSpecializedVersionNo() {
        return 20180112_00; // Edit comment above too!
    }

    @Override
    public void analyze(Document doc, StreamSource src, Writer xrefOut) throws IOException, InterruptedException {<FILL_FUNCTION_BODY>}

    /**
     * Creates a wrapped {@link TroffXref} instance.
     * @param reader the data to produce xref for
     * @return xref instance
     */
    @Override
    protected Xrefer newXref(Reader reader) {
        return new TroffXref(reader);
    }
}

        //this is to explicitly use appropriate analyzers tokenstream to workaround #1376 symbols search works like full text search
        JFlexTokenizer symbolTokenizer = symbolTokenizerFactory.get();
        symbolTokenizer.setReader(getReader(src.getStream()));
        OGKTextField full = new OGKTextField(QueryBuilder.FULL, symbolTokenizer);
        doc.add(full);

        if (xrefOut != null) {
            try (Reader in = getReader(src.getStream())) {
                WriteXrefArgs args = new WriteXrefArgs(in, xrefOut);
                args.setProject(project);
                XrefWork xrefWork = new XrefWork(args, this);

                try {
                    Xrefer xref = xrefWork.getXrefer();
                    String path = doc.get(QueryBuilder.PATH);
                    addNumLinesLOC(doc, new NumLinesLOC(path, xref.getLineNumber(), xref.getLOC()));
                } catch (ExecutionException e) {
                    throw new InterruptedException("failed to generate xref :" + e);
                }
            }
        }
    
<methods>public org.opengrok.indexer.analysis.Xrefer writeXref(org.opengrok.indexer.analysis.WriteXrefArgs) throws java.io.IOException<variables>