Package de.fraunhofer.aisec.cpg
Class TranslationResult
java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.TranslationResult
- All Implemented Interfaces:
Persistable,de.fraunhofer.aisec.cpg.helpers.StatisticsHolder,IVisitable<de.fraunhofer.aisec.cpg.graph.Node>
public class TranslationResult
extends de.fraunhofer.aisec.cpg.graph.Node
implements de.fraunhofer.aisec.cpg.helpers.StatisticsHolder
The global (intermediate) result of the translation. A
LanguageFrontend will initially populate it and a Pass can extend it.-
Nested Class Summary
Nested classes/interfaces inherited from class de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.graph.Node.CompanionNested classes/interfaces inherited from interface de.fraunhofer.aisec.cpg.helpers.StatisticsHolder
de.fraunhofer.aisec.cpg.helpers.StatisticsHolder.DefaultImpls -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringSOURCE_LOCATIONS_TO_FRONTENDFields inherited from class de.fraunhofer.aisec.cpg.graph.Node
Companion, EMPTY_NAME, TO_STRING_STYLE -
Constructor Summary
Constructors Constructor Description TranslationResult(de.fraunhofer.aisec.cpg.TranslationManager translationManager) -
Method Summary
Modifier and Type Method Description voidaddBenchmark(de.fraunhofer.aisec.cpg.helpers.Benchmark b)voidaddTranslationUnit(TranslationUnitDeclaration tu)Add aTranslationUnitDeclarationto this translation result in a thread safe way.java.util.Set<de.fraunhofer.aisec.cpg.graph.Node>getAdditionalNodes()de.fraunhofer.aisec.cpg.helpers.BenchmarkResultsgetBenchmarkResults()java.util.List<de.fraunhofer.aisec.cpg.helpers.Benchmark>getBenchmarks()TranslationConfigurationgetConfig()java.util.Map<java.lang.String,java.lang.Object>getScratch()Scratch storage that can be used by passes to store additional information in this result.java.util.List<java.lang.String>getTranslatedFiles()de.fraunhofer.aisec.cpg.TranslationManagergetTranslationManager()java.util.List<TranslationUnitDeclaration>getTranslationUnits()List of translation units.booleanisCancelled()Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node
addAnnotations, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, equals, getAnnotations, getArgumentIndex, getAstChildren, getCode, getComment, getFile, getId, getLocation, getName, getNextDFG, getNextEOG, getNextEOGEdges, getPrevDFG, getPrevEOG, getPrevEOGEdges, getTypedefs, hashCode, isImplicit, isInferred, removeNextDFG, removePrevDFG, removePrevEOGEntry, setAnnotations, setArgumentIndex, setCode, setComment, setFile, setId, setImplicit, setInferred, setLocation, setName, setNextDFG, setNextEOG, setNextEOGEdges, setPrevDFG, setPrevEOG, setPrevEOGEdges, setTypedefs, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.fraunhofer.aisec.cpg.processing.IVisitable
accept
-
Field Details
-
SOURCE_LOCATIONS_TO_FRONTEND
public static final java.lang.String SOURCE_LOCATIONS_TO_FRONTEND- See Also:
- Constant Field Values
-
-
Constructor Details
-
TranslationResult
public TranslationResult(de.fraunhofer.aisec.cpg.TranslationManager translationManager)
-
-
Method Details
-
isCancelled
public boolean isCancelled() -
getTranslationUnits
List of translation units. Note that this list is immutable. UseaddTranslationUnit(TranslationUnitDeclaration)if you wish to modify it.- Returns:
- the list of translation units
-
addTranslationUnit
Add aTranslationUnitDeclarationto this translation result in a thread safe way.- Parameters:
tu- The translation unit to add
-
getScratch
public java.util.Map<java.lang.String,java.lang.Object> getScratch()Scratch storage that can be used by passes to store additional information in this result. Callers must ensure that keys are unique. It is recommended to prefix them with the class name of the Pass.- Returns:
- the scratch storage
-
getAdditionalNodes
public java.util.Set<de.fraunhofer.aisec.cpg.graph.Node> getAdditionalNodes() -
getTranslationManager
public de.fraunhofer.aisec.cpg.TranslationManager getTranslationManager() -
addBenchmark
public void addBenchmark(@NotNull de.fraunhofer.aisec.cpg.helpers.Benchmark b)- Specified by:
addBenchmarkin interfacede.fraunhofer.aisec.cpg.helpers.StatisticsHolder
-
getBenchmarks
@NotNull public java.util.List<de.fraunhofer.aisec.cpg.helpers.Benchmark> getBenchmarks()- Specified by:
getBenchmarksin interfacede.fraunhofer.aisec.cpg.helpers.StatisticsHolder
-
getTranslatedFiles
@NotNull public java.util.List<java.lang.String> getTranslatedFiles()- Specified by:
getTranslatedFilesin interfacede.fraunhofer.aisec.cpg.helpers.StatisticsHolder
-
getConfig
- Specified by:
getConfigin interfacede.fraunhofer.aisec.cpg.helpers.StatisticsHolder
-
getBenchmarkResults
@NotNull public de.fraunhofer.aisec.cpg.helpers.BenchmarkResults getBenchmarkResults()- Specified by:
getBenchmarkResultsin interfacede.fraunhofer.aisec.cpg.helpers.StatisticsHolder
-