3 * Copyright 2002-2004 The Ant-Contrib project
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package net
.sf
.antcontrib
.cpptasks
.compiler
;
18 import net
.sf
.antcontrib
.cpptasks
.CCTask
;
19 import net
.sf
.antcontrib
.cpptasks
.ProcessorDef
;
20 import net
.sf
.antcontrib
.cpptasks
.TargetDef
;
21 import org
.apache
.tools
.ant
.types
.Environment
;
23 * A processor. Base interface for Compiler and Linker
27 public interface Processor
{
29 * Returns a bid indicating the desire of this compiler to process the
34 * @return 0 = no interest, 100 = high interest
36 int bid(String inputFile
);
37 Processor
changeEnvironment(boolean newEnvironment
, Environment env
);
39 * Returns the compiler configuration for <cc>or <compiler>element.
41 * @param defaultProviders
42 * When specificConfig corresponds to a <compiler>or linker
43 * element, defaultProvider will be a zero to two element array.
44 * If there is an extends attribute, the first element will be
45 * the referenced ProcessorDef, unless inherit = false, the last
46 * element will be the containing <cc>element
47 * @param specificConfig
48 * A <cc>or <compiler>element.
49 * @return resulting configuration
51 ProcessorConfiguration
createConfiguration(CCTask task
, LinkType linkType
,
52 ProcessorDef
[] defaultProviders
, ProcessorDef specificConfig
,
53 TargetDef targetPlatform
);
55 * Retrieve an identifier that identifies the specific version of the
56 * compiler. Compilers with the same identifier should produce the same
57 * output files for the same input files and command line switches.
59 String
getIdentifier();
61 * Gets the linker that is associated with this processors
63 Linker
getLinker(LinkType type
);
65 * Output file name (no path components) corresponding to source file
69 * @return output file name or null if no output file or name not
70 * determined by input file
72 String
getOutputFileName(String inputFile
);