Interface Language

  • All Known Subinterfaces:
    BytecodeLanguage
    All Known Implementing Classes:
    JavaLanguage, LanguageImpl

    public interface Language
    Main interface for language-specific information. This interface helps build analyses which can operate over multiple languages.
    • Method Detail

      • getName

        Atom getName()
        What is the name of the language?
      • getBaseLanguage

        Language getBaseLanguage()
        If this language is "derived" from some other langauge, which one?
      • registerDerivedLanguage

        void registerDerivedLanguage​(Language l)
        Yuck? Languages are mutable?
      • getDerivedLanguages

        Set<Language> getDerivedLanguages()
      • getRootType

        TypeReference getRootType()
        What is the root type in a type hierarchy for this language? e.g. java.lang.Object in Java.
      • getThrowableType

        TypeReference getThrowableType()
        What is the root type of exceptions in this language? e.g. java.lang.Throwable in Java
      • getConstantType

        TypeReference getConstantType​(Object o)
        Given a Java constant o, return the appropriate language type to associate with the constant. Possible types for o can be language dependent, but typically include Boolean, String, Integer, Float, etc.
      • isNullType

        boolean isNullType​(TypeReference t)
        Is t the type of the language's null value? Should return true if t == null (?).
      • isMetadataType

        boolean isMetadataType​(TypeReference t)
        Is t a "metadata" type for the language, i.e., a type describing some other type (e.g., java.lang.Class for Java)?
      • getMetadataToken

        Object getMetadataToken​(Object value)
        Get the representation of the meta-data corresponding to value. For example, in Java, if value represents some type, the returned object should be the corresponding TypeReference. The returned object should be appropriate for use as the token in an SSALoadMetadataInstruction for the language
      • getArrayInterfaces

        TypeReference[] getArrayInterfaces()
        get the interfaces implemented by all arrays in the language
      • lookupPrimitiveType

        TypeName lookupPrimitiveType​(String name)
        Given a source-level primitive type name, get the corresponding "low-level" type name, e.g., the corresponding character to use in a Java method descriptor