Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiler design and construction class [closed]

I'm taking several classes this fall for my masters and one of them is Compiler Design and Construction. I am pretty well versed in most things related to computer technology, but I have not had much experience with how compilers do the dirty, I just use them when I need to. I am not usually nervous about classes, but I kind of feel like I am walking into this one naked. If anyone can recommend some good reading or provide a short list of basic principles that I can research to bring me up to speed quickly I would be most grateful.

UPDATE:

Well I great in the class, and the text book we used was actually very good. This site also helped me visualize and test my regular expressions (which I now believe is the best thing to master when learning about compilers). I picked up the basics of LEX pretty quickly but YACC (for some reason) was a bit harder for me. Simply looking up examples online helped with both of them.

like image 920
ubiquibacon Avatar asked Aug 06 '10 04:08

ubiquibacon


People also ask

What is Compiler Construction course?

Course contentThe course discusses grammars, lexical and syntactic analysis, semantic analysis, optimizations, code generation, interpreters and abstract machines, linkers and run time systems. The concrete structure of a compiler that generates code for a real computer is studied in some detail.

Why Studying the course of compiler construction is important?

A competent computer professional knows about high-level programming and hardware. A compiler connects the two. Therefore, understanding compilation techniques is essential for understanding how programming languages and computers hang together.

What is closure in compiler design?

Definition: If I is an item set and X is a grammar symbol, then GOTO(I,X) is the closure of the set of items A→αX·β where A→α·Xβ is in I.


2 Answers

Compilers are a bit of a head-spinning exercise. However, if you have solid grasp of data structures, algorithms, and assembly code, and a penchant for thinking through the details, you'll probabaly find the class fascinating because it is so different than most of conventional business data processing and/or embedded computing.

I'd make sure you had the assembly code background down pretty well. Most procedural coders aren't used to machine instructions, registers, address modes and pointers. If you get those, the instructor will likely explain the rest pretty well.

If you aren't used to pointers, then run don't walk, to your nearest C compiler and write a bunch of programs that use them.

For some background on what compilers are not, see Writing compilers ... what's right and what's wrong?

If you want a really interesting exercise, you can learn about MetaII, which is how to build a compiler that builds a compiler with an insanely small amount of effort. There is a 10 page paper on how to do this that has a mind-blowing moment in the middle where you suddenly see how the compiler can compile itself. There's a MetaII tutorial (with the paper) at:

http://www.bayfronttechnologies.com/mc_tutorial.html

like image 133
Ira Baxter Avatar answered Sep 21 '22 12:09

Ira Baxter


Check the Dragon Book

like image 22
stacker Avatar answered Sep 19 '22 12:09

stacker