Lab 2
Overview
Here we look at grammars. We will look at working with predefined grammars such as determining whether or not a particular sentence
belongs to the language of a grammar.
Please work in teams of 2/3.
Problems
Working with grammars - assume that you have the following grammar:
<exp>* ::= <exp> + <exp>
| <exp> * <exp>
| ( <exp> )
| a | b | c
Determine whether the following strings belong to the language of the above grammar. Construct an explicit parse tree where possible.
- a*b*c
- (a+b)(a+b)
- ((a + b))
- (a b)
- (c)+(b)
- b++
Submit your answers via Sakai - each team member has to submit their own answers. Scanned pencil and paper work is OK.