|
| 1 | +/* |
| 2 | + * CDDL HEADER START |
| 3 | + * |
| 4 | + * The contents of this file are subject to the terms of the |
| 5 | + * Common Development and Distribution License (the "License"). |
| 6 | + * You may not use this file except in compliance with the License. |
| 7 | + * |
| 8 | + * See LICENSE.txt included in this distribution for the specific |
| 9 | + * language governing permissions and limitations under the License. |
| 10 | + * |
| 11 | + * When distributing Covered Code, include this CDDL HEADER in each |
| 12 | + * file and include the License file at LICENSE.txt. |
| 13 | + * If applicable, add the following below this CDDL HEADER, with the |
| 14 | + * fields enclosed by brackets "[]" replaced with your own identifying |
| 15 | + * information: Portions Copyright [yyyy] [name of copyright owner] |
| 16 | + * |
| 17 | + * CDDL HEADER END |
| 18 | + */ |
| 19 | +package org.opensolaris.opengrok.analysis.erlang; |
| 20 | + |
| 21 | +import java.io.IOException; |
| 22 | +import java.io.Reader; |
| 23 | +import java.io.Writer; |
| 24 | +import org.opensolaris.opengrok.analysis.Definitions; |
| 25 | +import org.opensolaris.opengrok.analysis.FileAnalyzer; |
| 26 | +import org.opensolaris.opengrok.analysis.FileAnalyzer.Genre; |
| 27 | +import org.opensolaris.opengrok.analysis.FileAnalyzerFactory; |
| 28 | +import org.opensolaris.opengrok.configuration.Project; |
| 29 | +import org.opensolaris.opengrok.history.Annotation; |
| 30 | + |
| 31 | +public class ErlangAnalyzerFactory extends FileAnalyzerFactory { |
| 32 | + |
| 33 | + private static final String[] SUFFIXES = { |
| 34 | + "ERL", "HRL", "ESCRIPT" |
| 35 | + }; |
| 36 | + private static final String[] MAGICS = { |
| 37 | + "#!/usr/bin/env escript" |
| 38 | + }; |
| 39 | + |
| 40 | + public ErlangAnalyzerFactory() { |
| 41 | + super(null, null, SUFFIXES, MAGICS, null, "text/plain", Genre.PLAIN); |
| 42 | + } |
| 43 | + |
| 44 | + @Override |
| 45 | + protected FileAnalyzer newAnalyzer() { |
| 46 | + return new ErlangAnalyzer(this); |
| 47 | + } |
| 48 | + |
| 49 | + @Override |
| 50 | + public void writeXref(Reader in, Writer out, Definitions defs, Annotation annotation, Project project) |
| 51 | + throws IOException { |
| 52 | + ErlangAnalyzer.writeXref(in, out, defs, annotation, project); |
| 53 | + } |
| 54 | +} |
0 commit comments