pyparsing is very slow when there are dozens of alternatives, as there
were when the whole instruction set appeared as alternatives of the main
production.
Instead, use our knowledge of the structure of assembler files so that there
are only a few top-level rules: only one for all types of instruction,
and only one for all types of pseudo-ops
Also, lay the basis for a proper pseudo-op implementation. Implement
pseudo-ops .org and .equ; parse but don't act on .end.
Change the format of the test program accordingly.
This improves the speed by a factor of about 4 on the 'ssremote' input.
This real program goes from 4s runtime to 1s.
.. this requires explicitly matching the space after an instruction
because otherwise the pattern order
JMP *
JMPNZ *
would cause 'JMPNZ LABEL' to actually parse as 'JMP NZ LABEL', and
issue an error due to the trailing 'LABEL'. (This doesn't actually
make sense to me, except that it's what pyparsing seemed to do)