Custom language not being registered.

Timothy Baldridge tbaldridge at gmail.com
Sun Nov 18 23:45:57 UTC 2018


Yes it was, but that would have been an improvement to the error I
originally had. With that typeo it would have said "Can't find
Fae...acceptable imputs are [llvm, Faee, ...]"

On Sun, Nov 18, 2018 at 1:07 PM Andrew Luo <
andrewluotechnologies at outlook.com> wrote:

> 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;
>     }
> }
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)


More information about the graal-dev mailing list