This fascinating sentence is impossible to parse strictly, because the phrase each other has become, in our linguistic consciousness, divorced from the original structure which generated it.
- That underlying structure is something like:
Each of us has the other(s). (the plural being employed when there are more than two of us)
- This becomes
We have, each the other(s).
- This is generalized as
We have each other.
- So far, so good. What happens next is that each other becomes apprehended as a fixed noun phrase, still signifying the reciprocal relationship but no longer constrained to a strict syntactical coherence. (I make no claim that what follows represents an actual historical development — just a sort of underlying logic.)
What we have is each other. or All we have is each other.
Each other is all we have. or Each other is all we have.
- This now runs up against a semantically equivalent construction:
We are all we have.
- But since in 4) all we have is each other, the penultimate stage is to substitute each other for we as a sort of reciprocal pronoun
*We're all each other have.We're all each other have.
- And the final stage is to replace have, reflecting what our high-school teachers drummed into us — that each takes has.
*We're all each other has.We're all each other has.