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 20 /* 21 * Copyright (c) 2019, Chris Fraire <cfraire@me.com>. 22 */ 23 24 package org.opengrok.indexer.analysis.verilog; 25 26 import org.opengrok.indexer.analysis.AbstractAnalyzer.Genre; 27 import org.opengrok.indexer.analysis.FileAnalyzer; 28 import org.opengrok.indexer.analysis.FileAnalyzerFactory; 29 30 /** 31 * Represents a factory to create {@link VerilogAnalyzer} instances. 32 */ 33 public class VerilogAnalyzerFactory extends FileAnalyzerFactory { 34 35 private static final String NAME = "Verilog"; 36 37 private static final String[] SUFFIXES = {"SV", "SVH", "V", "VH"}; 38 39 /** 40 * Initializes a factory instance to associate a file extensions ".sv", 41 * ".svh", ".v", and ".vh" with {@link VerilogAnalyzer}. 42 */ VerilogAnalyzerFactory()43 public VerilogAnalyzerFactory() { 44 super(null, null, SUFFIXES, null, null, "text/plain", Genre.PLAIN, 45 NAME); 46 } 47 48 /** 49 * Creates a new {@link VerilogAnalyzer} instance. 50 * @return a defined instance 51 */ 52 @Override newAnalyzer()53 protected FileAnalyzer newAnalyzer() { 54 return new VerilogAnalyzer(this); 55 } 56 } 57