Package de.fraunhofer.aisec.cpg
Class TranslationConfiguration
- java.lang.Object
-
- de.fraunhofer.aisec.cpg.TranslationConfiguration
-
public class TranslationConfiguration extends java.lang.ObjectThe configuration for theTranslationManagerholds 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.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TranslationConfiguration.Builderbuilder()java.util.List<Pass>getRegisteredPasses()java.util.List<java.io.File>getSourceLocations()java.util.Map<java.lang.String,java.lang.String>getSymbols()java.io.FilegetTopLevel()
-
-
-
Field Detail
-
debugParser
public final boolean debugParser
Set to true to generate debug output for the parser.
-
loadIncludes
public final boolean loadIncludes
Set 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[] includePaths
Paths 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> includeWhitelist
This 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> includeBlacklist
This 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 disableCleanup
Switch off cleaning up TypeManager memory after analysis.Set this to
trueonly for testing.
-
codeInNodes
public final boolean codeInNodes
should the code of a node be shown as parameter in the node *
-
processAnnotations
public final boolean processAnnotations
Set to true to process annotations or annotation-like elements.
-
symbols
public final java.util.Map<java.lang.String,java.lang.String> symbols
Definition of additional symbols, mostly useful for C++.
-
-
Method Detail
-
builder
public static TranslationConfiguration.Builder builder()
-
getSymbols
public java.util.Map<java.lang.String,java.lang.String> getSymbols()
-
getSourceLocations
public java.util.List<java.io.File> getSourceLocations()
-
getTopLevel
public java.io.File getTopLevel()
-
getRegisteredPasses
public java.util.List<Pass> getRegisteredPasses()
-
-