net.sf.antcontrib.cpptasks.mozilla

Class XpidlCompiler

public final class XpidlCompiler extends CommandLineCompiler

Adapter for the Mozilla Xpidl Compiler.

Author: Curt Arnold

Method Summary
protected voidaddImpliedArgs(Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization)
Add arguments for debug, etc.
protected voidaddIncludes(String baseDirPath, File[] includeDirs, Vector args, Vector relativeArgs, StringBuffer includePathId)
Adds command line arguments for include paths.
protected voidaddWarningSwitch(Vector args, int level)
Add arguments for specified warning level.
ProcessorchangeEnvironment(boolean newEnvironment, Environment env)
Change enviroment (deprecated).
voidcompile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor)
Compiles an .idl file into the corresponding .h and .xpt files.
protected ParsercreateParser(File source)
Gets dependency parser.
protected intgetArgumentCountPerInputFile()
Gets number of command line arguments per input file.
protected voidgetDefineSwitch(StringBuffer buffer, String define, String value)
Gets switch to define preprocessor macro.
protected File[]getEnvironmentIncludePath()
Gets standard include paths.
StringgetIdentifier()
Gets compiler identifier.
protected StringgetIncludeDirSwitch(String includeDir)
Gets include directory switch.
protected StringgetInputFileArgument(File outputDir, String filename, int index)
Gets input file arguments.
static XpidlCompilergetInstance()
Gets singleton instance of compiler.
LinkergetLinker(LinkType type)
Gets linker associated with this type.
intgetMaximumCommandLength()
Gets maximum length of command line.
protected intgetMaximumInputFilesPerCommand()
Gets maximum number of input files processed per command.
String[]getOutputFileNames(String inputFile, VersionInfo versionInfo)
Gets output file names.
protected intgetTotalArgumentLengthForInputFile(File outputDir, String inputFile)
Get total command line length due to the input file.
protected voidgetUndefineSwitch(StringBuffer buffer, String define)
Gets switch to undefine preprocessor macro.

Method Detail

addImpliedArgs

protected void addImpliedArgs(Vector args, boolean debug, boolean multithreaded, boolean exceptions, LinkType linkType, Boolean rtti, OptimizationEnum optimization)
Add arguments for debug, etc.

Parameters: args Vector command argument list debug boolean build for debug if true multithreaded boolean build for multithreading if true exceptions boolean enable exceptions if true linkType LinkType output and runtime type rtti Boolean enable run-time type identification if true optimization OptimizationEnum optimization

addIncludes

protected void addIncludes(String baseDirPath, File[] includeDirs, Vector args, Vector relativeArgs, StringBuffer includePathId)
Adds command line arguments for include paths.

Parameters: baseDirPath String base directory includeDirs File[] include directories args Vector command line arguments relativeArgs Vector arguments for configuration identification includePathId StringBuffer buffer for configuration identification

addWarningSwitch

protected void addWarningSwitch(Vector args, int level)
Add arguments for specified warning level.

Parameters: args Vector command line arguments level int warning level value

changeEnvironment

public Processor changeEnvironment(boolean newEnvironment, Environment env)
Change enviroment (deprecated).

Parameters: newEnvironment boolean use new environment. env Environment environment

Returns: Processor modified processor

compile

public void compile(CCTask task, File outputDir, String[] sourceFiles, String[] args, String[] endArgs, boolean relentless, CommandLineCompilerConfiguration config, ProgressMonitor monitor)
Compiles an .idl file into the corresponding .h and .xpt files.

Parameters: task current cc task outputDir output directory sourceFiles source files args command line arguments that appear before input files endArgs command line arguments that appear after input files relentless if true, do not stop at first compilation error config compiler configuration monitor progress monitor

createParser

protected Parser createParser(File source)
Gets dependency parser.

Parameters: source source file

Returns: parser

getArgumentCountPerInputFile

protected int getArgumentCountPerInputFile()
Gets number of command line arguments per input file.

Returns: int number of command line arguments per input file.

getDefineSwitch

protected void getDefineSwitch(StringBuffer buffer, String define, String value)
Gets switch to define preprocessor macro.

Parameters: buffer StringBuffer command line argument define String macro name value String macro value, may be null.

getEnvironmentIncludePath

protected File[] getEnvironmentIncludePath()
Gets standard include paths.

Returns: File[] standard include paths

getIdentifier

public String getIdentifier()
Gets compiler identifier.

Returns: String compiler identification string

getIncludeDirSwitch

protected String getIncludeDirSwitch(String includeDir)
Gets include directory switch.

Parameters: includeDir String include directory

Returns: String command switch to add specified directory to search path

getInputFileArgument

protected String getInputFileArgument(File outputDir, String filename, int index)
Gets input file arguments.

Parameters: outputDir File output directory filename String input file name. index int argument index, 0 to getNumberOfArgumentsPerInputFile() -1

Returns: String input file argument

getInstance

public static XpidlCompiler getInstance()
Gets singleton instance of compiler.

Returns: XpidlCompiler singleton instance

getLinker

public Linker getLinker(LinkType type)
Gets linker associated with this type.

Parameters: type LinkType linker, returns ld.

Returns: Linker

getMaximumCommandLength

public int getMaximumCommandLength()
Gets maximum length of command line.

Returns: int maximum length of command line

getMaximumInputFilesPerCommand

protected int getMaximumInputFilesPerCommand()
Gets maximum number of input files processed per command.

Returns: int maximum number of input files processed per command.

getOutputFileNames

public String[] getOutputFileNames(String inputFile, VersionInfo versionInfo)
Gets output file names.

Parameters: inputFile String input file name versionInfo version info, not used by this compiler.

Returns: String[] output file names

getTotalArgumentLengthForInputFile

protected int getTotalArgumentLengthForInputFile(File outputDir, String inputFile)
Get total command line length due to the input file.

Parameters: outputDir File output directory inputFile String input file

Returns: int characters added to command line for the input file.

getUndefineSwitch

protected void getUndefineSwitch(StringBuffer buffer, String define)
Gets switch to undefine preprocessor macro.

Parameters: buffer StringBuffer command line argument define String macro name

Copyright ? 2001-2011 Ant-Contrib project. All Rights Reserved.