This document outlines Lecture 5 on term rewriting within the CS4200 Compiler Construction course at TU Delft, highlighting transformations of abstract syntax trees using rewrite rules, and discusses Spoofax as a language workbench for language definitions. Key components covered include programmable rewriting strategies, specific syntax and desugaring techniques, as well as integration with Eclipse and the use of Stratego for program transformation. Additionally, it touches upon practical applications such as debugging and outlining within the Spoofax environment.