GithubHelp home page GithubHelp logo

hw4's Introduction

ICD20 Homework4

There are three test case set in this homework.

You can use make example, make test, make bonus to run them.

We provide simple argument parser in parser.y, if output is not NULL, please use it as assembly filename, otherwise you can use the PROGRAM name as filename.

It would be something like:

PASS_HANDLE(codegen, ProgNode      , node){
  char fn[128];
  prog = node->name;
  sprintf(fn, "%s.s", node->name);
  fd = fopen(output ? output : fn, "w");
  gen(";gen code into the file\n");
  fclose(fd);
}
  • Use float to implement real type.

Bonus:

  • nested (pure) function
  • string operation
  • array assignment

Material:

Note the example of x := y + z (strings) in mapping:

java/lang/StringBuffer/append(java/lang/String;)Ljava/lang/StringBuffer;

should be:

java/lang/StringBuffer/append(Ljava/lang/String;)Ljava/lang/StringBuffer;

Hints:

  • you may initialize the variables manually

hw4's People

Contributors

nobodyzxc avatar rniczh avatar

Forkers

icd23

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.