Module Simula

Class JavaClassInfo

java.lang.Object
simula.compiler.byteCodeEngineering.JavaClassInfo

public class JavaClassInfo extends Object
Java class info.

This class is introduced to compensate for a weakness in ASM.

ClassWriter.getCommonSuperClass does not work because Global.tempClassFileDir is not present in java.class.path

See: ExtendedClassWriter.getCommonSuperClass

Link to GitHub: Source File.

Author:
Øystein Myhre Andersen
  • Field Details

    • DEBUG

      private static final boolean DEBUG
      DEBUG on/off
      See Also:
    • javaClassMap

      private static Hashtable<String,JavaClassInfo> javaClassMap
      The java class map
    • externalIdent

      public String externalIdent
      External identifier.
    • prefixIdent

      public String prefixIdent
      Prefix identifier.
  • Constructor Details

    • JavaClassInfo

      public JavaClassInfo()
      Default constructor.
  • Method Details

    • put

      public static void put(String key, JavaClassInfo info)
      Update javaClassMap.
      Parameters:
      key - the key
      info - the info
    • init

      public static void init()
      Initiate javaClassMap
    • get

      static JavaClassInfo get(String key)
      Get the JavaClassInfo associated with 'key'
      Parameters:
      key - a java class map key
      Returns:
      the associated info or an empty String if not found
    • isSuperTypeOf

      boolean isSuperTypeOf(JavaClassInfo other)
      Test if this JavaClassInfo is super of the other JavaClassInfo.

      This is subtype of other iff This is in other's prefix chain.

      Parameters:
      other - the other JavaClassInfo
      Returns:
      true if condition holds
    • getPrefixIdent

      private String getPrefixIdent(String ident)
      Return the prefix identifier of a class named 'ident'. May be null
      Parameters:
      ident - class identifier
      Returns:
      the prefix identifier or null
    • printJavaClassMap

      static void printJavaClassMap(String title)
      Utility: Print Java class map
      Parameters:
      title - the title
    • toString

      public String toString()
      Overrides:
      toString in class Object