73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan/*
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * CDDL HEADER START
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan *
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * The contents of this file are subject to the terms of the
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * Common Development and Distribution License (the "License").
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * You may not use this file except in compliance with the License.
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan *
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * See LICENSE.txt included in this distribution for the specific
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * language governing permissions and limitations under the License.
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan *
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * When distributing Covered Code, include this CDDL HEADER in each
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * file and include the License file at LICENSE.txt.
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * If applicable, add the following below this CDDL HEADER, with the
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * fields enclosed by brackets "[]" replaced with your own identifying
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * information: Portions Copyright [yyyy] [name of copyright owner]
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan *
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * CDDL HEADER END
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan */
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan/*
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan */
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panpackage org.opensolaris.opengrok.analysis.haskell;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport java.io.IOException;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport java.io.Reader;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport java.io.Writer;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.analysis.Definitions;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.analysis.FileAnalyzer;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.configuration.Project;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panimport org.opensolaris.opengrok.history.Annotation;
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan/**
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan * @author Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan */
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Panpublic class HaskellAnalyzerFactory extends FileAnalyzerFactory {
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco private static final String name = "Haskell";
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan private static final String[] SUFFIXES = {
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan "HS",
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan "HSC"
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan };
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan private static final String[] MAGICS = {
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan };
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan public HaskellAnalyzerFactory() {
eb11fe3584b7b243fb0641da4ab2e157610bb767Lubos Kosco super(null, null, SUFFIXES, MAGICS, null, "text/plain", Genre.PLAIN, name);
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan }
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan @Override
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan protected FileAnalyzer newAnalyzer() {
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan return new HaskellAnalyzer(this);
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan }
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan @Override
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan public void writeXref(Reader in, Writer out, Definitions defs, Annotation annotation, Project project)
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan throws IOException {
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan HaskellAnalyzer.writeXref(in, out, defs, annotation, project);
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan }
73189ea86c6fb0af01e16eaa5b0da3f2bb775c41Harry Pan}