Notices

  • Final marks

    Posted by Jingling Xue Thursday 20 May 2021, 10:10:47 AM.

    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.

  • Final Exam is Over

    Posted by Jingling Xue Saturday 01 May 2021, 12:03:40 PM.

    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.

  • Q5

    Posted by Jingling Xue Saturday 01 May 2021, 09:47:18 AM.

    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.

  • Exam: file sizes for Q1

    Posted by Jingling Xue Saturday 01 May 2021, 09:34:02 AM.

    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.

  • Final Exam Paper Released

    Posted by Jingling Xue Saturday 01 May 2021, 08:57:48 AM.

    Dear COMP3131/9102 Student,

    The final exam paper has now been available.
    Good luck.

  • Submitting your finished questions during the exam as soon as you are done with them

    Posted by Jingling Xue Friday 30 April 2021, 05:48:15 PM.

    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.

  • Exam again

    Posted by Jingling Xue Friday 30 April 2021, 03:39:31 PM.

    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.

  • Exam

    Posted by Jingling Xue Friday 30 April 2021, 02:34:55 PM.

    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.

  • Please ignore the meeting email

    Posted by Jingling Xue Tuesday 27 April 2021, 03:30:52 PM.

    Dear COMP3131/9102 Student,

    That happended by accident. Please ignore the meeting invitation sent just now.

  • Assignment 5 feedback video

    Posted by Jingling Xue Monday 26 April 2021, 10:09:57 PM.

    Dear COMP3131/9102 Student,

    I have made a short feedback video available for Assignment in our team's SharePoint of Week 10 (Mon).

  • Assignment 5 Marked

    Posted by Jingling Xue Monday 26 April 2021, 02:27:06 PM.

    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.

  • More details on the final exam

    Posted by Jingling Xue Sunday 25 April 2021, 04:10:01 PM.

    Dear COMP3131/9102 Student,

    1. I have just created a new menu item called "Exams" under "Course Work". This is where you will retrieve the exam paper and submit your answers.
    2. The exam will be 3 hours (20 more mins than I announced earlier), starting from 9am Saturday 1 May 2021 (Sydney time).
    3. There will be five (instead of six) questions.
    4. You can take a look at the past exam papers (~cs3131/Exams/past-exams.zip).
    5. Please visit the resource pages under "Exams" and do the following:
      • Please sign the declaration page and submit it before the exam starts.
      • Please read the instructions now to save your time for reading them during the exam.
      • Please try to submit a few dummy answer files to some questions to become familiar with the submission process. Anyway, this is the same process by which you have submitted your programming assignments.

      Please let me know if you have any questions regarding the final exam.

  • Final Exam (Preliminary Annoucement)

    Posted by Jingling Xue Friday 23 April 2021, 10:36:41 AM.

    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.

  • The Jasmin Assembler

    Posted by Jingling Xue Monday 19 April 2021, 05:23:04 PM.

    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).

  • Assignment 5 Extension

    Posted by Jingling Xue Monday 19 April 2021, 10:46:36 AM.

    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.

  • Reference Checker Implementation

    Posted by Jingling Xue Sunday 18 April 2021, 10:02:06 PM.

    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.

  • Past Exam Papers

    Posted by Jingling Xue Thursday 15 April 2021, 10:22:49 PM, last modified Thursday 15 April 2021, 11:59:55 PM.

    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.

  • Feedback video for Assignment 4

    Posted by Jingling Xue Tuesday 13 April 2021, 11:33:14 AM.

    Dear COMP3131/9102 Student,


    You can find this in the sharepoint at our team's Week 9 (Thu) channel.

  • Assignment 4 Marked

    Posted by Jingling Xue Tuesday 13 April 2021, 10:10:37 AM.

    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).

  • Error Messages for Assignment 4

    Posted by Jingling Xue Sunday 11 April 2021, 09:01:05 AM.

    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.

  • Assignment 5 Spec Released

    Posted by Jingling Xue Wednesday 07 April 2021, 05:40:41 PM.

    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.

  • Monday 20-21 tutorial

    Posted by Jingling Xue Wednesday 07 April 2021, 12:42:08 PM.

    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

  • The reference parser solution

    Posted by Jingling Xue Friday 02 April 2021, 06:52:02 PM.

    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.

  • Assignment 3 Feedback

    Posted by Jingling Xue Wednesday 31 March 2021, 12:10:12 PM.

    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.

  • Assignment 3 Marked

    Posted by Jingling Xue Wednesday 31 March 2021, 11:00:41 AM.

    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.

  • Assignment 4: The deadline extended to Mon 12 April

    Posted by Jingling Xue Tuesday 30 March 2021, 07:28:05 PM.

    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.

  • This week's lectures

    Posted by Jingling Xue Monday 29 March 2021, 12:10:20 PM.

    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.

  • Assignment 3 Extended for one day

    Posted by Jingling Xue Thursday 25 March 2021, 04:54:32 PM.

    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."

  • Downtime for CSE servers Fri 7pm - Sat 8pm

    Posted by Jingling Xue Wednesday 24 March 2021, 10:37:43 PM.

    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."

  • Tutorial recordings

    Posted by Jingling Xue Tuesday 23 March 2021, 03:01:20 PM.

    Dear COMP3131/9102 Student,

    You can find the tutorial recordings from Week 3 at the course web page:

  • Type checking

    Posted by Jingling Xue Friday 19 March 2021, 09:36:52 AM, last modified Friday 19 March 2021, 09:37:51 AM.

    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.






  • Tutorial Issue

    Posted by Jingling Xue Thursday 18 March 2021, 05:58:23 PM.

    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 Bonus Assignment

    Posted by Jingling Xue Thursday 18 March 2021, 01:11:08 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.

  • Assignment 4 released

    Posted by Jingling Xue Thursday 18 March 2021, 01:09:39 PM.

    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.

  • Assignment 2 feedback

    Posted by Jingling Xue Tuesday 16 March 2021, 09:36:58 AM, last modified Tuesday 16 March 2021, 09:38:29 AM.

    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.

  • Assignment 2 Marked

    Posted by Jingling Xue Monday 15 March 2021, 11:46:30 PM.

    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.

  • Assignment 3

    Posted by Jingling Xue Monday 15 March 2021, 11:18:28 PM.

    When building ASTs for expressions. please be reminded to ensure that the operator precedence and associativity are enforced correctly in the ASTs,

  • Assignment 2 is due on the coming monday

    Posted by Jingling Xue Thursday 11 March 2021, 10:00:01 PM.

    If you haven't started working in Assignment 2, please start asap, as the deadline is this coming Monday.

  • Today's lecture due to some password issue

    Posted by Jingling Xue Thursday 11 March 2021, 08:17:17 PM.

    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.

  • Lecture on zoom

    Posted by Jingling Xue Thursday 11 March 2021, 06:19:27 PM.

    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

  • Slide 273

    Posted by Jingling Xue Friday 05 March 2021, 10:33:32 AM.

    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.

  • accept() vs. acceptOperator()

    Posted by Jingling Xue Thursday 04 March 2021, 09:44:30 PM.

    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.


  • The spec for Assignment 3 released

    Posted by Jingling Xue Thursday 04 March 2021, 12:22:58 PM.

    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.

  • Monday 15 March for the deadline of Assignment 2

    Posted by Jingling Xue Monday 01 March 2021, 04:57:57 PM.

    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.

  • New Deadline for Assignment 2

    Posted by Jingling Xue Monday 01 March 2021, 02:02:42 PM.

    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.

  • Today's lecture

    Posted by Jingling Xue Monday 01 March 2021, 09:56:44 AM.

    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 Marked

    Posted by Jingling Xue Sunday 28 February 2021, 05:43:56 PM.

    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.

  • Lecture Recording (Part 2) for Thursday (25 Feb)

    Posted by Jingling Xue Friday 26 February 2021, 10:51:57 AM.

    Available now also in the SharePoint associated with the Week 2 (Thu) channel.

  • Lecture Recording (Part 1) for Thursday (25 Feb)

    Posted by Jingling Xue Friday 26 February 2021, 08:53:07 AM.

    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.

  • The Spec for Assignment 2 Released

    Posted by Jingling Xue Friday 26 February 2021, 12:14:55 AM, last modified Friday 26 February 2021, 12:21:46 AM.

    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.

  • Tutorial Links

    Posted by Jingling Xue Monday 22 February 2021, 08:07:04 PM, last modified Monday 22 February 2021, 09:52:06 PM.

    The links for the tutorial classes have been sent and removed here.

  • Step-By-Step-NFA-Construction for today's example

    Posted by Jingling Xue Thursday 18 February 2021, 09:40:53 PM.

    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.


  • ErrorReporter.java for Assignment 1

    Posted by Jingling Xue Wednesday 17 February 2021, 06:08:59 PM.

    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.

  • vc.java for Assignment 1.

    Posted by Jingling Xue Wednesday 17 February 2021, 04:24:09 PM.

    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.

  • Binary representations for ints and floats

    Posted by Jingling Xue Monday 15 February 2021, 08:47:59 PM.

    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.

  • maximal munch

    Posted by Jingling Xue Monday 15 February 2021, 08:44:43 PM, last modified Tuesday 16 February 2021, 09:25:37 AM.

    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.


  • COMP3131/9102: 1st lecture today

    Posted by Jingling Xue Monday 15 February 2021, 09:17:33 AM.

    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,


  • Team Code Resent for COMP3131/9102

    Posted by Jingling Xue Thursday 11 February 2021, 05:24:03 PM, last modified Monday 15 February 2021, 10:43:42 AM.

    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.


  • Live Lectures for COMP3131/9102

    Posted by Jingling Xue Wednesday 10 February 2021, 02:56:27 PM, last modified Monday 15 February 2021, 10:43:29 AM.

    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

    Posted by Jingling Xue Monday 08 February 2021, 10:39:18 AM.

    Welcome to COMP3131/9102. Please read our course outline before our first lecture.


Back to top

COMP3131/COMP9102 21T1 (Programming Languages and Compilers) is powered by WebCMS3
CRICOS Provider No. 00098G