LanguageProvider provides factory methods for language data types, expressions,
statements and scripts used for testing language inter-operability. The LanguageProvider
implementations are loaded by the ServiceLoader and should be registered in the
'META-INF/services/org.graalvm.polyglot.tck.LanguageProvider'. See
Test
Compatibility Kit for details how to add a new language provider and execute tests.
| Modifier and Type | Method and Description |
|---|---|
| public default Map | Returns: The(key, value) pairs of language option to add to the context.Allows language providers to provide language options during the creation of the test context. |
| public Collection | Returns: factories creating the language expressionsthe context for a guest language code literal evaluation context)Creates a collection of functions representing language expressions to test. |
| public Value | Returns: theValue representing the identity functionthe context for a guest language code literal evaluation context)Creates an identity function. |
| public default Snippet | Returns: theSnippet representing the identity functionthe context for a guest language code literal evaluation context)Creates a |
| public default Collection | Returns: A collection of inline code snippets.the context for a guest language code literal evaluation context)Creates a collection of inline code snippets. |
| public Collection | Returns: the scriptsthe context for a guest language code literal evaluation context)Creates a collection of scripts containing a syntax error. |
| public Collection | Returns: the language scriptsthe context for a guest language code literal evaluation context)Creates a collection of simple scripts used for instrumentation testing. |
| public Collection | Returns: factories creating the language statementsthe context for a guest language code literal evaluation context)Creates a collection of functions representing language statements to test. |
| public Collection | Returns: factories creating the language data typesthe context for a guest language code literal evaluation context)Creates a collection of functions creating language data types. |
| public String |
| additionalOptions | back to summary |
|---|---|
| public default Map Allows language providers to provide language options during the creation of the test
context. | |
| createExpressions | back to summary |
|---|---|
| public Collection Creates a collection of functions representing language expressions to test. For each
language operator create a function performing given operator and assign a correct
The JavaScript sample implementation creating a plus operator: LanguageProviderSnippets#JsSnippets#createExpressions
The R sample implementation creating a plus operator: LanguageProviderSnippets#RSnippets#createExpressions
| |
| createIdentityFunction | back to summary |
|---|---|
| public Value createIdentityFunction(Context context) Creates an identity function. The identity function just returns its argument. The JavaScript sample implementation: LanguageProviderSnippets#JsSnippets#createIdentityFunction
The R sample implementation: LanguageProviderSnippets#RSnippets#createIdentityFunction
| |
| createIdentityFunctionSnippet | back to summary |
|---|---|
| public default Snippet createIdentityFunctionSnippet(Context context) Creates a
The implementor can delegate to the default identity function verifier obtained by
| |
| createInlineScripts | back to summary |
|---|---|
| public default Collection Creates a collection of inline code snippets.
This method is optional, it should be implemented if
The JavaScript sample implementation creating inline code snippets: LanguageProviderSnippets#JsSnippets#createInlineScripts
| |
| createInvalidSyntaxScripts | back to summary |
|---|---|
| public Collection Creates a collection of scripts containing a syntax error. The JavaScript sample implementation: LanguageProviderSnippets#JsSnippets#createInvalidSyntaxScripts
| |
| createScripts | back to summary |
|---|---|
| public Collection Creates a collection of simple scripts used for instrumentation testing. Each script is
represented as a function performing the script. The function must have no formal parameters
but may return a result which can be asserted by The JavaScript sample implementation: LanguageProviderSnippets#JsSnippets#createScripts
| |
| createStatements | back to summary |
|---|---|
| public Collection Creates a collection of functions representing language statements to test. For each control
flow statement create a function performing given statement and assign a correct
The JavaScript sample implementation creating the LanguageProviderSnippets#JsSnippets#createStatements
The R sample implementation creating the LanguageProviderSnippets#RSnippets#createStatements
| |
| createValueConstructors | back to summary |
|---|---|
| public Collection Creates a collection of functions creating language data types. For each language data type
create a function returning a value of given type and assign a correct The JavaScript sample implementation creating a boolean type: LanguageProviderSnippets#JsSnippets#createValueConstructors
The R sample implementation creating a boolean type: LanguageProviderSnippets#RSnippets#createValueConstructors
| |
| getId | back to summary |
|---|---|
| public String getId() Returns an identification of a provider. The common pattern is to use the identification of the tested language.
| |