Rewrites the parser stack reduction logic.

Centralizes the scattered logic surrounding erroneous
pattern syntax. Consolidates the redundant lookahead
implementations. Eliminates var manipulation in favor
of recursion.