Table of Contents:
1. Introduction
2. Overview of Compilers
3. Scanner
4. Parser and Code Generation
5. Conclusions
Introduction:
This document briefly introduces the concepts and construction of programming language compilers. The document uses a simple programming language we named “D” for the purposes of this project, then goes through the process of constructing a full compiler for the “D” programming language. “D” only represents the name of the sample programming language used in this project, and has no relationship with any popular existing programming language. Code samples will be included in this document; however, since this document will be published on the Internet, to prevent future computer science students with similar assignments from plagiarizing any part of this paper, the full source code for the compiler project will not be included in this document. All source codes for the compiler in this document are written in C, and compiled using gcc in Unix/Linux. The source code has also been tested for compilation under Windows NT (including 2000, XP, and Vista) using Visual C++ (including 6.0, 2003, and 2005). The X86 assembly language code presented in this documents uses the Microsoft/ Intel standard, which is different from the GNU/AT&T standard in some respects. This document is neither a course requirement, nor an assignment. All contents represent the author’s personal interests and the author provides no warranty.
To view the full document, either:
-
Download the attachment of this post, which is in *.zip format.
-