Package de.fraunhofer.aisec.cpg
Class TranslationConfiguration
java.lang.Object
de.fraunhofer.aisec.cpg.TranslationConfiguration
public class TranslationConfiguration
extends java.lang.Object
The configuration for the
TranslationManager holds all information that is used during
the translation.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTranslationConfiguration.BuilderBuilds aTranslationConfiguration. -
Field Summary
Fields Modifier and Type Field Description booleancodeInNodesshould the code of a node be shown as parameter in the node *booleandebugParserSet to true to generate debug output for the parser.booleandisableCleanupSwitch off cleaning up TypeManager memory after analysis.java.util.List<java.lang.String>includeBlacklistThis acts as a black list for include files, if the array is not empty.java.lang.String[]includePathsPaths to look for include files.java.util.List<java.lang.String>includeWhitelistThis acts as a white list for include files, if the array is not empty.booleanloadIncludesSet to true to transitively load include files into the CPG.booleanmatchCommentsToNodesIf true the frontend shall use a heuristic matching of comments found in the source file to match them to the closest AST node and save it in the comment property.booleanprocessAnnotationsSet to true to process annotations or annotation-like elements.java.util.Map<java.lang.String,java.lang.String>symbolsDefinition of additional symbols, mostly useful for C++. -
Method Summary
Modifier and Type Method Description static TranslationConfiguration.Builderbuilder()@Nullable de.fraunhofer.aisec.cpg.frontends.CompilationDatabasegetCompilationDatabase()java.util.Map<java.lang.Class<? extends LanguageFrontend>,java.util.List<java.lang.String>>getFrontends()de.fraunhofer.aisec.cpg.InferenceConfigurationgetInferenceConfiguration()java.util.List<Pass>getRegisteredPasses()java.util.Map<java.lang.String,java.util.List<java.io.File>>getSoftwareComponents()java.util.List<java.io.File>getSourceLocations()Returns a list of all analyzed files.java.util.Map<java.lang.String,java.lang.String>getSymbols()java.io.FilegetTopLevel()java.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
debugParser
public final boolean debugParserSet to true to generate debug output for the parser. -
loadIncludes
public final boolean loadIncludesSet to true to transitively load include files into the CPG.If this value is set to false but includePaths are given, the parser will resolve symbols/templates from these include, but do not load the parse tree into the CPG
-
includePaths
public final java.lang.String[] includePathsPaths to look for include files.It is recommended to set proper include paths as otherwise unresolved symbols/templates will result in subsequent parser mistakes, such as treating "<" as a BinaryOperator in the following example: <code> std::unique_ptr<Botan::Cipher_Mode> bla; </code>
As long as loadIncludes is set to false, include files will only be parsed, but not loaded into the CPG. *
-
includeWhitelist
public final java.util.List<java.lang.String> includeWhitelistThis acts as a white list for include files, if the array is not empty. Only the specified includes files will be parsed and processed in the CPG, unless it is a port of the blacklist, in which it will be ignored. -
includeBlacklist
public final java.util.List<java.lang.String> includeBlacklistThis acts as a black list for include files, if the array is not empty. The specified includes files will excluded from being parsed and processed in the CPG. The blacklist entries always take priority over those in the whitelist. -
disableCleanup
public boolean disableCleanupSwitch off cleaning up TypeManager memory after analysis.Set this to
trueonly for testing. -
codeInNodes
public final boolean codeInNodesshould the code of a node be shown as parameter in the node * -
processAnnotations
public final boolean processAnnotationsSet to true to process annotations or annotation-like elements. -
symbols
public final java.util.Map<java.lang.String,java.lang.String> symbolsDefinition of additional symbols, mostly useful for C++. -
matchCommentsToNodes
public final boolean matchCommentsToNodesIf true the frontend shall use a heuristic matching of comments found in the source file to match them to the closest AST node and save it in the comment property.
-
-
Method Details
-
builder
-
getSymbols
public java.util.Map<java.lang.String,java.lang.String> getSymbols() -
getSourceLocations
public java.util.List<java.io.File> getSourceLocations()Returns a list of all analyzed files. -
getSoftwareComponents
public java.util.Map<java.lang.String,java.util.List<java.io.File>> getSoftwareComponents() -
getCompilationDatabase
public @Nullable de.fraunhofer.aisec.cpg.frontends.CompilationDatabase getCompilationDatabase() -
getTopLevel
public java.io.File getTopLevel() -
getRegisteredPasses
-
getFrontends
public java.util.Map<java.lang.Class<? extends LanguageFrontend>,java.util.List<java.lang.String>> getFrontends() -
getInferenceConfiguration
public de.fraunhofer.aisec.cpg.InferenceConfiguration getInferenceConfiguration() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-