public final class MetaObjectCompiler extends CommandLineCompiler
Modifier and Type | Field and Description |
---|---|
private static MetaObjectCompiler |
INSTANCE
Singleton instance.
|
DEFAULT_DISCARD_BID, DEFAULT_PROCESS_BID
Modifier | Constructor and Description |
---|---|
private |
MetaObjectCompiler(boolean newEnvironment,
org.apache.tools.ant.types.Environment env)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addImpliedArgs(java.util.Vector args,
boolean debug,
boolean multithreaded,
boolean exceptions,
LinkType linkType,
java.lang.Boolean rtti,
OptimizationEnum optimization)
Add arguments for debug, etc.
|
protected void |
addWarningSwitch(java.util.Vector args,
int level)
Add arguments for specified warning level.
|
int |
bid(java.lang.String inputFile)
Returns the bid of the processor for the file.
|
Processor |
changeEnvironment(boolean newEnvironment,
org.apache.tools.ant.types.Environment env)
Change enviroment (deprecated).
|
protected Parser |
createParser(java.io.File source)
Gets a parser to scan source file for dependencies.
|
protected int |
getArgumentCountPerInputFile()
Gets number of command line arguments per input file.
|
protected void |
getDefineSwitch(java.lang.StringBuffer buffer,
java.lang.String define,
java.lang.String value)
Gets switch to define preprocessor macro.
|
protected java.io.File[] |
getEnvironmentIncludePath()
Gets standard include paths.
|
protected java.lang.String |
getIncludeDirSwitch(java.lang.String includeDir)
Gets include directory switch.
|
protected java.lang.String |
getInputFileArgument(java.io.File outputDir,
java.lang.String filename,
int index)
Gets input file arguments.
|
static MetaObjectCompiler |
getInstance()
Gets singleton instance of compiler.
|
Linker |
getLinker(LinkType type)
Gets linker associated with this type.
|
int |
getMaximumCommandLength()
Gets maximum length of command line.
|
protected int |
getMaximumInputFilesPerCommand()
Gets maximum number of input files processed per command.
|
java.lang.String[] |
getOutputFileNames(java.lang.String inputFile,
VersionInfo versionInfo)
Gets output file names.
|
protected int |
getTotalArgumentLengthForInputFile(java.io.File outputDir,
java.lang.String inputFile)
Get total command line length due to the input file.
|
protected void |
getUndefineSwitch(java.lang.StringBuffer buffer,
java.lang.String define)
Gets switch to undefine preprocessor macro.
|
addIncludes, buildDefineArguments, compile, createConfiguration, getCommand, getIdentifier, getLibtool, getLibtoolCompiler, runCommand, setCommand
canParse, createConfiguration, getBaseOutputName, parseIncludes, resolveInclude
clone, getHeaderExtensions, getIdentifier, getOSArch, getOSName, getSourceExtensions, isDarwin, toString
private static final MetaObjectCompiler INSTANCE
private MetaObjectCompiler(boolean newEnvironment, org.apache.tools.ant.types.Environment env)
newEnvironment
- boolean establish an new environment.env
- Environment environment.public static MetaObjectCompiler getInstance()
protected void addImpliedArgs(java.util.Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, java.lang.Boolean rtti, OptimizationEnum optimization)
addImpliedArgs
in class CommandLineCompiler
args
- Vector command argument listdebug
- boolean build for debug if truemultithreaded
- boolean build for multithreading if trueexceptions
- boolean enable exceptions if truelinkType
- LinkType output and runtime typertti
- Boolean enable run-time type identification if trueoptimization
- OptimizationEnum optimizationprotected void addWarningSwitch(java.util.Vector args, int level)
addWarningSwitch
in class CommandLineCompiler
args
- Vector command line argumentslevel
- int warning level valuepublic Processor changeEnvironment(boolean newEnvironment, org.apache.tools.ant.types.Environment env)
changeEnvironment
in interface Processor
changeEnvironment
in class AbstractProcessor
newEnvironment
- boolean use new environment.env
- Environment environmentprotected Parser createParser(java.io.File source)
createParser
in class AbstractCompiler
source
- source fileprotected int getArgumentCountPerInputFile()
getArgumentCountPerInputFile
in class CommandLineCompiler
public int bid(java.lang.String inputFile)
bid
in interface Processor
bid
in class AbstractProcessor
inputFile
- filename of input filepublic java.lang.String[] getOutputFileNames(java.lang.String inputFile, VersionInfo versionInfo)
getOutputFileNames
in interface Processor
getOutputFileNames
in class AbstractCompiler
inputFile
- String input file nameversionInfo
- version info, not used by this compiler.protected java.lang.String getInputFileArgument(java.io.File outputDir, java.lang.String filename, int index)
getInputFileArgument
in class CommandLineCompiler
outputDir
- File output directoryfilename
- String input file name.index
- int argument index,
0 to getNumberOfArgumentsPerInputFile() -1public int getMaximumCommandLength()
getMaximumCommandLength
in class CommandLineCompiler
protected int getMaximumInputFilesPerCommand()
getMaximumInputFilesPerCommand
in class CommandLineCompiler
protected java.lang.String getIncludeDirSwitch(java.lang.String includeDir)
getIncludeDirSwitch
in class CommandLineCompiler
includeDir
- String include directoryprotected void getDefineSwitch(java.lang.StringBuffer buffer, java.lang.String define, java.lang.String value)
getDefineSwitch
in class CommandLineCompiler
buffer
- StringBuffer command line argumentdefine
- String macro namevalue
- String macro value, may be null.protected void getUndefineSwitch(java.lang.StringBuffer buffer, java.lang.String define)
getUndefineSwitch
in class CommandLineCompiler
buffer
- StringBuffer command line argumentdefine
- String macro nameprotected java.io.File[] getEnvironmentIncludePath()
getEnvironmentIncludePath
in class CommandLineCompiler
public Linker getLinker(LinkType type)
type
- LinkType linker, returns ld.protected int getTotalArgumentLengthForInputFile(java.io.File outputDir, java.lang.String inputFile)
getTotalArgumentLengthForInputFile
in class CommandLineCompiler
outputDir
- File output directoryinputFile
- String input file