comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/TruffleLanguage.java @ 21649:1c76a5662753

Merge with 645f170013a451083414ff695412c465e9d2ebf0
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Mon, 01 Jun 2015 17:47:28 -0700
parents 31fc2fce38f3
children 2f9e4d984d16
comparison
equal deleted inserted replaced
21648:610d76a131cd 21649:1c76a5662753
1 /* 1 /*
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
36 /** 36 /**
37 * An entry point for everyone who wants to implement a Truffle based language. By providing 37 * An entry point for everyone who wants to implement a Truffle based language. By providing
38 * implementation of this type and registering it using {@link Registration} annotation, your 38 * implementation of this type and registering it using {@link Registration} annotation, your
39 * language becomes accessible to users of the {@link TruffleVM Truffle virtual machine} - all they 39 * language becomes accessible to users of the {@link TruffleVM Truffle virtual machine} - all they
40 * will need to do is to include your JAR into their application and all the Truffle goodies (multi 40 * will need to do is to include your JAR into their application and all the Truffle goodies (multi
41 * language support, multi tennat hosting, debugging, etc.) will be made available to them. 41 * language support, multitenant hosting, debugging, etc.) will be made available to them.
42 */ 42 */
43 public abstract class TruffleLanguage { 43 public abstract class TruffleLanguage {
44 private final Env env; 44 private final Env env;
45 45
46 /** 46 /**
54 } 54 }
55 55
56 /** 56 /**
57 * The annotation to use to register your language to the {@link TruffleVM Truffle} system. By 57 * The annotation to use to register your language to the {@link TruffleVM Truffle} system. By
58 * annotating your implementation of {@link TruffleLanguage} by this annotation you are just a 58 * annotating your implementation of {@link TruffleLanguage} by this annotation you are just a
59 * <em>one JAR drop to the classpath</em> away from your users. Once they include your JAR in 59 * <em>one JAR drop to the class path</em> away from your users. Once they include your JAR in
60 * their application, your language will be available to the {@link TruffleVM Truffle virtual 60 * their application, your language will be available to the {@link TruffleVM Truffle virtual
61 * machine}. 61 * machine}.
62 */ 62 */
63 @Retention(RetentionPolicy.SOURCE) 63 @Retention(RetentionPolicy.SOURCE)
64 @Target(ElementType.TYPE) 64 @Target(ElementType.TYPE)
70 * @return identifier of your language 70 * @return identifier of your language
71 */ 71 */
72 String name(); 72 String name();
73 73
74 /** 74 /**
75 * List of mimetypes associated with your language. Users will use them (directly or 75 * List of MIME types associated with your language. Users will use them (directly or
76 * inderectly) when {@link TruffleVM#eval(java.lang.String, java.lang.String) executing} 76 * indirectly) when {@link TruffleVM#eval(java.lang.String, java.lang.String) executing}
77 * their code snippets or their {@link TruffleVM#eval(java.net.URI) files}. 77 * their code snippets or their {@link TruffleVM#eval(java.net.URI) files}.
78 * 78 *
79 * @return array of mime types assigned to your language files 79 * @return array of MIME types assigned to your language files
80 */ 80 */
81 String[] mimeType(); 81 String[] mimeType();
82 } 82 }
83 83
84 protected final Env env() { 84 protected final Env env() {