202N/A/*
202N/A * CDDL HEADER START
202N/A *
202N/A * The contents of this file are subject to the terms of the
202N/A * Common Development and Distribution License (the "License").
202N/A * You may not use this file except in compliance with the License.
202N/A *
202N/A * See LICENSE.txt included in this distribution for the specific
202N/A * language governing permissions and limitations under the License.
202N/A *
202N/A * When distributing Covered Code, include this CDDL HEADER in each
202N/A * file and include the License file at LICENSE.txt.
202N/A * If applicable, add the following below this CDDL HEADER, with the
202N/A * fields enclosed by brackets "[]" replaced with your own identifying
202N/A * information: Portions Copyright [yyyy] [name of copyright owner]
202N/A *
202N/A * CDDL HEADER END
202N/A */
202N/A
202N/A/*
1072N/A * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
202N/A */
202N/Apackage org.opensolaris.opengrok.analysis.sh;
202N/A
394N/Aimport java.io.IOException;
921N/Aimport java.io.Reader;
1384N/A
1127N/Aimport org.opensolaris.opengrok.analysis.Definitions;
202N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzer;
202N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
202N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
1384N/Aimport org.opensolaris.opengrok.analysis.XrefWriter;
271N/Aimport org.opensolaris.opengrok.configuration.Project;
202N/Aimport org.opensolaris.opengrok.history.Annotation;
202N/A
1461N/A/**
1461N/A * A shell and shell-like file analyzer.
1461N/A *
1461N/A * @author Jens Elkner
1461N/A * @version $Revision$
1461N/A */
202N/Apublic class ShAnalyzerFactory extends FileAnalyzerFactory {
483N/A private static final String[] NAMES = {
483N/A "MAKEFILE", "GNUMAKEFILE"
483N/A };
483N/A
202N/A private static final String[] SUFFIXES = {
202N/A "SH",
202N/A "KSH",
1180N/A "KSHLIB", // RFE #17849
202N/A "CSH",
1190N/A "BASH",
1190N/A "RUBY",
1190N/A "RB",
202N/A "P5",
202N/A "AWK",
202N/A "GMK",
202N/A "CONF",
202N/A "COM",
202N/A "SPEC",
202N/A "FLG",
202N/A "XCL", // message
202N/A };
202N/A
202N/A private static final String[] MAGICS = {
202N/A "#!",
202N/A };
202N/A
1461N/A /**
1461N/A * Create a new instance.
1461N/A */
202N/A public ShAnalyzerFactory() {
483N/A super(NAMES, SUFFIXES, MAGICS, null, "text/plain", Genre.PLAIN);
202N/A }
202N/A
1461N/A /**
1461N/A * {@inheritDoc}
1461N/A */
202N/A @Override
202N/A protected FileAnalyzer newAnalyzer() {
202N/A return new ShAnalyzer(this);
202N/A }
202N/A
1461N/A /**
1461N/A * {@inheritDoc}
1461N/A */
202N/A @Override
1461N/A public void writeXref(Reader in, XrefWriter out, Definitions defs,
1461N/A Annotation annotation, Project project) throws IOException
1461N/A {
1127N/A ShAnalyzer.writeXref(in, out, defs, annotation, project);
202N/A }
202N/A}