Class TruffleLanguageProvider

java.lang.Object
com.oracle.truffle.api.provider.TruffleLanguageProvider

public abstract class TruffleLanguageProvider extends Object
Used to register a TruffleLanguage using a ServiceLoader. This interface is not intended to be implemented directly by a language developer, rather the implementation is generated by the Truffle DSL. The generated implementation has to inherit the TruffleLanguage.Registration and ProvidedTags annotations from the TruffleLanguage.
Since:
23.1
  • Constructor Details

    • TruffleLanguageProvider

      protected TruffleLanguageProvider()
      Constructor to be called by subclasses.
      Since:
      23.1
  • Method Details

    • getLanguageClassName

      protected abstract String getLanguageClassName()
      Returns the name of a class implementing the TruffleLanguage.
      Since:
      23.1
    • create

      protected abstract Object create()
      Creates a new instance of a TruffleLanguage.
      Since:
      23.1
    • getServicesClassNames

      protected abstract Collection<String> getServicesClassNames()
      Returns the class names of provided services.
      Since:
      23.1
    • createFileTypeDetectors

      protected abstract List<?> createFileTypeDetectors()
      Creates file type detectors used by the TruffleLanguage.
      Since:
      23.1
    • getInternalResourceIds

      protected List<String> getInternalResourceIds()
      Returns ids of provided internal resources.
      Since:
      23.1
    • createInternalResource

      protected Object createInternalResource(String resourceId)
      Creates a language InternalResource identified by the resourceId.
      Throws:
      IllegalArgumentException - if resourceId is not supported by this language
      Since:
      23.1