Observe these lines of BPF filters in tcpdump/libpcap syntax:
1: not host x or host y
2: not (host x or host y)
3: not (host x or y)
4: not host x or y
5: (not host x) or host y
6: (not host x) or y
It is my opinion that host z matches all of the above (with the exception of 6 because that one has an invalid syntax). My problem is with line 4. The tcpdump program sees that as equivalent to 5, but I think that is not intuitive and therefore not correct. Line 5 is unambiguous, as is line 3. However, line 4 can mean both things, depending how you look at things. I am of the opinion that because you cannot see y separately from the "host" keyword, it is wrong to treat line 4 like line 5.
What is the parse logic behind this? Who can explain why 1 == 4 == 5 and why 2 != 4 and 3 != 4 ?