Custom language not being registered.

Christian Humer christian.humer at gmail.com
Sun Nov 18 12:23:06 UTC 2018


Hi Timothy

Did the truffle dsl annotation processor run when compiling?
That one will generate a file in META-INF/truffle/language for your
language. That file is needed for your language to be picked up.

Hope this helps.

- Christian Humer


Timothy Baldridge <tbaldridge at gmail.com> schrieb am So., 18. Nov. 2018,
07:45:

> 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