Author: Yu Senlin (Compiler)
Publisher:
Publish Date: 2006-07-01
Features: Learning computer professional courses by dissecting the source code of existing software is an effective approach. This book achieves the goal of learning LALR(1) syntax analysis in compiler principles by dissecting a LALR(1) syntax analysis generator—LEMON. The structure of this book is arranged with the execution flow of LEMON in the main function mmn() as the serial main thread. During the analysis process, each function's working mechanism, related data structures, and their organic connections are explained in the order they are encountered. The book is divided into 11 chapters. Chapter 1 provides a brief introduction to LEMON. Chapter 2 introduces how to use LEMON to develop applications through the development example of a desktop calculator with variable functions and overloaded functions. Chapter 3 analyzes how LEMON processes the parameters input in the command line. Chapter 4 elaborates on the various data structures in LEMON and their initialization processes. Chapter 5 discusses how LEMON performs lexical scanning on the content of syntax files and introduces how to convert syntax files on disk into various data structures in machine memory. Chapter 6 explains the process of finding the First set of symbols and establishing priorities. Chapter 7 discusses the formation of LR(0) analyzer states and the establishment of propagation chains for each item. Chapter 8 covers finding the elements of the Follow set for each grammar symbol. Chapter 9 explains the mechanism and process of adding precedents based on an existing LR(0) analyzer to build an LALR(1) analyzer. Chapter 10 is the most important part of the book, discussing how LEMON works with the carefully designed lempar.c template file to finally generate the C language version file of an LALR(1) type syntax analyzer. Chapter 11 briefly introduces the relationship between function calls and arrays within the syntax analyzer, their good encapsulation, and how to remove debugging and error-checking functions to achieve a smaller software size. This book can be used as a textbook or teaching reference for senior undergraduate and graduate students in computer science, as well as a reference for computer system researchers or application developers.
LEMON parser generator (LALR(1) type) source code scenario analysis
📌 Related Posts
Literature
Sichuan Seafood New Dishes
2026-09-20
Literature
Geffen Cat Essence Version.8
2026-09-25
Literature
The theory, algorithms, and practice of concurrency control and recovery in transaction information systems
2026-10-07
Literature
Network Law Review (Volume 3)
2026-10-07
Literature
Imagine Shanghai in N Ways - 1990s Literature Shanghai and the Construction of Urban Identity
2026-10-11
Literature
New Twenty-Four Filial Piety
2026-10-11
Literature
Little Encyclopedia Trivia Quiz - (2-3 years old) (Volume A)
2026-10-11
Literature
PowerBuilder Database Development Classic Case Analysis - (Treasure Edition) (Includes 2 CDs)
2026-10-11