@@ -192,22 +192,35 @@ Evaluation and execute by certain means
192
192
193
193
##### 1. Complilation
194
194
195
- Construction of descriptors and tables
195
+ Construction of class descriptors table and method table.
196
196
197
- Construction of descriptors
198
- - [ ] object descriptor ? object descriptor space
199
- - [ ] class descriptor ? class descriptor space
200
- - [ ] methode descriptor ? methode descriptor space
197
+ class descriptors table :
198
+ name - classTable : (string, globalClassDescriptor) Hashtbl.t
201
199
202
- Allocations
200
+ method table :
201
+ name - methodTable : (string, astmethod) Hashtbl.t
203
202
204
- working from specail cases:
205
- - object -> null, true, false
206
- - class -> Object, Int, Boolean, String
203
+ All the contents of functions of different classes are saved in the methodTable
204
+ All the contents of classes are saved in the classTable except for the contents of functions
205
+ Here we use the name of functions and type of params to in class descriptor to find the content of function in the methodTable
206
+
207
+ functions:
208
+ - class descriptor of a class : func_name_typeOfpara1,typeOfpara2 classname_func_name_typeOfpara1,typeOfpara2
209
+ - method table of : classname_func_name_typeOfpara1,typeOfpara2 astmethod
210
+ In this way, functions that has the same name but different type of paramters are permitted in the compilation
211
+
212
+ constructors:
213
+ name : typeOfpara1,typeOfpara2
214
+ content: astconst
215
+ In this way, different types of constructors are permitted
216
+
217
+
218
+
219
+ ##### Errors that can be found during Complilation
220
+ ParentClassNotDefined :raised when parent class is not defined in the file
221
+ SameFunctionAlreadyDefined: raised when function of class have the same name and the same type of parameters
222
+ SameFunctionConstructorsDefined : raised when constructors of class have the same name and the same type of parameters
207
223
208
- - [ ] allocation of special classes
209
- - [ ] allocation of special objects
210
- - [ ] allocation of class if it is not allocated
211
224
212
225
##### 2. Execution
213
226
@@ -216,4 +229,4 @@ working from specail cases:
216
229
217
230
### Problems of Type
218
231
219
- ### Problems of Execution
232
+ ### Problems of Execution
0 commit comments