本文整理汇总了Java中jdk.nashorn.internal.ir.UnaryNode.isTokenType方法的典型用法代码示例。如果您正苦于以下问题:Java UnaryNode.isTokenType方法的具体用法?Java UnaryNode.isTokenType怎么用?Java UnaryNode.isTokenType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.ir.UnaryNode
的用法示例。
在下文中一共展示了UnaryNode.isTokenType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
if (unaryNode.isTokenType(TokenType.NEW)) {
curExpr = new NewTreeImpl(unaryNode,
translateExpr(unaryNode.getExpression()));
} else if (unaryNode.isTokenType(TokenType.YIELD) ||
unaryNode.isTokenType(TokenType.YIELD_STAR)) {
curExpr = new YieldTreeImpl(unaryNode,
translateExpr(unaryNode.getExpression()));
} else if (unaryNode.isTokenType(TokenType.SPREAD_ARGUMENT) ||
unaryNode.isTokenType(TokenType.SPREAD_ARRAY)) {
curExpr = new SpreadTreeImpl(unaryNode,
translateExpr(unaryNode.getExpression()));
} else {
curExpr = new UnaryTreeImpl(unaryNode,
translateExpr(unaryNode.getExpression()));
}
return false;
}
示例2: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
if(unaryNode.isTokenType(TokenType.NOT) || unaryNode.isTokenType(TokenType.NEW)) {
// Operand of boolean negation is never optimistic (always coerced to boolean).
// Operand of "new" is never optimistic (always coerced to Object).
tagNeverOptimistic(unaryNode.getExpression());
}
return true;
}
示例3: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
if (unaryNode.isTokenType(SPREAD_ARRAY)) {
// rest element
return true;
} else {
return enterDefault(unaryNode);
}
}
示例4: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
if (es6) {
if (unaryNode.isTokenType(TokenType.YIELD) ||
unaryNode.isTokenType(TokenType.YIELD_STAR)) {
throwNotImplementedYet("es6.yield", unaryNode);
} else if (unaryNode.isTokenType(TokenType.SPREAD_ARGUMENT) ||
unaryNode.isTokenType(TokenType.SPREAD_ARRAY)) {
throwNotImplementedYet("es6.spread", unaryNode);
}
}
return super.enterUnaryNode(unaryNode);
}
示例5: branchOptimizer
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
private void branchOptimizer(final UnaryNode unaryNode, final Label label, final boolean state) {
if (unaryNode.isTokenType(NOT)) {
branchOptimizer(unaryNode.getExpression(), label, !state);
} else {
loadTestAndJump(unaryNode, label, state);
}
}