Skip to content

qfu/Build-Your-Own-Programming-Language

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Your Own Programming Language

Build Your Own Programming Language

This is the code repository for Build Your Own Programming Language , published by Packt.

A programmer's guide to designing compilers, interpreters, and DSLs for solving modern computing problems

What is this book about?

The need for different types of computer languages is growing rapidly and developers prefer creating domain-specific languages for solving specific application domain problems. Building your own programming language has its advantages. It can be your antidote to the ever-increasing size and complexity of software. However, creating a custom language isn't easy.

This book covers the following exciting features:

  • 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.
  • Implement a bytecode interpreter and run bytecode generated by your compiler.
  • Write tree traversals that insert information into the syntax tree.
  • Implement garbage collection in your language.

If you feel this book is for you, get your copy today!

Instructions and Navigations

All of the code is organized into folders. For example, Chapter02.

The code will look like the following:

procedure main(argv)
    simple := simple()
    yyin := open(argv[1])
    while i := yylex() do
        write(yytext, ": ", i)
end

Following is what you need for this book: 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. Intermediate-level knowledge and experience working with a high-level language such as Java or the C++ language are expected to help you get the most out of this book.

With the following software and hardware list you can run all code files present in the book (Chapter 1-17).

Software and Hardware List

Chapter Software required OS required
3-16 Uflex, Jflex, Unicon, Java Windows, Mac OS X, and Linux (Any)

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.

Code in Action

The Code in Action videos for this book can be viewed at https://bit.ly/3njc15D.

Related products

Get to Know the Author

Clinton L. Jeffery is Professor and Chair of the Department of Computer Science and Engineering at New Mexico Institute of Mining and Technology. He received his B.S. from the University of Washington, and M.S. and Ph.D. degrees from the University of Arizona, all in computer science. He has conducted research and written many books and papers on programming languages, program monitoring, debugging, graphics, virtual environments, and visualization. With colleagues, he invented the Unicon programming language, hosted on the Unicon website.

Download a free PDF

If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

https://packt.link/free-ebook/9781800204805

About

Build Your Own Programming Language, published by Packt

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 84.6%
  • Yacc 8.2%
  • Lex 5.7%
  • Makefile 1.5%