Mercurial > hg > truffle
diff graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.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 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java Sun May 31 17:23:14 2015 -0700 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/vm/TruffleVM.java Mon Jun 01 17:47:28 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,12 +40,12 @@ /** * Virtual machine for Truffle based languages. Use {@link #newVM()} to create new isolated virtual * machine ready for execution of various languages. All the languages in a single virtual machine - * see each other exported global symbols and can co-operate. Use {@link #newVM()} multiple times to + * see each other exported global symbols and can cooperate. Use {@link #newVM()} multiple times to * create different, isolated virtual machines completely separated from each other. * <p> * Once instantiated use {@link #eval(java.net.URI)} with a reference to a file or URL or directly * pass code snippet into the virtual machine via {@link #eval(java.lang.String, java.lang.String)}. - * Support for individual languages is initialized on demand - e.g. once a file of certain mime type + * Support for individual languages is initialized on demand - e.g. once a file of certain MIME type * is about to be processed, its appropriate engine (if found), is initialized. Once an engine gets * initialized, it remains so, until the virtual machine isn't garbage collected. * <p> @@ -190,7 +190,7 @@ } /** - * Changes the defaut input for languages running in <em>to be created</em> + * Changes the default input for languages running in <em>to be created</em> * {@link TruffleVM virtual machine}. The default is to use {@link System#out}. * * @param r the reader to use as input @@ -224,7 +224,7 @@ /** * Descriptions of languages supported in this Truffle virtual machine. * - * @return an immutable map with keys being mimetypes and values the {@link Language + * @return an immutable map with keys being MIME types and values the {@link Language * descriptions} of associated languages */ public Map<String, Language> getLanguages() { @@ -233,7 +233,7 @@ /** * Evaluates file located on a given URL. Is equivalent to loading the content of a file and - * executing it via {@link #eval(java.lang.String, java.lang.String)} with a mime type guess + * executing it via {@link #eval(java.lang.String, java.lang.String)} with a MIME type guess * based on the file's extension and/or content. * * @param location the location of a file to execute @@ -263,43 +263,43 @@ } TruffleLanguage l = getTruffleLang(mimeType); if (l == null) { - throw new IOException("No language for " + location + " with mime type " + mimeType + " found. Supported types: " + langs.keySet()); + throw new IOException("No language for " + location + " with MIME type " + mimeType + " found. Supported types: " + langs.keySet()); } return SPI.eval(l, s); } /** - * Evaluates code snippet. Chooses a language registered for a given mime type (throws + * Evaluates code snippet. Chooses a language registered for a given MIME type (throws * {@link IOException} if there is none). And passes the specified code to it for execution. * - * @param mimeType mime type of the code snippet - chooses the right language + * @param mimeType MIME type of the code snippet - chooses the right language * @param reader the source of code snippet to execute - * @return result of an exceution, possibly <code>null</code> + * @return result of an execution, possibly <code>null</code> * @throws IOException thrown to signal errors while processing the code */ public Object eval(String mimeType, Reader reader) throws IOException { checkThread(); TruffleLanguage l = getTruffleLang(mimeType); if (l == null) { - throw new IOException("No language for mime type " + mimeType + " found. Supported types: " + langs.keySet()); + throw new IOException("No language for MIME type " + mimeType + " found. Supported types: " + langs.keySet()); } return SPI.eval(l, Source.fromReader(reader, mimeType)); } /** - * Evaluates code snippet. Chooses a language registered for a given mime type (throws + * Evaluates code snippet. Chooses a language registered for a given MIME type (throws * {@link IOException} if there is none). And passes the specified code to it for execution. * - * @param mimeType mime type of the code snippet - chooses the right language + * @param mimeType MIME type of the code snippet - chooses the right language * @param code the code snippet to execute - * @return result of an exceution, possibly <code>null</code> + * @return result of an execution, possibly <code>null</code> * @throws IOException thrown to signal errors while processing the code */ public Object eval(String mimeType, String code) throws IOException { checkThread(); TruffleLanguage l = getTruffleLang(mimeType); if (l == null) { - throw new IOException("No language for mime type " + mimeType + " found. Supported types: " + langs.keySet()); + throw new IOException("No language for MIME type " + mimeType + " found. Supported types: " + langs.keySet()); } return SPI.eval(l, Source.fromText(code, mimeType)); } @@ -309,13 +309,13 @@ * program via one of your {@link #eval(java.lang.String, java.lang.String)} and then look * expected symbol up using this method. * <p> - * The names of the symbols are language dependant, but for example the Java language bindings + * The names of the symbols are language dependent, but for example the Java language bindings * follow the specification for method references: * <ul> * <li>"java.lang.Exception::new" is a reference to constructor of {@link Exception} * <li>"java.lang.Integer::valueOf" is a reference to static method in {@link Integer} class * </ul> - * Once an symbol is obtained, it remembers values for fast acces and is ready for being + * Once an symbol is obtained, it remembers values for fast access and is ready for being * invoked. * * @param globalName the name of the symbol to find @@ -391,8 +391,8 @@ * Description of a language registered in {@link TruffleVM Truffle virtual machine}. Languages * are registered by {@link Registration} annotation which stores necessary information into a * descriptor inside of the language's JAR file. When a new {@link TruffleVM} is created, it - * reads all available descritors and creates {@link Language} objects to represent them. One - * can obtain a {@link #getName() name} or list of supported {@link #getMimeTypes() mimetypes} + * reads all available descriptors and creates {@link Language} objects to represent them. One + * can obtain a {@link #getName() name} or list of supported {@link #getMimeTypes() MIME types} * for each language. The actual language implementation is not initialized until * {@link TruffleVM#eval(java.lang.String, java.lang.String) a code is evaluated} in it. */ @@ -405,9 +405,9 @@ } /** - * Mimetypes recognized by the language. + * MIME types recognized by the language. * - * @return returns immutable set of recognized mimetypes + * @return returns immutable set of recognized MIME types */ public Set<String> getMimeTypes() { TreeSet<String> ts = new TreeSet<>();