/** Return binary operator that corresponds to given access code. */ private OperatorSymbol binaryAccessOperator(int acode) { for (Scope.Entry e = syms.predefClass.members().elems; e != null; e = e.sibling) { if (e.sym instanceof OperatorSymbol) { OperatorSymbol op = (OperatorSymbol)e.sym; if (accessCode(op.opcode) == acode) return op; } } return null; }
/** Return binary operator that corresponds to given access code. */ private OperatorSymbol binaryAccessOperator(int acode) { for (Scope.Entry e = syms.predefClass.members().elems; e != null; e = e.sibling) { if (e.sym instanceof OperatorSymbol) { OperatorSymbol op = (OperatorSymbol)e.sym; if (accessCode(op.opcode) == acode) return op; } } return null; }
/** Return binary operator that corresponds to given access code. */ private OperatorSymbol binaryAccessOperator(int acode) { for (Scope.Entry e = syms.predefClass.members().elems; e != null; e = e.sibling) { if (e.sym instanceof OperatorSymbol) { OperatorSymbol op = (OperatorSymbol)e.sym; if (accessCode(op.opcode) == acode) return op; } } return null; }
/** Return binary operator that corresponds to given access code. */ private OperatorSymbol binaryAccessOperator(int acode) { for (Scope.Entry e = syms.predefClass.members().elems; e != null; e = e.sibling) { if (e.sym instanceof OperatorSymbol) { OperatorSymbol op = (OperatorSymbol)e.sym; if (accessCode(op.opcode) == acode) return op; } } return null; }
/** return access code for identifier, * @param tree The tree representing the identifier use. * @param enclOp The closest enclosing operation node of tree, * null if tree is not a subtree of an operation. */ private static int accessCode(JCTree tree, JCTree enclOp) { if (enclOp == null) return DEREFcode; else if (enclOp.tag == JCTree.ASSIGN && tree == TreeInfo.skipParens(((JCAssign) enclOp).lhs)) return ASSIGNcode; else if (JCTree.PREINC <= enclOp.tag && enclOp.tag <= JCTree.POSTDEC && tree == TreeInfo.skipParens(((JCUnary) enclOp).arg)) return (enclOp.tag - JCTree.PREINC) * 2 + PREINCcode; else if (JCTree.BITOR_ASG <= enclOp.tag && enclOp.tag <= JCTree.MOD_ASG && tree == TreeInfo.skipParens(((JCAssignOp) enclOp).lhs)) return accessCode(((OperatorSymbol) ((JCAssignOp) enclOp).operator).opcode); else return DEREFcode; }
/** return access code for identifier, * @param tree The tree representing the identifier use. * @param enclOp The closest enclosing operation node of tree, * null if tree is not a subtree of an operation. */ private static int accessCode(JCTree tree, JCTree enclOp) { if (enclOp == null) return DEREFcode; else if (enclOp.getTag() == JCTree.ASSIGN && tree == TreeInfo.skipParens(((JCAssign) enclOp).lhs)) return ASSIGNcode; else if (JCTree.PREINC <= enclOp.getTag() && enclOp.getTag() <= JCTree.POSTDEC && tree == TreeInfo.skipParens(((JCUnary) enclOp).arg)) return (enclOp.getTag() - JCTree.PREINC) * 2 + PREINCcode; else if (JCTree.BITOR_ASG <= enclOp.getTag() && enclOp.getTag() <= JCTree.MOD_ASG && tree == TreeInfo.skipParens(((JCAssignOp) enclOp).lhs)) return accessCode(((OperatorSymbol) ((JCAssignOp) enclOp).operator).opcode); else return DEREFcode; }
acode = accessCode(tree, enclOp); if (acode >= FIRSTASGOPcode) { OperatorSymbol operator = binaryAccessOperator(acode);
/** return access code for identifier, * @param tree The tree representing the identifier use. * @param enclOp The closest enclosing operation node of tree, * null if tree is not a subtree of an operation. */ private static int accessCode(JCTree tree, JCTree enclOp) { if (enclOp == null) return DEREFcode; else if (enclOp.hasTag(ASSIGN) && tree == TreeInfo.skipParens(((JCAssign) enclOp).lhs)) return ASSIGNcode; else if (enclOp.getTag().isIncOrDecUnaryOp() && tree == TreeInfo.skipParens(((JCUnary) enclOp).arg)) return mapTagToUnaryOpCode(enclOp.getTag()); else if (enclOp.getTag().isAssignop() && tree == TreeInfo.skipParens(((JCAssignOp) enclOp).lhs)) return accessCode(((OperatorSymbol) ((JCAssignOp) enclOp).operator).opcode); else return DEREFcode; }
/** return access code for identifier, * @param tree The tree representing the identifier use. * @param enclOp The closest enclosing operation node of tree, * null if tree is not a subtree of an operation. */ private static int accessCode(JCTree tree, JCTree enclOp) { if (enclOp == null) return DEREFcode; else if (enclOp.hasTag(ASSIGN) && tree == TreeInfo.skipParens(((JCAssign) enclOp).lhs)) return ASSIGNcode; else if (enclOp.getTag().isIncOrDecUnaryOp() && tree == TreeInfo.skipParens(((JCUnary) enclOp).arg)) return mapTagToUnaryOpCode(enclOp.getTag()); else if (enclOp.getTag().isAssignop() && tree == TreeInfo.skipParens(((JCAssignOp) enclOp).lhs)) return accessCode(((OperatorSymbol) ((JCAssignOp) enclOp).operator).opcode); else return DEREFcode; }
acode = accessCode(tree, enclOp); if (acode >= FIRSTASGOPcode) { OperatorSymbol operator = binaryAccessOperator(acode);
acode = accessCode(tree, enclOp); if (acode >= FIRSTASGOPcode) { OperatorSymbol operator = binaryAccessOperator(acode);
acode = accessCode(tree, enclOp); if (acode >= FIRSTASGOPcode) { OperatorSymbol operator = binaryAccessOperator(acode);