Top Inners Constructors Methods
org.graalvm.polyglot.tck

pack-priv final Class LanguageProviderSnippets

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStreamReader, .Reader, java.util.ArrayList, .Collection, .Collections, org.graalvm.polyglot.Context, .Source, .SourceSection, .Value

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class
pack-priv abstract static class

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LanguageProviderSnippetsback to summary
pack-priv LanguageProviderSnippets()
org.graalvm.polyglot.tck back to summary

pack-priv final Class LanguageProviderSnippets.JsSnippets

extends Object
implements LanguageProvider
Class Inheritance
All Implemented Interfaces
org.graalvm.polyglot.tck.LanguageProvider

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Collection<? extends Snippet>
createExpressions(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Creates a collection of functions representing language expressions to test.

public Value
createIdentityFunction(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Creates an identity function.

public Collection<? extends InlineSnippet>
createInlineScripts(Context
the context for a guest language code literal evaluation
context
)

Overrides default org.graalvm.polyglot.tck.LanguageProvider.createInlineScripts.

Creates a collection of inline code snippets.

public Collection<? extends Source>
createInvalidSyntaxScripts(Context
the context for a guest language code literal evaluation
ctx
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Creates a collection of scripts containing a syntax error.

public Collection<? extends Snippet>
createScripts(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createScripts.

Creates a collection of simple scripts used for instrumentation testing.

public Collection<? extends Snippet>
createStatements(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createStatements.

Creates a collection of functions representing language statements to test.

public Collection<? extends Snippet>
createValueConstructors(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Creates a collection of functions creating language data types.

public String
getId()

Implements org.graalvm.polyglot.tck.LanguageProvider.getId.

Returns an identification of a provider.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JsSnippetsback to summary
pack-priv JsSnippets()

Method Detail

createExpressionsback to summary
public Collection<? extends Snippet> createExpressions(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Creates a collection of functions representing language expressions to test. For each language operator create a function performing given operator and assign a correct TypeDescriptors to its parameters and return type. The parameter types and return type can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an union type.

The JavaScript sample implementation creating a plus operator:

LanguageProviderSnippets#JsSnippets#createExpressions
LanguageProviderSnippets#JsSnippets#createExpressions

The R sample implementation creating a plus operator:

LanguageProviderSnippets#RSnippets#createExpressions
LanguageProviderSnippets#RSnippets#createExpressions
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language expressions

Annotations
@Override
createIdentityFunctionback to summary
public Value createIdentityFunction(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Creates an identity function. The identity function just returns its argument.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createIdentityFunction
LanguageProviderSnippets#JsSnippets#createIdentityFunction

The R sample implementation:

LanguageProviderSnippets#RSnippets#createIdentityFunction
LanguageProviderSnippets#RSnippets#createIdentityFunction
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Value

the Value representing the identity function

Annotations
@Override
createInlineScriptsback to summary
public Collection<? extends InlineSnippet> createInlineScripts(Context context)

Overrides default org.graalvm.polyglot.tck.LanguageProvider.createInlineScripts.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createInlineScripts.

Creates a collection of inline code snippets.

This method is optional, it should be implemented if TruffleLanguage.parse(InlineParsingRequest) is implemented. It returns an empty list by default.

The JavaScript sample implementation creating inline code snippets:

LanguageProviderSnippets#JsSnippets#createInlineScripts
LanguageProviderSnippets#JsSnippets#createInlineScripts
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends InlineSnippet>

A collection of inline code snippets.

Annotations
@Override
createInvalidSyntaxScriptsback to summary
public Collection<? extends Source> createInvalidSyntaxScripts(Context ctx)

Implements org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Creates a collection of scripts containing a syntax error.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createInvalidSyntaxScripts
LanguageProviderSnippets#JsSnippets#createInvalidSyntaxScripts
Parameters
ctx:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Source>

the scripts

Annotations
@Override
createScriptsback to summary
public Collection<? extends Snippet> createScripts(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createScripts.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createScripts.

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 ResultVerifier.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createScripts
LanguageProviderSnippets#JsSnippets#createScripts
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

the language scripts

Annotations
@Override
createStatementsback to summary
public Collection<? extends Snippet> createStatements(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createStatements.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createStatements.

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 TypeDescriptors to its parameters and return type. The parameter types and return type can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an union type.

The JavaScript sample implementation creating the if statement:

LanguageProviderSnippets#JsSnippets#createStatements
LanguageProviderSnippets#JsSnippets#createStatements

The R sample implementation creating the if statement:

LanguageProviderSnippets#RSnippets#createStatements
LanguageProviderSnippets#RSnippets#createStatements
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language statements

Annotations
@Override
createValueConstructorsback to summary
public Collection<? extends Snippet> createValueConstructors(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

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 TypeDescriptor to it. The TypeDescriptor can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an intersection type.

The JavaScript sample implementation creating a boolean type:

LanguageProviderSnippets#JsSnippets#createValueConstructors
LanguageProviderSnippets#JsSnippets#createValueConstructors

The R sample implementation creating a boolean type:

LanguageProviderSnippets#RSnippets#createValueConstructors
LanguageProviderSnippets#RSnippets#createValueConstructors
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language data types

Annotations
@Override
getIdback to summary
public String getId()

Implements org.graalvm.polyglot.tck.LanguageProvider.getId.

Doc from org.graalvm.polyglot.tck.LanguageProvider.getId.

Returns an identification of a provider. The common pattern is to use the identification of the tested language.

Returns:String

the language identification

Annotations
@Override
org.graalvm.polyglot.tck back to summary

pack-priv final Class LanguageProviderSnippets.RSnippets

extends Object
implements LanguageProvider
Class Inheritance
All Implemented Interfaces
org.graalvm.polyglot.tck.LanguageProvider

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Collection<? extends Snippet>
createExpressions(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Creates a collection of functions representing language expressions to test.

public Value
createIdentityFunction(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Creates an identity function.

public Collection<? extends Source>
createInvalidSyntaxScripts(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Creates a collection of scripts containing a syntax error.

public Collection<? extends Snippet>
createScripts(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createScripts.

Creates a collection of simple scripts used for instrumentation testing.

public Collection<? extends Snippet>
createStatements(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createStatements.

Creates a collection of functions representing language statements to test.

public Collection<? extends Snippet>
createValueConstructors(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Creates a collection of functions creating language data types.

public String
getId()

Implements org.graalvm.polyglot.tck.LanguageProvider.getId.

Returns an identification of a provider.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RSnippetsback to summary
pack-priv RSnippets()

Method Detail

createExpressionsback to summary
public Collection<? extends Snippet> createExpressions(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createExpressions.

Creates a collection of functions representing language expressions to test. For each language operator create a function performing given operator and assign a correct TypeDescriptors to its parameters and return type. The parameter types and return type can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an union type.

The JavaScript sample implementation creating a plus operator:

LanguageProviderSnippets#JsSnippets#createExpressions
LanguageProviderSnippets#JsSnippets#createExpressions

The R sample implementation creating a plus operator:

LanguageProviderSnippets#RSnippets#createExpressions
LanguageProviderSnippets#RSnippets#createExpressions
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language expressions

Annotations
@Override
createIdentityFunctionback to summary
public Value createIdentityFunction(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createIdentityFunction.

Creates an identity function. The identity function just returns its argument.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createIdentityFunction
LanguageProviderSnippets#JsSnippets#createIdentityFunction

The R sample implementation:

LanguageProviderSnippets#RSnippets#createIdentityFunction
LanguageProviderSnippets#RSnippets#createIdentityFunction
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Value

the Value representing the identity function

Annotations
@Override
createInvalidSyntaxScriptsback to summary
public Collection<? extends Source> createInvalidSyntaxScripts(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createInvalidSyntaxScripts.

Creates a collection of scripts containing a syntax error.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createInvalidSyntaxScripts
LanguageProviderSnippets#JsSnippets#createInvalidSyntaxScripts
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Source>

the scripts

Annotations
@Override
createScriptsback to summary
public Collection<? extends Snippet> createScripts(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createScripts.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createScripts.

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 ResultVerifier.

The JavaScript sample implementation:

LanguageProviderSnippets#JsSnippets#createScripts
LanguageProviderSnippets#JsSnippets#createScripts
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

the language scripts

Annotations
@Override
createStatementsback to summary
public Collection<? extends Snippet> createStatements(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createStatements.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createStatements.

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 TypeDescriptors to its parameters and return type. The parameter types and return type can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an union type.

The JavaScript sample implementation creating the if statement:

LanguageProviderSnippets#JsSnippets#createStatements
LanguageProviderSnippets#JsSnippets#createStatements

The R sample implementation creating the if statement:

LanguageProviderSnippets#RSnippets#createStatements
LanguageProviderSnippets#RSnippets#createStatements
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language statements

Annotations
@Override
createValueConstructorsback to summary
public Collection<? extends Snippet> createValueConstructors(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

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 TypeDescriptor to it. The TypeDescriptor can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an intersection type.

The JavaScript sample implementation creating a boolean type:

LanguageProviderSnippets#JsSnippets#createValueConstructors
LanguageProviderSnippets#JsSnippets#createValueConstructors

The R sample implementation creating a boolean type:

LanguageProviderSnippets#RSnippets#createValueConstructors
LanguageProviderSnippets#RSnippets#createValueConstructors
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language data types

Annotations
@Override
getIdback to summary
public String getId()

Implements org.graalvm.polyglot.tck.LanguageProvider.getId.

Doc from org.graalvm.polyglot.tck.LanguageProvider.getId.

Returns an identification of a provider. The common pattern is to use the identification of the tested language.

Returns:String

the language identification

Annotations
@Override
org.graalvm.polyglot.tck back to summary

pack-priv abstract Class LanguageProviderSnippets.TypeDescriptorSnippets

extends Object
implements LanguageProvider
Class Inheritance
  • java.lang.Object
  • org.graalvm.polyglot.tck.LanguageProviderSnippets.TypeDescriptorSnippets
All Implemented Interfaces
org.graalvm.polyglot.tck.LanguageProvider

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Collection<? extends Snippet>
createValueConstructors(Context
the context for a guest language code literal evaluation
context
)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Creates a collection of functions creating language data types.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

TypeDescriptorSnippetsback to summary
pack-priv TypeDescriptorSnippets()

Method Detail

createValueConstructorsback to summary
public Collection<? extends Snippet> createValueConstructors(Context context)

Implements org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

Doc from org.graalvm.polyglot.tck.LanguageProvider.createValueConstructors.

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 TypeDescriptor to it. The TypeDescriptor can be one of the predefined TypeDescriptors, an array with component type, an executable with required parameter types or an intersection type.

The JavaScript sample implementation creating a boolean type:

LanguageProviderSnippets#JsSnippets#createValueConstructors
LanguageProviderSnippets#JsSnippets#createValueConstructors

The R sample implementation creating a boolean type:

LanguageProviderSnippets#RSnippets#createValueConstructors
LanguageProviderSnippets#RSnippets#createValueConstructors
Parameters
context:Context

the context for a guest language code literal evaluation

Returns:Collection<? extends Snippet>

factories creating the language data types

Annotations
@Override