lkesteloot / turbopascal

Web-based Turbo Pascal compiler.
https://www.teamten.com/lawrence/projects/turbo_pascal_compiler/
BSD 2-Clause "Simplified" License
480 stars 54 forks source link

Code Question #4

Closed ghost closed 8 years ago

ghost commented 8 years ago

I've been reading the source code for the compiler and I really congratulate you, never seen anything any neater, the code is self explanatory and readable and comment are doing a great job., Maybe I missed it when I got into the VM part because I do not know the theory ., I am looking forward to implement a Pascal Interpreter in C/C++ (Because I really want to make one), however I'm not sure about the type checking !, Any hints how to implement that ?, Thank you very much ^^

lkesteloot commented 8 years ago

Pascal compilers are very easy to write. The language was designed to be easy to implement. Niklaus Wirth (the author of Pascal) has a book called "Compiler Construction" that is supposedly very good (I've never read it). Don't worry at first about the type checking. Just start writing the compiler, and it will later be obvious where to do the type checking when you have to generate code.

ghost commented 8 years ago

Thank you :D, never intented to post an issue. I wanted to reach you for a while, never knew how :+1: )