[Solved] CCUCD Project 3-A Simple C Interpreter

$25

File Name: CCUCD_Project_3-A_Simple_C_Interpreter.zip
File Size: 357.96 KB

SKU: [Solved] CCUCD Project 3-A Simple C Interpreter Category: Tag:
5/5 - (1 vote)

In this project, you should implement a C interpreter. The supported input file should at least contain the following features:

  • integer and floating-point data types: int, float.
  • Statements for arithmetic computation. (ex: a = b+2*(100-1)) (3) Comparison expression. (ex: a > b)
  • if-then-else program construct.
  • printf() function with one/two parameters. (support types: %d, %f)
  • scanf() (support types: %d, %f)

The following is a sample C program (input file):

  1. void main()
  2. {
  3. int num;
  4. float s;
  5. printf(Please enter a number:); 7. scanf(%d, &num);
  6. if (num > 10) {
  7. s = 3 * (num + 3.14);
  8. } else {
  9. s = num * (num 3.14);
  10. }
  11. printf(The result is %f
    , s);
  12. }

In your hand-in report, you need to have the followings:

  • Describe the C subset supported by your interpreter.
  • Give a set of testing programs which can illustrate the features of your interpreter. (at least 3 test programs)
  • Use the ANTLR to help you develop your interpreter.
  • You can use Java or other programming languages to write your interpreter. (Java is recommended)
  • Please ensure your program can be executed under the mcore8 or

1

Compiler Design

linux.cs.ccu.edu.tw workstation.

3

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CCUCD Project 3-A Simple C Interpreter
$25