|
JPascal is a programming language I implemented for teaching concurrent programming at South Bank University. The idea came after taking some classes in concurrency. The tool we were using for teaching concurrency was a library for version 3.0 of Turbo Pascal. The system was ok, but there were some features missing. I then decided that I wanted to implement a language based on Pascal-FC, a concurrent programming language used for teaching concurrent programming as well. Since I wanted a language that could run across several platforms and since Java had built-in support for multithreading, I decided to implement the compiler using Java and target it to the Java Virtual Machine. At the time, I didn't know of many good tools for writing compilers in Java, so I started searching the web and found a couple of them. I had found the equivalent to Lex and Bison, but then I found a tool which fulfilled my needs. This tool was SableCC. The good thing about this tools is that it used good object oriented programming practices and also it generated the Trees we needed to traverse. Hence, I only had to implement the semantic analyser and the code generator. For a tutorial on how to write compilers with SableCC check the section on compiler design on the left hand side of the menu on this page. If you have any queries regarding this compiler, do not hesitate to contact me.
In the future I will implement a better version of this language. I want to add built-in support for graphics to be used in simulations. We could for example simulate traffic lights.
You can download JPascal with the source code from here.
Best Regards
Fidel.
|