|
Post by tsh73 on Jan 28, 2024 21:41:45 GMT
old compiler tutorial Let's Build a Compiler, by Jack Crenshaw This fifteen-part series, written from 1988 to 1995, is a non-technical introduction to compiler construction. You can read the parts on-line or download them in a ZIP file. compilers.iecc.com/crenshaw/(probably could be found elsewhere) I have read it long time ago, and remember it being understandable but be warned that 1) it is written in TurboPascal 4 2) it produces asembler code for 68000 microprocessor (not Intel'86) Now I started actually *do* it (in JB of cource) It will be separate post referring here.
|
|
|
Post by cundo on Jan 28, 2024 21:57:41 GMT
Doing it in JB? wow
|
|
|
Post by Rod on Jan 29, 2024 13:05:08 GMT
Cool project, so Just BASIC to C?
|
|
|
Post by tsh73 on Jan 29, 2024 22:13:35 GMT
Of cource. One should pick language he knows ;)
Anecdotal evidence. I translated some parsing program from C to JB. No hitch. I translated it again, to C#. Had troubles handling and-of-stream. My student worked on some translator. C#, he apparently had troubles handling and-of-stream (invented using a dot (.) to mark end-of-program. just like in Pascal) Here in chapter 4 author uses a dot (.) to mark end-of-program. Then I translated it to JB, I somehow got round it.
Just recently it downed to me: in C/C#/Pascal, then you go out of string, you get an exception Ib JB, if you MID$(a$, out_of_string_pos, 1), you just get empty string. It happened to make lots of difference.
I dunno. Actually I had some JB 2 C code, and it kind of worked. But it was made without any theory/book, just on a whim and I just had no idea how to continue - say to add subs/functions. Probably after working along this book I'll get some ideas.
|
|