Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lab3.md assignment text #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions assignments/ms1/lab3.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,28 @@ If your start symbols are not defined in the main SDF3 module, you might need to
Typically, the pretty-printed code lacks proper indentation and line breaks.
You can fix this by improving your templates in the syntax definition.
The pretty-printer follows the indentation and line breaks from the syntax definition.
So any formatting that you add to your templates will be reflected in the product of the pretty-printer.
For instance, by changing the following MiniJava template:
```
Statement.While = <while (<Exp>) <Statement>>
```
Into a template which includes layout:
```
Statement.While =
<
while ( <Exp> )
<Statement>
>
```
This will transform your formatted program code:
```
while (true) a = 5;
```
Into the following pretty-printed product:
```
while ( true )
a = 5;
```

You should improve your syntax definition in order to get readable code with a consistent indentation.
You might read on [indent styles](http://en.wikipedia.org/wiki/Indent_style) for some inspiration.
Expand Down