tylonhouse362
10.05.2021 •
Computers and Technology
The goal of this project is to give you some hands-on experience with implementing a small compiler. You will write a compiler for a simple language. You will not be generating assembly code. Instead, you will generate an intermediate representation (a data structure that represents the program). The execution of the program will be done after compilation by interpreting the generated intermediate representation.
1 Introduction You will write a small compiler that will read an input program and represent it in an internal data structure. The data structure consists of two parts: (1) a representation of instructions to be executed and (2) a representation of the memory of the program (locations for variables). Instructions are represented by a data structure that includes the operand(s) of the instruction (if any) and that specify the next instruction to be executed. After the data structures are generated by your compiler, your compiler will execute the generated instructions representation by interpreting it. This means that the program will traverse the data structure and at every node it visits, it will execute the node by changing the content of memory locations corresponding to operands and deciding what is the next instruction to execute (program counter). The output of your compiler is the output that the input program should produce. These steps are illustrated in the following gure 1 The remainder of this document is organized as follows: 1. Grammar Denes the programming language syntax including grammar.
2. Execution Semantics Describe statement semantics for if, while, switch and print state- ments.
3. How to generate the intermediate representation Explains step by step how to generate the intermediate representation (data structure). You should read this sequentially and not skip around.
4. Executing the intermediate representation Basically, you have two options. If you are using C/C++, you should use the code we provide to execute the intermediate representation. If you are using Java, it describes the strict rules to follow in executing the intermediate representation. Those rules will be enforced.
5. Requirements Lists the programming languages you are allowed to use in your solution (C/C++ or Java) and other requirements.
6. Grading Describes the grading scheme.
7. Bonus Project Describes the requirements for the bonus project. 2 Grammar The grammar for this project is a simplied form of the grammar from the previous project, but there are a couple extensions.
Solved
Show answers
More tips
- H Health and Medicine What to Do When Your Jaw Locks Up?...
- G Goods and services What Are the Most Popular Services?...
- P Philosophy How did the concept of module arise in computer science?...
- D Dating, Love, Relationships Why Should the Man be Active and the Woman Passive during Foreplay?...
- S Society and Politics Выборы: Смысл, Значение и Отражение...
- B Business and Finance How to Get Your Money Back When Lending? Top 7 Ways...
- F Family and Home Do Lullabies Help Babies Sleep or Is it Just a Myth?...
- F Family and Home Why Does God Punish Us Constantly and How Can We Fix It?...
- D Dating, Love, Relationships Why do we feel shame?...
- S Society and Politics How Could Nobody Know About the Dead Mountaineers?...
Answers on questions: Computers and Technology
- C Computers and Technology When i turn on my computer it says no operating system found?...
- C Computers and Technology Name two purposes of creating a microsoft account for use in visual studio 2015...
- E English In at least 150 words, tell how the image of “chinese shirley temple” indicates the themes of the story....
- S Social Studies When the interest rate falls below the equilibrium, excess or a shortage of funds, occurs in the market. credit card firms will believe that there is interest rates because of the...
- E English Read the following sentence from the article in passage 2. likewise, many religious figures at this time sought to unify the sacred with the secular to demand expansive reforms...
- P Physics Two rope tows operate on the same ski slope. tow a with a heavier load pulls as fast as tow b. which does the most work? tow b they both do the same work tow a which has the most...
- E English Which excerpt from “seventh grade” is an example of an external expectation? he already spoke spanish and english, but he thought someday he might travel to france, where it was...
- E English Read the excerpt from justin lebo. based on the details in this excerpt, which word best describes the garage? when he got it home, he wheeled the junker into the garage and showed...
- M Mathematics Given abcd, solve for x. (8x + 30) (4x + 18)...
- B Business Which customers in the profitability and growth of an organization? both external and customers in the profitability and growth of an organization in a direct or indirect manner....
Ответ:
Neto's conflict about playing football for racist fans is developed through complications. First, he encourages all of the players to quit the team, but most of the players decide to keep playing. Then, the school officials refuse to help. These events reach a climax when Allison reads a letter against racism at the next football game. The resolution is that the fans change their behavior. Now, Neto knows that some things are more important than football and that he can make a difference in his community.
Explanation: It's correct