CSC447: Concepts of Programming Languages

Homework Assignment 1 revisited (optional, due Wednesday, September 25th)


 

 

Exercise 1: Describe, in English, the language defined by the following grammar :

<S> ::= a <A> b | ab | a <B> b
<A> ::= a | a <B> | a <A>
<B> ::= b | b <A> | b <B>

Exercise 2: Which of the following sentences are in the following grammar:

<S> ::= a <S> c <B>

<S> ::= <A> | b

<A> ::= c <A> | c

<B> ::= d | <A>

  1. abcd        
  2. acccbd      
  3. acccbcc     
  4. acd         

Exercise 3: Give an example of a static property of a program and an example of a dynamic property of a program.

Exercise 4: Give an example of a programming language that is typically interpreted and a programming language that is typically compiled.

Exercise 5: Rewrite the following EBNF grammar in BNF.

          <decl> ::= <ident_list> : (int | float | char);
          <ident_list> ::= <identifier>{,<identifier}
        

 

 

last revised: September 17, 1996