Building yourself a compiler

Computers are a very powerful machine that can solve problems in a short time with a huge of calculations. Computers are one of the greatest inventions of the 20th century. It will be great if we can ask a computer to solve our problem. Programming languages such as Java or C++ has been a key facto...

Full description

Saved in:
Bibliographic Details
Main Author: Ngo, Trung Le Bao
Other Authors: Ta Nguyen Binh Duong
Format: Final Year Project
Language:English
Published: 2018
Subjects:
Online Access:http://hdl.handle.net/10356/74039
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Nanyang Technological University
Language: English
Description
Summary:Computers are a very powerful machine that can solve problems in a short time with a huge of calculations. Computers are one of the greatest inventions of the 20th century. It will be great if we can ask a computer to solve our problem. Programming languages such as Java or C++ has been a key factor for people to communicate and interact with computers. Today, more and more programming languages are created for many specific purposes like Go for microservices, R for statistics. However, these programming languages are so hard to learn and so complicated to install a compiler. For example, to use Java, you need to install a JDK or JRE with multiple steps and many configurations which are error-prone and hard to debug. These languages are not suitable for a simple program with a small number of code lines. Luckily, the core principle to create a new language is not so complicated. People only need a basic understanding of lexical, syntax and semantic specifications to create a simple programming language. Users can use their own simple programming languages to meet their requirements. However, one of the current challenges is that we lack tools for beginners to create a language on their own. In this project, an online compiler generator was developed so that create a compiler with declared lexical and syntax specifications. Specifically, users will key in the keywords and rules of syntax, then the generator will generate a compiler respect to provided tokens and rules. Users can run their script on the online editor or offline editor by downloading the generated compiler. This report was written to discuss every aspect of all the work, including the way of what I have done, the challenges I have met and comment on them. Moreover, remaining problems and future features are also mentioned so that this project can be continued in the next years and become a useful tool not only for NTU students but also for other engineers who want to create a programming language for their need.