Lex & Yacc
by John R Levine, Tony Mason, Doug Brown
This book was first published in 1990. It describes how to use the Unix tools lex and yacc. They both work on Linux, and nowadays there are many versions in different languages.
Lex and Yacc can generate program fragments that read the source program and discover its structure.
The task of discovering the source structure again is decomposed into subtasks:
1. Split the source file into tokens (Lex).
2. Find the hierarchical structure of the program (Yacc).