Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Compiler Design - project C-interpreter ?Or just give me a C-compiler program in

ID: 3911525 • Letter: C

Question

Compiler Design - project C-interpreter

?Or just give me a C-compiler program in Java! Not follow the rules below is okay! I need a frame!?

In this project, the students are encouraged to build a semi-C interpreter based on the given
semi-c language production rule.
1. Basic structure as an interpreter: The implemented interpreter should generate a flow
graph and symbol table that reflect input source code. The flow graph contains the instructions
of source code and represents the control flow of each instructions. The symbol table holds
variables and their type and scope.
2. Command functions: The interpreter should provide interactive command prompt like
Python or some other interpret languages. The implemented interpreter is required to include
three basic commands:
next command: This command executes a single or multiple line(s) of the source code. For
example, “next” just executes current line of source code, and “next 10” will execute 10 lines
including current line.
print command: This command prints the value contained in a variable at the moment. For
example, if an integer variable a contains value 10, then “print a” will print “10”
trace command: This command shows the history of a variable from beginning to the
moment.

More details please click :

The language grammar
https://www2.cs.arizona.edu/~debray/Teaching/CSc453/DOCS/cminusminusspec.html

implement in C/C++ or Java code (JAVA preferable)

Explanation / Answer

Well designing a C compiler cannot be done surely in 2 hours (the time Chegg experts get to solve a question). What I can suggest you is to go through online resources to learn how to develop a C compiler. For your learning purpose, you can go through the following tutorial series:

https://norasandler.com/2017/11/29/Write-a-Compiler.html

Alternatively, you can also go through this developed Java C-compiler code available at https://code.google.com/archive/p/my-c-compiler/source/default/source.

Hope this will be helpful. If you have any doubts, please reach out to me.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote