x86 compiler self-made with python

I made my own compiler with python.

The concept is like this

--Implemented with python (not C language) --x86_64 Output assembler code (not running on your own virtual machine) --Parser is also made by yourself (not relying on yacc) --Practicality is not particularly considered (it is OK if you make it fun and move)

Introduced in the order of implementation

the first stage Implement something that works for the time being Implements variable declaration, assignment, and four arithmetic operations. The parser is also simple, so it's almost like handwriting an abstract syntax tree.

Second stage Implemented backend The parser remains poor, but implements arrays, namespaces, function calls, and so on. The tail-recursive function is also implemented.

Third stage Implemented front end (completed version) Define the grammar in BNF notation and implement the SLR parser.

Reference material

--Munehiro Takimoto "Introduction to Practical Compiler" A book that implements a compiler in Ocaml. The back end was mainly based on this book.

--Mamoru Miyamoto "First Compiler" A book that implements a compiler in C language. I used it as a reference when implementing the front end.

--Rui Ueyama "Live coding to create a simple programming language" A video that is live coded in C language.

Recommended Posts

x86 compiler self-made with python
Install Python 2.7.9 and Python 3.4.x with pip.
Logistic regression analysis Self-made with python
FizzBuzz with Python3
Scraping with Python
Statistics with python
Scraping with Python
Python with Go
Twilio with Python
Integrate with Python
Play with 2016-Python
AES256 with python
Tested with Python
python starts with ()
with syntax (Python)
Bingo with python
Zundokokiyoshi with python
Join an online judge with Python 3.x
Installing PIL with Python 3.x on macOS
Light image processing with Python x OpenCV
Excel with Python
Microcomputer with Python
[Blender x Python] Let's get started with Blender Python !!
Cast with python
GUI automation with Python x Windows App Driver
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
Install shogun with python modular (OS X Yosemite)
[Blender x Python] Think of code with symbols
Registering with PyPI from modern Python library self-made
Zip, unzip with python
Django 1.11 started with Python3.6
Primality test with Python
Python with eclipse + PyDev.
Scraping with Python (preparation)
Try scraping with Python.
Learning Python with ChemTHEATER 03
Sequential search with Python
"Object-oriented" learning with python
Run Python with VBA
Handling yaml with python
Solve AtCoder 167 with python
Serial communication with python
[Python] Use JSON with Python
Learning Python with ChemTHEATER 05-1
Learn Python with ChemTHEATER
Run prepDE.py with python3
1.1 Getting Started with Python
Collecting tweets with Python
Binarization with OpenCV / Python
3. 3. AI programming with Python
Kernel Method with Python
Non-blocking with Python + uWSGI
Scraping with Python + PhantomJS
Python self-made class sort
Posting tweets with python
Drive WebDriver with python
Use mecab with Python3
[Python] Redirect with CGIHTTPServer
Voice analysis with python
Think yaml with python
Operate Kinesis with Python