001/*-------------------------------------------------------------------------+ 002| | 003| Copyright 2005-2011 the ConQAT Project | 004| | 005| Licensed under the Apache License, Version 2.0 (the "License"); | 006| you may not use this file except in compliance with the License. | 007| You may obtain a copy of the License at | 008| | 009| http://www.apache.org/licenses/LICENSE-2.0 | 010| | 011| Unless required by applicable law or agreed to in writing, software | 012| distributed under the License is distributed on an "AS IS" BASIS, | 013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 014| See the License for the specific language governing permissions and | 015| limitations under the License. | 016+-------------------------------------------------------------------------*/ 017package eu.cqse.check.framework.preprocessor; 018 019import java.util.List; 020 021import eu.cqse.check.framework.scanner.IToken; 022 023/** 024 * Common interface for all preprocessors. The preprocessor is not guaranteed to 025 * be state-free so a new instance should be created for every new file that 026 * needs to be processed. 027 */ 028public interface IPreprocessor { 029 030 /** 031 * Performs the actual preprocessing of the given tokens. 032 * 033 * @param uniformPath 034 * may be null if this information is not available. 035 * @param tokens 036 * A list of tokens that need to be preprocessed. The given list 037 * may get modified. 038 * @return A new list with the preprocessed tokens. 039 */ 040 List<IToken> preprocess(String uniformPath, List<IToken> tokens); 041}