Homework #1. J. H. Wang Oct. 4, 2011. Homework #1. Chap.1 1.8 1.11 Chap.2 2.1 (a) 2.2 (a) 2.4 2.5 (a). Chap.1
PowerPoint Slideshow about 'Homework #1' - blake
An Image/Link below is provided (as is) to download presentation
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
1.8: Most programming languages, such as C and C++, are compiled directly into the machine language of a “real” microprocessor (for example, an Intel x86 or Sparc). Java takes a different approach. It is commonly compiled into the machine language of the JVM. The JVM is not implemented in its own microprocessor, but is instead interpreted on some existing processor. This allows Java to be run on a wide variety of machines, thereby making it highly platform independent.Explain why building an interpreter for a virtual machine like the JVM is easier and faster than building a complete Java compiler. What are the disadvantages of this virtual machine approach?
1.11: C is sometimes called the universal assembly language in light of its ability to be very efficiently implemented on a wide variety of computer architectures. In light of this characterization, some compiler writers have chosen to generate C code as their output instead of a particular machine language. What are the advantages to this approach to compilation? Are there any disadvantages?
2.5: Sometimes it is necessary to modify the syntax of a programming language. This is done by changing the CFG that the language uses. What changes would have to be made to ac’s CFG (Figure 2.1) to implement the following changes?(a) All ac programs must contain at least one statement.