COS341 - Compiler Construction
Access to Campus
Note that access to campus is only possible once you have registered and you have an activated student card.
2016 Exam Perusals
Exam perusals for the Nov/Dec 2016 exams will take place 7 Feb 09:30 to 12:30 and 8 Feb 09:30 to 12:30, in IT 4-66.
Reminder: Written test #2 TODAY
Dear COS341 students, Please don't forget our written test #2 TODAY. See you later in the afternoon......
Room for Test #2: EMB 2-150
Dear COS341 Students, According to the UP calendar, the room for our 2nd written test is: EMB-2-150. Please check your campus-map to find out where that is. Day: 25th of April, Time: 17.30h, Scope: Textbook Chapters 3+4+5 ("closed book"). See you soon..........
Recommended Preparation Time for Written Test #2
Important: The recommended preparation time for the upcoming written test #2 is 30 hours of intense textbook-studying (Chapters: 3, 4, 5). Weak students, who did poorly in the previous written test, are advised to invest some extra hours on top of those 'general' 30 hours. The test will be of CLOSED BOOK type. Best wishes to all of you!
Special Days in month April
The following two 'special days' in April are relevant for our course: * Wednesday 19-4-2017: University follows the time-table of Monday ==> NO lecture in COS341 * Thursday 27-4-2017: Republican holiday ==> NO lecture in COS341
Next Assessment Dates!
Important! The next ASSESSMENT DATES are FIXED as follows: * Written Test #2 = Tuesday April the 25th, 17:30h, as per official UP calendar. Strongly recommended preparation time = 30 hours of intense textbook studying! * Programming Project #2 = Tuesday May the 2nd. This day is NOT negotiable, as we would otherwise run out of time towards the end of the semester. Demo-opportunities: all day long, from morning to evening. * Programming Project #3 = Tuesday May the 16th. This day is NOT negotiable, as we would otherwise run out of time towards the end of the semester. Demo-opportunities: all day long, from morning to evening. * Final Exam (Written Test #3) = to be announced soon in a separate communication.
Reminder: Software Demos (P1) TODAY
Reminder: COS341 Software Demos (P1) TODAY! No other demo day is possible. To register yourself for participation, first UPLOAD your software onto the COS341 web site. Thereafter you may come along to the demo (in IT-4-44). Bring your own laptop computer along with you.
important: Wednesday 5 April
Important: EVERY COS341 student MUST come to the lecture on Wednesday the 5th of April (7:30h), because your NEW PROJECT PARTNER (for P2) will be allocated to you during the lecture.
Mistake on Slide 7 in the Project_1a Specification
Dear COS341 Students, There is a mistake on slide 7 in the Project_1a Specification for numbers, in which the simple number 0 is accidentally excluded. The CORRECT regular expression should be ==> ( 0 | ( ( - | epsilon).D_pos.(D_null)* ) ) In other words: the simple number 0 is indeed a legal number. Many THANKS to student Lucian for having spotted the mistake, well done Lucian.
Mistake on Slide 14 in Project_1b Specification
Dear COS341 students, On slide 14 (Example) of the Project_1b Specification are the following MISTAKES: (n < 0) (n > 0) eq(n,0) The mistakes are due to the specification of BOOL in the grammar on slide 10, which only takes Variables as arguments, not numbers. To FIX the example on slide 14, we would have to write something like: y = 0 and thereafter: (n < y) (n > y) eq(n,y) MANY THANKS to student Vignesh who has spotted the mistake on slide 14, well done Vignesh.
Registration for the Software Demo
Dear COS341 Students, Your REGISTRATION for the forthcoming software demo (4-4-2017) is the UPLOAD of your software package onto the COS341 web site. No software upload ==> not registered for demo ==> no demo permission ==> zero marks. Best wishes, see you next week!
Assessment Mode of the Software Demo (4-4-2017)
ADVICE: COS341 Project #1 will be assessed as follows: Because the project is worth 10 marks (as per study guide), 10 different test-files.TXT will be given to you on the demo day (4-4-2017). You will then copy these 10 files onto the HD of your computer, and use them ---one after another--- as input for your software. FOR EACH of the 10 test-files.TXT: --- mark 1, if your Lexer+Parser software processes it correctly, --- mark 0, if your Lexer+Parser software does NOT process it correctly. Among those 10 cases, some of them might be 'corrupted', in which case your Lexer+Parser software MUST EMIT an ERROR MESSAGE appropriate to the detected error. IF your software fails all the 10 tests, then nevertheless I will generously grant you a quarter-mark (0.25) ---instead of giving you the plain zero--- for your whole Project #1, as an acknowledgment of your efforts. REMINDER: students who do not possess their own portable laptop computer, please let me know (via EMail) as soon as possible!
Study-Scope: 2nd Written Test
Study-Scope for the forthcoming 2nd Written Test are: * Chapter 3, * Chapter 4, * Chapter 5, of the prescribed textbook. Participation is compulsory. DAY, TIME, ROOM: as printed in the university's official semester test calendar.
4-4-2017: Project #1 Software Demos
COS341 Software Demo Day for Project #1: Tuesday the 4th of April (4-4-2017). NO OTHER DAY IS POSSIBLE! Earliest possible Demo time: 11.00h (a.m.) Latest possible Demo time: 18.00h (p.m.) Demos will take place in IT-4-44 (meeting room). Students must please bring their own Laptop Computers for the demo. IF students do not possess their own laptop, then please contact me via e-Mail well in advance before the demo day. During the demo, you will be given several test inputs. MARKS will be given according to how well your software processes the test inputs in a 'black box' mode of testing. Preferably BOTH project-partners must present the demo TOGETHER. Only in very exceptional cases (serious illness, student in hospital) one project partner will be allowed to present the demo also on behalf of his ill partner.
Reminder: COS341 Test TODAY
Reminder: COS341 Written test TODAY, 16:30h in the "Tswelopele". Participation is compulsory.
Please use the extended weekend for thorough studying
Dear students of COS341, Please use this extended weekend (with no lectures Monday-Tuesday) for thorough studying in preparation for the written test. I strongly recommend a total of 30 hours of preparation time for this test; please do not expect good results if you have not put those 30 preparation hours into it.
First WRITTEN TEST: Day, Time, Venue
Attention please! Our first WRITTEN TEST in COS341 is scheduled as follows: * DATE: Friday the 24th of March, * ROOM: IT-4-64 ("Tswelopele"), * TIME: 16:30h--18:00h (90 minutes duration). PARTICIPATION IS COMPULSORY, as per study guide. STUDENT ID CARD MUST BE PRESENTED at the door. * NOTE: The test is of "CLOSED BOOK" type. * SCOPE: Textbook Chapters #1 and #2, plus the additional paper on Grammars (available on the COS341 Website) * ADVICE: You must be able to 'work things out' constructively, NOT just 'memorize' like a parrot-bird! Best wishes to everybody.
Online Opinion Poll: Dates for Semester Tests (Written Exams) #1 and #2
All COS341 students, Please participate in the new online opinion poll about the dates of Semester Tests #1 and #2. --- Voting deadline: 14th of March!
Results from the recent online opinion poll
Dear COS341 students, Many thanks for your participation in the recent online opinion poll. The results are as follows: --- 2 votes for "COS341 is far too simple and easy: it should definitely be made much harder!" --- 7 votes for "COS341 is not the hardest course in my curriculum: the course could still be made slightly harder" --- 5 votes for "COS341 is the hardest course in my curriculum: please do NOT make this course even harder." Thus all in all we have (2+7) votes for making the course harder, versus only 5 votes for NOT making the course harder. Taking the students' votes into account, I will make sure that especially the 1st written exam test will be "crisp" and "crunchy" for you :)
Comment about Chapter #2 of the Textbook
Dear students, On the topic of textbook chapter #2, particularly subsection 2.1.1, you might find the following technical report enlightening: ==> http://liacs.leidenuniv.nl/~hoogeboomhj/second/codingcomputations.pdf For compiler construction there is, indeed, a conundrum: After you have manually transformed some ambiguous grammar G into a non-ambiguous grammar G', there is automatic no algorithm to decide generally whether Lang(G)=Lang(G'), (although you might find some proof mathematically "with pen and paper" in individual cases). This general undecidability result of above must not be confused with the other problem whether a single given word W belongs into Lang(G). For a context-FREE grammar G this problem is indeed decidable, otherwise we could not construct an effective compiler for G. For a context-sensitive grammar, however, even the word-membership problem is generally not decidable any more. I expect that all students please read the technical report mentioned above.
Sub-Project 3a is released for viewing
You can find the instructions in the file section at the bottom of the COS341 website. (Remember: For the third project you will later get your second new project partner.)
Specification of Sub-Project 2c is released
For your perusal I have now also released the specification of Sub-Project 2c, which is the final sub-project of #2. However, you may NOT YET work on it actively UNTIL you have fully completed (and demonstrated) Project #1. The specifications for Project #3 will soon be released, too...
Specification of Sub-Project 2b is released
For your perusal I have now also released the specification of Sub-Project 2b. However, you may NOT YET work on it actively UNTIL you have fully completed (and demonstrated) Project 1.
Assignment specification 2a is released
Assignment Specification 2a is herewith released. Note, however, that you may NOT YET WORK on Sub-Project 2a before I have allocated a new project partner to you (which will happen only after your software demonstrations for Project 1). However, nevertheless, a "sneak preview" of the Task 2a Specification might perhaps help you to do an even "better job" in Task 1b, because with the early release of Task 2a you can already grasp more clearly into which direction the entire semester project (with all its 3 sub-projects) is moving...
Study-Scope for the Written Test #1
Dear COS341 Students, STUDY-SCOPE for the first Written Test (Exam-Opportunity #1) are the FIRST TWO CHAPTERS of our Mogensen-textbook: 1. Lexical Analysis, 2. Syntax Analysis. DATE and ROOM of the examination will be announced later, in a separate communication. PREPARATION ADVICE: * The exam will be 'closed book', * Many 'DO'-questions will be asked, in which you have to demonstrate your ability to 'work something out'.
Assessment Scheme approved by Head of Department
Dear students of COS341, The Head of CS Department has approved the following assessment scheme, which is herewith stated as official part of the COS341 'study guide': CALCULATION OF FINAL MARK: ADD: Semester Project #1: 10 Semester Project #2: 10 Semester Project #3: 10 Exam-Opportunity #1: 24 Exam-Opportunity #2: 23 Exam-Opportunity #3: 23 = 100 Total Marks (max.) ADDITIONAL CONDITIONS: Each project must be attempted and demonstrated, and each exam event must be attempted, too. In other words: It is not allowed to 'skip' any project, and it is also not allowed to 'skip' any written test. ALSO NOTE: "Aegrotat events" for ill students (with valid proof letter from Hospital) will be arranged if needed, whereby proven medical illness is the ONLY acceptable reason for absence from an examination event. (NO other "reasons" are acceptable.)
THURSDAY 23 February: Special Arrangement
COS341 SPECIAL ARRANGEMENT for TOMORROW = Thursday 23 February! As I have been invited to a Logic Seminar at UNISA (with professor Spreen from Germany), there will be NO lecture this Thursday. However, as a replacement, I herewith request that all COS341 students must please WATCH the following three Education VIDEOS on "YouTube" (in preparation for the second chapter of our book): 1. ==> https://www.youtube.com/watch?v=AlSB2_CehbM (5 minutes) 2. ==> https://www.youtube.com/watch?v=Jx30Dz89dHY (19 minutes) 3. ==> https://www.youtube.com/watch?v=9XKUcm8au4U (13 minutes) All together these three education videos are almost as long as our usual in-class lecture. We will see each other again week, for the discussion of Chapter #2 of our book.
Where do we stand?
RECAPITULATION: In the COS341 lecturers we have now finished the discussion of Chapter #1, including: Regular Expressions, Regular Languages, NFA, DFA, Miminimsation, the recognition strategies "First Match" versus "Longest Match". If students have not already done so, then students should please thoroughly study all the pages of Chapter #1 by the end of this week. Additional study material ---if needed--- can be found in the Library of the University of Pretoria, as well as on the Internet.
Freedom of Method in the Semester Projects
For clarification: In all COS341 semester projects, students are free to apply any suitable method of implementation, as long as NO PLAGIARISM is being committed, [remember: proper CITATIONS]. When I am marking your projects, I will only black-box-test whether or not your software code "does the job" from an Input-Output perspective.
Assignment specification 1b is released
The tasks for part 1b of project 1 are now released, too. For 1b, you continue to work with the same project partner as in 1a. (Only for the following Project 2 you will get a new project partner). HAPPY CODING :)
Assignment specification 1a is released
The TASK SPECIFICATION for assignment (project) 1A is herewith released: See file section at the bottom of the COS341 web page. Your PROJECT PARTNER for assignment 1 has already been allocated to you (during the lecture). Please START CODING (with your partner) as swiftly as possible. The other half (1B) of the project specification will soon be released, too. SOFTWARE DEMO DATES will be communicated later in a separate announcement. PLAGIARISM is FORBIDDEN! And now ==> Happy Coding :)
Topics of the three forthcoming Programming Projects
The TOPICS of the three forthcoming programming projects will be as follows: 1. Lexical analysis (Scanner) and Syntax analysis (Parser), 2. Scope analysis and Type checking (Static Semantics), 3. Intermediate Code Generation and Optimisation. All practical projects will be done in teams (pairs) of two students, whereby for each project you will get a new team partner who had not yet been your team partner previously. Project specifications (and Software Demo dates) will be released soon.
Details about Assessment
COS341 follows a "continuous" assessment scheme in which there is NO distinction between "semester mark" and "exam mark". Instead, all marks are collected and added, up to a maximal final mark of 100. In more details, we will have: * THREE WRITTEN TESTS, each of which will cover approximately 65 pages of the textbook, * THREE PROGRAMMING ASSIGNMENTS, each of which will cover an important 'chunk' in the software system of a compiler. In a follow-up announcement (soon), I will tell you exactly how these three written tests and the three programming assignments will 'add up' to the final maximum of 100.
Class Representatives, and "WhatsApp" Group
The following two students have been elected as the COS341 Class Representatives: 1. Dewald de Jager (male), 2. Nikki Constancon (female). At the right-hand-side of the COS341 web page you can find the links to their e-mail addresses, if you need to contact any of them. Moreover: the class representatives are inviting all other COS341 students to join the COS341 "WhatsApp" group with their mobile telephones.
Special event, Tuesday 14 February
Students of COS341 are cordially invited to a special seminar by professor Valentin Goranko (University of Stockholm, Sweden) on the topic of LOGIC. Date: Tuesday 14th February, Time: 13.00h afternoon, Room: IT-4-66.
Errors made by students when designing Finite Automata
Students of COS341 are advised to download and to read the following paper: "Errors made by students when designing Finite Automata" ==> https://www.researchgate.net/profile/Wynand_Van_Staden2/publication/280076428_Errors_made_by_students_when_designing_Finite_Automata/links/562f225f08aef25a244460fd.pdf Knowledge of this paper might be helpful for you when you start your own practical COS341 projects on this topic.
1st Lecture: Wednesday 8 February
1st Lecture of COS341: Wednesday the 8th of February, 7:30h, in IT-4-3. I will explain the 'modalities' of the course for the remainder of this semester. All registered students MUST attend.
The following book is prescribed for COS341 this year: * Torben MOGENSEN, "Introduction to Compiler Design", Springer. Obtaining access to this book is the students' own responsibility.
For students with PRIVATE PROBLEMS
Any student with PRIVATE PROBLEMS, such as (for example): - Psychological issues or anxieties, - Grievance in the family, - Addictions of whatever type, - Financial shortages or debt, are encouraged to VISIT Sipho DLAMINI for private consultation and advice. Sipho DLAMINI can be found in the INFORMATICS department: IT Building, 5th floor.
THIS WEB PAGE IS THE STUDY GUIDE for COS341: COMPILER CONSTRUCTION. Please carefully take note of all further announcements which will appear on this web page! In COS341 we follow ...Show Long Description
There are no tutors assigned.
There are no teaching assistants assigned.
H.o.D Office times
The dates and times are as follows:
- 3 February 12:30-13:30
- 10 February 12:30-13:30
- 13 February 08:00-09:00
- 17 February 12:30-13:30
- 20 February 08:00-09:00
- 27 February 08:00-09:00
- 6 March 08:00-09:00
- 10 March 12:30-13:30
- 13 March 08:00-09:00
- 17 March 12:30-13:30
- 24 March 12:30-13:30
- 27 March 08:00-09:00
- 31 March 12:30-13:30
Active Fitch Fork Assignments
No bookings available
No lab bookings available
Active Team Allocations
No team allocations available
No individual bids
No team bids
No Team Pages
Team Pages Open to Module Members
No Public Team Pages