bartvandewoestyne / modern-compiler-implementation-in-c Goto Github PK
View Code? Open in Web Editor NEWAn unfinished implementation of the Tiger compiler.
An unfinished implementation of the Tiger compiler.
My implementation of the Tiger compiler from the book Modern Compiler Implementation in C Andrew W. Appel Cambridge University Press ISBN 0-521-60765-5 This work is not finished yet. From time to time, I hack on it. I was not quite sure in what C-standard or dialect I was going to write my code, so I did some investigations... From the inside of the book, we have: First published 1998 Reprinted with corrections, 1999 First paperback edition 2004 Also, the code from Chapter 1 defines its own TRUE and FALSE in util.h, and since C99 has true and false macros in stdbool.h, I think we can conclude that the book's code is *not* C99. Finally, in Chapter 2, the strdup function is used. This function is neither C90 nor C99... so the code from the book is probably some pre-C90 dialect... I am therefore simply compiling it with gcc without any -std option. Some other remarks: ------------------- * In the post https://groups.google.com/d/msg/comp.compilers/QYrE4LvCcCE/fxLyAJfxDocJ on comp.compilers it is written that the book was originally written by Appel in ML, and then translated to C and Java, so the C and Java are not great examples of how to code in those languages (the Java version uses few OO programming techniques). * The code often makes use of a union paired with a discrete value that indicates the active member of the union. This is called a 'discriminated union' or 'tagged union'. The discrete value is called a discriminator or tag. See also http://www.drdobbs.com/cpp/discriminated-unions/240009296 http://en.wikipedia.org/wiki/Tagged_union
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.