Giter Club home page Giter Club logo

support-code-for-students's Introduction

https://github.com/lambda7xx/Essentials-of-Compilation

https://iu.instructure.com/courses/1517577

http://github.com/jsiek/Essentials-of-Compilation #上面的是课程链接,努力学好这个project

p423-public-code

Utility code, test suites, etc. for the compiler course.

This code will be described in the Appendix of the book.

The runtime.c file needs to be compiled and linked with the assembly code that your compiler produces. To compile runtime.c, do the following

   gcc -c -g -std=c99 runtime.c

This will produce a file named runtime.o. The -g flag is to tell the compiler to produce debug information that you may need to use the gdb (or lldb) debugger.

Next, suppose your compiler has translated the Racket program in file foo.rkt into the x86 assembly program in file foo.s (The .s filename extension is the standard one for assembly programs.) To produce an executable program, you can then do

  gcc -g runtime.o foo.s

which will produce the executable program named a.out.

There is an example "compiler" in the file compiler.rkt. That file defines two passes that translate R_0 programs to R_0 programs and tests them using the interp-tests function from utilities.rkt. It tests the passes on the three example programs in the tests subdirectory. You may find it amusing (I did!) to insert bugs in the compiler and see the errors reported. Note that interp-tests does not test the final output assembly code; you need to use compiler-tests for that purpose. The usage of compiler-tests is quite similar to interp-tests.

support-code-for-students's People

Contributors

mvitousek avatar jsiek avatar ryanglscott avatar chamibuddhika avatar akuhlens avatar rrnewton avatar ckoparkar avatar vollmerm avatar lambda7xx avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.