Docsity

Programming Languages and Compilers - Midterm Exam with Solution Key | CS 5363, Exams of Computer Science

Partial preview of the text

Download Programming Languages and Compilers - Midterm Exam with Solution Key | CS 5363 and more Exams Computer Science in PDF only on Docsity!

Name CS 5363, Fall 2013 Midterm Examination 1 Matching (50pts, 2pts each) In each blank, place the letter for the word that the description best defines. ¢ —_[__A phaserol,a compiler thar Hocus iontundertanding the source-language and encodes this knowledge by translating the program into an intermediate representation (IR). 2. _b A phase of a compiler that maps the IR program into the instruction set and the finite resources of the target machine. 3. _d_ A tool that translates programs from a source language into semantically equivalent programs in some target language (typ- ically, machine code). GC 4. A tool that executes programs in some language by read- A _ associativity ing the program’s statements executing them one at a time. * B back-end 5. —_ => _ The priority of an operator (or class of operators) com- © Backus-Naur Form pared to other operators (or class of operators) when grouping parts of an expression into subexpressions. D compiler 6. —_______ The method to be used for grouping parts of an expres- _ E context-free grammar sion involving multiple occurrences of the same operator (or opera- tors from the same class) into subexpressions. It can be either “left” F_ front-end or “right”. : 5 G interpreter 7. ——— Top-down parsing, in which, in contrast to backtrack- $y packrat parser ing, the decision of which alternative production to use for a non- an is made by peeking ahead at one or more terminal symbols. | precedence 8. _______ A top-down parsing parsing technique, in which the J predictive parsing exponential cost of backtracking is avoided by using memoization. Applies to parsing expression grammars rather. - & 9. ——=—_ A syntax for writing context-free grammars where the non-terminal symbols are writing between angle brackets ((, )), ::= is used to separate each non-terminal from the sequence of symbols it derives, and alternative productions of a single non-terminal are grouped together and separated by the vertical bars (1). 10, —__—_____ A generative grammar in which the left-hand-side of each production rule is a single non-terminal symbol.