本文整理了Java中com.oracle.truffle.api.nodes.Node.getLanguage()
方法的一些代码示例,展示了Node.getLanguage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getLanguage()
方法的具体详情如下:
包路径:com.oracle.truffle.api.nodes.Node
类名称:Node
方法名:getLanguage
[英]Returns a string representing the language this node has been implemented for. If the language is unknown, returns "".
[中]返回一个字符串,该字符串表示该节点的实现语言。如果语言未知,则返回“”。
代码示例来源:origin: com.oracle/truffle
/**
* Returns a string representing the language this node has been implemented for. If the
* language is unknown, returns "".
*/
public String getLanguage() {
NodeInfo info = getClass().getAnnotation(NodeInfo.class);
if (info != null && info.language() != null && info.language().length() > 0) {
return info.language();
}
if (parent != null) {
return parent.getLanguage();
}
return "";
}
代码示例来源:origin: org.graalvm.truffle/truffle-api
/**
* Returns a string representing the language this node has been implemented for. If the
* language is unknown, returns "".
*
* @since 0.8 or earlier
* @deprecated in 0.25 use {@link #getRootNode() getRootNode()}.
* {@link RootNode#getLanguageInfo() getLanguageInfo()}.
* {@link LanguageInfo#getName() getName()} instead
*/
@Deprecated
public String getLanguage() {
NodeInfo info = getClass().getAnnotation(NodeInfo.class);
if (info != null && info.language() != null && info.language().length() > 0) {
return info.language();
}
if (parent != null) {
return parent.getLanguage();
}
return "";
}
代码示例来源:origin: com.oracle.truffle/truffle-api
/**
* Returns a string representing the language this node has been implemented for. If the
* language is unknown, returns "".
*
* @since 0.8 or earlier
* @deprecated in 0.25 use {@link #getRootNode() getRootNode()}.
* {@link RootNode#getLanguageInfo() getLanguageInfo()}.
* {@link LanguageInfo#getName() getName()} instead
*/
@Deprecated
public String getLanguage() {
NodeInfo info = getClass().getAnnotation(NodeInfo.class);
if (info != null && info.language() != null && info.language().length() > 0) {
return info.language();
}
if (parent != null) {
return parent.getLanguage();
}
return "";
}
代码示例来源:origin: com.oracle/truffle
public static void dumpNewNode(Node newNode) {
if (AstJsonDumpBuilder != null) {
AstJsonDumpBuilder.append("{ \"action\": \"createNode\", \"newId\": \"" + getID(newNode) + "\", \"type\": \"" + getType(newNode) + "\", \"description\": \"" + newNode.getDescription() +
"\", \"language\": \"" + newNode.getLanguage() + "\"" + getSourceSectionInfo(newNode) + " },\n");
}
}
内容来源于网络,如有侵权,请联系作者删除!