net.sf.antcontrib.cpptasks.compiler

Class AbstractCompiler

Implemented Interfaces:
Cloneable, Compiler, Processor
Known Direct Subclasses:
CommandLineCompiler

public abstract class AbstractCompiler
extends AbstractProcessor
implements Compiler

An abstract compiler implementation.
Authors:
Adam Murdoch
Curt Arnold

Field Summary

Fields inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID

Constructor Summary

AbstractCompiler(String[] sourceExtensions, String[] headerExtensions, String outputSuffix)

Method Summary

protected boolean
canParse(File sourceFile)
Checks file name to see if parse should be attempted Default implementation returns false for files with extensions '.dll', 'tlb', '.res'
protected abstract CompilerConfiguration
createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, CompilerDef specificConfig, TargetDef targetPlatform, VersionInfo versionInfo)
ProcessorConfiguration
createConfiguration(CCTask task, LinkType linkType, ProcessorDef[] baseConfigs, ProcessorDef specificConfig, TargetDef targetPlatform, VersionInfo versionInfo)
Returns the compiler configuration for or element.
protected abstract Parser
createParser(File sourceFile)
protected String
getBaseOutputName(String inputFile)
String[]
getOutputFileNames(String inputFile, VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
DependencyInfo
parseIncludes(CCTask task, File source, File[] includePath, File[] sysIncludePath, File[] envIncludePath, File baseDir, String includePathIdentifier)
Returns dependency info for the specified source file
protected boolean
resolveInclude(String includeName, File[] includePath, Vector onThisPath)

Methods inherited from class net.sf.antcontrib.cpptasks.compiler.AbstractProcessor

bid, changeEnvironment, clone, getHeaderExtensions, getIdentifier, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString

Constructor Details

AbstractCompiler

protected AbstractCompiler(String[] sourceExtensions,
                           String[] headerExtensions,
                           String outputSuffix)

Method Details

canParse

protected boolean canParse(File sourceFile)
Checks file name to see if parse should be attempted Default implementation returns false for files with extensions '.dll', 'tlb', '.res'

createConfiguration

protected abstract CompilerConfiguration createConfiguration(CCTask task,
                                                             LinkType linkType,
                                                             ProcessorDef[] baseConfigs,
                                                             CompilerDef specificConfig,
                                                             TargetDef targetPlatform,
                                                             VersionInfo versionInfo)

createConfiguration

public ProcessorConfiguration createConfiguration(CCTask task,
                                                  LinkType linkType,
                                                  ProcessorDef[] baseConfigs,
                                                  ProcessorDef specificConfig,
                                                  TargetDef targetPlatform,
                                                  VersionInfo versionInfo)
Returns the compiler configuration for or element.
Specified by:
createConfiguration in interface Processor
Parameters:
specificConfig - A or element.
Returns:
resulting configuration

createParser

protected abstract Parser createParser(File sourceFile)

getBaseOutputName

protected String getBaseOutputName(String inputFile)

getOutputFileNames

public String[] getOutputFileNames(String inputFile,
                                   VersionInfo versionInfo)
Output file name (no path components) corresponding to source file
Specified by:
getOutputFileNames in interface Processor
Parameters:
inputFile - input file
Returns:
output file name or null if no output file or name not determined by input file

parseIncludes

public final DependencyInfo parseIncludes(CCTask task,
                                          File source,
                                          File[] includePath,
                                          File[] sysIncludePath,
                                          File[] envIncludePath,
                                          File baseDir,
                                          String includePathIdentifier)
Returns dependency info for the specified source file
Parameters:
task - task for any diagnostic output
source - file to be parsed
includePath - include path to be used to resolve included files
sysIncludePath - sysinclude path from build file, files resolved using sysInclude path will not participate in dependency analysis
envIncludePath - include path from environment variable, files resolved with envIncludePath will not participate in dependency analysis
baseDir - used to produce relative paths in DependencyInfo
includePathIdentifier - used to distinguish DependencyInfo's from different include path settings
Author:
Curt Arnold

resolveInclude

protected boolean resolveInclude(String includeName,
                                 File[] includePath,
                                 Vector onThisPath)

Copyright B) 2001-2006 Ant-Contrib project. All Rights Reserved.