Custom language not being registered.
Timothy Baldridge
tbaldridge at gmail.com
Sun Nov 18 13:36:49 UTC 2018
Yep, that did it! I enabled Annotation Processing in Intelij, included
truffle-dsl-processor in the project and it works. Thanks!
On Sun, Nov 18, 2018 at 4:23 AM Christian Humer <christian.humer at gmail.com>
wrote:
> 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;
>> }
>> }
>>
>
--
“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