This is the source code of My LLVM Pascal Compiler Tutorial. You can click [this] 1 to visit my blog and this compiler tutorial.
This project will implement almost all ISO Pascal 90 syntax and can work on Windows, Linux and Mac OS X.
ISO Pascal 90 Doc link (pdf file): Pascal 90
Scanner. 100%.
Parser. Working... (Complete parser framework but have much detail work to do)
Semantic. Working...
Very very little. Maybe I need more test from you. Welcome any issues you find.
I have not started this work. I will consider travis ci, which is a nice and popular CI tool in the GitHub.
Microsoft Visual Studio 2013+.
Click LLVMPascal.sln and Build. You can debug and run in the environment of MSVS or You can run LLVMPascal.exe in cmd environment. But if you run it in cmd, you should copy scanner_test.pas in the fold of LLVMPascal.exe. Do not be sad, after the completion of this tutorial, we will make this easier.
Note: CMake will be the only one build system in the future, I have also provided it now and tested successfully in the Windows 10 with MSVS 2013 / MSVS 2015. However, I will keep both MSVS solution and CMake for a while.
April 1, 2017 Note:
I will give up Visual Studio Solution project support very very soon and make CMake be the only valid build system like Linux / macOS. This is not April Fools'Day jokes. :-)
Required CMake 3.1.3+
I have provided one initial CMakeLists.txt in the source folder. This CMakeLists.txt is generated by CMake 3.1.3.
Additionally, I have tested it successfully in the macOS environment using GCC 5.3 and Apple Clang 7.0.2.
Maybe this can work under lower version of CMake, GCC , Clang, but I can not make sure.
If you find any problem, welcome to raise issue :-)