Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Paperback)
暫譯: 語言實現模式:創建您自己的領域特定和通用程式語言 (平裝本)

Terence Parr

買這商品的人也買了...

商品描述

Knowing how to create domain-specific languages (DSLs) can give you a huge productivity boost. Instead of writing code in a general-purpose programming language, you can first build a custom language tailored to make you efficient in a particular domain.

The key is understanding the common patterns found across language implementations. Language Design Patterns identifies and condenses the most common design patterns, providing sample implementations of each.

The pattern implementations use Java, but the patterns themselves are completely general. Some of the implementations use the well-known ANTLR parser generator, so readers will find this book an excellent source of ANTLR examples as well. But this book will benefit anyone interested in implementing languages, regardless of their tool of choice. Other language implementation books focus on compilers, which you rarely need in your daily life. Instead, Language Design Patterns shows you patterns you can use for all kinds of language applications.

You'll learn to create configuration file readers, data readers, model-driven code generators, source-to-source translators, source analyzers, and interpreters. Each chapter groups related design patterns and, in each pattern, you'll get hands-on experience by building a complete sample implementation. By the time you finish the book, you'll know how to solve most common language implementation problems.

商品描述(中文翻譯)

了解如何創建特定領域語言(DSLs)可以大幅提升您的生產力。與其在通用編程語言中編寫代碼,不如先構建一個定制語言,以提高您在特定領域的效率。

關鍵在於理解語言實現中常見的模式。《語言設計模式(Language Design Patterns)》識別並濃縮了最常見的設計模式,並提供每個模式的示例實現。

這些模式實現使用 Java,但模式本身是完全通用的。其中一些實現使用了知名的 ANTLR 解析器生成器,因此讀者會發現這本書也是 ANTLR 示例的極佳來源。但這本書將使任何對實現語言感興趣的人受益,無論他們選擇的工具是什麼。其他語言實現書籍專注於編譯器,而這在日常生活中很少需要。相反,《語言設計模式》向您展示了可以用於各種語言應用的模式。

您將學會創建配置文件讀取器、數據讀取器、模型驅動的代碼生成器、源到源翻譯器、源分析器和解釋器。每一章都將相關的設計模式分組,並在每個模式中,您將通過構建完整的示例實現來獲得實踐經驗。當您完成這本書時,您將知道如何解決大多數常見的語言實現問題。