CHAPTER 6
Decompiler Implementation
We are now at the point where you will learn to actually deal with the individual bytecodes, decompile the opcodes into partial statements and expressions and, ultimately (well that’s the plan anyway), back into complete blocks of source code.
If I’m gauging my audience correctly, this chapter, and possibly Chapter 5, will appeal to a significant cross section of readers. We’re now at the nub of the problem of how to implement a decompiler using using Java versions of Lex and Yacc, namely JLex and CUP.
To keep this as practical as possible, I’ll use a test suite of ten simple programs, each with a different language construct. For each program, I’ll reconstruct the original source gradually, building the decompiler ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access