1028N/A/*
1028N/A * CDDL HEADER START
1028N/A *
1028N/A * The contents of this file are subject to the terms of the
1028N/A * Common Development and Distribution License (the "License").
1028N/A * You may not use this file except in compliance with the License.
1028N/A *
1028N/A * See LICENSE.txt included in this distribution for the specific
1028N/A * language governing permissions and limitations under the License.
1028N/A *
1028N/A * When distributing Covered Code, include this CDDL HEADER in each
1028N/A * file and include the License file at LICENSE.txt.
1028N/A * If applicable, add the following below this CDDL HEADER, with the
1028N/A * fields enclosed by brackets "[]" replaced with your own identifying
1028N/A * information: Portions Copyright [yyyy] [name of copyright owner]
1028N/A *
1028N/A * CDDL HEADER END
1028N/A */
1028N/A
1028N/A/*
1072N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
1028N/A */
1028N/A
1028N/Apackage org.opensolaris.opengrok.analysis.python;
1028N/A
1028N/Aimport java.io.IOException;
1028N/Aimport java.io.Reader;
1384N/A
1127N/Aimport org.opensolaris.opengrok.analysis.Definitions;
1028N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzer;
1028N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzer.Genre;
1028N/Aimport org.opensolaris.opengrok.analysis.FileAnalyzerFactory;
1384N/Aimport org.opensolaris.opengrok.analysis.XrefWriter;
1028N/Aimport org.opensolaris.opengrok.configuration.Project;
1028N/Aimport org.opensolaris.opengrok.history.Annotation;
1028N/A
1028N/A/**
1028N/A *
1028N/A * @author Lubos Kosco
1028N/A */
1028N/A
1028N/Apublic class PythonAnalyzerFactory extends FileAnalyzerFactory {
1073N/A //TODO note that .PM below is kind of wrong, since perl already has this and is registered before python analyzer
1073N/A // unfortunately we miss code that would be able to share extensions between analyzers
1028N/A private static final String[] SUFFIXES = {
1073N/A "PY"
1028N/A };
1073N/A //"PM"
1028N/A private static final String[] MAGICS = {
1072N/A "#!/usr/bin/env python",
1073N/A "#!/usr/bin/python",
1073N/A "#!/bin/python"
1028N/A };
1028N/A
1028N/A public PythonAnalyzerFactory() {
1028N/A super(null, SUFFIXES, MAGICS, null, "text/plain", Genre.PLAIN);
1028N/A }
1028N/A
1028N/A @Override
1028N/A protected FileAnalyzer newAnalyzer() {
1028N/A return new PythonAnalyzer(this);
1028N/A }
1028N/A
1028N/A @Override
1384N/A public void writeXref(Reader in, XrefWriter out, Definitions defs, Annotation annotation, Project project)
1028N/A throws IOException {
1127N/A PythonAnalyzer.writeXref(in, out, defs, annotation, project);
1028N/A }
1028N/A}