Overhaul the entire grammar generation, replace the old string-based
SLR1 parser generator with the new type-based one.
Write a new lexer.

Each signature symbol is now recognized by the lexer, and the grammar
operates on them directly so the arity is coded right into the productions.