Skip to content

Commit 73cfa79

Browse files
committed
update readme for compilation
1 parent bede4f3 commit 73cfa79

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,22 +192,35 @@ Evaluation and execute by certain means
192192

193193
##### 1. Complilation
194194

195-
Construction of descriptors and tables
195+
Construction of class descriptors table and method table.
196196

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
201199

202-
Allocations
200+
method table :
201+
name - methodTable : (string, astmethod) Hashtbl.t
203202

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
207223

208-
- [] allocation of special classes
209-
- [] allocation of special objects
210-
- [] allocation of class if it is not allocated
211224

212225
##### 2. Execution
213226

@@ -216,4 +229,4 @@ working from specail cases:
216229

217230
### Problems of Type
218231

219-
### Problems of Execution
232+
### Problems of Execution

0 commit comments

Comments
 (0)