Package com.oracle.truffle.api.provider
Class TruffleLanguageProvider
java.lang.Object
com.oracle.truffle.api.provider.TruffleLanguageProvider
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 Summary
ModifierConstructorDescriptionprotected
Constructor to be called by subclasses. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Object
create()
Creates a new instance of aTruffleLanguage
.protected abstract List
<?> Creates file type detectors used by theTruffleLanguage
.protected Object
createInternalResource
(String resourceId) Creates a languageInternalResource
identified by theresourceId
.Returns ids of provided internal resources.protected abstract String
Returns the name of a class implementing theTruffleLanguage
.protected abstract Collection
<String> Returns the class names of provided services.
-
Constructor Details
-
TruffleLanguageProvider
protected TruffleLanguageProvider()Constructor to be called by subclasses.- Since:
- 23.1
-
-
Method Details
-
getLanguageClassName
Returns the name of a class implementing theTruffleLanguage
.- Since:
- 23.1
-
create
Creates a new instance of aTruffleLanguage
.- Since:
- 23.1
-
getServicesClassNames
Returns the class names of provided services.- Since:
- 23.1
-
createFileTypeDetectors
Creates file type detectors used by theTruffleLanguage
.- Since:
- 23.1
-
getInternalResourceIds
Returns ids of provided internal resources.- Since:
- 23.1
-
createInternalResource
Creates a languageInternalResource
identified by theresourceId
.- Throws:
IllegalArgumentException
- ifresourceId
is not supported by this language- Since:
- 23.1
-