Custom language not being registered.

Timothy Baldridge tbaldridge at gmail.com
Sun Nov 18 06:44:22 UTC 2018


I seem to be having problems getting my language to properly register with
Truffle. I'm annotating my class with TruffleLanguage.Registration, but
when I go to run tests, I get the following error:

java.lang.IllegalArgumentException: A language with id 'Fae' is not
installed. Installed languages are: [TCK, js, llvm, truffletestinvoker].

I'm importing the FaeLanguage (that extends TruffleLanguage) into the JUnit
module just to make sure the class is getting loaded. What am I missing? If
it helps I'm doing all this in Intelij, and I'm not seeing any errors at
all. When I debug the test, I'm not seeing the constructor for the language
getting invoked.

Thoughts?

Timothy

Code for the Language class:

package org.fae;

import com.oracle.truffle.api.TruffleLanguage;

@TruffleLanguage.Registration(id=FaeLanguage.ID, name=FaeLanguage.ID,
defaultMimeType = FaeLanguage.MIME_TYPE, characterMimeTypes =
FaeLanguage.MIME_TYPE, contextPolicy = TruffleLanguage.ContextPolicy.SHARED)
public class FaeLanguage extends TruffleLanguage<FaeContext> {
    public static final String ID = "Faee";
    public static final String MIME_TYPE = "application/x-fae";

    private static int counter;

    public FaeLanguage() {
        counter++;
    }

    @Override
    protected FaeContext createContext(Env env) {
        return null;
    }

    @Override
    protected boolean isObjectOfLanguage(Object object) {
        return false;
    }
}


More information about the graal-dev mailing list