ParsedCompilerCommand

data class ParsedCompilerCommand(val projectRoot: Path, val directory: EnvPath, val file: EnvPath, val compiler: EnvPath, val language: Language, val languageStandard: String?, val standardIncludePaths: Set<StandardIncludePaths>, val includePaths: Map<String, List<EnvPath>>, val definedMacros: Map<String, String>, val undefinedMacros: List<String>, val arguments: ParsedArgs, val ignoredArguments: ParsedArgs, val parseErrors: List<String> = emptyList())

The result of parsing a CompilationCommand with a CompilerCommandParser

Parameters

projectRoot

the root of the project as the local file system path.

directory

the environment-specific path to the working directory of the compilation. All paths specified in the file, compiler, includePaths, arguments or ignoredArguments fields must be either absolute or relative to this directory.

file

the environment-specific path to the main translation unit source processed by this compilation step.

compiler

the environment-specific path to the compiler.

language

the language of the source file (C, C++, or other).

languageStandard

the language standard, such as c++23, gnu++14, or iso9899:2018.

standardIncludePaths

the standard include paths (those which don't need to be explicitly requested via -I).

includePaths

the include paths. The keys are command-line switches such as -I or -include. The values are paths to include files or directories.

definedMacros

the defined macros along with their values.

undefinedMacros

the undefined (cancelled) macros.

arguments

the compile command argv as list of strings, similar to CompilationCommand.arguments. The list may contain additional arguments as a result of response file expansion.

ignoredArguments

the arguments which are neither includePaths, nor definedMacros, nor undefinedMacros — in other words, those which don't fall into any of the "interesting" categories.

parseErrors

the list of parse errors encountered, if any.

See also

Constructors

Link copied to clipboard
constructor(projectRoot: Path, directory: EnvPath, file: EnvPath, compiler: EnvPath, language: Language, languageStandard: String?, standardIncludePaths: Set<StandardIncludePaths>, includePaths: Map<String, List<EnvPath>>, definedMacros: Map<String, String>, undefinedMacros: List<String>, arguments: ParsedArgs, ignoredArguments: ParsedArgs, parseErrors: List<String> = emptyList())

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun includePaths(pathMapper: PathMapper = LocalPathMapper): Map<String, List<Path>>

Converts the include paths to a local form using the pathMapper, normalizing them if necessary.