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>
<S> ::= a <S> c <B>
<S> ::= <A> | b
<A> ::= c <A> | c
<B> ::= d | <A>
abcd YesNo acccbd YesNo acccbcc YesNo acd YesNo
abcd YesNo
acccbd YesNo
acccbcc YesNo
acd YesNo
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