<commit_before>---
layout: page
title: "Lab 11: More Code Generation"
excerpt: "Lab 11: More Code Generation"
tags: ["assignment"]
context: assign
subcontext: ms3
---

{% include _toc.html %}

In this lab, you extend your code generator to handle expressions, statements, methods without local parameters, and classes without fields.

## Overview

### Objectives

1. Write MiniJava programs and corresponding Jasmin programs which cover the following constructs:
    * all kinds of unary and binary expressions,
    * object and array creation,
    * `this` expressions,
    * method calls without arguments,
    * block statements,
    * `if` statements,
    * `while` statements,
    * methods without parameters and local variables,
    * classes without fields.
2. Extend your code generator to handle these constructs.

### Submission

You need to submit your MiniJava project with a pull request against branch `assignment11` on GitHub.
Your GitHub repository contains a step-by-step procedure how to file such a request.
This project should contain a `README.md` with a short paragraph explaining the organisation of your Stratego files.
When you solved challenges, you should provide another paragraph sketching your approach.

The deadline for submissions is December 13th, 23:59.
{: .notice .notice-warning}

### Grading

You can earn up to 25 points for your example MiniJava programs and their corresponding Jasmin programs.
We will focus on completeness and correctness of your examples.
Furthermore, you can earn up to 65 points for your code generator:

* transformation (55 points)
    * classes (8 points)
    * methods (7 points)
    * statements (13 points)
        * block statements (2 points)
        * `if` statements (5 points)
        * `while` loops (6 points)
    * expressions (27 points)
        * logic constants (1 point)
        * unary expressions (5 points)
        * binary expressions, including array subscript (14 points)
        * object and array creation (1 point)
        * `this` expressions (1 point)
        * method calls (5 points)
* challenges (10 points)
    * overlays (2 points)
    * reusable method descriptors (2 points)
    * stack limits (6 points)

You can earn up to 5 points for the organisation of your Stratego files and up to 5 points for the quality of your code.
We focus on readability in general, meaningful variable names and the consistent use of Stratego paradigms.
We will consider the fact that Stratego is new to you.

### Early Feedback

This assignment is graded manually. Thus, we do not provide early feedback for this submission.

## Detailed Instructions

### Git Repository

You continue with your work from the previous assignment.
See the [Git documentation](/documentation/git.html#continue-from-previous-assignment) on how to create the `assignment11` branch from your previous work.

### Write More Jasmin Code

Before you extend your code generator, you should come up with small example MiniJava programs, which cover the following constructs:

* all kinds of unary and binary expressions,
* object creation,
* `this` expressions,
* method calls without arguments,
* block statements,
* `if` statements,
* `while` statements,
* methods without parameters and local variables,
* classes without fields.

Write corresponding Jasmin programs, which you expect to be the result of a MiniJava-to-Jasmin compiler.
Generate Java class files from them and run them.<commit_msg>Change lab 11 grading + submission instruction<commit_after>---
layout: page
title: "Lab 11: More Code Generation"
excerpt: "Lab 11: More Code Generation"
tags: ["assignment"]
context: assign
subcontext: ms3
---

{% include _toc.html %}

In this lab, you extend your code generator to handle expressions, statements, methods without local parameters, and classes without fields.

## Overview

### Objectives

1. Write MiniJava programs and corresponding Jasmin programs which cover the following constructs:
    * all kinds of unary and binary expressions,
    * object and array creation,
    * `this` expressions,
    * method calls without arguments,
    * block statements,
    * `if` statements,
    * `while` statements,
    * methods without parameters and local variables,
    * classes without fields.
2. Extend your code generator to handle these constructs.

### Submission

You need to submit your MiniJava project with a pull request against branch `assignment11` on GitHub.
The [Git documentation](/documentation/git.html#submitting-an-assignment) explains how to file such a request.

The deadline for submissions is December 13th, 23:59.
{: .notice .notice-warning}

### Grading

You can earn up to 25 points for your example MiniJava programs and their corresponding Jasmin programs.
We will focus on completeness and correctness of your examples.
Furthermore, you can earn up to 65 points for your code generator:

* transformation (55 points)
    * classes (8 points)
    * methods (7 points)
    * statements (13 points)
        * block statements (2 points)
        * `if` statements (5 points)
        * `while` loops (6 points)
    * expressions (27 points)
        * logic constants (1 point)
        * unary expressions (5 points)
        * binary expressions, including array subscript (14 points)
        * object and array creation (1 point)
        * `this` expressions (1 point)
        * method calls (5 points)
* challenges (10 points)
    * overlays (2 points)
    * reusable method descriptors (2 points)
    * stack limits (6 points)

You can earn up to 10 points for the quality of your code.
We focus on readability in general, meaningful variable names and the consistent use of Stratego paradigms.
We will consider the fact that Stratego is new to you.

### Early Feedback

This assignment is graded manually. Thus, we do not provide early feedback for this submission.

## Detailed Instructions

### Git Repository

You continue with your work from the previous assignment.
See the [Git documentation](/documentation/git.html#continue-from-previous-assignment) on how to create the `assignment11` branch from your previous work.

### Write More Jasmin Code

Before you extend your code generator, you should come up with small example MiniJava programs, which cover the following constructs:

* all kinds of unary and binary expressions,
* object creation,
* `this` expressions,
* method calls without arguments,
* block statements,
* `if` statements,
* `while` statements,
* methods without parameters and local variables,
* classes without fields.

Write corresponding Jasmin programs, which you expect to be the result of a MiniJava-to-Jasmin compiler.
Generate Java class files from them and run them.
{'fraction_non_alphanumeric': 0.06761194029850746, 'fraction_numerical': 0.014029850746268656, 'mean_word_length': 3.909157509157509, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6166449', 'n_tokens_mistral': 1751, 'n_tokens_neox': 1645, 'n_words': 868}