Literals

There are 5 literals: '0', '1', 'L', 'H', and 'null'. Not surprisingly, '0' represents a 0 bit and '1' represents a '1' bit. The 'null' terminal, not surprisingly, matches the empty string. Then we have 'L' and 'H.

The bit value of an 'L' or 'H' depends on the position within the encoding. Take the bit pattern 0x2B ('0010 1011') and repeat it infinitely many times. Line up your entire encoding with this pattern. The value of 'L' at a given position in the encoding is the value of the bit at the corresponding position in the pattern. The value of 'H' is the opposite of the value of 'L'. So, for example, given an encoding of '0010 1011' (which matches the pattern exactly), you have the encoding for 'LLLL LLLL'. Given an encoding of '1101 0100' (the negation of the pattern), you have the encoding for 'HHHH HHHH'. '0111 1110' is the encoding for 'LHLH LHLH'. All of these examples assume that the encoding given is at the beginning of the entire encoding. In order to determine the value for an L or H bit, you have to know your position relative to the start of the entire encoding.