ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role)); switch (role) { default: return null; case ChildRole.LOPERAND: return getFirstChildNode(); case ChildRole.ROPERAND: return ElementType.EXPRESSION_BIT_SET.contains(getLastChildNode().getElementType()) ? getLastChildNode() : null; case ChildRole.OPERATION_SIGN: return findChildByType(OUR_OPERATIONS_BIT_SET); } }