Computer Science 3675
Fall 2006
Practice questions for quiz 1

  1. Which of the following are true, and which are false?

    1. All compilers translate to machine language.
    2. All programming language implementations are compilers.
    3. A simple value is a value that has no visible internal structure.
    4. Characters are typically considered complex values.
    5. A token can only have one associated lexeme.
    6. A variable name is typically a single lexeme in a program.
    7. Backus-Naur Form is a notation for giving precise definitions of semantics.
    8. Pattern matching can be used to bind names by solving simple equations.
    9. The scope of a binding is that part of the program where that binding is in effect.

  2. What is a just-in-time compiler?

  3. What is shadowing, and how can it occur? Give an example.

  4. What is an important advantage of the linked representation of sequences over the sequential representation?

  5. What is an important advantage of the sequential representation of sequences over the linked representation?

  6. Show that the following BNF grammar is ambiguous. The start symbol is <S>.

        <S> ::= <S> a
             |  a <S>
             |  a
      

  7. Show a parse tree for string aacacab according to the following grammar, where the start symbol is <S>.

        <S> ::= <F> a <S>
             |  b
        <F> ::= a <F>
             |  c
      

  8. What is a solution to pattern match equation [x,y+1] = [7,99]?

  9. What is the head of list [2,4,6]? What is the tail of list [2,4,6]?