Package de.fraunhofer.aisec.cpg.passes
Class Pass
java.lang.Object
de.fraunhofer.aisec.cpg.passes.Pass
- All Implemented Interfaces:
java.util.function.Consumer<TranslationResult>
- Direct Known Subclasses:
CallResolver,ControlFlowSensitiveDFGPass,EvaluationOrderGraphPass,FilenameMapper,ImportResolver,JavaExternalTypeHierarchyResolver,TypeHierarchyResolver,TypeResolver,VariableUsageResolver
public abstract class Pass extends java.lang.Object implements java.util.function.Consumer<TranslationResult>
Represents an abstract class that enhances the graph before it is persisted.
Passes are expected to mutate the TranslationResult.
-
Field Summary
Fields Modifier and Type Field Description protected @Nullable LanguageFrontendlangprotected static org.slf4j.Loggerlog -
Constructor Summary
Constructors Constructor Description Pass() -
Method Summary
Modifier and Type Method Description abstract voidcleanup()@Nullable LanguageFrontendgetLang()voidsetLang(@Nullable LanguageFrontend lang)Passes may need information about what source language they are parsing.booleansupportsLanguageFrontend(LanguageFrontend lang)Specifies, whether this pass supports this particular language frontend.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.Consumer
accept, andThen
-
Field Details
-
log
protected static final org.slf4j.Logger log -
lang
-
-
Constructor Details
-
Pass
public Pass()
-
-
Method Details
-
getLang
- Returns:
- May be null
-
setLang
Passes may need information about what source language they are parsing.- Parameters:
lang- May be null
-
cleanup
public abstract void cleanup() -
supportsLanguageFrontend
Specifies, whether this pass supports this particular language frontend. This defaults totrueand needs to be overridden if a different behaviour is wanted.Note: this is not yet used, since we do not have an easy way at the moment to find out which language frontend a result used.
- Parameters:
lang- the language frontend- Returns:
trueby default
-