Making a Programming Language From Scratch
Introduction
editThis book covers the art of language creation. Making a language is a sophisticated task; however, simple languages can be made by transpiling to other higher level languages and by using lexing and parsing packages such as Bison or Flex. This book does not cover this. It demonstrates the creation of languages from nothing at all, as most commercial languages are. Here, the basic algorithms for conversion, assembly language equivalents for some common statements, the advantages and disadvantages of each type of compilation method, basic lexing and parsing are demonstrated. Note that this book assumes that you have at least a moderate understanding of x86 assembly and can write programs in a language. Keep in mind that language creation is an exhaustive process, and thus will require many days of hard labor to create.
Chapters
editPreliminaries
editData Declarations
editExpressions
editConditions
edit- Comparing Two Values
- Complex Conditions
- The Braces Problem
- If statements
- Else if and else
- While statements