click below
click below
Normal Size Small Size show me how
*CS445:RELATEDPROG
Programs Related To Compilers : Compiler Construction : Louden : CH1.2
Question | Answer |
---|---|
What are other programs that are related to or used together with compilers and that often come together with compilers in a complete language development environment | Interpreters, assemblers, linkers, loaders, preprocessors, editors, debuggers, profilers, project managers |
What is an interpreter | Language translator like a compiler that executes the source program immediately rather than generating object code that is executed after translation is complete |
How does an interpreter execute code | Executes source program immediately |
How does a compiler execute code | Generates object code that is executed after translation is complete |
True or false : any programming language can be either interpreted or compiled | True |
What are the factors that are considered to determine if your code should be interpreted or compiled | Depends on the language in use and the situation under which translation occurs |
Is the language BASIC interpreted or compiled | Usually interpreted |
What type of languages tend to be interpreted | Functional languages |
Is LISP interpreted or compiled | Interpreted |
What type of language is LISP | Functional |
Is it more preferable to use an interpreter or a compiler in a software development situation where programs are likely translated and retranslated many times | Interpreter |
When is it more preferable to use a compiler over an interpreter | If speed of execution is a primary consideration since compiled object code is invariably faster than interpreted source code sometimes by a factor of 10 or more |
How are interpreters and compilers similar | Interpreters share many of their operations with compilers (there can even be translators that are hybrids- lying somewhere between interpreters and compilers) |
What is an assembler | Translator for the assembly language of a particular computer |
What is assembly language | Is a symbolic form of the machine language of the computer |
Describe the difficulty level of assembly language translation | Particularly easy to translate |
Can a compiler generate assembly language as its target language | Yes |
If a compilers target language is assembly language what does it then rely on to finish the translation into object code | An assembler |
If the compiler generates assembly language as its target language what is the next step the computer has to go through | It invokes an assembler to finish the translation into object code |
What are the two programs that rely on a program called a linker | Compilers and assemblers |
What is the first task a linker does | -Collects code separately compiled or assembled in different object files into a file that is directly executable |
Is there a distinction between object code - machine code that has not yet been linked - and executable machine code | Yes |
What is the second task a linker does | -Connects an object program to the code for standard library functions and to resources supplied by the operating system of the computer - such as memory allocators and input and output devices |
What's ironic about linkers | They now perform the task that was originally one of the principal activities of a compiler ( hence the use of the word compile - to construct by collecting from different sources ) |
What is the linking process dependent on | The details of the operating system and processor |
Define relocatable | code that is not yet completely fixed& ready to execute,but whose principal memory references are all made relative to an undetermined starting location that can be anywhere in memory |
What does a loader do | Resolve all relocatable addresses relative to a given base, or starting address |
What does the use of a loader do | Makes executable code more flexible |
What produces code that is relocatable | Often a compiler, assembler, or linker |
Is a loader a separate program | Rarely is a loader an actual separate program;the loading process often occurs behind the scenes (as part of the operating environment) or in conjunction with linking |
What is a preprocessor | A separate program that is called by the compiler before actual translation begins |
What does a preprocessor do | Can delete comments, including other files, and perform macro substitutions |
When is a preprocessor envoked | Before translation begins |
What is a preprocessor called by | A compiler |
Are preprocessors required | Can be required by the language (as in C) or can be later add ons that provide additional facilities (such as the Ratfor preprocessor for FORTRAN) |
What types of files do compilers accept | Accept source programs written using any editor that will produce a standard file, such as am ASCII file |
What is a structure based editor | an editor,while still producing standard files,may be oriented toward the format/structure of the programming language specified&already include some of the operations of a compiler (Editors found in IDEs) |
Compilers have been bundled with editors and other programs into | IDEs (interactive development environment) |
What is an example of something a structure based editor can do because it already includes some of the operations of a compiler | Programmer may be informed of errors as the program is written rather then when it's compiled ; the compiler and its companion programs can also be called from within the editor, so that the programmer can execute the program without leaving the editor |
What is a debugger | A program that can be used to determine execution errors in a compiled program |
What is a debugger often packaged with | Compiler in an IDE |
How is running a program with a debugger different from running a program using straight execution | A debugger keeps track of most or all of the source code information, such as line numbers, names of variables and procedures |
What is a breakpoint | A debugger can halt execution at prespecified locations |
What can a debugger do (what are the functions of a debugger) | -keeps track of most or all of the source code info (line #, names of variables/procedures) -halt execution at break points -provide information on what functions have been called and what current values of variables are |
What is needed to perform the functions of a debugger | The debugger must be supplied with appropriate symbolic information by the compiler |
What makes it difficult to supply a debugger with appropriate symbolic information | A compiler that tries to optimize the object code can sometimes make it difficult for the compiler to supply the debugger with appropriate symbolic information |
What is a profiler | A program that collects statistics on the behavior of an object program during execution |
What are the typical statistics that may be of interest to the programmer | -the number of times each procedure is called -the percentage of execution time spent in each procedure |
Why are profiler statistics useful | Can be useful in helping the programmer to improve the execution speed of the program |
Can a compiler use the output of the profiler to automatically Improve the object code without intervention by the programmer | Yes |
What is the job of project managers | To coordinate Files being worked on by different people |
How many people work on large modern software projects and why does it matter | Modern software projects are usually so large that they are undertaken by groups of programmers rather than a single programmer |
What are some tasks of project managers | -should coordinate the merging of separate versions of the same file produced by different programmers -also maintain a history of changes to each of a group of files, so that coherent versions of a program under development can be maintained |
While a project manager can be written in a language independent way , what are the benefits when it is bundled together with a compiler | It can maintain information on the specific compiler and linker operations needed to build a complete executable program |
What are two popular project manager programs on UNIX systems | sccs (source code control system) & rcs (revision control system) |