本文整理汇总了Java中jdk.nashorn.internal.ir.UnaryNode.tokenType方法的典型用法代码示例。如果您正苦于以下问题:Java UnaryNode.tokenType方法的具体用法?Java UnaryNode.tokenType怎么用?Java UnaryNode.tokenType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jdk.nashorn.internal.ir.UnaryNode
的用法示例。
在下文中一共展示了UnaryNode.tokenType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: branchOptimizer
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
private void branchOptimizer(final UnaryNode unaryNode, final Label label, final boolean state) {
final Expression rhs = unaryNode.getExpression();
switch (unaryNode.tokenType()) {
case NOT:
branchOptimizer(rhs, label, !state);
return;
default:
if (unaryNode.getType().isBoolean()) {
branchOptimizer(rhs, label, state);
return;
}
break;
}
loadTestAndJump(unaryNode, label, state);
}
示例2: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final boolean enterUnaryNode(final UnaryNode unaryNode) {
switch (unaryNode.tokenType()) {
case ADD:
return enterADD(unaryNode);
case BIT_NOT:
return enterBIT_NOT(unaryNode);
case DELETE:
return enterDELETE(unaryNode);
case NEW:
return enterNEW(unaryNode);
case NOT:
return enterNOT(unaryNode);
case SUB:
return enterSUB(unaryNode);
case TYPEOF:
return enterTYPEOF(unaryNode);
case VOID:
return enterVOID(unaryNode);
case DECPREFIX:
case DECPOSTFIX:
case INCPREFIX:
case INCPOSTFIX:
return enterDECINC(unaryNode);
default:
return super.enterUnaryNode(unaryNode);
}
}
示例3: leaveUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final Node leaveUnaryNode(final UnaryNode unaryNode) {
switch (unaryNode.tokenType()) {
case ADD:
return leaveADD(unaryNode);
case BIT_NOT:
return leaveBIT_NOT(unaryNode);
case DELETE:
return leaveDELETE(unaryNode);
case NEW:
return leaveNEW(unaryNode);
case NOT:
return leaveNOT(unaryNode);
case SUB:
return leaveSUB(unaryNode);
case TYPEOF:
return leaveTYPEOF(unaryNode);
case VOID:
return leaveVOID(unaryNode);
case DECPREFIX:
case DECPOSTFIX:
case INCPREFIX:
case INCPOSTFIX:
return leaveDECINC(unaryNode);
default:
return super.leaveUnaryNode(unaryNode);
}
}
示例4: leaveUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public Node leaveUnaryNode(final UnaryNode unaryNode) {
if (unaryNode.isAssignment() && unaryNode.getExpression() instanceof IdentNode) {
checkConstAssignment((IdentNode) unaryNode.getExpression());
}
switch (unaryNode.tokenType()) {
case DELETE:
return leaveDELETE(unaryNode);
case TYPEOF:
return leaveTYPEOF(unaryNode);
default:
return super.leaveUnaryNode(unaryNode);
}
}
示例5: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
switch (unaryNode.tokenType()) {
case POS:
return enterPOS(unaryNode);
case BIT_NOT:
return enterBIT_NOT(unaryNode);
case DELETE:
return enterDELETE(unaryNode);
case NEW:
return enterNEW(unaryNode);
case NOT:
return enterNOT(unaryNode);
case NEG:
return enterNEG(unaryNode);
case TYPEOF:
return enterTYPEOF(unaryNode);
case VOID:
return enterVOID(unaryNode);
case DECPREFIX:
case DECPOSTFIX:
case INCPREFIX:
case INCPOSTFIX:
return enterDECINC(unaryNode);
default:
return super.enterUnaryNode(unaryNode);
}
}
示例6: leaveUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public final Node leaveUnaryNode(final UnaryNode unaryNode) {
switch (unaryNode.tokenType()) {
case POS:
return leavePOS(unaryNode);
case BIT_NOT:
return leaveBIT_NOT(unaryNode);
case DELETE:
return leaveDELETE(unaryNode);
case NEW:
return leaveNEW(unaryNode);
case NOT:
return leaveNOT(unaryNode);
case NEG:
return leaveNEG(unaryNode);
case TYPEOF:
return leaveTYPEOF(unaryNode);
case VOID:
return leaveVOID(unaryNode);
case DECPREFIX:
case DECPOSTFIX:
case INCPREFIX:
case INCPOSTFIX:
return leaveDECINC(unaryNode);
default:
return super.leaveUnaryNode(unaryNode);
}
}
示例7: leaveUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public Node leaveUnaryNode(final UnaryNode unaryNode) {
switch (unaryNode.tokenType()) {
case DELETE:
return leaveDELETE(unaryNode);
case TYPEOF:
return leaveTYPEOF(unaryNode);
default:
return super.leaveUnaryNode(unaryNode);
}
}
示例8: enterUnaryNode
import jdk.nashorn.internal.ir.UnaryNode; //导入方法依赖的package包/类
@Override
public boolean enterUnaryNode(final UnaryNode unaryNode) {
enterDefault(unaryNode);
final TokenType tokenType = unaryNode.tokenType();
if (tokenType == TokenType.NEW) {
type("NewExpression");
comma();
final CallNode callNode = (CallNode)unaryNode.getExpression();
property("callee");
callNode.getFunction().accept(this);
comma();
array("arguments", callNode.getArgs());
} else {
final String operator;
final boolean prefix;
switch (tokenType) {
case INCPOSTFIX:
prefix = false;
operator = "++";
break;
case DECPOSTFIX:
prefix = false;
operator = "--";
break;
case INCPREFIX:
operator = "++";
prefix = true;
break;
case DECPREFIX:
operator = "--";
prefix = true;
break;
default:
prefix = true;
operator = tokenType.getName();
break;
}
type(unaryNode.isAssignment()? "UpdateExpression" : "UnaryExpression");
comma();
property("operator", operator);
comma();
property("prefix", prefix);
comma();
property("argument");
unaryNode.getExpression().accept(this);
}
return leave();
}