Build your own Programming Language : A programmer's guide to designing compilers, DSLs and interpreters for solving modern computing, 2/e (Paperback)
暫譯: 打造自己的程式語言:程式設計師設計編譯器、DSL 和解譯器以解決現代計算的指南,第二版 (平裝本)
Jeffery, Clinton L.
- 出版商: Packt Publishing
- 出版日期: 2024-01-30
- 售價: $1,980
- 貴賓價: 9.5 折 $1,881
- 語言: 英文
- 頁數: 556
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1804618020
- ISBN-13: 9781804618028
-
相關分類:
Compiler
立即出貨 (庫存 < 3)
買這商品的人也買了...
-
$2,460$2,337 -
$2,540$2,413 -
$480$379 -
$580$458 -
$1,250$1,225 -
$580$458 -
$580$493 -
$780$616 -
$680$537 -
$580$458 -
$580$458 -
$1,601Designing Software Architectures: A Practical Approach (Hardcover)
-
$1,700$1,700 -
$2,900$2,755 -
$580$493 -
$4,620$4,389 -
$1,650$1,568 -
$1,750,800$1,663,260 -
$680$537 -
$980$774 -
$2,450$2,328 -
$1,830$1,739 -
$780$663 -
$1,700$1,615 -
$1,760$1,672
相關主題
商品描述
Written by the creator of the Unicon programming language, this book will show you how to implement programming languages to reduce the time and cost of creating applications for new or specialized areas of computing.
Key Features:
- Solve pain points in your application domain by building a custom programming language
- Learn how to create parsers, code generators, semantic analyzers, and interpreters
- Target bytecode, native code, and preprocess or transpile code into another high level language
Book Description:
The need for different types of computer languages is growing, as is the need for domain-specific languages. Building your own programming language has its advantages, as it can be your antidote to the ever-increasing complexity of software.
In this book, you'll start with implementing the frontend of a compiler for your language, including a lexical analyzer and parser, including the handling of parse errors. The book then covers a series of traversals of syntax trees, culminating with code generation for a bytecode virtual machine or native code. You'll also manage data structures and output code when writing a preprocessor or a transpiler.
Moving ahead, you'll learn how domain-specific language features are often best represented by operators and functions that are built into the language, rather than library functions. We'll conclude with how to implement garbage collection. Throughout the book, Dr. Jeffery weaves in his experience from building the Unicon programming language to give better context to the concepts. Relevant examples are provided in Unicorn and Java so that you can follow the code of your choice. In this edition, code examples have been extended and further tested.
By the end of this book, you'll be able to build and deploy your own domain-specific languages, capable of compiling and running programs.
What You Will Learn:
- Perform requirements analysis for the new language and design language syntax and semantics
- Write lexical and context-free grammar rules for common expressions and control structures
- Develop a scanner that reads source code and generate a parser that checks syntax
- Build key data structures in a compiler and use your compiler to build a syntax-coloring code editor
- Write tree traversals that insert information into the syntax tree
- Implement a bytecode interpreter and run bytecode generated by your compiler
- Write native code and run it after assembling and linking using system tools
- Preprocess and transpile code from your language into another high level language
- Implement garbage collection in your language
Who this book is for:
This book is for software developers interested in the idea of inventing their own language or developing a domain-specific language. Computer science students taking compiler construction courses will also find this book highly useful as a practical guide to language implementation to supplement more theoretical textbooks. We assume most readers will have intermediate or better proficiency in a high level programming language such as Java or C++.
商品描述(中文翻譯)
本書由 Unicon 程式語言的創作者撰寫,將向您展示如何實現程式語言,以減少為新興或專門計算領域創建應用程式的時間和成本。
主要特色:
- 通過構建自定義程式語言來解決您應用領域中的痛點
- 學習如何創建解析器、代碼生成器、語義分析器和解釋器
- 針對位元組碼、原生代碼,並將代碼預處理或轉譯成另一種高級語言
書籍描述:
不同類型的計算機語言需求正在增長,特定領域語言的需求也在增加。構建自己的程式語言有其優勢,因為它可以成為應對日益增加的軟體複雜性的解藥。
在本書中,您將從實現語言的編譯器前端開始,包括詞法分析器和解析器,以及解析錯誤的處理。接著,本書涵蓋了一系列語法樹的遍歷,最終生成位元組碼虛擬機或原生代碼的代碼。您還將在編寫預處理器或轉譯器時管理數據結構並輸出代碼。
接下來,您將學習特定領域語言的特性通常最好由內建於語言中的運算符和函數來表示,而不是庫函數。我們將以如何實現垃圾回收作為結尾。在整本書中,Jeffery 博士融入了他構建 Unicon 程式語言的經驗,以便為概念提供更好的背景。相關的範例提供了 Unicorn 和 Java,以便您可以選擇跟隨您喜歡的代碼。在本版中,代碼範例已擴展並進一步測試。
到本書結束時,您將能夠構建和部署自己的特定領域語言,能夠編譯和運行程式。
您將學到的內容:
- 對新語言進行需求分析,設計語言的語法和語義
- 為常見表達式和控制結構編寫詞法和上下文無關文法規則
- 開發一個掃描器來讀取源代碼,並生成一個檢查語法的解析器
- 在編譯器中構建關鍵數據結構,並使用您的編譯器構建語法著色代碼編輯器
- 編寫樹遍歷,將信息插入語法樹中
- 實現位元組碼解釋器,運行由您的編譯器生成的位元組碼
- 編寫原生代碼,並在使用系統工具進行組裝和鏈接後運行它
- 將您的語言的代碼預處理和轉譯成另一種高級語言
- 在您的語言中實現垃圾回收
本書適合誰:
本書適合對發明自己的語言或開發特定領域語言感興趣的軟體開發人員。修習編譯器構建課程的計算機科學學生也會發現本書作為語言實現的實用指南非常有用,以補充更理論的教科書。我們假設大多數讀者在 Java 或 C++ 等高級程式語言方面具有中級或更高的熟練程度。