Weekly Note 2, DM18, Spring 2007
Lecture February 6
-
Syntax analysis (parsing).
Background material: Appel Chapter 3.
Exercises February 8
-
Remaining exercises from the last weekly note.
-
Appel 2.1 a-f.
-
Discuss the C programming style introduced in Appel, Chapter 1.
Make changes in Program 1.5 corresponding to the addition of the
following rules to Grammar 1.3:
- Exp -> string
- Exp -> sqrt ( Exp )
- Stm -> if ( Exp ) then Stm
-
Read about Flex. Make an overview of the additional possibilities
for specifying regular expressions which are available in the tool
compared with what was discussed at the lecture.
-
What does the following regular expressions match?
-
\"([^\"])*\"
-
http:[^?]*\?
-
[-+]?[0-9]*\.[0-9]+([eE][-+]?[0-9]+)?
-
Make and test the following three Flex scanners:
-
Make texts politically correct. Replace "idiot" with
"intellectually challenged person", etc.
-
Remove all whitespace and produce lines in lengths of 80 characters.
-
Remove all tags from an HTML document.
For those who do not speak HTML fluently, HTML is just regular
text with some extra interpreted constructions.
A "tag" consists of a "less than" symbol followed by some text
and closed by a "greater than" symbol
(you can view the source of this page to see an example).
With regards to literature and material on C, flex, etc., see the
literature page.
Announcements
-
Those students who want to use DM18 as their bachelor project
must sign a statement confirming this.
It is not possible later to decide to use DM18 as the
bachelor project if one did not sign up for this at the
beginning of the course.
The engineering study board has decided that datatechnology students
are not allowed to use DM18 as a bachelor project.
The procedure for computer science students is the following:
no later than February 9 at 12:00, you must have sent an e-mail
to the lecturer with your full name,
e-mail address (the one you read daily),
IMADA login,
and first 6 digits of your CPR number. Please use
"DM18: bachelor project" as the subject of the mail.
The secretaries' office will then prepare statements and you
will be informed as to when you can come by and sign.
-
At the exercises February 5, you will be divided up into groups.
If you are not able to show up for the exercises that week,
send an e-mail to the lecturer containing your name,
study program (normally "datalogi" or "datateknologi"),
e-mail address (the one you read daily),
IMADA/MIP login, and whether you are taking the
9 ECTS or the 15 ECTS version (the size option only applies to
datatechnology students).
Please use "DM18: group" as the subject of your mail.
-
The first part of the exam project has been posed
(see the project page).
The deadline is Wednesday, February 21, 2007 at 12:00.
Last modified: Tue Feb 6 13:02:05 CET 2007
Kim Skak Larsen
(kslarsen@imada.sdu.dk)