forked from DennisTT/cpsc411project5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme-project-2.html
96 lines (95 loc) · 8.21 KB
/
readme-project-2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>CS411 - MiniJava Project</title>
<style type="text/css">
p, table, li, h1, h2, h3 {
font-family: verdana,arial,'sans serif';
}
p, h1, h2, h3, table, li, hr {
margin-left: 10pt;
}
body {
}
p, li {
font-size: smaller;
}
pre {
margin-left: 30pt;
}
</style></head>
<body>
<h1>CPSC 411 - Stage 2: Semantic Checking</h1>
<p>In
this stage of the project we are doing the work described
in Chapter 5 of the book. The goal of this stage is to
produce (and test) a semantic checker for MiniJava. It accepts a parsed
MiniJava program (AST) as input and verifies whether the AST is a valid
Java program (i.e. a program that is ok according to the type and
scoping rules of the language). </p><p>If
the program passes by the type checker it should mean that the program
is "correct" in the sense that it can be compiled and run (but it
doesn't, ofcourse, make any guarantees that the program has no bugs).</p><h2>Project Setup</h2><p><span style="font-weight: bold; color: red;">Warning:</span>
Before installing the new files, it is advisable to make backup copy of
your phase 1 project. Otherwise you run the risk of overwriting any
changes you have made to some of the files that were provided in phase
1.</p><p>The
zip file in which these instructions are contained is an archived copy
of an Eclipse project. To import this project into Eclipse do as
follows:</p><ol><li>Select "File > Import" Menu.</li><li>Select "General > Existing Projects into Workspace".</li><li>Select "Select Archive file" and Browse for this .zip file.</li><li>Select the project and click "Finish".</li></ol><p>The project is set up with a number of JUnit tests. The provided tests should be thought of as an <span style="font-weight: bold;">executable specification</span>. This means that<span style="font-weight: bold;"> you should not change any code in the test classes</span>. Otherwise
you are free to change any and all code in the project. We also
encourage you to create additional tests, to more thoroughly test your
solution.</p><p>Test classes<span style="font-weight: bold;"><span style="font-weight: bold;"> </span></span>who's
name contains the word "Internal" are an exception to the "don't change
the tests" rule. These tests are intended to test a chunk of
functionality that is "internal" to your solution. You may in fact
chose to change these tests. For example, in this project a file
TestTypeCheckPhase1Internal.java tests the stage that builds the symbol
table. As such it is dependent on
specific choices of how you chose to represent the symbol table. Later
stages of the compiler may (and probably will) dependend on some of these
details. However, we want you to explicitly think about what goes into
the symbol table, and to have the freedom to choose your own
implementation strategy. <span style="font-weight: bold;"><span style="font-weight: bold;"></span></span></p><p>The project contains the same files from the phase 1 starter and the following new files:</p><ul><li><span style="font-weight: bold;">src </span></li><ul><li><span style="font-weight: bold;">minijava.test.typechecker:</span> JUnit tests for this phase of the project.</li></ul><ul><li><span style="font-weight: bold;">minijava.typechecker:</span> Some starter code provided for you.</li><li><span style="font-weight: bold;">minijava.typechecker.implementation: </span>
You should create this package. The intention is to put (as much as it
is possible / reasonable) all the code implementing your type checker
in this package.</li><li><span style="font-weight: bold;">minijava.util: </span>there
are two classes ImpTable and FunTable that may be useful to implement
symbol tables. You don't have to use them (e.g. maybe you prefer to
simply use java.util.HashMap or java.util.TreeMap instead, or implement something yourself).</li><span style="font-family: verdana,arial,'sans serif';"></span></ul></ul>
<h2>How to get started</h2><span style="font-family: verdana,arial,'sans serif';"></span><p>Many classes in the starter code are heavily commented and provide explanation about the code. In particular, the following
are good places to start:</p>
<ul><li>The README_stage2 file at the toplevel of the src directory.</li><li>The files in the package <span style="font-weight: bold;">minijava.typechecker</span>.</li><li>The comments in the<span style="font-weight: bold;"> minijava.test.typechecker</span> tests.<span style="font-weight: bold;"></span></li><li>You should also read Chapter 5 of the textbook.</li></ul><p>One
further note: although you are allowed to change all code except
for the tests, this does not mean that you actually have to change any
code at all! In fact, you can complete this assignment by only adding code in the <span style="font-weight: bold;">minijava.typechecker.implementation</span> package.</p><h2>Handing In</h2>
<p>Only one of the team members should hand in for your team. <span style="font-weight: bold;">Make sure you have filled in the names of each team member in the src/README_stage2.txt file</span>. </p><p>The name of this project stage for the electronic handin is <b>
project2</b>. Please use the <a href="http://www.cs.ubc.ca/ugrad/facilities/windows/handin.shtml">handin
web-interface</a>.</p>
<p>You should handin the entire contents of your project's src
directory, excluding the test files. We have provided a <span style="font-weight: bold;">build.xml</span> script in the src directory that packages up the correct files in a .zip file. <span style="font-weight: bold;">Please use this script</span>, it will ensure a uniform layout for all handed in materials, which makes it easier for the TA.</p><h3>Copying and Plagiarism Policy</h3><span style="font-family: verdana,arial,'sans serif';"></span><p>Please read the departmental policy on Plagiarism and Collaboration <a href="http://www.cs.ubc.ca/about/policies/collaboration.shtml">here</a>.</p><p>Plagiarism
means passing of someone else's work as your own. Plagiarism is a
serious offense and dealt with quite harshly by the
university. Suspected cases are forwarded to the Dean's office and can
result in suspension from the university as well as an entry on your
academic transcript.</p><p>The key to using other people's code without
commiting plagiarism is to make it absolutely clear how much of
your assignment is your own work and how much it is based on someone else's
work. When copying something, or adapting it as part of your solution, <span style="font-weight: bold;">you are fully responsible to provide clear references to your</span> <span style="font-weight: bold;">sources</span>, <span style="font-weight: bold;">and to what extent your solution is based on these sources</span>. Code comments are a good way to do that for programming assignments.</p><p>For
the MiniJava project you will work in teams. It is expected that the
work submitted as a team is collaborative work. As such we will treat
the code as being developed by all team members together. We do not
require you to provide comments about the details of exactly which team member wrote
every single line of code. However, if we suspect
there is an imbalance in the contributions made by each team member, we
may ask for clarification and we may reflect this imbalance in your
final marks. </p><p>You are not supposed to copy code or
otherwise collaborate with people other than those on your own project team. If
you do, then you can still submit your work for partial credit,
provided that you provide adequate documentation of your sources and
the extent to which your solution is derived from them.</p><p>When
you are provided starter code, as is the case in most of our assignments and project drops, it is
automatically assumed that you did not write the starter code yourself.
It is therefore not necessary to provide explicit documentation to explain this
obvious fact. On the other hand, it is automatically assumed that <span style="font-weight: bold;">you
are claiming any code that differs from the original starter code as
entirely your own work. If this is not the case, you are fully
responsible to provide a clear and complete explanation of this fact.</span> Any failure to do so will be considered academic misconduct. Forgetfulness is not an excuse.</p></body></html>