CISC 670 Programming Languages (Fall 2002) Midterm Exam Study Guide Midterm Time and Date: classtime on Tuesday, October 29, 2002 References - Lectures notes from start of course through October 24,2002. - Textbook: Chapters 1, 2 (2.1, 2.2.1, 2.2.2, 2.2.3), 3(not 3.5 and 3.6.2), 6(6.1 to 6.6 but not 6.5.3), 8(8.1, 8.2, 8.3). - Homework assignments (1, 2, and 3). Topic Coverage - basics of programming language implementation: interpreters, compilers: overview of what they do, components, differences, similarities. - language syntax: regular expressions, context free grammars, derivations, parse trees, tokens, scanners, parser classes. - names: scoping, implementation of scoping, symbol tables, subroutine closues, subroutines are passed as parameters, or returned as results. - control flow: expression evaluation, precedence, associativity, assignments, side effects, short-circuit evaluation, iteration and recursion. - storage management: basics of stack, heap, static management, activation records, garbage collection. Format of Exam The exam is closed book and notes. The exam will have a heavy emphasis on understanding and applying the concepts we have discussed in class. If coding in ML is required for some problems, the emphasis will not be on the correctness of syntax. There will be four to five problems. Example questions: - True or false with one sentence explanation regarding general concepts: compilers, interpreters,... - Write/read regular expressions. - Explain the set of strings that a regular expression accepts. - Write/read context free grammars. - Draw a parse tree or derivation for a given string. - Determine whether a given string is accepted by a grammar. - Give example strings generated by a grammar. - Show that a given grammar is ambiguous. - Modify a given grammar so that it is unamgiguous or satisfies certain properties, such as left-recursion free. - Show the output or indicate the variables accessible at different points in a program based on static versus dynamic scoping rules. - Show the implementation of static scoping and dynamic scoping - Indicate where a particular item would most likely be stored: stack, heap, static store - Draw a snapshot of the stack showing frames, their static and dynamic links, name and content of local variables - Show the output or indicate the variables accessible at different points in a program based on different parameter passing modes - Identify whether a recursion is tail recursion, and modify a recursion so that it is tail recursive - Write or modify a small ML code segment to implement certain design features for an interpretor. - Explain how a particular concept is exhibited by a code segment.