Chapter 1

Short answer

  1. What three components allow us to fully specify a language? How do Tucker & Noonan end up with four principles? (which 'component' do they divide into two 'principles'?) Why?
  2. Name and describe the four programming paradigms. Give an example of a language particularly well-suited to each. If you choose a language that is designed to support more than one paradigm, specify what would constitute a program that follows the paradigm in question.
  3. Other than simplicity and readability, what are some outcomes & goals that are desirable in programming language design?
  4. Beyond internal theoretical issues (e.g., correctness, ease of expression), what are some external constraints that impact language design?

 

Chapter 2

  1. Be prepared to use the formalisms of (E)BNF grammars to specify the syntax of a language described in prose. For example
    1. L = the set of non-negative integers, including 0 but without leading zeros. Use your grammar to give parse trees for 0, 10, and 135
    2. L = the set of all integers, including leading '-' and optional leading '+' signs. Give parse trees for 0, 64, -128, and 256
    3. L = the set of strings beginning with an upper-case letter, followed by any number of lower-case letters or digits. Give parse trees for Boo, D8, and MoOo
    4. L = the set of strings of letters, digits, underscores and dashes, provided that (1) the first character in the string is an upper-case letter, and (2) the final character is neither an underscore or a dash. Give parse trees for B4-8, L_L, and La-Ti-Do
    5. L = the set of even negative integers (-2, -4, -6, ...). Give parse trees for -16, and -378.
    6. L = the set of odd positive integers that have an even digit as their first character (21, 23, ... 41, 43, ...). Give parse trees for 21 and 235794
    7. L = the set of strings axbx -- any number of a's followed by an equal number of b's. Give parse trees for "" (the empty string), aabb
    8. L = the set of sequences of syllables CVN, where C stands for exactly one consonant from the set {k,s,t,n,h,m,y,r,w}, V stands for exactly one of {a,i,u,e,o} and N is optional {n} (each syllable either ends with either V or Vn). give trees for watasi, wa, nihon, jin, desu
    9. L = the set of strings C0-3V1-2C0-2 : that is, sequences of 0-3 consonants, followed by 1-2 vowels, followed by 0-2 consonants (use {a,e,i,o,u} for vowels and all other English letters as consonants). Give parse trees for fled, bring, sprains
  2. Determine whether two grammars are equivalent and defend your answer.

Chapter 3

Chapter 4

Define the following terms and discuss their significance to programming languages

  1. binding (static & dynamic)
  2. reserved words & predefined identifiers
  3. l-value & r-value
  4. scope, visibility, overloading

Short answer

  1. What are the four basic bindings for a variable?
  2. Given a program segment, show how static v. dynamic scoping will result in different run-time behavior (see 4.5-4.6)
Copyright © 1999-2008| Gene Rohrbaugh | Privacy Statement