Dear COMP3131/9102,
I believe the system may have emailed you (or some of you) wrong final marks, since the system assumes the arithmetic means is used for computing the final mark from both the assignment marks and the exam marks.
Dear COMP3131/9102 Student.
The deadline has passed. I assume you have all submitted your answers.
If you haven't submitted your declaration as per the instructions for this exam, please do it asap.
Unless we have your declaration, we cannot mark your paper.
Thanks.
For Q5, can you draw the AST in ASCII? All we care is that the labels must be correct.
You have been given plenty of time to draw such a tree in ASCII, as a physical exam in the past of this level of complexity was done in 2 hours only.
Dear COMP3131/9102 Student,
A one-page jpeg is only about 250KB, but some photo files are really large for some strange reasons.
I have modified the submission script so that you can also submitted a zipped file for Q1.
So now any file with ".zip" as the suffix can also be accepted.
Dear COMP3131/9102 Student,
The final exam paper has now been available.
Good luck.
Dear COMP3131/9102 Student,
This is what I have just received from the school:
* Encourage students to submit-as-they-go
* Don't rely on them needing to open lots of Webcms3 pages
Please submit your answers as soon as you ready without waiting until the very end of the exam to over-stress the file server at CSE.
Thanks.
Dear COMP3131/9102 Student,
During the exam, if you think a question is incorrect, you can contact me via my email address or Teams.
Please don't post any questions related to the exam to the course forum during the exam.
If I have an announcement to make during the exam, I will send a notice through out course forum.
Good luck.
Dear COMP3131/9102 Student,
Just to remind everyone to sign the declaration as required for the final exam.
Your exam will not be marked unless we receive your declaration by 12noon tomorrow the latest.
Thanks.
Dear COMP3131/9102 Student,
That happended by accident. Please ignore the meeting invitation sent just now.
Dear COMP3131/9102 Student,
I have made a short feedback video available for Assignment in our team's SharePoint of Week 10 (Mon).
Dear COMP3131/9102 Student,
Assignment 5 has been marked. Please check your marks and take a look at the assignment page providing some feedback for this assignment. Please let me know if you have any issues with the marks.
Dear COMP3131/9102 Student,
Dear COMP3131/9102 Student,
Here is some information for the final exam:
1. Date: 1 May 2021
2. Time: 9 am (running for 2 hours and 40 mins)
3. Online (with the exam paper to be downloaded from the course web page)
4. No webcam monitoring, etc.
5. All solutions will be submitted via give
More details later.
Dear COMP3131/9102 Student,
If you have trouble installing the Jasmin assembler downloaded directly from the BCEL website, you can install the pre-compiled assembler by following the instructions given in the spec for Assignment 5 (Section 2).
Dear COMP3131/9102 Student,
After consulting with the school (regarding the impact of the file system failure to our last assignment), the deadline for Assignment 5 has been extended until 9 am Monday 26 April.
Dear COMP3131/9102 Student,
If you want to use the reference implementation for Checker, you can download it from ~cs3131/VC/RefSols/Checker.zip. This is the same directory where you can download the reference implementations for Scanner and Parser.
Dear COMP3131/9102 Student,
You can find some past exam papers from the course account under ~cs3131/Exams. The file to download is past-exams.zip.
Dear COMP3131/9102 Student,
You can find this in the sharepoint at our team's Week 9 (Thu) channel.
Dear COMP3131/9102 Student,
Assignment 4 has been marked. Please let me know if you have any issues with the marks.
If your type checker doesn't fully work yet, you can fix the bugs using the test cases provided. Otherwise, you can use the reference solution (see the spec of Assignment 5 how to download it).
Dear COMP3131/9102 Student,
In Assignment 4, you are implementing a type checker. The error messages are sometimes not unique for a particular error. In the example below, our type checker has printed two error messages, which are both relevant. Either will be acceptable. When marking this assignment, we will also visually check each error message issued by your type checker to see if it is relevant. For example, in the following example, any of the following error messages is not relevant to the error:
"*18: array size missing"
"*20: if conditional is not boolean"
"*27: wrong type for actual parameter"
Finally, each test case used for marking Assignment 4 will be tiny, containing just one error. In almost all the cases, one unique error message can be issued.
jingling% cat test.vc
void f() {}
int main() {
int a1[5] = f;
return 0;
}
jingling% !ja
java VC.vcchecker test.vc
======= The VC compiler =======
Pass 1: Lexical and syntactic Analysis
Pass 2: Semantic Analysis
ERROR: 3(17)..3(17): *11: attempt to use an array/function as a scalar: f
ERROR: 3(9)..3(17): *15: invalid initialiser: scalar initialiser for array: a1
Compilation was unsuccessful.
Dear COMP3131/9102 Student,
The spec for the last assignment has just been released. I will introduce the code generation technique we will use to implement our code generator in tomorrow's lecture.
Please see the following message from the tutor. --- Jingling
Hi Jingling,
Could you please post this message on the WebCMS on my behalf?
"Students who are in Monday 20-21 tutorial and wish to have a compensation class for the WK8 session please vote for a time on Doodle using this link .
Otherwise, they can participate in one of the Thursday 15-16, 16-17, 17-18, or 20-21 tutorials this week (on 08/04/21)."
Regards,
Samad
Dear COMP3131/9102 Student,
If you want to use the reference parser solution (in bytecode), follow these steps:
If you want to use our parser in case yours does not work properly, copy
~cs3131/VC/RefSols/Parser.zip
to your Parser directory and type:
unzip Parser.zip
This installs the class
Parser.class
under package
VC.Parser
.
It is not necessary to understand how this parser works. Your type checker will only work on the AST constructed for the program by the parser.
Dear COMP3131/9102 Student,
I have made a short video recording available at the SharePoint for the Week 7 (Thu) channel, providing some feedback for Assignment 3.
This assignment is straightforward. The bugs can be avoided or eliminated if a solution can be tested more thoroughly.
Dear COMP3131/9102 Student,
Assignment 3 has been marked. Please check your marks and let me know if there are any problems with the marks.
If your parser doesn't yet work fully, you can use the reference parser solution (provided in bytecode), which can be downloaded from
~
cs3131/VC/RefSols/Parser.zip
Then you can install it by first setting your current directory as VC and then unzip Parser.zip.
I have extended the deadline for Assignment 4 from 9 April to 12 April. However, as the deadline for Assignment 5 is 23 April (the last day of Term 1), you are still encouraged to complete your Assignment 4 as early as possible.
Dear COMP3131/9102 Student,
This week, we will look at JVM and Java bytecode to prepare us to implement a code generator that translates VC into Java bytecode in Assignment 5.
Dear COMP3131/9102 Student,
Due to the following reason, the deadline for Assignment 3 has been extended by one day.
The new deadline is 9pm Tuesday 30 March.
"Just a reminder that all of CSE's online infrastructure will be off
the air from 7pm Fri 26 March until at least 8pm Sat 27 March."
Dear COMP3131/9012 Student,
I am forwarding the following message I received from the school:
"Just a reminder that all of CSE's online infrastructure will be off
the air from 7pm Fri 26 March until at least 8pm Sat 27 March."
Dear COMP3131/9102 Student,
You can find the tutorial recordings from Week 3 at the course web page:
This is the example I used in yesterday's lecture on type checking:
void test ( float a, float b ) { //float x float --> void
if ( a+b >= 1 )
putStringLn ( "a+b>= 1 " ) ;
else
putStringLn ( "a+b< 1 " ) ;
}
int main () {
test ( 1 . 5 , 2 . 5 ) ;
test ( 15 , 25 ) ;
}
java VC.vcchecker typing.vc
======= The VC compiler =======
Pass 1: Lexical and syntactic Analysis
Pass 2: Semantic Analysis
visitIntTtpe
Compilation was successful.
However, if we modify the signature of test() to:
void test
(
int a, int b
)
{
//int x int --> void
Our type checker will report the following two errors:
java VC.vcchecker typing.vc
======= The VC compiler =======
Pass 1: Lexical and syntactic Analysis
Pass 2: Semantic Analysis
visitIntTtpe
ERROR: 10(8)..10(10): *27: wrong type for actual parameter: a
ERROR: 10(13)..10(15): *27: wrong type for actual parameter: b
Compilation was unsuccessful.
Dear COMP3131/9102 Student,
Here is a message from Samad (the tutor):
It seems there was a technical error in the current session, i.e. 5-6 pm Thur 18 March, and the students didn't see/hear some parts of the class and hence they left the meeting before it finishes.
Would you please ask the students to participate in the next session running today from 8-9 pm ?
The spec has been released. If you are interested, you can choose to extend your VC compiler by implementing the extra programming language features as specified in the spec.
Dear COMP3131/9102 Student,
The spec for Assignment 4 has been released. I will explain how to implement a type checker in Assignment 4 today.
Dear COMP3131/9102 Student,
I have just recorded a short video providing some feedback for Assignment 2. As I would like to give you some quick feedback without having to wait for this Thursday's lecture in order for you to start working on Assignment 3 asap. In fact, I have received a few submissions for Assignment 3 already.
You can find the feedback video on the Channel for the forthcoming lecture: Week 05 (Thur) at Microsoft Teams.
Please watch the video from the sharepoint associated with this channel.
Dear COMP3131/9102 Student,
Assignment 2 has been marked. Please check your marks.
You can find the feedback, together with the test cases used, from the course web page.
When building ASTs for expressions. please be reminded to ensure that the operator precedence and associativity are enforced correctly in the ASTs,
If you haven't started working in Assignment 2, please start asap, as the deadline is this coming Monday.
Due to some password issue, I wasn't able to use Teams Today. UNSW IT is investigating the issue. We should be able to use Teams again from next week. Sorry for the inconvience caused todaty.
Dear COMP3131/9102 Student,
I cannot log in to teams. Today's lecture will be done using zoom:
https://unsw.zoom.us/j/83898883493?pwd=QWR2WEFJcGp...
passcode: 170078
I explained this a bit yesterday, but I have now drawn the parse tree completely to show how the attribute grammar in slide 273 can be used to convert an infix expression to a postfix expression. This drawing can be found under the lecture material for Week 3.
You may find these two auxiliary methods provided in the supporting code for Recogniser.java being implemented in Assignment 2. In Assignment 3, your recogniser will be extended to become parser in which both auxiliary methods can be used differently as follows:
accept(): consumes a token and throws it away.
acceptOperator(): consumes a token and returns a pointer to its AST representation.
For example, "(" and ")" can be thrown away but "+" needs to appear in the AST.
In today's lecture, I will discuss how to write a parser (by extending your recogniser from Assignment 2) to build the AST for a given program.
The spec for Assignment 3 has just been released.
Well, the deadline for Assignment 2 is now 9pm Monday 15 March. I will try to release the spec of Assignment 3 as early as possible. As you will be building a parser for VC in two stages, you are encouraged to finish your Assignment 2 as soon as possible, so that you can start extending it to obtain a parser.
The deadline for Assignment 2 has been changed from 11:59pm Saturday 13 March to 8:59pm Friday 12 March, as the school doesn't want a deadline to fall into a Saturday or Sunday.
Remember that Assignments 2 and 3 are really just one assignment. In Assignment, you will implement a recogniser to perform syntactic analysis while in Assignment 3, you will extend your recogniser to obtain a parser.
If you haven't watched the recorded lecture for Thursday last week, you are advised to do so before today's lecture.
We will continue our live lecture today using Teams.
Once again, the marks for Assignment 1 are now available.
Assignment 1 has been marked. Please check your marks. Some feedback for this assignment can be found at the course web page. You can also find the test cases used for marking this assignment. If your scanner doesn't fully work yet, you can fix its bugs by using these test cases.
For the four subsequent programming assignments, you are encouraged to use your only scanner (if it works correctly). Otherwise, you can down the reference solution in bytecode from ~cs3131/RefSols/Scanner.zip.
Available now also in the SharePoint associated with the Week 2 (Thu) channel.
I recorded my lecture for 25 Feb (Thursday) using Screenflow, but it always freezes towards the end when the recording is converted from screenflow to mp4. I have now managed to upload the first part of the lecture to Microsoft Teams. The second part will be available shortly.
1. Log in to the Team for the course.
2. Go the channel for Week 2 (Thu).
3. Click the three dots on the top-right corner.
4. Click "Open in Sharepoint".
You can also find the lecture recordings for the other lectures from the share point as well.
I have just released the spec for Assignment 2. I finished today's lecture about two hours ago but it takes hours to convert the recorded lecture from screenflow to mp4. I will make it available as soon as possible.
The links for the tutorial classes have been sent and removed here.
I have just re-drawn this for you on a piece of paper. You can find it where this week's lecture notes are.
It is difficult to do some parts of our lectures online when I need to draw something on a whiteboard. Team's whiteboard is good for drawing a few lines only.
If Scanner.zip you have downloaded in the past hour doesn't container ErrorReporter.java under VC, you can either redownload Scanner.zip or just download this file alone as follows:
1. Log in to a CSE computer.
2.
cp ~cs3131/VC/ErrorReporter.java .
where "." is your current directory.
You don't have to read further if you haven't downloaded the supporting code for Assignment 1.
If you have, you may see vc.java appearing under both VC and VC/Scanner. Please delete vc.java under VC/Scanner/vc.java.
Just to refresh everyone's memory, 1 and 1.0 have different binary representations:
public class Bin {
public static void main(String[] argv) {
int binData = 0x3f800000 ;
float d = Float.intBitsToFloat(binData);
System.out.println(d); // prints 1.0
}
}
That is why in Slide 27 of lec1-1.pdf, the typer checker has modified the AST from the parser by adding i2f to convert 60 from its int representation to its float representation. i2f can be understood as a call: i2f(60) = 60.0. But this will become clear when we start implementing our code generator in Assignment 5.
The scanner, when called, always finds the longest sequence of chars that can form a legal token. Here is the example I used today:
#include <stdio.h>
int main() {
int i = 20 , j = 10 ;
int k;
k = i---j;
printf( "k = %d\n " , k);
// OUTPUT:
// (A) 10
// (B) 9
// (C) 11
// (D) doesn't compile
// (E) compiles but the output is implementation-dependent
}
k = i---j will be tokenised as:
k = i-- - j;
i.e.,
k = (i--) - j
As -- is the post-decrement operator, i-- evaluates to 20. So k = 10.
I emailed the class the Team Code last Friday. You can also find the team code in the 2nd slide of today's lecture notes, which are available on our course web page. Cheers,
Somehow, my original email containing our team code hasn't reached you as planned.
Here it goes again.
Our live lectures will be done with Microsoft Teams. The recorded lectures will also be available at the same Team for the course:
NAME: COMP3131/9102
Team Code: xxxxxxx (
edited out
)
Please join this team with the team code for the first time.
Dear COMP3131/9102 Student,
We will try to have live lectures using Microsoft Teams to see how it goes. In a separate notice (which I will delete after it has been emailed to you), I will email you the Team Code for you to join the lectures using Teams.
Welcome to COMP3131/9102. Please read our course outline before our first lecture.