You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-7Lines changed: 18 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -141,28 +141,33 @@ If you are a team member of the project, please review the [Guidelines for Contr
141
141
- parent: a class reference type that refers to its class
142
142
-[x] create a `Hashtbl` that maps from class
143
143
-[x] The second phase is concerned with verifying that the inside of classes is correct (mainly the body of methods). She will also make sure of the correction of the higher level expression.
144
-
-[x] create 3 verification method that verifies the following aspects of the program
144
+
-[x] create 3 verification methods that verify the following aspects of the program
145
145
- [x]`verify_methods` that checks the type of methods
146
-
- [x] create a local definition environment type called `current_env`it contains 3 fields as follows
146
+
- [x] create a local definition environment type called `current_env`that contains 3 fields as follows
147
147
- returntype: the declared return type of the method
148
148
- variables: a `Hashtbl` that maps from local variable name to local variable declared type
149
149
- this_class: the id of the class
150
150
- env_type: a string that identifies the type of the local definition environment, it could be `constructor`, `method` or `attribute`, in this case, the `env_type` is `method`
151
-
- [x] write a verification method (`verify_declared_args`) that checks the declared type of variables in the method arguments
151
+
- [x] write a verification method (`verify_declared_args`) that checks the declared type of variables in the method argument list
152
152
- [x] check if there exists Duplicate Local Variable
153
153
- [x] write a verification method (`verify_statement`) that checks the body of the method
154
-
- [x] check declared variables
154
+
- [x] check variable declaration statement
155
155
- [x] check block of statement
156
156
- [x] check expression
157
157
- [x] check return statement when it's none, ex: `return;`
158
158
- [x] check return statement when it's not none, ex: `return x;`
159
159
- [x] check throw statement
160
+
- it does check if exception type or a supertype of that exception type is mentioned in a throws clause in the declaration of the method, it should be checked in compiling
160
161
- [x] check while statement
161
-
- [x] check if statement when it doesn't have `else`
162
-
- [x] check if statement when it has `else`
162
+
- [x] check if without else statement
163
+
- [x] check if with else statement
163
164
- [x] check for statement
164
165
- [x] check try statement
165
166
- [x]`verify_constructors` that checks the type of constructors
167
+
- same as verify_methods, except for the following minor difference
168
+
- `returntype` in the local definition environment `current_env` is a reference to the class it belongs to
169
+
- `env_type` in the local definition environment `current_env` is `constructor`
170
+
- check return statement in `verify_statement` is slightly different since constructors can have `reuturn;` but not something like `return x;`
166
171
- [x]`verify_attributes` that checks the type of attributes
167
172
168
173
##### Errors that can be found during Type-checking
@@ -212,7 +217,8 @@ If you are a team member of the project, please review the [Guidelines for Contr
212
217
213
218
- errors related to overloading
214
219
- errors related to overriding
215
-
220
+
- errors related to generic types
221
+
- errors related to `this` keyword
216
222
217
223
#### Execution
218
224
@@ -257,4 +263,9 @@ SameFunctionConstructorsDefined : raised when constructors of class have the sam
0 commit comments