Skip to main content
GameDev.net gamedev.net
🔒 Locked

Pascal-C(++, #)

Started by EmrldDrgn Jan 31, 2007 at 5:37 PM 3 replies 1k views
Original Post
EmrldDrgn
EmrldDrgn
I was recently poking around the internet and came across "Let's Build a Compiler!" by Jack Crenshaw. I quickly realized it was massively out of date, as it was using the "new" Turbo Pascal 4.0. However, I thought I might attempt to translate the code samples to a language I understood, such as C, C++, or C# (although C# might be problematical). Would this be really difficult? Can anyone recommend a similar book using one of those languages? Please don't tell me I'll basically never develop my own programming language. I know that. This is just for fun.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~I program in C++, on MSVC++ '05 Express, and on Windows. Most of my programs are also for windows.
programwizard
programwizard
Compilers: Principles, Tools, and Techniques is considered the definitive book on compiler construction. You might also want to look at Lex and Yacc.
------------------------------Support the Blue Skies in Games Campaign!A blog... of sorts.As a general rule, if you don't have a general rule in your signature, you aren't as awesome as someone who does. General rules roxor teh big one one ones.
Alpha_ProgDes
Alpha_ProgDes
Well first thing is first. Get a Pascal and a C tutorial (you can get a C++ tutorial as well; i think Pascal and C map is pretty mappable) and start translating. In fact, I remember some people making C Pascal like by using macros. Once you hit a bump, ask! [smile]. Honestly I don't think translating the code will be all that difficult.
Beginner in Game Development?  Read here. And read here.  
daviangel
daviangel
I use this book myself
and it mentions the dragon book and how it's like 100x more difficult so I'd stay away from that book until you already have some compiler experience.
the language used is vb.net which easily translates into c#.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
EmrldDrgn
EmrldDrgn
Thanks for the responses. After reading the posted links, I've come to the following decisions:

1) I'm still gonna try to translate the Pascal code. I figure it might come in handy someday.
2) I've decided on Compiling for the .Net CLR based on the "dragon book" looking rather complex for me, and "Build Your .Net Language Compiler" getting less than favorable reviews on Amazon. Anyone who's read/used this book, I'd be interested in your thoughts.

Thanks again for the feedback!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~I program in C++, on MSVC++ '05 Express, and on Windows. Most of my programs are also for windows.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.