Custom language not being registered.

Andrew Luo andrewluotechnologies at outlook.com
Sun Nov 18 21:07:47 UTC 2018


Isn't this a typo?

public static final String ID = "Faee";

should be 

public static final String ID = "Fae";

Thanks
Andrew

-----Original Message-----
From: graal-dev <graal-dev-bounces at openjdk.java.net> On Behalf Of Timothy Baldridge
Sent: Saturday, November 17, 2018 10:44 PM
To: graal-dev at openjdk.java.net
Subject: Custom language not being registered.

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