Class TranslationResult

java.lang.Object
de.fraunhofer.aisec.cpg.graph.Node
de.fraunhofer.aisec.cpg.TranslationResult
All Implemented Interfaces:
Persistable, IVisitable<de.fraunhofer.aisec.cpg.graph.Node>

public class TranslationResult
extends de.fraunhofer.aisec.cpg.graph.Node
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.Companion
  • Field Summary

    Fields
    Modifier and Type Field Description
    static java.lang.String SOURCE_LOCATIONS_TO_FRONTEND  

    Fields 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
    void addTranslationUnit​(TranslationUnitDeclaration tu)
    Add a TranslationUnitDeclaration to this translation result in a thread safe way.
    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.
    de.fraunhofer.aisec.cpg.TranslationManager getTranslationManager()  
    java.util.List<TranslationUnitDeclaration> getTranslationUnits()
    List of translation units.
    boolean isCancelled()  

    Methods inherited from class de.fraunhofer.aisec.cpg.graph.Node

    addAnnotations, addNextDFG, addNextEOG, addPrevDFG, addPrevEOG, addTypedef, clearNextEOG, disconnectFromGraph, equals, getAnnotations, getArgumentIndex, 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, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods 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

      public java.util.List<TranslationUnitDeclaration> getTranslationUnits()
      List of translation units. Note that this list is immutable. Use addTranslationUnit(TranslationUnitDeclaration) if you wish to modify it.
      Returns:
      the list of translation units
    • addTranslationUnit

      public void addTranslationUnit​(TranslationUnitDeclaration tu)
      Add a TranslationUnitDeclaration to 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
    • getTranslationManager

      public de.fraunhofer.aisec.cpg.TranslationManager getTranslationManager()