Compiler written in Java: Peephole optimizer implementation
问题 I'm writing a compiler for a subset of Pascal. The compiler produces machine instructions for a made-up machine. I want to write a peephole optimizer for this machine language, but I'm having trouble substituting some of the more complicated patterns. Peephole optimizer specification I've researched several different approaches to writing a peephole optimizer, and I've settled on a back-end approach: The Encoder makes a call to an emit() function every time a machine instruction is to be