mulfile java_Java Token.MUL属性代码示例

/**

* for infix expressions, we ignore implicit coercions for now. For arithmetic

* operators, we assume the type of the entire expression to be the same as that

* of either operand. For comparison operators, we require operands to have

* the same type, and assume that the result is a boolean. Note that Assignments

* are also InfixExpressions and that some property-get operations show up as

* InfixExpressions for which the operator is GETPROP.

*/

private ITypeTerm processInfixExpression(InfixExpression i) throws Error {

int operator = i.getOperator();

AstNode leftOperand = i.getLeft();

AstNode rightOperand = i.getRight();

ITypeTerm iTerm = findOrCreateExpressionTerm(i);

switch (operator){

case Token.GETPROP:

return processPropertyGet(i, leftOperand, rightOperand);

case Token.ASSIGN:

case Token.ASSIGN_ADD:

case Token.ASSIGN_SUB:

case Token.ASSIGN_MUL:

case Token.ASSIGN_DIV:

case Token.ASSIGN_BITAND:

case Token.ASSIGN_BITOR:

case Token.ASSIGN_BITXOR:

case Token.ASSIGN_RSH:

processAssignment((Assignment)i);

return iTerm;

case Token.ADD:

case Token.SUB:

case Token.MUL:

case Token.DIV:

case Token.MOD:

case Token.BITOR:

case Token.EQ:

case Token.LE:

case Token.LT:

case Token.NE:

case Token.GT:

case Token.GE:

case Token.SHNE:

case Token.SHEQ:

case Token.AND:

case Token.OR:

case Token.BITAND:

case Token.BITXOR:

case Token.LSH:

case Token.RSH:

case Token.URSH:

case Token.IN:

ITypeTerm leftTerm = processExpression(leftOperand);

ITypeTerm rightTerm = processExpression(rightOperand);

OperatorTerm opTerm = findOrCreateOperatorTerm(RhinoToIR.decodeRhinoOperator(operator), leftTerm, rightTerm, i.getLineno());

addTypeEqualityConstraint(iTerm, opTerm, i.getLineno(), (solution) -> binaryOperatorMisuse(i, solution.typeOfTerm(leftTerm), solution.typeOfTerm(rightTerm), solution.typeOfTerm(opTerm)));

break;

default:

error("unexpected infix operator: " + operator + "(" + RhinoToIR.decodeRhinoOperator(operator) + ") in " + i.toSource(), i);

}

theMap.put(i, iTerm);

return iTerm;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值