本文整理汇总了Java中com.sun.tools.javac.tree.JCTree.Tag方法的典型用法代码示例。如果您正苦于以下问题:Java JCTree.Tag方法的具体用法?Java JCTree.Tag怎么用?Java JCTree.Tag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.tree.JCTree
的用法示例。
在下文中一共展示了JCTree.Tag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveUnary
import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
/**
* Entry point for resolving a unary operator given an operator tag and an argument type.
*/
OperatorSymbol resolveUnary(DiagnosticPosition pos, JCTree.Tag tag, Type op) {
return resolve(tag,
unaryOperators,
unop -> unop.test(op),
unop -> unop.resolve(op),
() -> reportErrorIfNeeded(pos, tag, op));
}
示例2: resolveBinary
import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
/**
* Entry point for resolving a binary operator given an operator tag and a pair of argument types.
*/
OperatorSymbol resolveBinary(DiagnosticPosition pos, JCTree.Tag tag, Type op1, Type op2) {
return resolve(tag,
binaryOperators,
binop -> binop.test(op1, op2),
binop -> binop.resolve(op1, op2),
() -> reportErrorIfNeeded(pos, tag, op1, op2));
}
示例3: operatorName
import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
/**
* Return name of operator with given tree tag.
*/
public Name operatorName(JCTree.Tag tag) {
return opname[tag.operatorIndex()];
}
示例4: getTagName
import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
/**
* Names for tree tags.
*/
private static String getTagName(JCTree.Tag tag) {
String name = tag.name();
return (name == null) ? "??" : name;
}
示例5: nameFromTag
import com.sun.tools.javac.tree.JCTree; //导入方法依赖的package包/类
String nameFromTag(JCTree.Tag tag) {
String name = tag.name();
return (name == null) ? "??" : name;
}