Class TypeResolver

  • All Implemented Interfaces:
    java.util.function.Consumer<TranslationResult>

    public class TypeResolver
    extends Pass
    • Field Summary

      • Fields inherited from class de.fraunhofer.aisec.cpg.passes.Pass

        lang
    • Constructor Summary

      Constructors 
      Constructor Description
      TypeResolver()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void accept​(TranslationResult translationResult)
      Pass on the TypeSystem: Sets RecordDeclaration Relationship from ObjectType to RecordDeclaration
      void cleanup()  
      java.util.Set<Type> ensureUniqueSubTypes​(java.util.Set<Type> subTypes)  
      void ensureUniqueType​(Node node)  
      void handle​(Node node)
      Creates the recordDeclaration relationship between ObjectTypes and RecordDeclaration (from the Type to the Class)
      Type obtainType​(Type type)
      Ensures that two different Types that are created at different Points are still the same object in order to only store one node into the database
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Consumer

        andThen
    • Constructor Detail

      • TypeResolver

        public TypeResolver()
    • Method Detail

      • obtainType

        public Type obtainType​(Type type)
        Ensures that two different Types that are created at different Points are still the same object in order to only store one node into the database
        Parameters:
        type - newly created Type
        Returns:
        If the same type was already stored in the typeState Map the stored one is returned. In the other case the parameter type is stored into the map and the parameter type is returned
      • accept

        public void accept​(TranslationResult translationResult)
        Pass on the TypeSystem: Sets RecordDeclaration Relationship from ObjectType to RecordDeclaration
        Parameters:
        translationResult -
      • ensureUniqueSubTypes

        public java.util.Set<Type> ensureUniqueSubTypes​(java.util.Set<Type> subTypes)
      • ensureUniqueType

        public void ensureUniqueType​(Node node)
      • handle

        public void handle​(Node node)
        Creates the recordDeclaration relationship between ObjectTypes and RecordDeclaration (from the Type to the Class)
        Parameters:
        node -
      • cleanup

        public void cleanup()
        Specified by:
        cleanup in class Pass