Question: pls help for build an Small C compiler for x86 The goal is to develop a prototype C compiler. This is done by compiling C

pls help for build an Small C compiler for x86

The goal is to develop a prototype C compiler. This is done by compiling C programs into embedded platforms such as 68K, MIPS, ARM, or pseudo assemblies. we will mainly use x86 as the target codes. The project is divided into several parts including language definition, scanner, C-grammar, symbol table handlings, parser, type checker, and code generation. In the assignment, you will need to choose the set of language features which you want to develop the compiler for in this course, and write the whole compiler (including the code generator).

The generated x86 assembly code is expected to be executed on linux based systems. In your hand-in report, you need to have the followings:

1. To define the subset of the language which you want to choose from C.It could be simple or complex,up to you.But support (at least two parameters) printf function in your compiler

2. Give a set of testing programs which can illustrate the features of your testing programs. (at least 3 test programs)

3. Use the ANTLR to help you develop your compiler.

4. You can use C or Java to write your compiler. (Java is recommended)

5.Please ensure your program can be executed under the linux environment.

6. Support (at least two parameters) printf function in your compiler. ? Ex: printf(%d , var);

7. You can assume the compiler can always get a free register to use.

Please turn in the following files :

1. A file describes your language which is a subset of C language. (MS-WORD file)

2. The source codes:

Your compiler (a) ANTLR grammar file, myCompiler.g. (b) A program to call your parser, myCompiler_test.

3 Testing programs (.c) and the corresponding x86 assembly codes (.s) generated by your compiler. (at least 3 programs)

4 A readme file (pure text file) describes the features of your compiler and explains how to compile and execute your compiler.

5 Makefile

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!